/* ─────────────────────────────────────────────────────────────────
   Easing tokens
───────────────────────────────────────────────────────────────── */
:root {
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Slide 1: layout ──────────────────────────────────────────────── */

.slide-1-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(var(--space-lg), 8vw, var(--space-xl));
  width: 100%;
}

.slide-1-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  flex: 1;
}

.slide-1-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

/* ── Slide 1 typography ───────────────────────────────────────────── */

/*
  Typeset rationale (impeccable):
  Three steps, each with a distinct role — not just size variation.

  "Your business is changing."
    → Declaration. Mid scale (display-sm). Uppercase + tight tracking = authority.
      Weight 540 + halation = presence without aggression.
      Ratio to body: ~2.4x at max → clear head of hierarchy.

  "Most studios will give you a new look."
    → Context. Body scale (1rem–1.35rem). Normal case, normal weight.
      letter-spacing: 0.01em — slightly open helps legibility light-on-dark.
      line-height: 1.65 — looser than headings, more conversational.
      Max-width 38ch → comfortable line length, never wraps awkwardly.

  "That won't be enough."
    → Punchline. Display scale (display-lg). Italic, right-aligned.
      Ratio to mid: ~1.6x → unmistakably the largest element on slide.
      Halation returns — this is the emotional peak.
*/

/* display-sm: authoritative opening */
.intro-line {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 3.5rem);
  font-weight: 540;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--color-cream);
  text-shadow:
    0 0 4px  rgba(254, 222, 185, 0.6),
    0 0 15px rgba(238, 35,   36, 0.5),
    0 0 35px rgba(170, 31,   35, 0.4),
    0 0 70px rgba(170, 31,   35, 0.2);
  max-width: 16ch;
}

/* body: supporting context — quiet, readable */
.intro-secondary {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  font-weight: normal;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--color-cream-body);
  max-width: 38ch;
}

/* display-lg: punchline — the biggest, italic, right */
.intro-aside {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 5.5rem);
  font-style: italic;
  font-weight: 540;
  line-height: 1.0;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--color-cream);
  text-shadow:
    0 0 4px  rgba(254, 222, 185, 0.6),
    0 0 15px rgba(238, 35,   36, 0.5),
    0 0 35px rgba(170, 31,   35, 0.4),
    0 0 70px rgba(170, 31,   35, 0.2);
  text-align: right;
  max-width: 12ch;
}

/* ── Scroll hint ──────────────────────────────────────────────────── */

.scroll-hint {
  position: absolute;
  bottom: var(--margin-y);
  right: var(--margin-x);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.scroll-hint__label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-cream-dim);
}

.scroll-hint__arrow {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-cream);
  display: inline-block;
  animation: arrow-bounce 1.8s var(--ease-out-strong) infinite;
}

@keyframes arrow-bounce {
  0%, 100% { transform: translateX(0);   opacity: 1;   }
  50%       { transform: translateX(7px); opacity: 0.45; }
}

@media (hover: hover) and (pointer: fine) {
  .scroll-hint:hover .scroll-hint__arrow {
    animation-play-state: paused;
    transform: translateX(8px);
    transition: transform 200ms var(--ease-out-strong);
  }
}

/* ── Keyboard hint ───────────────────────────────────────────────── */

.keyboard-hint {
  position: absolute;
  bottom: var(--margin-y);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  z-index: 10;
  opacity: 0;
  pointer-events: none;  /* hint itself doesn't capture — keys below do */
}

.keyboard-hint__label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-cream-dim);
}

.keyboard-hint__keys {
  display: flex;
  gap: 0.5rem;
  pointer-events: all;
}

/* Filled button, hollow (stroke-only) arrow */
.keyboard-hint__key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: rgba(254, 222, 185, 0.12);
  border: 1px solid rgba(254, 222, 185, 0.2);
  border-radius: 4px;
  color: var(--color-cream);
  cursor: pointer;
  transition: background 200ms var(--ease-out-smooth),
              border-color 200ms var(--ease-out-smooth);
}

@media (hover: hover) and (pointer: fine) {
  .keyboard-hint__key:hover {
    background: rgba(254, 222, 185, 0.22);
    border-color: rgba(254, 222, 185, 0.4);
  }
}

/* Triggered by JS: fade in, hold, fade out */
@keyframes keyboard-hint-show {
  0%   { opacity: 0; transform: translateX(-50%) translateY(6px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  78%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

.keyboard-hint.is-playing {
  animation: keyboard-hint-show 3.4s var(--ease-out-smooth) forwards;
}

@media (max-width: 900px), (hover: none) {
  .keyboard-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .keyboard-hint.is-playing {
    animation: keyboard-hint-show 3.4s linear forwards;
  }
}

/* ── Slide 2 typography ───────────────────────────────────────────── */

/*
  Typeset rationale:
  Slide 2 is the answer — same emotional register as slide 1 but
  slightly smaller and without uppercase. This creates a natural
  deceleration: the site leans in rather than shouts.

  "We build the brand infrastructure…"
    → display-sm, mixed case. Weight 540. Line-height 1.2 for multi-line.
      28ch max-width keeps the break point clean — avoids widow on last word.

  "From diagnosis to system."
    → kicker. ~0.6x the main size. Italic, cream-dim.
      No halation — this is a quiet conclusion, not a declaration.
      letter-spacing: 0.01em helps it breathe at a smaller size.
*/

.slide2-line {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 3rem);
  font-weight: 540;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-cream);
  text-shadow:
    0 0 4px  rgba(254, 222, 185, 0.6),
    0 0 15px rgba(238, 35,   36, 0.5),
    0 0 35px rgba(170, 31,   35, 0.4),
    0 0 70px rgba(170, 31,   35, 0.2);
  max-width: 28ch;
  text-wrap: balance;   /* equalizes line lengths, prevents orphans */
}

.slide2-secondary {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.6vw, 1.6rem);
  font-style: italic;
  font-weight: normal;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--color-cream-body);
  margin-top: var(--space-md);
  max-width: 28ch;
}

/* ── Slide 3 — overlay ────────────────────────────────────────────── */

/* Radial darken at center: a seamless borderless radial gradient
   that creates beautiful contrast for the cream halation behind the title
   and progresses smoothly all the way to the margins of the frame. */
.overlay-slide3 {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(
      ellipse at 50% 50%,
      rgba(22, 18, 15, 0.67) 0%,
      rgba(39, 30, 24, 0.17) 30%,
      rgba(39, 30, 24, 0.17) 50%,
      rgba(73, 65, 60, 0) 70%
    );
  pointer-events: none;
  opacity: 0;
  will-change: opacity, transform;
}

/* ── Slide 3 — tagline ────────────────────────────────────────────── */

/*
  Typeset rationale:
  "Choose what lasts." is the emotional peak of the intro sequence.
  It follows the punchline of slide 1 and the method of slide 2 —
  so it earns full display scale. Uppercase, centered, halation at
  full intensity against the red background.

  The tag "Brand Strategy & Identity Systems" is UI — it belongs
  near the logo, small, tracking-wide. Minimum 1rem to stay legible.
*/

[data-slide="3"] .content-wrapper {
  justify-content: center;
  align-items: center;
  text-align: center;
}

[data-slide="3"] h1 {
  font-size: clamp(2.8rem, 7vw, 6.5rem);
  margin-bottom: 0;
  letter-spacing: -0.03em;
  line-height: 1.0;
  /* Stronger halation — red bg absorbs the glow, needs more intensity */
  text-shadow:
    0 0 6px  rgba(254, 222, 185, 0.95),
    0 0 20px rgba(238, 35,   36, 0.75),
    0 0 55px rgba(170, 31,   35, 0.65),
    0 0 110px rgba(170, 31,   35, 0.45);
}

/* Tag above logo — UI role, sans, minimum 1rem */
.logo-container--with-tag {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
  width: clamp(120px, 14vw, 200px);
}

.tag--below-logo {
  font-family: var(--font-sans);
  font-size: clamp(0.7rem, 0.75vw, 0.82rem);
  font-weight: 600;            /* impeccable: uppercase labels need weight to read at small sizes */
  letter-spacing: 0.22em;      /* wider tracking compensates for uppercase optical tightness */
  text-transform: uppercase;
  text-align: right;
  margin-top: var(--space-xs);
  margin-bottom: 0;
  color: var(--color-cream);
  opacity: 0.75;               /* slightly more opaque — weight increase demands less opacity crutch */
  line-height: 1.7;
  width: 100%;
}

/* ── Reveal animation ─────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(1rem);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity  450ms var(--ease-out-smooth),
    transform 450ms var(--ease-out-smooth);
}

.logo--fadein {
  opacity: 0;
  transition: opacity 1000ms ease;
}

.logo--fadein.is-visible {
  opacity: 1;
}

/* ── Background stage ────────────────────────────────────────────── */

#bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 500ms var(--ease-out-smooth);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-layer.is-active {
  opacity: 1;
}

/* ── Fixed logo (desktop, slide 3 onwards) ───────────────────────── */

#logo-fixed {
  position: fixed;
  bottom: var(--margin-y);
  right: var(--margin-x);
  width: clamp(100px, 12vw, 180px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease-out-smooth);
}

#logo-fixed.is-visible {
  opacity: 1;
}

.logo-fixed__img {
  width: 100%;
  height: auto;
}

/* Light/dark logo swap: default shows light (on dark bg) */
.logo-fixed__img--dark  { display: none; }

#logo-fixed.on-light .logo-fixed__img--light { display: none; }
#logo-fixed.on-light .logo-fixed__img--dark  { display: block; }
#logo-fixed.on-light .logo-fixed__tag        { color: var(--color-dark); }

.logo-fixed__tag {
  font-family: var(--font-sans);
  font-size: clamp(0.6rem, 0.65vw, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: right;
  line-height: 1.7;
  width: 100%;
  color: var(--color-cream);
  opacity: 0;
  transition: opacity 400ms var(--ease-out-smooth);
}

#logo-fixed.tag-visible .logo-fixed__tag {
  opacity: 0.75;
}

#logo-fixed.on-light.tag-visible .logo-fixed__tag {
  opacity: 0.55;
}

/* Per-slide logos on 4–10: mobile only */
.logo-mobile-only {
  display: none !important;
}

@media (max-width: 900px) {
  #logo-fixed {
    width: clamp(150px, 44vw, 220px);
  }

  #logo-fixed .logo-fixed__img {
    width: 70%;
  }

  #logo-fixed .logo-fixed__tag {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
  }
}

/* ── Slide 4 — Posture ────────────────────────────────────────────── */

.posture-heading {
  font-size: clamp(3rem, 8vw, 8rem);
  font-weight: 540;
  line-height: 1.0;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--color-cream);
  text-shadow:
    0 0 4px  rgba(254, 222, 185, 0.6),
    0 0 15px rgba(238, 35,   36, 0.5),
    0 0 35px rgba(170, 31,   35, 0.4),
    0 0 70px rgba(170, 31,   35, 0.2);
  margin-bottom: var(--space-md);
}

.posture-body {
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  font-weight: normal;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--color-cream-body);
  max-width: 44ch;
  text-wrap: pretty;
}

/* ── Slides 5–7 — Method series ──────────────────────────────────── */

.method-heading {
  font-size: clamp(3rem, 8vw, 8rem);
  font-weight: 540;
  line-height: 1.0;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--color-cream);
  text-shadow:
    0 0 4px  rgba(254, 222, 185, 0.6),
    0 0 15px rgba(238, 35,   36, 0.5),
    0 0 35px rgba(170, 31,   35, 0.4),
    0 0 70px rgba(170, 31,   35, 0.2);
  margin-bottom: var(--space-md);
}

.method-body {
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  font-weight: normal;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--color-cream-body);
  max-width: 44ch;
  text-wrap: pretty;
}

/* ── Slide 8 — Founding case ──────────────────────────────────────── */

.case-result {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 2.8rem);
  font-weight: 540;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--color-cream);
  text-shadow:
    0 0 4px  rgba(254, 222, 185, 0.6),
    0 0 15px rgba(238, 35,   36, 0.5),
    0 0 35px rgba(170, 31,   35, 0.4),
    0 0 70px rgba(170, 31,   35, 0.2);
  max-width: 36ch;
  text-wrap: balance;
  margin-bottom: var(--space-lg);
}

.case-cta {
  display: inline-flex;
  align-self: flex-start;   /* don't stretch to full column width */
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-cream);
  border: 1px solid rgba(254, 222, 185, 0.35);
  padding: 0.75em 1.4em;
  border-radius: 2px;
  transition: background 250ms var(--ease-out-smooth),
              border-color 250ms var(--ease-out-smooth);
}

.case-cta::after {
  content: '→';
  transition: transform 200ms var(--ease-out-strong);
}

@media (hover: hover) and (pointer: fine) {
  .case-cta:hover {
    background: rgba(254, 222, 185, 0.08);
    border-color: rgba(254, 222, 185, 0.6);
  }
  .case-cta:hover::after {
    transform: translateX(4px);
  }
}

/* ── Slide 9 — Identity grid ──────────────────────────────────────── */

.identity-grid-layout {
  gap: var(--space-md);
}

.identity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.5rem, 1.5vw, 1.5rem);
  width: 100%;
  max-width: 900px;
}

.identity-item {
  aspect-ratio: 4 / 3;
  background: rgba(254, 222, 185, 0.06);
  border: 1px solid rgba(254, 222, 185, 0.1);
  border-radius: 2px;
}

/* ── Slide 10 — CTA ───────────────────────────────────────────────── */

.cta-layout {
  justify-content: center;
  gap: var(--space-xl);
  /* Bottom padding creates breathing room for the fixed logo */
  padding-bottom: clamp(5rem, 10vh, 9rem);
}

.cta-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.cta-question {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 4.5rem);
  font-weight: 540;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--color-cream);
  text-shadow:
    0 0 4px  rgba(254, 222, 185, 0.6),
    0 0 15px rgba(238, 35,   36, 0.5),
    0 0 35px rgba(170, 31,   35, 0.4),
    0 0 70px rgba(170, 31,   35, 0.2);
  max-width: 20ch;
}

.cta-sub {
  font-size: clamp(1rem, 1.4vw, 1.4rem);
  font-weight: normal;
  line-height: 1.5;
  color: var(--color-cream-body);
  max-width: 40ch;
}

.cta-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-cream);
  border: 1px solid rgba(254, 222, 185, 0.35);
  padding: 0.75em 1.4em;
  border-radius: 2px;
  align-self: flex-start;
  transition: background 250ms var(--ease-out-smooth),
              border-color 250ms var(--ease-out-smooth);
}

.cta-contact::after {
  content: '→';
  transition: transform 200ms var(--ease-out-strong);
}

@media (hover: hover) and (pointer: fine) {
  .cta-contact:hover {
    background: rgba(254, 222, 185, 0.08);
    border-color: rgba(254, 222, 185, 0.6);
  }
  .cta-contact:hover::after {
    transform: translateX(4px);
  }
}

.cta-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  padding-top: 2rem;
  border-top: 1px solid rgba(254, 222, 185, 0.1);
}

.cta-tagline {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-cream-dim);
  letter-spacing: 0.02em;
}

.cta-links {
  display: flex;
  gap: var(--space-md);
}

.cta-links a {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-cream-dim);
  transition: color 200ms var(--ease-out-smooth);
}

@media (hover: hover) and (pointer: fine) {
  .cta-links a:hover {
    color: var(--color-cream);
  }
}

/* ── Reduced motion ───────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; }
  .reveal.is-visible { transition: opacity 300ms ease; }
  .scroll-hint__arrow { animation: none; }
}

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

@media (max-width: 900px) {
  /*
    Slide 1 mobile: simple flex column, top-aligned.
    Elements stack in order: heading → body → punchline → scroll hint.
    margin-top: auto on scroll-hint pushes it to the bottom of the slide.
  */
  /* Slide 1: content centered, scroll hint anchored to bottom */
  [data-slide="1"] {
    justify-content: center;
  }

  .slide-1-layout {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    flex: 0 0 auto;
    width: 100%;
  }

  .slide-1-left {
    gap: var(--space-sm);
    width: 100%;
  }

  .slide-1-right {
    align-items: flex-start;
    margin-top: var(--space-lg);
    width: 100%;
  }

  /* ── Mobile type scale
     All values verified at 390px viewport.
     Minimums respect 16px floor for body, 14px floor for UI labels.  */

  .intro-line {
    font-size: clamp(1.5rem, 7vw, 2.2rem);   /* 24px → fluid → 35px */
  }

  .intro-aside {
    text-align: left;
    font-size: clamp(1.8rem, 8vw, 2.8rem);   /* 29px → fluid → 45px — punchline, not overwhelming */
  }

  .intro-secondary {
    font-size: 1rem;                           /* 16px fixed — minimum body */
  }

  .slide2-line {
    font-size: clamp(1.3rem, 6vw, 2rem);     /* 21px → fluid — comfortable heading */
  }

  .slide2-secondary {
    font-size: 1rem;                           /* 16px fixed */
  }

  /* Scroll hint and UI labels: minimum 14px on mobile */
  .scroll-hint__label {
    font-size: 0.875rem;                       /* 14px */
  }

  /* Scroll hint: absolute, bottom-center */
  .scroll-hint {
    position: absolute;
    bottom: var(--margin-y);
    left: 0;
    right: 0;
    margin-inline: auto;
    width: fit-content;
  }

  /* Arrow points down on mobile */
  .scroll-hint__arrow {
    display: inline-block;
    animation-name: arrow-bounce-down;
  }

  @keyframes arrow-bounce-down {
    0%, 100% { transform: rotate(90deg) translateX(0);   opacity: 1;   }
    50%       { transform: rotate(90deg) translateX(6px); opacity: 0.45; }
  }

  /* Slide 3: wider logo container so tag fits in 2 lines */
  .logo-container--with-tag {
    align-items: flex-end;
    width: clamp(160px, 44vw, 220px);
  }

  /* Logo smaller than container — container stays wide for the tag text */
  .logo-container--with-tag .logo {
    width: 70%;
  }

  .tag--below-logo {
    font-size: 0.75rem;                        /* 12px — acceptable for a label this short */
    letter-spacing: 0.16em;                    /* reduce tracking slightly at smaller size */
  }

  [data-slide="3"] h1 {
    font-size: clamp(2.2rem, 9vw, 3.8rem);   /* 35px → fluid — tagline, centered */
  }
}
