/* Matthew Allen Studio — dusk-lit editorial design system
   Chapter color worlds are driven by CSS custom properties that GSAP
   tweens as you scroll, so the whole page (and the WebGL paint behind
   it) cross-fades like dawn turning to dusk. */

:root {
  --bg: #1a1410;
  --ink: #f3ead9;
  --ink-dim: rgba(243, 234, 217, 0.62);
  --accent: #e8a84c;
  --hairline: rgba(243, 234, 217, 0.16);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Jost", "Avenir Next", sans-serif;
}

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

html { scroll-behavior: auto; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.65;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  transition: background-color 0.2s linear;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #101014; }

/* WebGL paint layer + CSS gradient fallback underneath */
#paint {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#paint canvas { display: block; width: 100%; height: 100%; }
.paint-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 80% 10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(100% 80% at 10% 90%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 55%);
}

main { position: relative; z-index: 1; }

/* Reading progress bar */
.progress {
  position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 60;
  transform-origin: 0 50%; transform: scaleX(0);
  background: var(--accent); transition: background-color 0.25s linear;
}

/* Chapter index rail (desktop only) */
.rail {
  position: fixed; right: clamp(14px, 2.5vw, 34px); top: 50%;
  transform: translateY(-50%); z-index: 40;
  display: flex; flex-direction: column; gap: 14px;
}
.rail a {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-dim); opacity: 0.45; display: block;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.rail a.on { opacity: 1; background: var(--accent); transform: scale(1.5); }
@media (pointer: coarse), (max-width: 760px) { .rail { display: none; } }

/* Etched chapter numerals — outlined, drifting slower than the page */
.numeral {
  position: absolute; z-index: 0;
  font-family: var(--font-display); font-weight: 400; font-style: italic;
  font-size: clamp(180px, 30vw, 480px); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--hairline);
  user-select: none; pointer-events: none;
  top: 50%; right: -2%; transform: translateY(-50%);
}
@media (max-width: 860px) {
  .numeral { font-size: clamp(140px, 46vw, 260px); top: auto; bottom: -4%; right: -6%; transform: none; }
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; }

.display {
  font-size: clamp(2.6rem, 1.4rem + 6.4vw, 7rem);
  line-height: 1.02;
  letter-spacing: 0.005em;
}
.display em { font-style: italic; color: var(--accent); }

.chapter-kicker {
  font-family: var(--font-body);
  font-size: clamp(0.68rem, 0.62rem + 0.2vw, 0.8rem);
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.chapter-kicker::before {
  content: "";
  width: 3rem;
  height: 1px;
  background: var(--accent);
  flex: none;
}

.chapter-title {
  font-size: clamp(2.2rem, 1.2rem + 5vw, 5.2rem);
  line-height: 1.05;
  margin: 0.6rem 0 0;
}

.lede { max-width: 34em; color: var(--ink-dim); }

/* ---------- Layout ---------- */
.shell { width: min(1240px, 100% - clamp(2.4rem, 8vw, 7rem)); margin-inline: auto; }

.chapter {
  position: relative;
  padding-block: clamp(5rem, 14vh, 10rem);
}

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(0.9rem, 2.5vw, 1.4rem) clamp(1.2rem, 4vw, 3.5rem);
  padding-top: max(clamp(0.9rem, 2.5vw, 1.4rem), env(safe-area-inset-top));
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent) 0%, transparent 100%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.site-nav.tucked { transform: translateY(-110%); }
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.15rem; letter-spacing: 0.04em;
}
.brand img { width: 40px; height: 40px; border-radius: 50%; background: #fff; object-fit: cover; }
.nav-links { display: flex; gap: clamp(1rem, 2.5vw, 2.2rem); align-items: center; }
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
  padding: 0.6rem 0; /* ≥44px touch target with line-height */
}
.nav-links a:hover { opacity: 1; color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.75rem 1.7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 0.35s ease, color 0.35s ease;
}
.btn:hover { background: var(--accent); color: #15120c; }
.btn.solid { background: var(--accent); color: #15120c; }
.btn.solid:hover { filter: brightness(1.08); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding-block: clamp(6rem, 16vh, 9rem) clamp(3rem, 8vh, 5rem);
}
.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* portrait maternity hero: bias the crop toward the top so faces stay in
     frame instead of being cut off above the viewport */
  object-position: center 22%;
  transform: scale(1.12);
  filter: brightness(0.62) saturate(1.05);
}
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,16,20,0.35) 0%, rgba(16,16,20,0.05) 45%, var(--bg) 100%);
}
.hero-copy { max-width: 56rem; }
.hero-tagline {
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.25rem);
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  max-width: 38em;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }
.scroll-hint {
  position: absolute;
  right: clamp(1.2rem, 4vw, 3.5rem);
  bottom: 2.2rem;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-dim);
  writing-mode: vertical-rl;
}

/* ---------- Chapter scenes on index ---------- */
.scene { display: grid; gap: clamp(2rem, 5vw, 4.5rem); }
@media (min-width: 880px) {
  .scene { grid-template-columns: 1fr 1fr; align-items: center; }
  .scene.flip > .scene-media { order: 2; }
}
.scene-media { position: relative; overflow: hidden; border-radius: 4px; }
.scene-media img {
  display: block;
  width: 100%;
  height: clamp(22rem, 60vh, 38rem);
  object-fit: cover;
  transform: scale(1.1);
}
.scene-media .frame-num {
  position: absolute;
  top: 1rem; left: 1.2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.2em;
}
.scene-copy p { color: var(--ink-dim); max-width: 30em; }
.scene-copy .btn { margin-top: 1.2rem; }

.scene-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.6rem, 1.5vw, 1.2rem);
  margin-top: clamp(2.5rem, 6vw, 4rem);
}
.scene-strip a { display: block; overflow: hidden; border-radius: 3px; }
.scene-strip img {
  display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.scene-strip a:hover img { transform: scale(1.05); }

/* ---------- About ---------- */
.about-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 880px) { .about-grid { grid-template-columns: 0.85fr 1.15fr; align-items: start; } }
.about-grid img { width: 100%; border-radius: 4px; height: auto; }
.stat-row { display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: 2rem; }
.stat .num { font-family: var(--font-display); font-size: clamp(2rem, 1.5rem + 2vw, 3.2rem); color: var(--accent); line-height: 1; }
.stat .lbl { font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-dim); margin-top: 0.4rem; }

/* ---------- Pricing ---------- */
.tier-grid { display: grid; gap: 1.2rem; margin-top: clamp(2rem, 5vw, 3.5rem); }
@media (min-width: 880px) { .tier-grid { grid-template-columns: repeat(3, 1fr); } }
.tier {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: clamp(1.6rem, 3vw, 2.4rem);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 0.9rem;
}
.tier.featured { border-color: var(--accent); position: relative; }
.tier.featured::before {
  content: "Most booked";
  position: absolute; top: -0.75rem; left: 1.4rem;
  background: var(--accent); color: #15120c;
  font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase;
  padding: 0.3rem 0.8rem; border-radius: 999px;
}
.tier h3 { font-size: 1.5rem; }
.tier .price { font-family: var(--font-display); font-size: 2.1rem; color: var(--accent); }
.tier .price small { font-size: 0.95rem; color: var(--ink-dim); font-family: var(--font-body); letter-spacing: 0.05em; }
.tier ul { margin: 0; padding: 0; list-style: none; color: var(--ink-dim); font-size: 0.95rem; display: grid; gap: 0.45rem; }
.tier ul li::before { content: "— "; color: var(--accent); }
.tier .btn { margin-top: auto; }
.pricing-note { color: var(--ink-dim); font-size: 0.9rem; max-width: 46em; margin-top: 2rem; }

/* ---------- Contact ---------- */
.contact { text-align: center; padding-block: clamp(6rem, 18vh, 12rem); }
.contact .display { margin-bottom: 1.2rem; }
.contact-channels {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1rem; margin-top: 2.6rem;
}
.contact-meta { margin-top: 2.4rem; color: var(--ink-dim); font-size: 0.92rem; }
.contact-meta a { color: var(--ink); text-decoration-color: var(--accent); }

/* Cal.com inline booking embed */
.booking-frame {
  width: min(940px, 100%);
  margin: clamp(2rem, 5vw, 3.2rem) auto 0;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(6px);
}
.booking-frame #cal-booking { min-height: 580px; width: 100%; }
.booking-frame iframe { width: 100% !important; }
.contact-or {
  margin-top: clamp(2rem, 5vw, 3rem);
  font-size: 0.8rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------- Footer ---------- */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--hairline);
  padding: 2rem clamp(1.2rem, 4vw, 3.5rem) calc(2rem + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between;
  color: var(--ink-dim); font-size: 0.8rem; letter-spacing: 0.08em;
}
footer a { color: var(--ink-dim); }

/* ---------- Gallery pages ---------- */
.gallery-hero { padding-block: clamp(9rem, 24vh, 13rem) clamp(3rem, 7vh, 5rem); }

/* Poetic subhead under the keyword H1 (keeps the cinematic feel, SEO-safe H1) */
.hero-poetic {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 1rem + 2.2vw, 2.6rem);
  color: var(--accent);
  line-height: 1.1;
  margin-top: 0.3rem;
}

/* Answer-first SEO content + FAQ block on gallery pages */
.seo-content { padding-block: clamp(1rem, 3vh, 2rem) clamp(4rem, 12vh, 7rem); }
.prose { max-width: 46rem; }
.prose h2 { font-size: clamp(1.5rem, 1rem + 2.2vw, 2.4rem); margin-top: 2.6rem; }
.prose > h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-dim); margin-top: 1rem; }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--hairline); transition: border-color 0.3s; }
.prose a:hover { border-color: var(--accent); }
.faq { margin-top: 1.6rem; display: grid; gap: 1.4rem; }
.faq-item h3 { font-family: var(--font-body); font-weight: 500; font-size: 1.06rem; color: var(--ink); letter-spacing: 0.01em; margin: 0; }
.faq-item p { margin-top: 0.45rem; }
.masonry { columns: 3 280px; column-gap: 1rem; padding-bottom: clamp(4rem, 10vh, 7rem); }
.masonry a { display: block; margin-bottom: 1rem; overflow: hidden; border-radius: 3px; break-inside: avoid; }
.masonry img {
  display: block; width: 100%; height: auto;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.7s ease;
}
.masonry a:hover img { transform: scale(1.04); filter: brightness(1.06); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 8, 10, 0.94);
  display: none;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(94vw, 1500px); max-height: 88svh; object-fit: contain; }
.lightbox button {
  position: absolute;
  background: none; border: none; color: #fff;
  font-size: 2rem; cursor: pointer;
  width: 56px; height: 56px;
  display: grid; place-items: center;
}
.lightbox .lb-close { top: max(0.8rem, env(safe-area-inset-top)); right: 0.8rem; }
.lightbox .lb-prev { left: 0.4rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 0.4rem; top: 50%; transform: translateY(-50%); }

/* ---------- Reveal primitives (animated by GSAP) ---------- */
.reveal-line { overflow: hidden; display: block; }
.reveal-line > span { display: block; will-change: transform; }

/* Reduced motion: everything visible, no choreography */
@media (prefers-reduced-motion: reduce) {
  .scene-media img, .hero-media img { transform: none !important; }
  * { animation: none !important; transition-duration: 0.01ms !important; }
}

/* Mobile nav: collapse links, keep CTA */
@media (max-width: 720px) {
  .nav-links a:not(.btn) { display: none; }
  .scroll-hint { display: none; }
  .masonry { columns: 2 160px; }
}
