/* ==========================================================================
   TIFFANY & CO. — Concept Rebuild
   A cinematic, scroll-scrubbed one-page experience.
   Written for a framework-free single-file PHP deployment.
   ========================================================================== */

/* ---- Fonts -------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,450;0,9..144,600;1,9..144,450&family=Manrope:wght@400;500;600;700&display=swap');

/* ---- Design tokens -------------------------------------------------------
   Palette is drawn from the source footage itself: the black velvet stage
   the diamond sits on, and the robin's-egg silk the necklace is draped in.
   -------------------------------------------------------------------------- */
:root{
  --ink:        #0a0b0d;   /* velvet black — the stage the diamond sits on */
  --ink-soft:   #14171a;   /* raised surfaces on black */
  --paper:      #f6f3ee;   /* warm ivory, used sparingly for the finale */
  --facet:      #81d8d0;   /* Tiffany Blue — Pantone 1837 */
  --facet-deep: #3e9e93;   /* pressed / hover state of Tiffany Blue */
  --platinum:   #cdd2d5;   /* metal, secondary text on dark */
  --champagne:  #b79564;   /* warm accent — reserved for tiny secondary marks */
  --white-90:   rgba(247,246,243,.92);
  --white-60:   rgba(247,246,243,.62);
  --white-30:   rgba(247,246,243,.30);
  --line-30:    rgba(247,246,243,.16);

  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body:    'Manrope', -apple-system, 'Helvetica Neue', Arial, sans-serif;

  --edge: clamp(1.5rem, 5vw, 5rem);       /* shared side gutter */
  --panel-w: min(30rem, 86vw);

  --ease: cubic-bezier(.22,.61,.22,1);
  --dur-panel: 900ms;
}

/* ---- Reset ---------------------------------------------------------------*/
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--ink);
  color: var(--white-90);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
h1,h2,h3,p,ul{ margin: 0; }
ul{ padding: 0; list-style: none; }
a{ color: inherit; }
button{ font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Keyboard focus — always visible, never suppressed */
:focus-visible{
  outline: 2px solid var(--facet);
  outline-offset: 3px;
}

.skip-link{
  position: fixed;
  top: -3rem;
  left: 1rem;
  z-index: 500;
  background: var(--facet);
  color: var(--ink);
  padding: .6rem 1rem;
  border-radius: 2px;
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus{ top: 1rem; }

/* ---- Background video ----------------------------------------------------
   Pinned for the full document height. Its playhead is driven by scroll
   position (see scroll-engine.js) rather than by time, so scrolling reads
   the film frame by frame like turning the page of a lookbook. Once the
   narrative beats are spent (end of Chapter II) it holds its final frame
   and the page continues over it, gently dimmed.
   -------------------------------------------------------------------------- */
.bg-video{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* never crop the footage — the black stage blends into --ink either side */
  object-position: center center;
  z-index: 0;
  background: var(--ink);
}
.bg-poster{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  z-index: -1; /* sits behind the video; only visible if the video fails to paint */
}
.bg-overlay{
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10,11,13,.55) 0%, rgba(10,11,13,.15) 30%, rgba(10,11,13,.35) 70%, rgba(10,11,13,.85) 100%);
  transition: background 600ms var(--ease);
}
.bg-overlay.is-dimmed{
  background:
    linear-gradient(180deg, rgba(10,11,13,.86) 0%, rgba(10,11,13,.8) 100%);
}

/* ---- Header ---------------------------------------------------------------*/
.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--edge);
  background: linear-gradient(180deg, rgba(10,11,13,.65), transparent);
  transition: background 400ms var(--ease), backdrop-filter 400ms var(--ease);
}
.site-header.is-scrolled{
  background: rgba(10,11,13,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-30);
}
.wordmark{
  font-family: var(--display);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  letter-spacing: .06em;
  text-decoration: none;
  color: var(--white-90);
}

.chapter-nav{
  display: flex;
  gap: clamp(.9rem, 2vw, 1.6rem);
}
.chapter-nav button{
  font-family: var(--display);
  font-style: italic;
  font-size: .95rem;
  color: var(--white-60);
  padding: .25rem .1rem;
  position: relative;
  transition: color 300ms var(--ease);
}
.chapter-nav button::after{
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--facet);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 350ms var(--ease);
}
.chapter-nav button:hover{ color: var(--white-90); }
.chapter-nav button.is-active{ color: var(--facet); }
.chapter-nav button.is-active::after{ transform: scaleX(1); }
.chapter-nav button span{
  display: none;
}
@media (min-width: 46rem){
  .chapter-nav button span{ display: inline; margin-left: .4em; font-family: var(--body); font-style: normal; font-size: .7rem; letter-spacing: .04em; color: var(--white-60); }
}

/* ---- Facet progress mark ---------------------------------------------------
   A single quiet instrument: a faceted mark, bottom-right, that turns as
   you move through the story and fills as the page completes. It echoes
   the sparkle glyph that appears in the footage itself.
   -------------------------------------------------------------------------- */
.facet-progress{
  position: fixed;
  right: clamp(1rem, 3vw, 2.4rem);
  bottom: clamp(1rem, 3vw, 2.4rem);
  z-index: 100;
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
}
.facet-progress svg{ width: 100%; height: 100%; }
.facet-progress .track{ fill: none; stroke: var(--line-30); stroke-width: 2; }
.facet-progress .fill{
  fill: none;
  stroke: var(--facet);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 132;
  stroke-dashoffset: 132;
  transition: stroke-dashoffset 120ms linear;
}
.facet-progress .gem{
  transform-origin: center;
  fill: var(--white-90);
}

/* ---- Chapters / sections ---------------------------------------------------*/
.chapter{
  position: relative;
  z-index: 2;
  min-height: 100svh;
  padding: 7rem var(--edge);
  display: flex;
}

/* Hero ------------------------------------------------------------------- */
.hero{
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  gap: 1.1rem;
  padding-top: clamp(5.5rem, 15vh, 9rem);
}
.hero .kicker{
  font-family: var(--body);
  font-size: .8rem;
  letter-spacing: .18em;
  color: var(--white-60);
}
.hero h1{
  font-family: var(--display);
  font-weight: 450;
  font-size: clamp(2.6rem, 9vw, 6.4rem);
  letter-spacing: .015em;
  text-transform: uppercase;
  line-height: 1.02;
}
.hero .hero-line{
  font-family: var(--display);
  font-style: italic;
  font-weight: 450;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--white-90);
  max-width: 34rem;
  margin-top: .4rem;
}
.scroll-cue{
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--white-60);
}
.scroll-cue .thread{
  width: 1px;
  height: 2.6rem;
  background: linear-gradient(180deg, var(--facet), transparent);
  animation: thread-draw 2.4s var(--ease) infinite;
}
@keyframes thread-draw{
  0%{ transform: scaleY(0); transform-origin: top; opacity: .3;}
  50%{ transform: scaleY(1); transform-origin: top; opacity: 1;}
  51%{ transform-origin: bottom; }
  100%{ transform: scaleY(0); transform-origin: bottom; opacity: .3;}
}

/* Chapter mark (roman numeral) — used because these sections are a real
   sequence in the story, not a decorative 01/02/03 grid. */
.chapter-mark{
  display: inline-block;
  font-family: var(--display);
  font-style: italic;
  font-size: 1rem;
  color: var(--facet);
  margin-bottom: 1.1rem;
}

/* Text-only panel (Chapters I and III) ------------------------------------ */
.panel{
  flex-direction: row;
  align-items: center;
}
.panel-card{
  width: var(--panel-w);
  background: rgba(10,11,13,.58);
  border: 1px solid var(--line-30);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: clamp(1.8rem, 3.4vw, 3rem);
  border-radius: 2px;
  opacity: 0;
  transition: opacity var(--dur-panel) var(--ease), transform var(--dur-panel) var(--ease);
}
.panel--left{ justify-content: flex-start; }
.panel--right{ justify-content: flex-end; }
.panel--left .panel-card{ transform: translateX(-4.5rem); }
.panel--right .panel-card{ transform: translateX(4.5rem); }
.panel.is-in .panel-card{ opacity: 1; transform: translateX(0); }

.panel-card h2{
  font-family: var(--display);
  font-weight: 450;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  margin-bottom: .9rem;
}
.panel-card p{
  color: var(--white-90);
  max-width: 32ch;
}
.panel-card p + p{ margin-top: .9rem; }
.panel-card .meta{
  margin-top: 1.4rem;
  font-size: .8rem;
  color: var(--white-60);
  letter-spacing: .03em;
}

/* Media panel (Chapters II and IV) — image + text, mirrored by chapter ---- */
.panel-card--media{
  width: min(56rem, 92vw);
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
}
.panel-card--media img{
  width: 100%;
  height: 100%;
  min-height: 20rem;
  object-fit: cover;
}
.panel-card--media .panel-text{
  padding: clamp(1.8rem, 3.4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Mirror the media side for right-aligned chapters so the image still
   sits toward the outer edge of the viewport it entered from. */
.panel--right .panel-card--media{ direction: rtl; }
.panel--right .panel-card--media > *{ direction: ltr; }

@media (max-width: 46rem){
  .panel-card--media,
  .panel--right .panel-card--media{ grid-template-columns: 1fr; }
  .panel-card--media img{ min-height: 15rem; }
  .panel--right .panel-card--media{ direction: ltr; }
}

/* Icons chapter — a refined list, not a card grid ------------------------ */
.icon-list{ margin-top: 1.6rem; }
.icon-list li{
  border-top: 1px solid var(--line-30);
  padding: 1.1rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .3rem 1.5rem;
}
.icon-list li:last-child{ border-bottom: 1px solid var(--line-30); }
.icon-name{
  font-family: var(--display);
  font-size: 1.15rem;
}
.icon-desc{
  color: var(--white-60);
  font-size: .88rem;
  max-width: 26ch;
  text-align: right;
}
@media (max-width: 30rem){
  .icon-desc{ text-align: left; max-width: 100%; }
}

/* Product gallery — full-bleed stills that continuously fade in as they
   approach the centre of the viewport and fade out as they leave it,
   driven by scroll position in scroll-engine.js. Falls back to fully
   visible when JS or motion is unavailable. */
.gallery-frame{
  padding: 0;
  overflow: hidden;
  opacity: 1;
}
.gallery-frame .gallery-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.gallery-frame .gallery-scrim{
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,11,13,.15) 0%, rgba(10,11,13,.05) 45%, rgba(10,11,13,.75) 100%);
}
.gallery-caption{
  position: relative;
  z-index: 1;
  margin-top: auto;
  max-width: 28rem;
}
.gallery-caption h3{
  font-family: var(--display);
  font-weight: 450;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin-bottom: .6rem;
}
.gallery-caption p{ color: var(--white-90); max-width: 34ch; }
.gallery-frame{ display: flex; align-items: flex-end; }
.gallery-frame .gallery-caption{ padding: clamp(1.6rem, 3.4vw, 3rem); }


.finale{
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.finale h2{
  font-family: var(--display);
  font-weight: 450;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  max-width: 20ch;
}
.finale > p{
  margin-top: 1rem;
  color: var(--white-90);
  max-width: 40ch;
}
.appointment-form{
  margin-top: 2.6rem;
  width: min(30rem, 92vw);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
}
.field{
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.field label{
  font-size: .78rem;
  letter-spacing: .05em;
  color: var(--white-60);
}
.field input,
.field textarea,
.field select{
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-30);
  color: var(--white-90);
  font-family: var(--body);
  font-size: 1rem;
  padding: .5rem 0;
  transition: border-color 250ms var(--ease);
}
.field select option{ color: #111; }
.field input:focus,
.field textarea:focus,
.field select:focus{ border-color: var(--facet); outline: none; }
.field textarea{ resize: vertical; min-height: 4.5rem; }
.hp-field{ position: absolute; left: -9999px; }

.errors{
  width: min(30rem, 92vw);
  margin-top: 2rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(215,120,110,.5);
  background: rgba(215,120,110,.08);
  font-size: .88rem;
  text-align: left;
}
.errors li + li{ margin-top: .3rem; }

.confirmation{
  margin-top: 2.6rem;
  padding: 2rem 2.4rem;
  border: 1px solid var(--line-30);
  background: rgba(10,11,13,.42);
  max-width: 28rem;
}
.confirmation .chapter-mark{ margin-bottom: .6rem; }

.btn{
  align-self: flex-start;
  margin-top: .4rem;
  padding: .85rem 2rem;
  border: 1px solid var(--facet);
  color: var(--white-90);
  letter-spacing: .04em;
  font-size: .92rem;
  transition: background 300ms var(--ease), color 300ms var(--ease);
}
.btn:hover{ background: var(--facet); color: var(--ink); }

.finale-links{
  margin-top: 2.2rem;
  font-size: .85rem;
  color: var(--white-60);
}
.finale-links a{ text-decoration: underline; text-underline-offset: 3px; }
.finale-links a:hover{ color: var(--facet); }

/* ---- Footer ---------------------------------------------------------------*/
.site-footer{
  position: relative;
  z-index: 2;
  padding: 3.4rem var(--edge) 2.4rem;
  background: var(--ink);
  border-top: 1px solid var(--line-30);
}
.footer-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 2rem;
  max-width: 72rem;
  margin: 0 auto;
}
.footer-grid h3{
  font-family: var(--display);
  font-style: italic;
  font-size: .95rem;
  color: var(--white-60);
  margin-bottom: .9rem;
}
.footer-grid ul li + li{ margin-top: .55rem; }
.footer-grid a{ font-size: .88rem; color: var(--white-90); text-decoration: none; }
.footer-grid a:hover{ color: var(--facet); }
.footer-bottom{
  max-width: 72rem;
  margin: 2.6rem auto 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-30);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.4rem;
  justify-content: space-between;
  font-size: .76rem;
  color: var(--white-30);
}
.footer-bottom p{ max-width: 42rem; }

/* No-JS fallback ------------------------------------------------------------*/
.no-js .panel-card,
.no-js .panel-card--media{ opacity: 1; transform: none; }
