/* ============================================================
   RFCI — Charlotte's Art Gallery
   Colours from Charlotte's own Ohuhu markers:
     Burnt Sienna  YR515  #C8611A
     Pomegranate   R213   #C42030
     Cerise        R412   #E84060
     Brilliant Blue BV310 #6EB0E0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&family=Playfair+Display:wght@400;700&display=swap');

:root {
  --burnt-sienna:   #C8611A;
  --sienna-dark:    #8B3D0A;
  --sienna-light:   #E5854A;
  --pomegranate:    #C42030;
  --cerise:         #E84060;
  --brilliant-blue: #6EB0E0;
  --blue-dark:      #3A7BAA;
  --wall:           #F4EFE8;
  --wall-dark:      #E8DFD4;
  --ink:            #1E1410;
  --cream:          #FFFCF7;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--wall);
  color: var(--ink);
  font-family: 'Playfair Display', Georgia, serif;
  min-height: 100vh;
  /* subtle linen texture */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.012) 2px,
      rgba(0,0,0,0.012) 4px
    );
}

/* ── Header ────────────────────────────────────────── */

header {
  background-color: var(--pomegranate);
  padding: 0;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255,255,255,0.04) 10px,
      rgba(255,255,255,0.04) 20px
    );
}

.header-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  font-family: 'Caveat', cursive;
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.12em;
  line-height: 1;
  text-shadow: 3px 3px 0 var(--sienna-dark);
}

.logo span {
  display: inline-block;
  transition: transform 0.2s;
}
.logo span:hover { transform: rotate(-5deg) scale(1.15); cursor: default; }

.tagline {
  font-family: 'Caveat', cursive;
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: rgba(255,255,255,0.88);
  font-weight: 400;
  letter-spacing: 0.05em;
}

/* decorative stripe below header */
.header-stripe {
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--burnt-sienna)   0, var(--burnt-sienna)   25%,
    var(--cerise)          25%, var(--cerise)          50%,
    var(--brilliant-blue) 50%, var(--brilliant-blue) 75%,
    var(--cream)          75%, var(--cream)          100%
  );
}

/* ── Nav ────────────────────────────────────────────── */

nav {
  background: var(--cream);
  border-bottom: 2px solid var(--wall-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

nav ul {
  list-style: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 0;
}

nav a {
  display: block;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  position: relative;
  transition: color 0.2s;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 1.5rem; right: 1.5rem;
  height: 3px;
  background: var(--cerise);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

nav a:hover { color: var(--pomegranate); }
nav a:hover::after { transform: scaleX(1); }

/* ── Page sections ──────────────────────────────────── */

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-title {
  font-family: 'Caveat', cursive;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--pomegranate);
  margin-bottom: 0.25rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  height: 4px;
  background: var(--burnt-sienna);
  margin-top: 0.25rem;
  border-radius: 2px;
  /* wavy via clip-path */
  clip-path: polygon(
    0% 0%, 4% 100%, 8% 0%, 12% 100%, 16% 0%, 20% 100%,
    24% 0%, 28% 100%, 32% 0%, 36% 100%, 40% 0%, 44% 100%,
    48% 0%, 52% 100%, 56% 0%, 60% 100%, 64% 0%, 68% 100%,
    72% 0%, 76% 100%, 80% 0%, 84% 100%, 88% 0%, 92% 100%,
    96% 0%, 100% 100%, 100% 100%, 0% 100%
  );
  height: 6px;
}

.section-subtitle {
  font-size: 1rem;
  color: #7a6050;
  margin-bottom: 3rem;
  margin-top: 0.5rem;
  font-style: italic;
}

/* ── Gallery Grid ────────────────────────────────────── */

#gallery { background: transparent; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4rem 3.5rem;
  align-items: start;
  padding: 1rem 0 2rem;
}

/* THE FRAME — Charlotte's design brought to life */
.artwork-frame {
  position: relative;
  cursor: pointer;
  animation: fadeInUp 0.6s ease both;
}

.artwork-frame:nth-child(1) { animation-delay: 0.05s; --tilt:  1.5deg; }
.artwork-frame:nth-child(2) { animation-delay: 0.15s; --tilt: -2deg;   }
.artwork-frame:nth-child(3) { animation-delay: 0.25s; --tilt:  0.8deg; }
.artwork-frame:nth-child(4) { animation-delay: 0.35s; --tilt: -1.2deg; }
.artwork-frame:nth-child(5) { animation-delay: 0.45s; --tilt:  1.8deg; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* outer frame — wood grain effect */
.frame-outer {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,0.07) 0px,
      transparent 1px,
      transparent 6px,
      rgba(0,0,0,0.04) 7px,
      transparent 8px,
      transparent 14px
    ),
    linear-gradient(
      160deg,
      var(--sienna-light) 0%,
      var(--burnt-sienna) 40%,
      var(--sienna-dark) 100%
    );
  padding: 16px;
  border-radius: 6px 3px 8px 4px; /* slightly uneven corners */
  box-shadow:
    0 6px 20px rgba(0,0,0,0.22),
    inset 0 0 0 2px rgba(0,0,0,0.18),
    inset 0 0 0 4px rgba(255,255,255,0.1);
  transform: rotate(var(--tilt, 1deg));
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

/* corner joints (Charlotte drew these!) */
.frame-outer::before,
.frame-outer::after {
  content: '';
  position: absolute;
  background: var(--sienna-dark);
  border-radius: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
}
.frame-outer::before { top: 6px; left: 6px; }
.frame-outer::after  { top: 6px; right: 6px; }

.frame-inner-corners::before,
.frame-inner-corners::after {
  content: '';
  position: absolute;
  background: var(--sienna-dark);
  border-radius: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
  z-index: 2;
}
.frame-inner-corners::before { bottom: 22px; left: 22px; }
.frame-inner-corners::after  { bottom: 22px; right: 22px; }

.artwork-frame:hover .frame-outer {
  transform: translateY(-6px) rotate(calc(var(--tilt, 1deg) * 0.3));
  box-shadow:
    0 16px 40px rgba(0,0,0,0.28),
    inset 0 0 0 2px rgba(0,0,0,0.18),
    inset 0 0 0 4px rgba(255,255,255,0.1);
}

/* inner frame — mat board */
.frame-mat {
  background: #f0ebe2;
  padding: 10px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: inset 0 0 8px rgba(0,0,0,0.12);
}

.frame-mat img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center;
}

/* artwork label */
.artwork-label {
  margin-top: 1rem;
  text-align: center;
}

.artwork-title {
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
}

.artwork-medium {
  font-size: 0.8rem;
  color: #9a8070;
  font-style: italic;
  margin-top: 0.15rem;
}

/* ── Lightbox ────────────────────────────────────────── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,12,8,0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.lightbox.active { display: flex; }

.lightbox-content {
  position: relative;
  max-width: min(90vw, 720px);
  max-height: 90vh;
  cursor: default;
  animation: lightboxIn 0.3s ease;
}

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-frame {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,0.07) 0px,
      transparent 1px,
      transparent 6px,
      rgba(0,0,0,0.04) 7px,
      transparent 8px,
      transparent 14px
    ),
    linear-gradient(160deg, var(--sienna-light), var(--burnt-sienna) 40%, var(--sienna-dark));
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.lightbox-mat {
  background: #f0ebe2;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.1);
}

.lightbox-mat img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.lightbox-info {
  margin-top: 1rem;
  text-align: center;
  color: white;
}

.lightbox-info h3 {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  font-weight: 600;
}

.lightbox-info p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  font-style: italic;
  margin-top: 0.2rem;
}

.lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  background: var(--cerise);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  transition: background 0.2s, transform 0.2s;
  font-family: sans-serif;
  line-height: 1;
}
.lightbox-close:hover { background: var(--pomegranate); transform: scale(1.1); }

/* ── About ──────────────────────────────────────────── */

#about { background: var(--cream); border-top: 3px solid var(--wall-dark); border-bottom: 3px solid var(--wall-dark); }
#about .section { max-width: 800px; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  line-height: 1.8;
  color: #3a2820;
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
}

.name-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.name-card {
  background: var(--wall);
  border: 2px solid var(--wall-dark);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}
.name-card:hover { transform: translateY(-3px); }

.name-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.name-card:nth-child(1)::before { background: var(--pomegranate); }
.name-card:nth-child(2)::before { background: var(--burnt-sienna); }
.name-card:nth-child(3)::before { background: var(--cerise); }
.name-card:nth-child(4)::before { background: var(--brilliant-blue); }

.name-card .initial {
  font-family: 'Caveat', cursive;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}
.name-card:nth-child(1) .initial { color: var(--pomegranate); }
.name-card:nth-child(2) .initial { color: var(--burnt-sienna); }
.name-card:nth-child(3) .initial { color: var(--cerise); }
.name-card:nth-child(4) .initial { color: var(--blue-dark); }

.name-card .name { font-size: 0.9rem; color: #7a6050; font-style: italic; }
.name-card .role { font-size: 0.75rem; color: #aaa; margin-top: 0.2rem; }

/* ── Footer ─────────────────────────────────────────── */

footer {
  background: var(--pomegranate);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 2.5rem 2rem;
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
}

footer .footer-logo {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

footer p { margin-top: 0.3rem; }
footer a { color: var(--cream); }

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 640px) {
  .gallery-grid { gap: 2.5rem 1.5rem; grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }
  .about-grid   { grid-template-columns: 1fr; }
  nav ul        { justify-content: center; }
  nav a         { padding: 0.75rem 0.9rem; font-size: 1.1rem; }
}
