/* Homepage styles. Shared header/menu/footer styles live in site.css. */

/* ── Design tokens ── */
:root { --margin-top: 10.5vh; --margin-bottom: 10.5vh; }

/* ── Base ── */
html {
  /* no height:100% — let spacer control scroll height */
  background: var(--bg);
  overflow-x: hidden;
}

body {
  color: var(--text);
  font-family: 'Figtree', sans-serif;
  overflow-x: hidden;
  /* scrollbar hidden — content is fixed wrapper driven by lerp,
     native scroll is invisible so custom scrollbar isn't viable */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body::-webkit-scrollbar { display: none; }

/* ── LERP SCROLL SYSTEM ── */
#scroll-spacer {
  /* static positioning — stays in normal document flow so body scrolls */
  display: block;
  width: 1px;
  pointer-events: none;
  visibility: hidden;
}

#scroll-content {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
}

body { --mask-start: -9999px; }

/* ── Section content mask wrapper ── */
.section-mask-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  --section-top: 0px;
  margin-left:  calc(-100vw - var(--margin-side));
  margin-right: calc(-100vw - var(--margin-side));
  padding-left:  calc(100vw + var(--margin-side));
  padding-right: calc(100vw + var(--margin-side));
  box-sizing: border-box;
  -webkit-mask-image: linear-gradient(to bottom,
    transparent  calc(var(--mask-start) - var(--section-top) - 50px),
    black        calc(var(--mask-start) - var(--section-top) - 50px));
          mask-image: linear-gradient(to bottom,
    transparent  calc(var(--mask-start) - var(--section-top) - 50px),
    black        calc(var(--mask-start) - var(--section-top) - 50px));
}

/* ── LAYER 1 — SLIDESHOW (furthest back) ── */
#slideshow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

/* Fade overlay: opacity driven by JS CSS var as user scrolls off home */
#slideshow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: var(--fade-opacity, 0);
  pointer-events: none;
  z-index: 1;
}

#slideshow.paused .slide { animation-play-state: paused; }

.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  will-change: transform, opacity;
}

.slide.active { opacity: 1; }

.slide:nth-child(1) { animation: kb-1 20s ease-in-out infinite alternate; }
.slide:nth-child(2) { animation: kb-2 23s ease-in-out infinite alternate; animation-delay: -8s; }
.slide:nth-child(3) { animation: kb-3 18s ease-in-out infinite alternate; animation-delay: -5s; }
.slide:nth-child(4) { animation: kb-4 25s ease-in-out infinite alternate; animation-delay: -12s; }
.slide:nth-child(5) { animation: kb-5 21s ease-in-out infinite alternate; animation-delay: -16s; }
.slide:nth-child(6) { animation: kb-6 22s ease-in-out infinite alternate; animation-delay: -9s; }
.slide:nth-child(7) { animation: kb-7 19s ease-in-out infinite alternate; animation-delay: -3s; }

@keyframes kb-1 { from{transform:scale(1.2)  translate( 0%,  0%)} to{transform:scale(1.35) translate(-3%,-2%)} }
@keyframes kb-2 { from{transform:scale(1.3)  translate( 3%,  1%)} to{transform:scale(1.2)  translate(-3%, 2%)} }
@keyframes kb-3 { from{transform:scale(1.2)  translate( 0%,  2%)} to{transform:scale(1.35) translate( 2%,-3%)} }
@keyframes kb-4 { from{transform:scale(1.3)  translate(-3%, -1%)} to{transform:scale(1.2)  translate( 3%, 2%)} }
@keyframes kb-5 { from{transform:scale(1.3)  translate(-2%, -2%)} to{transform:scale(1.2)  translate( 2%, 2%)} }
@keyframes kb-6 { from{transform:scale(1.2)  translate( 2%, -2%)} to{transform:scale(1.35) translate(-2%, 3%)} }
@keyframes kb-7 { from{transform:scale(1.3)  translate( 1%,  3%)} to{transform:scale(1.2)  translate(-1%,-3%)} }

/* ── Scroll indicator ── One little ball per section, right edge of viewport. */
#scroll-indicator {
  position: fixed;
  right: clamp(12px, 2vw, 24px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: all;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#scroll-indicator.visible { opacity: 1; }

.scroll-spark {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  /* the padding is invisible extra click area around the ball */
  padding: 5px;
  background-color: currentColor;
  background-clip: content-box;
  opacity: 0.45;
  color: var(--link); /* coral — matches nav links */
  transition: opacity 0.3s ease, color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.scroll-spark:hover { opacity: 0.8; }

.scroll-spark.active {
  opacity: 1;
  color: var(--accent); /* olive gold — matches active nav */
  transform: scale(1.35);
}

/* ── LAYER 4 — FOREGROUND dots ── */
#foreground {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.fg-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  will-change: transform;
}

/* ── HEADER ── */
header { top: var(--margin-top); padding: 0 var(--margin-side) 0.5rem; background: transparent; }

.logo-link { opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }

header.scrolled .logo-link { opacity: 1; pointer-events: all; }

/* ── SECTIONS ── */
.section {
  position: relative;
  z-index: 1;
  /* 120vh ensures there's always a scroll range where only this section is visible */
  min-height: 110vh;
  padding: calc(var(--header-h) + 4vh) var(--margin-side) calc(var(--margin-bottom) * 1.5);
  display: flex;
  flex-direction: column;
}

/* HOME — transparent so slideshow shows through */
#section-home {
  padding-top: var(--margin-top);
  /* Moves the whole logo+button group up/down as one unit: bigger multiplier = less room for #hero-main's flex:1 area to grow into = group sits higher. */
  padding-bottom: calc(var(--margin-bottom) * 1.3);
  background: transparent;
  min-height: 100vh;
}

/* SOLID sections (about, flash, contact) */
.section-solid {
  background: var(--bg);
}

/* "Image" sections (portfolio, contact): no background photo any more, but
   their content has its own parallax speed (see home.js) */
.section-image {
  background-color: var(--bg);
}

.section-image .section-inner {
  position: relative;
  z-index: 1;
  will-change: transform;
}

.section-solid .section-inner {
  will-change: transform;
}

/* ── Button fade — driven directly by JS, no CSS transition needed ── */
.fade-on-scroll { will-change: opacity, transform; }
#hero-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 5vh;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-logo-wrap {
  position: relative;
  width: 100%;
}

.hero-logo {
  display: block;
  width: 100%;
  height: auto;
  /* --mx/--my set by JS (see heroPanLoop), same lerped
     cursor-relative pan convention as the gallery grid images. */
  transform: translate(calc(var(--hero-mx, 0) * 32px), calc(var(--hero-my, 0) * 32px));
}

#hero-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 0;
  padding-bottom: 3.5rem;
}

/* ── SECTION CONTENT ── */
.section-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: 'Scilla', serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  color: var(--text);
  line-height: 1.05;
}

.section-body {
  font-family: 'Figtree', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.8;
  color: rgba(221,188,184,0.6);
  max-width: 540px;
  margin-top: 1.2rem;
}

.btn-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.3rem 3.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  overflow: visible;
  transition: color 0.3s ease;
}

.btn-wrap:hover .btn { color: var(--hover); }

.btn-outline {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  width: 100%; height: 100%;
}

.btn-outline rect {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.btn-wrap:hover .btn-outline rect { stroke: var(--hover); }

.sparkle-wrap {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 0 0px var(--accent));
  transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1), filter 0.35s ease;
}

.sparkle-wrap-1 { right: 25px; }
.sparkle-wrap-2 { left:  25px; }

.btn-wrap:hover .sparkle-wrap-1 { transform: translate( 6px,-6px) scale(1.15); }
.btn-wrap:hover .sparkle-wrap-2 { transform: translate(-6px, 6px) scale(1.15); }
.btn-wrap:hover .sparkle-wrap   { filter: drop-shadow(0 0 7px var(--hover)); }

.sparkle {
  display: block;
  color: var(--accent);
  width: 48px;
  overflow: visible;
  will-change: transform;
  transition: color 0.35s ease;
}

.btn-wrap:hover .sparkle {
  color: var(--hover);
  animation-play-state: paused;
}

@keyframes float-normal  {
  from { transform: translate(0,0); }
  to   { transform: translate(3px,-4px); }
}
@keyframes float-flipped {
  from { transform: rotate(180deg) translate(0,0); }
  to   { transform: rotate(180deg) translate(3px,-4px); }
}

.sparkle-1 { animation: float-normal  3.2s ease-in-out infinite alternate; }
.sparkle-2 { animation: float-flipped 3.9s ease-in-out infinite alternate; }

/* Hover: the outlined sparkles fill in with ink */
.sparkle path { transition: fill 0.35s ease; }
.btn-wrap:hover .sparkle path { fill: currentColor; }

@media (max-width: 600px) {
  :root {
    --margin-side: 5vw;
    --margin-top: 8vh;
    --margin-bottom: 8vh;
    --header-h: 64px;
  }

  .hamburger { display: flex; }

  nav {
    display: none;
    position: fixed; /* fixed so mobile menu isn't affected by lerp */
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 1.2rem var(--margin-side) 1.5rem;
    background: rgba(20,20,20,0.97);
    backdrop-filter: blur(12px);
    z-index: 99;
  }

  nav.open { display: flex; }
  nav a { font-size: 1.1rem; }
}

/* ── ABOUT SECTION ── */

#section-about {
  min-height: 95vh;
  padding-bottom: calc(var(--margin-bottom) * 0.3);
}

/* Bottom slack so the fast-moving polaroid isn't clipped by the mask. */
#section-about .section-mask-wrap { padding-bottom: 8vh; margin-bottom: -8vh; }

#section-about .section-inner {
  flex-direction: row;
  align-items: center;
  gap: clamp(3rem, 6vw, 6rem);
}

#section-about .about-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  will-change: transform;
}

#section-about .section-title {
  font-family: 'Scilla', serif;
  font-style: italic;
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  color: var(--accent);
  margin-bottom: 1.2rem;
  will-change: transform, opacity;
  opacity: 0;
  transform: translateX(-100vw);
}

/* ── Bio text flow ── */
#section-about .bio-flow { margin-top: 0.2rem; padding-left: 1.5rem; }
#section-about .bio-flow::after { content: ''; display: table; clear: both; }

#section-about .bio-flow .section-body {
  max-width: none;
  margin-top: 0;
  font-size: clamp(1rem, 1.3vw, 1.1rem);
}

#section-about .bio-flow .section-body + .section-body { margin-top: 1rem; }

#section-about .bio-link {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}

#section-about .bio-link:hover { color: #ffffff; }

.inline-link {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}

.inline-link:hover { color: #ffffff; }

/* ── Studio inset ── */
#section-about .studio-inset {
  float: right;
  width: 48%;
  margin: -1.8rem -3rem 0.4rem 0.4rem;
  padding: clamp(0.6rem, 1.2vw, 1rem);
  will-change: transform, opacity;
  opacity: 0;
}
/* The box is pulled up beside the bio's short last line. */
@media (min-width: 601px) {
  html[lang="pt-PT"] #section-about .studio-inset { margin-top: 0.4rem; }
}

#section-about .studio-label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

#section-about .studio-inset .section-body {
  font-size: clamp(1rem, 1.3vw, 1.1rem);
}

/* ── Residing block ── */
#section-about .residing-block {
  margin-top: clamp(1.2rem, 2vw, 1.8rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#section-about .residing-label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  color: var(--link);
  letter-spacing: 0.03em;
  margin-bottom: 0.6rem;
}

#section-about .residing-logo {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.45s ease;
}

#section-about .residing-logo:hover { transform: scale(1.06); }

/* ── Image column ── */
#section-about .about-right {
  flex: 0.9;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

#section-about .about-image-wrap {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 3 / 4.2;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  will-change: transform, opacity;
  opacity: 0;
}

#section-about .about-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#section-about .polaroid {
  position: absolute;
  bottom: -10%;
  right: 5%;
  width: 45%;
  transform: rotate(6deg);
  z-index: 2;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  will-change: transform;
}

#section-about .polaroid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* ── About mobile ── */
/* One column, in this order: title → photos → bio → "I'm inspired by…" → the studio.
   display: contents lets the title and paragraphs be ordered alongside the photos. */
@media (max-width: 600px) {
  #section-about .section-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  #section-about .about-left,
  #section-about .bio-flow { display: contents; }
  #section-about .bio-flow::after { display: none; }
  #section-about .section-title          { order: 1; }
  #section-about .about-right            { order: 2; margin-bottom: 2.5rem; }
  #section-about .bio-flow > p:first-child { order: 3; }
  #section-about .bio-flow > p:last-child  { order: 4; margin-top: 1rem; }
  #section-about .studio-inset           { order: 5; }
  #section-about .bio-flow > p { padding-left: 1.5rem; } /* the indent .bio-flow used to give */
  #section-about .about-right { width: 100%; }
  #section-about .polaroid { width: 40%; bottom: -3%; right: -3%; }
  #section-about .about-image-wrap { max-width: 100%; aspect-ratio: 3 / 4; }
  #section-about .studio-inset { float: none; width: auto; margin: 2rem 0 0 1.5rem; }
}

/* ── PORTFOLIO SECTION — Split Gallery ── */

#section-portfolio {
  min-height: 70vh;
  padding-top: calc(var(--header-h) + 3vh);
  padding-bottom: calc(var(--margin-bottom) * 0.3);
}

/* Bottom slack for the image-section content parallax. */
#section-portfolio .section-mask-wrap { padding-bottom: 6vh; }

#section-portfolio .section-inner {
  justify-content: flex-start;
  gap: 0;
}

#section-portfolio .section-title {
  font-style: italic;
  color: var(--accent);
  margin-bottom: clamp(2rem, 4vh, 3.5rem);
  will-change: transform, opacity;
  opacity: 0;
  transform: translateX(-100vw);
}

/* ── Subtitle row: matches about's studio-label sizing ── */
.portfolio-sub-row {
  display: flex;
  justify-content: space-between;
  padding: 0 0 clamp(0.3rem, 0.8vw, 0.5rem);
  margin-top: -0.3rem;
}

.portfolio-sub-row span,
.portfolio-sub-row a {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  letter-spacing: 0.03em;
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
  transform-origin: left bottom; /* grows upward, away from the gallery below, not downward into it */
  transition: opacity 0.3s ease, color 0.2s ease, transform 0.25s ease;
}

.portfolio-sub-row .sub-tattoo { color: var(--accent); }
.portfolio-sub-row .sub-illust { color: var(--link); transform-origin: right bottom; }

/* Same swept-underline technique as the header nav links:
   an ::after bar animating width 0 → 100%, not text-decoration. */
.portfolio-sub-row a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--hover);
  transition: width 0.25s ease;
}

/* ── Grouped hover: the "See all" link and its gallery half react together ── */
.portfolio-sub-row a.group-hover {
  color: var(--hover);
  transform: scale(1.3);
}
.portfolio-sub-row a.group-hover::after {
  width: 100%;
}

/* No transition on transform: it is driven every frame by the pan/zoom loop. */
.gallery-cell img { transition: opacity 0.4s ease; }

.half-tattoo.group-hover .gallery-cell img,
.half-illust.group-hover .gallery-cell img {
  opacity: 1;
}

/* The cell each floating title sits on: fades most of the way (not fully) to solid charcoal instead of just returning to full opacity like the others. */
.g1-tl, .g2-tr { background: var(--bg); }
.half-tattoo.group-hover .g1-tl img { opacity: 0.4; }
.half-illust.group-hover .g2-tr img { opacity: 0.4; }

/* ── Gallery container ── */
.portfolio-gallery {
  height: auto; /* driven by .gallery-grid's own aspect-ratio, not an independent vh-based clamp. */
  position: relative;
}

/* ── Split wrapper ── */
.portfolio-split {
  display: flex;
  height: auto;
  gap: 0;
}

/* ── Center divider line ── */
.portfolio-center-divider {
  flex: 0 0 2px;
  align-self: stretch;
  background: transparent; /* line removed, but same flex-basis + margins keep the gap identical */
  border-radius: 2px;
  opacity: 0.5;
  pointer-events: none;
  margin: 0 clamp(10px, 1.5vw, 18px);
  transition: margin 0.55s cubic-bezier(0.22,1,0.36,1);
}

/* ── Each half ── */
.portfolio-half {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: clamp(6px, 1vw, 10px);
  height: auto;
  align-items: stretch;
  position: relative;
  transition: flex 0.55s cubic-bezier(0.22,1,0.36,1);
}

/* ── GALLERY GRID — built from exact Affinity vector data ── */
.gallery-grid {
  position: relative;
  display: flex;
  width: 100%;
  gap: clamp(6px, 1vw, 10px); /* col1 ↔ col2 seam */
}
.gallery-cell {
  position: relative;
  display: block;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}
/* Thin edge that follows the cell's clip-path curve (a CSS border would only trace the box). */
.cell-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.cell-border path {
  fill: none;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.8; /* dims/washes out the photos a bit so the floating titles stay legible on top */
}
/* The whole gallery stays hidden until its photos have loaded, then fades in as one piece through its normal .reveal (see the PORTFOLIO LOADING script). */
.portfolio-gallery.awaiting-images { opacity: 0 !important; }
.gallery-sparkle {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}
/* Tattoo-side accents are gold, illustration-side are coral —
   matching each side's own established color (accent vs link). */
.gallery-sparkle path {
  stroke: rgba(255,255,255,0.06);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.gallery-sparkle--1 path { fill: var(--accent); }
.gallery-sparkle--2 path { fill: var(--link); }

/* ── Grid 1 (tattoo side) — tl/bl stacked in col1, circle
   overlapping br in col2 ── */
.gallery-grid--1 { aspect-ratio: 1.09077; }
.gallery-title {
  position: absolute;
  z-index: 4; /* above the sparkle (3) — floats over everything */
  pointer-events: none;
  /* --scroll-ty comes from the scroll parallax, --mx/--my from the mouse pan. */
  transform: translateY(var(--scroll-ty, 0px)) translate(calc(var(--mx, 0) * 28px), calc(var(--my, 0) * 28px));
}
.gallery-title--tattoo {
  /* centered over g1-tl: its measured center is (26.3%, 15.85%) of the grid. */
  top: 3.82%;
  left: 8.3%;
  width: 36%;
  aspect-ratio: 782 / 479;
}
.gallery-title img { width: 100%; height: 100%; display: block; }

/* Mouse-pan: --mx/--my are set per-grid by JS (see onFrame), ranging roughly -1 to 1, lerped for smoothness. */
.g1-col1 { flex: 619.045 0 0; display: flex; flex-direction: column; gap: clamp(6px, 1vw, 10px); }
.g1-tl   { flex: 345.042 0 0; --cell-scale: 1.3; }
.g1-tl img { transform: scale(calc(var(--cell-scale) + var(--hover-zoom, 0))) translateY(2%) translate(calc(var(--mx, 0) * 2%), calc(var(--my, 0) * 2%)); }
.g1-bl   { flex: 732.965 0 0; --cell-scale: 1.5; }
.g1-bl img { transform: scale(calc(var(--cell-scale) + var(--hover-zoom, 0))) translate(calc(var(--mx, 0) * 2%), calc(var(--my, 0) * 2%)); }
.g1-col2 { flex: 557.736 0 0; position: relative; }
.g1-br   { position: absolute; top: 37.626%; left: 0; width: 100%; height: 62.374%; z-index: 1; --cell-scale: 1.4; }
.g1-br img { transform: scale(calc(var(--cell-scale) + var(--hover-zoom, 0))) translateY(-8%) translate(calc(var(--mx, 0) * 2%), calc(var(--my, 0) * 2%)); }
.g1-circle {
  position: absolute;
  top: 0; left: 0; width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  --cell-scale: 1.4;
  border: 1.5px solid rgba(255,255,255,0.15);
}
.g1-circle img {
  transform: scale(calc(var(--cell-scale) + var(--hover-zoom, 0))) translateY(2%) translate(calc(var(--mx, 0) * 2%), calc(var(--my, 0) * 2%));
}
.gallery-sparkle--1 { left: 46.097%; top: 25.227%; width: 8.163%; height: 15.220%; }

/* ── Grid 2 (illustration side) — col1 (tl/bl) and col2
   (tr/br) each have their own independent row split ── */
.gallery-grid--2 { aspect-ratio: 1.09026; }
.gallery-title--illust {
  /* centered over g2-tr: measured center (69.1%, 15.79%) of the grid, then nudged up a bit from that centered top value. */
  top: -0.8%;
  left: 41%;
  height: 27%;
  aspect-ratio: 1308 / 547;
}
.g2-col1 { flex: 441.855 0 0; display: flex; flex-direction: column; gap: clamp(6px, 1vw, 10px); }
.g2-col2 { flex: 733.464 0 0; display: flex; flex-direction: column; gap: clamp(6px, 1vw, 10px); }
.gallery-grid--2 .gallery-cell { --cell-scale: 1.15; }
.gallery-grid--2 .gallery-cell img {
  transform: scale(calc(var(--cell-scale) + var(--hover-zoom, 0))) translate(calc(var(--mx, 0) * 2%), calc(var(--my, 0) * 2%));
}
.g2-tl { flex: 712.008 0 0; }
.gallery-grid--2 .g2-tl img { transform: scale(calc(var(--cell-scale) + var(--hover-zoom, 0))) translateY(5%) translate(calc(var(--mx, 0) * 2%), calc(var(--my, 0) * 2%)); }
.gallery-grid--2 .g2-bl { --cell-scale: 1.45; }
.g2-bl { flex: 364.649 0 0; }
.g2-tr { flex: 343.816 0 0; }
.gallery-grid--2 .g2-br { --cell-scale: 1.08; }
.g2-br { flex: 733.465 0 0; }
.gallery-sparkle--2 { left: 31.235%; top: 23.741%; width: 12.990%; height: 16.596%; }

/* ── Portfolio mobile ── */
@media (max-width: 600px) {
  .portfolio-gallery { height: auto; }
  .portfolio-split {
    flex-direction: column;
    height: auto;
    gap: clamp(1.5rem, 4vw, 2.5rem);
  }
  .portfolio-half {
    height: auto;
    align-items: flex-start; /* don't stretch gallery-grid — its own width+aspect-ratio must drive its height, unforced */
  }
  .portfolio-center-divider { display: none; }
}

/* ── FLASH SECTION ── */

#section-flash {
  padding-top: calc(var(--header-h) + 2vh);
  padding-bottom: 6vh;
  /* As tall as its content (not the usual 110vh), so the empty gap
     before Contact stays short */
  min-height: 0;
}

/* ── Three columns: text + moth | flash book | shop teaser. */
.flash-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  width: 100%;
  gap: clamp(1.5rem, 3vw, 3.5rem);
  margin-top: clamp(3rem, 6vh, 5.5rem);
  margin-bottom: 0;
  /* Room under the side columns matching the "Last updated" note, so
     their bottoms line up with the bottom of the book itself */
  --below-book: calc(clamp(1.2rem, 2vw, 1.8rem) + 2.4em);
  --shop-lift: clamp(2rem, 5vh, 3.5rem);
}

.flash-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding-bottom: var(--below-book);
}

.flash-text {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  max-width: 440px;
}

.flash-text .section-body {
  text-align: center;
}

#section-flash .section-body.flash-justify { text-align: justify; } /* must beat #section-flash .section-body */

#section-flash .section-body.flash-respect {
  color: var(--link);
  font-weight: 400;
}

.flash-moth {
  display: block;
  width: 100%; /* full width of the text column */
  height: auto;
}

/* ── Centre: the book, with "last updated" below ── */
.flash-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.2rem, 2vw, 1.8rem);
  padding-top: clamp(1.5rem, 4vh, 3rem); /* sits a little lower than the text beside it */
}

/* ── Right: caption + square shop panel, pushed to the bottom ── */
.flash-shop-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 2rem;
  /* sits a bit higher than the bottom of the book (desktop only) */
  padding-bottom: calc(var(--below-book) + var(--shop-lift, 0px));
  will-change: transform, opacity;
  opacity: 0;
}

.flash-shop-caption {
  font-family: 'Scilla', serif;
  font-style: italic;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  color: var(--text); /* same as the Flash text */
  text-align: center;
}

#section-flash .section-inner {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
}

/* ── Title row: dividers flank the title, move together as one unit. */
.flash-title-row {
  display: flex;
  align-items: center;
  width: calc(100% + 2 * var(--margin-side));
  margin-left: calc(-1 * var(--margin-side));
  margin-right: calc(-1 * var(--margin-side));
  will-change: transform, opacity;
  opacity: 0;
  transform: translateX(-100vw);
}

#section-flash .section-title {
  font-family: 'Scilla', serif;
  font-style: italic;
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  color: var(--accent);
  margin: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Background image so the artwork always scales to the box height. */
.flash-divider {
  display: block;
  height: clamp(2.4rem, 4.4vw, 3.4rem);
  background-image: url('../images/divider.svg');
  background-repeat: no-repeat;
  background-size: auto 100%;
  pointer-events: none;
  flex-shrink: 0;
}

.flash-divider-left {
  flex: 0 0 var(--margin-side);
  background-position: right center;
  margin-right: clamp(1rem, 2vw, 1.7rem);
  /* Fade the cropped left edge, matching the right divider. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,0.5) 55px, rgba(0,0,0,0.9) 110px, black 160px, black 100%);
          mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,0.5) 55px, rgba(0,0,0,0.9) 110px, black 160px, black 100%);
}

/* Right divider: filled by JS (syncFlashDividerTile) with whole, undistorted tiles. */
.flash-divider-right {
  display: flex;
  align-items: center;
  background-image: none;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  gap: clamp(0.3rem, 0.6vw, 0.5rem);
  margin-left: clamp(1.6rem, 2.8vw, 2.4rem);
  /* Fade the clipped end of the last tile into the page edge. */
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 160px), rgba(0,0,0,0.9) calc(100% - 110px), rgba(0,0,0,0.5) calc(100% - 55px), transparent 100%);
          mask-image: linear-gradient(to right, black calc(100% - 160px), rgba(0,0,0,0.9) calc(100% - 110px), rgba(0,0,0,0.5) calc(100% - 55px), transparent 100%);
}

.flash-divider-tile {
  flex: 0 0 auto;
  height: 100%;
  background-image: url('../images/divider.svg');
  background-repeat: no-repeat;
  background-size: auto 100%;
  background-position: left center;
}

#section-flash .section-body {
  color: var(--text); /* full opacity here (other sections use 60%) */
  max-width: none;
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  text-align: center;
}

.flash-book-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  will-change: transform, opacity;
  opacity: 0;
}

/* Floating "flip me" graphic, part of the cover button so it shares its hover. */
.flip-me-wrap {
  position: absolute;
  top: -2%;
  right: -34%;
  width: 50%;
  z-index: 5;
  pointer-events: none;
  transform: translateY(var(--flip-ty, 0px));
}
.flip-me-text {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 25% 80%; /* rotation anchor: near bottom-left, not the corner itself */
  transform: rotate(-8deg);
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.flash-cover-btn:hover .flip-me-text {
  transform: rotate(4deg) translateX(16px) scale(1.1);
}

#section-flash .flash-note {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(0.75rem, 1.1vw, 0.9rem);
  letter-spacing: 0.06em;
  color: var(--link);
  text-align: center;
  opacity: 0.8;
}

#section-flash .flash-note-date {
  font-family: 'Figtree', sans-serif;
  font-weight: 300;
  letter-spacing: 0.04em;
}

/* ── Flash Cover Button — hover tilt unchanged ── */
.flash-cover-btn {
  position: relative;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: block;
  width: clamp(300px, 30vw, 430px);
  overflow: visible;
}

.flash-cover-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 10px;
  border-radius: 4px;
}

.fc-book {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  perspective: 1600px;
}

.flash-cover-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 6px 22px 22px 6px;
  transform-origin: left center;
  transition: transform 0.5s ease-out, box-shadow 0.4s ease;
  box-shadow: 4px 8px 28px rgba(0,0,0,0.22);
  will-change: transform;
  border: 1px solid rgba(255,255,255,0.06);
}

.flash-cover-btn:hover .flash-cover-img {
  transform: rotateY(-18deg);
  box-shadow: 8px 14px 34px rgba(0,0,0,0.28);
  transition: transform 0.55s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.45s ease;
}

.fc-page-2 {
  position: absolute;
  /* Slightly inset so the cover (at a clean 100%) fully overlaps it and its edge can't peek out around the cover at rest. */
  inset: 2px;
  background-image: url('../images/flashbook/flash02.webp');
  background-color: #AFA028;
  background-size: cover;
  background-position: center;
  border-radius: 6px 22px 22px 6px;
  pointer-events: none;
  z-index: 0;
  transform: translateX(0);
  transition: transform 0.5s ease-out;
}

.flash-cover-btn:hover .fc-page-2 {
  transform: translateX(14px);
  transition: transform 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ── Shop panel: square image card linking to the shop. ── */
.flash-shop-panel {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 5 / 4; /* a little wider than tall */
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 1.5vw, 1.3rem);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Background art */
.flash-shop-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('../images/shopbg.webp?v=3') center center / cover no-repeat;
}

.shop-card-title {
  font-family: 'Scilla', serif;
  font-style: italic;
  font-weight: 700; /* Scilla has no bold file, so the browser thickens the regular one… */
  -webkit-text-stroke: 0.035em currentColor; /* …and an outline in the same colour thickens it more */
  font-size: clamp(3rem, 6vw, 5.2rem);
  color: #141414;
  line-height: 1;
}

.shop-card-btn {
  display: block;
  background: #141414;
  color: #F0E8DC;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  text-decoration: none;
  margin-top: 0.8rem; /* extra room below "Shop" on top of the panel's gap */
  padding: 0.9rem 2.1rem;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.shop-card-btn:hover { background: var(--link); }

/* Tablets and phones: one centred column (text → book → shop) */
@media (max-width: 1000px) {
  .flash-layout { grid-template-columns: 1fr; gap: 3rem; --below-book: 0px; --shop-lift: 0px; }
  .flash-moth { display: none; }
}

@media (max-width: 600px) {
  .flash-divider { display: none; }
  .flash-title-row { width: 100%; margin-left: 0; margin-right: 0; }
  .flash-layout { gap: 2.5rem; }
  .flash-shop-panel { width: min(100%, 320px); }
  .flash-cover-btn { width: min(260px, 70vw); }
  .flip-me-wrap { right: -14%; top: -7%; width: 44%; } /* stays on screen */
}

/* ── FLASHBOOK OVERLAY ── */

#flashbook-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  user-select: none;
}

#flashbook-overlay.open { opacity: 1; pointer-events: all; }

/* Close ✕: just above the book's top-right corner, bold coral strokes
   to match the arrows */
#fb-close {
  position: absolute;
  bottom: calc(100% + 8px);
  right: -6px;
  z-index: 40;
  background: none;
  border: none;
  padding: 0;
  color: var(--link);
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.2s;
}
#fb-close svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 3; stroke-linecap: round;
}

#fb-close:hover { color: var(--accent); transform: rotate(90deg); }
#fb-close:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

#fb-scene {
  position: relative; /* the close button sits against the book's corner */
  perspective: 2800px;
  perspective-origin: 50% 48%;
}

#fb-book {
  position: relative;
  display: flex;
  align-items: stretch;
  filter: drop-shadow(0 28px 48px rgba(0,0,0,0.85));
}

.fb-slot {
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  width: var(--fb-page-w, 300px);
  height: var(--fb-page-h, 400px);
}

#fb-left  { border-radius: 12px 0 0 12px; }
#fb-right { border-radius: 0 12px 12px 0; }

.fb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.fb-lbl {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 700; /* 600 isn't loaded, so it rendered as 700 anyway */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
}

.fb-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
}

#fb-tp {
  position: absolute;
  top: 0;
  width: var(--fb-page-w, 300px);
  height: var(--fb-page-h, 400px);
  transform-style: preserve-3d;
  z-index: 20;
  pointer-events: none;
  display: none;
}

#fb-tp.flip-fwd { left: var(--fb-page-w, 300px); transform-origin: left center;  border-radius: 0 12px 12px 0; }
#fb-tp.flip-bwd { left: 0;                        transform-origin: right center; border-radius: 12px 0 0 12px; }

.fb-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.fb-face.back { transform: rotateY(180deg); }

.fb-face::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; }

#fb-tp.flip-fwd .fb-face.front { border-radius: 0 12px 12px 0; }
#fb-tp.flip-fwd .fb-face.back  { border-radius: 12px 0 0 12px; }
#fb-tp.flip-bwd .fb-face.front { border-radius: 12px 0 0 12px; }
#fb-tp.flip-bwd .fb-face.back  { border-radius: 0 12px 12px 0; }

#fb-tp.flip-fwd .fb-face.front::after { background: linear-gradient(to left,  rgba(0,0,0,0.32) 0%, transparent 55%); animation: fold-in  var(--fb-half, 0.225s) ease-in  forwards; }
#fb-tp.flip-fwd .fb-face.back::after  { background: linear-gradient(to right, rgba(0,0,0,0.32) 0%, transparent 55%); animation: fold-out var(--fb-half, 0.225s) ease-out forwards; animation-delay: var(--fb-half, 0.225s); }
#fb-tp.flip-bwd .fb-face.front::after { background: linear-gradient(to right, rgba(0,0,0,0.32) 0%, transparent 55%); animation: fold-in  var(--fb-half, 0.225s) ease-in  forwards; }
#fb-tp.flip-bwd .fb-face.back::after  { background: linear-gradient(to left,  rgba(0,0,0,0.32) 0%, transparent 55%); animation: fold-out var(--fb-half, 0.225s) ease-out forwards; animation-delay: var(--fb-half, 0.225s); }

/* --fb-half = half the flip time, set by the flip code (normal or fast) */
@keyframes fold-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fold-out { from { opacity: 1; } to { opacity: 0; } }

.fb-zone { position: absolute; top: 0; height: 100%; width: 50%; z-index: 30; cursor: pointer; }
#fb-zone-l { left: 0;  cursor: w-resize; }
#fb-zone-r { right: 0; cursor: e-resize; }

#fb-controls { display: flex; align-items: center; gap: 14px; }

.fb-nav {
  background: none;
  border: none;
  color: var(--accent);
  width: 32px; height: 32px;
  padding: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, transform 0.15s;
}
.fb-nav svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}

#fb-prev:hover:not(:disabled) { color: var(--link); transform: translateX(-2px); }
#fb-next:hover:not(:disabled) { color: var(--link); transform: translateX(2px); }
.fb-nav:disabled { opacity: 0.2; cursor: default; }
.fb-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

#fb-info {
  font-family: 'Syne', sans-serif;
  color: var(--text);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  min-width: 110px;
  text-align: center;
}

#fb-dots { display: flex; gap: 6px; align-items: center; }

.fb-dot-nav {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transition: background 0.25s, transform 0.25s;
}

.fb-dot-nav.active { background: var(--accent); transform: scale(1.3); }

/* ── SCROLL-TRIGGERED REVEALS ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.85s cubic-bezier(0.16,1,0.3,1), transform 0.85s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.12s; }
.reveal-d2 { transition-delay: 0.25s; }
.reveal-d3 { transition-delay: 0.4s; }

/* ── CONTACT SECTION ── */

#section-contact {
  padding-top: calc(var(--header-h) + 3vh);
}

#section-contact .section-inner {
  justify-content: flex-start;
}

#section-contact .contact-body {
  will-change: transform;
}

#section-contact .section-title {
  font-family: 'Scilla', serif;
  font-style: italic;
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  color: var(--accent);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  will-change: transform, opacity;
  opacity: 0;
  transform: translateX(-100vw);
}

.contact-drift {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ── Services subtitle ── */
.contact-services-label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
  color: var(--accent);
  text-align: center;
  width: 100%;
  margin-bottom: clamp(0.9rem, 1.5vw, 1.3rem);
}

/* ── Services row ── */
.contact-services {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(2rem, 3.5vw, 3.5rem);
  margin-top: clamp(1rem, 3vh, 2.5rem);     /* sits a little lower under the title */
  margin-bottom: clamp(2rem, 3.5vw, 3.2rem); /* FAQ follows closer */
  margin-left: clamp(1.5rem, 4vw, 5rem);
  margin-right: clamp(1.5rem, 4vw, 5rem);
}

.contact-service-item {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: clamp(1.4rem, 2.2vw, 2rem) clamp(1.4rem, 2.2vw, 2rem);
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: 28px;
}

.service-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

.service-body {
  font-family: 'Figtree', sans-serif;
  font-weight: 300;
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  text-align: justify;
}

/* ── FAQ: between the service cards and the form. */
.contact-faq {
  /* same left/right edges as the service cards above */
  margin: 0 clamp(1.5rem, 4vw, 5rem) clamp(3.5rem, 6vw, 5.5rem);
  interpolate-size: allow-keywords;
}
.faq-title {
  font-family: 'Scilla', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  color: var(--accent);
  margin-bottom: 1rem;
}
.faq-item { border-bottom: 1px solid rgba(221,188,184,0.2); }
.faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  letter-spacing: 0.03em;
  color: var(--text);
  transition: color 0.2s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: 'Figtree', sans-serif;
  font-weight: 300;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.3s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover,
.faq-item[open] summary { color: var(--link); }
.faq-item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.35s ease, content-visibility 0.35s allow-discrete;
}
.faq-item[open]::details-content { block-size: auto; }
.faq-answer {
  padding: 0 0 1.3rem;
  font-family: 'Figtree', sans-serif;
  font-weight: 300;
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 1.7;
  color: var(--text);
}
.faq-answer p + p,
.faq-answer p + ul { margin-top: 0.8rem; }
.faq-answer ul { padding-left: 1.2rem; }
.faq-answer li::marker { color: var(--link); }

.contact-body {
  display: flex;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: flex-start;
  /* same left/right edges as the service cards and the FAQ */
  margin-left: clamp(1.5rem, 4vw, 5rem);
  margin-right: clamp(1.5rem, 4vw, 5rem);
}

/* ── Left info panel ── */
.contact-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  padding-top: 0.3rem;
  margin-top: -1.4rem; /* nudged up a little */
}

#section-contact .section-label {
  color: var(--link);
  margin-top: clamp(1.2rem, 2vw, 1.8rem);
  margin-bottom: 0.8rem;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.contact-info .section-body {
  max-width: none;
  font-size: clamp(1rem, 1.3vw, 1.1rem);
}

.contact-info .section-body + .section-body { margin-top: 1rem; }

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.4rem;
}

.contact-social {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s ease;
}

.contact-ig-icon {
  color: var(--link);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.contact-wa-icon {
  color: var(--accent);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.contact-social:hover { color: var(--link); }
.contact-social:hover .contact-ig-icon,
.contact-social:hover .contact-wa-icon { color: var(--link); }

.contact-social-handle {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(0.9rem, 1.3vw, 1rem);
  letter-spacing: 0.02em;
}

/* ── Vertical divider — flex sibling, sized by height to keep proportions ── */
.contact-divider {
  flex-shrink: 0;
  align-self: center;
  height: clamp(380px, 55vh, 520px);
  width: auto;
  display: block;
  pointer-events: none;
}

/* ── Right column ── */
.contact-right {
  flex: 1.4;
  min-width: 0;
  padding-top: calc(0.3rem + clamp(1.2rem, 2vw, 1.8rem));
}

/* ── Right form ── */
.contact-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(1.2rem, 2vw, 1.8rem);
  min-width: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2.5vw, 1.8rem);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-field label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--link);
}

.form-field input,
.form-field textarea {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(255,123,104,0.3); /* coral at 30% */
  border-radius: 0;
  padding: 0.5rem 0;
  font-family: 'Figtree', sans-serif;
  font-weight: 300;
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  color: var(--text);
  outline: none;
  width: 100%;
  resize: none;
  transition: border-color 0.25s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-bottom-color: var(--accent);
}

.form-field textarea {
  min-height: 110px;
  line-height: 1.75;
}

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status {
  font-family: 'Figtree', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
}
.form-status.error { color: var(--link); }

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.8rem;
}

.contact-submit {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  letter-spacing: 0.05em;
  color: var(--accent);
  background: transparent;
  border: 2.8px solid var(--accent);
  border-radius: 999px;
  padding: 1.1rem 3rem;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.contact-submit:hover {
  color: var(--hover);
  border-color: var(--hover);
}

.contact-submit:active { transform: translateY(0); }

/* ── Contact mobile ── */
@media (max-width: 600px) {
  .contact-services {
    grid-template-columns: 1fr;
  }

  .contact-body {
    flex-direction: column;
    align-items: stretch; /* full-width form (flex-start shrank it to its content) */
    gap: 1.8rem;
  }

  /* Cards, FAQ and form use the full width between the page margins */
  .contact-services,
  .contact-faq,
  .contact-body { margin-left: 0; margin-right: 0; }
  .contact-services { gap: 1.2rem; }
  .service-body { text-align: left; } /* justified text leaves big gaps on narrow cards */

  .contact-divider { display: none; }
  .contact-right { padding-top: 0; }

  /* "Get in touch" + links: left-aligned above the form */
  .contact-info { align-items: flex-start; text-align: left; margin-top: 0; padding-top: 0; }
  #section-contact .section-label { margin-top: 0; }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .contact-form { gap: 1.2rem; }

  /* Fields as soft rounded boxes, easy to see and tap. 16px text stops
     iPhones zooming in when a field is tapped. */
  .form-field { gap: 0.5rem; }
  .form-field label { font-size: 0.7rem; }
  .form-field input,
  .form-field textarea {
    font-size: 1rem;
    padding: 0.8rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,123,104,0.3);
    border-radius: 14px;
  }
  .form-field input:focus,
  .form-field textarea:focus { border-color: var(--accent); }
  .form-field textarea { min-height: 140px; line-height: 1.6; }

  .form-footer { margin-top: 0.4rem; }
  .contact-submit { width: 100%; padding: 1rem 2rem; }
}

/* ── Site footer ── */
.site-footer {
  padding: 4vh var(--margin-side) 9vh; /* more room below the © line */
  text-align: center;
  font-family: 'Figtree', sans-serif;
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--text);
  opacity: 0.5;
}
/* The menu panel can reach up behind the header on the home screen; keep ✕ tappable */
@media (max-width: 600px) {
  .hamburger { position: relative; z-index: 100; }
  /* Menu open: the header bar turns solid too, so the panel reaches the top */
  header:has(.hamburger.open) { background: var(--bg); }
  /* Main button: less side padding so its text stays on one line */
  .btn { padding: 1.2rem 1.8rem; white-space: nowrap; }
}

/* ══ PHONE VERSION ═══════════════════════════════════════════════════════
   html.lite = phones and tablets (set in index.html's <head>). The page scrolls
   normally (no fixed content layer, no fade masks, no parallax), the landing
   picture stands still, and the flash book becomes swipeable cards. */

/* Normal scrolling: the content is part of the page again */
html.lite #scroll-spacer { display: none; }
html.lite #scroll-content { position: static; transform: none !important; }
html.lite #foreground { display: none; }
/* clip (not hidden) so the body isn't a scroll box of its own: the page itself
   scrolls, which the scroll-linked title animation needs */
html.lite body { overflow-x: clip; }

/* The slideshow behind the landing screen scrolls away with it */
/* --hero-h is the screen height when the page opened (set in home.js). Some phone
   browsers (e.g. Chrome on iPhone) change vh units as their toolbar hides, which
   made the picture zoom while scrolling. */
html.lite #slideshow { position: absolute; height: 100vh; height: var(--hero-h, 100lvh); }
/* Only the picture(s) on screen pan and zoom; the others wait where they are.
   Fewer moving layers = smooth on phones. */
html.lite .slide { will-change: auto; animation-play-state: paused; }
html.lite .slide.active { will-change: transform, opacity; animation-play-state: running; }
html.lite #slideshow.paused .slide { animation-play-state: paused; }

/* Header: pinned to the top; solid (with the small logo) once past the landing screen */
html.lite header { top: 0; transition: background 0.3s ease; }
html.lite header.scrolled { background: var(--bg); }

/* No fade masks: sections are as tall as their content, and the sliding titles
   are simply clipped at the screen edge */
html.lite .section { min-height: 0; overflow-x: clip; }
html.lite #section-home {
  min-height: 100vh; min-height: var(--hero-h, 100svh);
  justify-content: center;   /* logo + button in the middle of the screen */
  padding-top: var(--margin-top);
  padding-bottom: var(--margin-top);
}
html.lite #hero-main { flex: 0 0 auto; padding-bottom: 2.5rem; }
html.lite #hero-footer { padding-bottom: 0; }
html.lite .section-mask-wrap {
  margin-left: 0; margin-right: 0;
  padding-left: 0; padding-right: 0;
  -webkit-mask-image: none; mask-image: none;
}
html.lite #section-about .section-mask-wrap { padding-bottom: 0; margin-bottom: 0; }
html.lite #scroll-content * { will-change: auto !important; }

/* Photos, the studio box, the flash book and the shop card fade in once */
html.lite .lite-reveal {
  opacity: 0 !important;
  transform: translateY(24px) !important;
  transition: opacity 0.85s cubic-bezier(0.16,1,0.3,1), transform 0.85s cubic-bezier(0.16,1,0.3,1) !important;
}
html.lite .lite-reveal.visible { opacity: 1 !important; transform: none !important; }
html.lite #section-about .about-image-wrap { opacity: 1; }

/* Sliding titles on phones. Browsers that can tie an animation to scrolling
   (Safari 26+, Chrome) run it themselves, perfectly in step with the finger;
   others fall back to home.js. Same timing as the script: slide in while
   rising through the lower half of the screen, then stay. */
html.lite #scroll-content .lite-sweep { will-change: transform, opacity !important; } /* own layer: moves without repainting */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    html.lite .lite-sweep.css-sweep {
      animation: lite-sweep linear both;
      animation-timeline: view();
      animation-range: cover;
    }
  }
}
@keyframes lite-sweep {
  0.0% { transform: translateX(-90.00vw); opacity: 0.00; }
  4.5% { transform: translateX(-68.69vw); opacity: 0.33; }
  9.0% { transform: translateX(-51.26vw); opacity: 0.67; }
  13.5% { transform: translateX(-37.30vw); opacity: 1.00; }
  18.0% { transform: translateX(-26.35vw); opacity: 1.00; }
  22.5% { transform: translateX(-18.00vw); opacity: 1.00; }
  27.0% { transform: translateX(-11.81vw); opacity: 1.00; }
  31.5% { transform: translateX(-7.34vw); opacity: 1.00; }
  36.0% { transform: translateX(-4.18vw); opacity: 1.00; }
  40.5% { transform: translateX(-1.87vw); opacity: 1.00; }
  45.0% { transform: translateX(0.00vw); opacity: 1.00; }
  100% { transform: translateX(0vw); opacity: 1; }
}

/* ── Flash book as cards ── */
html.fb-locked, html.fb-locked body { overflow: hidden; }
html.lite #flashbook-overlay {
  gap: 1.2rem;
  overscroll-behavior: contain;
  touch-action: none;
  /* As tall as the screen with the browser bars hidden, so the page never
     shows through underneath when iPhone's toolbar slides away */
  bottom: auto;
  height: 100vh;
  height: 100lvh;
}
html.lite #fb-scene,
html.lite #fb-controls,
html.lite #fb-dots { display: none; }
html.lite #fb-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 14px;
  bottom: auto;
  width: 44px; height: 44px;
}
.fb-cards {
  --card-w: min(80vw, 50vh, 420px);
  --card-gap: 14px;
  display: flex;
  gap: var(--card-gap);
  width: 100%;
  padding: 10px 0 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
}
@supports (height: 1svh) { .fb-cards { --card-w: min(80vw, 50svh, 420px); } }
.fb-cards::-webkit-scrollbar { display: none; }
.fb-cards:focus { outline: none; }
/* Spacers so the first and last cards can sit in the middle */
.fb-cards::before,
.fb-cards::after { content: ''; flex: 0 0 calc((100% - var(--card-w)) / 2 - var(--card-gap)); }
.fb-card {
  flex: 0 0 var(--card-w);
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  box-shadow: 0 14px 40px rgba(0,0,0,0.55);
  scroll-snap-align: center;
  scroll-snap-stop: always;   /* one card per swipe */
  transform: scale(0.9);
  opacity: 0.45;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.fb-card.current { transform: none; opacity: 1; }
.fb-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-cards-count {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.7;
}
