/* ============================================================
   CUTIE NAILS — Home page
   Hero, proof strip, feature rail, proof sections, shade studio,
   how-it-works, trust band, artists teaser, FAQ, download CTA.

   Loaded by index.html only. Requires tokens.css + base.css.
   ============================================================ */

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding-top: var(--nav-height);
  overflow: hidden;
  isolation: isolate;
  background: var(--gradient-soft);
}
.hero .blob { z-index: var(--z-base); }
.hero__blob-a { width: 520px; height: 520px; top: -160px; right: -140px; }
.hero__blob-b { width: 420px; height: 420px; bottom: -180px; left: -120px; opacity: 0.4; }

.hero__inner {
  position: relative;
  z-index: var(--z-raised);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16) 0 var(--space-20);
}

.hero__copy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-5); }
.hero__copy .badge { align-self: flex-start; }

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

.hero__sub {
  font-size: var(--text-lg);
  color: var(--text-body);
  line-height: var(--leading-normal);
  max-width: 46ch;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.hero__note {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ---------- Hero video card ----------
   A photo card, not a phone frame. The loop is a cropped camera-roll
   photograph of a hand — framing it as a phone screen would imply it
   is app UI, which it is not. The phone frame is used only where the
   content genuinely is the app (the feature rail). */
.hero__media { display: flex; justify-content: center; }

.hero__card {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 480 / 608;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface-card);
}
.hero__card video,
.hero__card img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.hero__caption {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  background: rgb(var(--white-rgb) / 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   PROOF STRIP
   ============================================================ */
.proof {
  background: var(--surface-card);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-10) 0;
}
.proof__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  text-align: center;
}
.proof__stat { display: flex; flex-direction: column; gap: var(--space-2); }
.proof__number {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 500;
  line-height: 1;
  color: var(--rose-gold);
}
.proof__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-snug);
}

/* ============================================================
   FEATURE RAIL  (§ "It's not a colour picker.")
   ============================================================ */
.rail { padding: var(--space-section) 0; }

.rail__inner {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: var(--space-16);
  align-items: start;
  margin-top: var(--space-16);
}

.rail__phone-col {
  position: sticky;
  top: calc(var(--nav-height) + 5vh);
  align-self: start;
  justify-self: center;
}

.rail__phone { width: 272px; }
.rail__phone .phone__screen { aspect-ratio: 543 / 1180; }

.rail__stack { position: relative; width: 100%; height: 100%; }
.rail__screen {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.rail__screen.is-active { opacity: 1; }

.rail__steps { display: flex; flex-direction: column; }

.rail__step {
  min-height: 78svh;
  display: grid;
  align-content: center;
  gap: var(--space-4);
  transition: opacity var(--dur-slow) var(--ease-out);
}
.rail__step-num {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--rose-gold);
}
.rail__step h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}
.rail__step p {
  font-size: var(--text-md);
  color: var(--text-body);
  line-height: var(--leading-normal);
  max-width: 52ch;
}

/* Desktop dims the inactive steps so the active one reads as the
   caption for whatever the sticky phone is showing. */
@media (min-width: 900px) {
  .rail__steps.is-tracking .rail__step { opacity: 0.35; }
  .rail__steps.is-tracking .rail__step.is-active { opacity: 1; }
}

/* Without JS the observer never runs, so the sticky phone would sit on
   screen 01 while the reader scrolls to step 05 — a caption that lies.
   Fall back to the stacked layout instead, where every step carries its
   own screenshot. */
html:not(.js) .rail__inner { grid-template-columns: 1fr; gap: 0; }
html:not(.js) .rail__phone-col { display: none; }
html:not(.js) .rail__step { min-height: 0; padding: var(--space-10) 0; }
html:not(.js) .rail__step-media { display: block; }

/* Each step carries its own inline image for the mobile layout. Same
   URL as the sticky stack, so the browser fetches each screen once. */
.rail__step-media { display: none; }
.rail__step-media .phone { width: 240px; margin: 0 auto var(--space-6); }
.rail__step-media .phone__screen { aspect-ratio: 543 / 1180; }
.rail__step-media img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   SHOWCASE  (§5 "It tells you why." / §6 "Every skin tone.")
   ============================================================ */
.showcase { padding: var(--space-section) 0; }
.showcase--sunk { background: var(--surface-sunk); }

.showcase__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}
.showcase__inner--flip .showcase__media { order: -1; }

.showcase__copy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.showcase__copy h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}
.showcase__copy p {
  font-size: var(--text-md);
  color: var(--text-body);
  line-height: var(--leading-normal);
  max-width: 50ch;
}

.showcase__shot {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  background: var(--surface-card);
}
.showcase__shot img { width: 100%; height: auto; }

.showcase__note {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: center;
}

.showcase__phone { width: min(100%, 300px); margin: 0 auto; }
.showcase__phone .phone__screen { aspect-ratio: 660 / 1434; }
.showcase__phone img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   SHADE STUDIO
   ============================================================ */
.studio { padding: var(--space-section) 0; }

.studio__inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-16);
  align-items: center;
}

.studio__copy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.studio__copy h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}
.studio__copy p {
  font-size: var(--text-md);
  color: var(--text-body);
  line-height: var(--leading-normal);
  max-width: 46ch;
}

.studio__panel { display: flex; flex-direction: column; align-items: center; gap: var(--space-5); }

.studio__stage {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 624 / 840;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface-card);
}
.studio__frame {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.studio__frame.is-active { opacity: 1; }

/* Without JS the crossfade never runs, so collapse to the first frame
   rather than stacking five images at opacity 0. */
html:not(.js) .studio__frame:not(.is-active) { display: none; }
html:not(.js) .studio__swatches { display: none; }

.studio__caption {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  min-height: 1.6em;
}
.studio__caption span { font-weight: 400; color: var(--text-secondary); }

.studio__swatches {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}

.swatch {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: var(--swatch);
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.swatch:hover { transform: scale(1.08); }
.swatch:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.swatch.is-active {
  border-color: var(--surface-page);
  box-shadow: 0 0 0 2px var(--rose-gold), var(--shadow-sm);
  transform: scale(1.08);
}

.studio__hint { font-size: var(--text-sm); color: var(--text-secondary); }

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how { padding: var(--space-section) 0; }

.how__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-12);
}
.how__step { display: flex; flex-direction: column; gap: var(--space-3); }
.how__step-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1;
  color: var(--petal-pink);
}
.how__step h3 { font-size: var(--text-xl); font-weight: 600; }
.how__step p {
  font-size: var(--text-base);
  color: var(--text-body);
  line-height: var(--leading-normal);
}

/* ============================================================
   TRUST BAND
   ============================================================ */
.trust {
  background: var(--surface-inverse);
  color: var(--text-inverse);
  padding: var(--space-section) 0;
}
.trust h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  text-align: center;
  margin-bottom: var(--space-12);
  letter-spacing: var(--tracking-display);
}
.trust__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-10);
}
.trust__item { display: flex; flex-direction: column; gap: var(--space-3); }
.trust__item h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-inverse);
}
.trust__item p {
  font-size: var(--text-base);
  color: var(--text-inverse-muted);
  line-height: var(--leading-normal);
}

/* ============================================================
   ARTISTS TEASER
   ============================================================ */
.artists { padding: var(--space-section) 0; background: var(--surface-sunk); }
.artists__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-16);
  align-items: center;
}
.artists__copy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.artists__copy h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}
.artists__copy p {
  font-size: var(--text-md);
  color: var(--text-body);
  line-height: var(--leading-normal);
  max-width: 50ch;
}
.artists__shot {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-height: 460px;
}
.artists__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ============================================================
   FAQ
   ============================================================ */
.faq { padding: var(--space-section) 0; }
.faq__list { max-width: 760px; margin: 0 auto; }

.faq__item {
  border-bottom: 1px solid var(--border-subtle);
}
.faq__item summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-5) 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--rose-gold);
  flex-shrink: 0;
  transition: transform var(--dur-base) var(--ease-out);
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.faq__answer {
  padding: 0 0 var(--space-5);
  font-size: var(--text-base);
  color: var(--text-body);
  line-height: var(--leading-normal);
  max-width: 68ch;
}
.faq__answer a { color: var(--rose-gold); }

/* ============================================================
   DOWNLOAD CTA
   ============================================================ */
.download {
  position: relative;
  background: var(--surface-inverse);
  color: var(--text-inverse);
  padding: var(--space-section) 0;
  overflow: hidden;
  isolation: isolate;
}
.download .blob { opacity: 0.22; z-index: var(--z-base); }
.download__blob-a { width: 460px; height: 460px; top: -180px; left: -120px; }
.download__blob-b { width: 380px; height: 380px; bottom: -160px; right: -100px; }

.download__inner {
  position: relative;
  z-index: var(--z-raised);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}
.download__icon {
  width: 76px; height: 76px;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  object-fit: cover;
}
.download__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}
.download__sub {
  font-size: var(--text-md);
  color: var(--text-inverse-muted);
  line-height: var(--leading-normal);
  max-width: 56ch;
}
.download__note { font-size: var(--text-sm); color: var(--text-inverse-faint); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: var(--space-12); text-align: center; padding-bottom: var(--space-16); }
  .hero__copy { align-items: center; }
  .hero__copy .badge { align-self: center; }
  .hero__sub { max-width: 100%; }
  .hero__actions { justify-content: center; }
  .hero__media { order: -1; }
  .hero__card { width: min(100%, 300px); }

  .showcase__inner,
  .studio__inner,
  .artists__inner { grid-template-columns: 1fr; gap: var(--space-10); }
  .showcase__inner--flip .showcase__media { order: 0; }
  .showcase__copy, .studio__copy, .artists__copy { align-items: center; text-align: center; }
  .showcase__copy p, .studio__copy p, .artists__copy p { max-width: 56ch; }

  .trust__grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .how__steps { grid-template-columns: 1fr; gap: var(--space-8); max-width: 420px; margin: 0 auto; }
}

/* The rail's sticky layout only exists above 900px. Below it the
   sticky column is removed entirely and each step renders its own
   phone inline — js/home.js never attaches the observer down here. */
@media (max-width: 899px) {
  .rail__inner { grid-template-columns: 1fr; gap: 0; margin-top: var(--space-10); }
  .rail__phone-col { display: none; }
  .rail__step { min-height: 0; padding: var(--space-10) 0; text-align: center; justify-items: center; }
  .rail__step p { margin: 0 auto; }
  .rail__step-media { display: block; }
}

@media (max-width: 768px) {
  .proof__inner { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
}

@media (max-width: 480px) {
  .studio__swatches { gap: var(--space-2); }
  .swatch { width: 38px; height: 38px; }
}
