/* ==========================================================================
   Iz Kuba — landing page
   Static layer. Scroll choreography (Lenis + GSAP) is added on top later,
   so element positions here must stay layout-stable without JS.
   ========================================================================== */

:root {
  /* Palette — light editorial studio, see Course.md §10.
     Warm neutrals throughout (no cool/warm grey mixing), one accent only.
     Chrome renders are cool and neutral, so a warm page makes them read
     as objects sitting on paper rather than as glowing screens. */
  --bg:         #E9E7E3;  /* warm off-white */
  --surface:    #F3F1ED;  /* raised card — lighter than the page */
  --surface-2:  #DEDAD3;  /* recessed band */
  --text:       #14120E;  /* warm near-black */
  --muted:      #6B665B;  /* warm taupe */
  --line:       #CBC6C0;
  --accent:     #C4471E;  /* vermilion: warm against chrome, 76% sat */
  --accent-ink: #FFF7F3;  /* text on accent */
  --accent-soft:#F3DED4;  /* accent tint for fills */

  --font-display: 'Onest', system-ui, sans-serif;
  --font-body:    'Onest', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Horizontal rhythm in vw, like produx.design — scales on any screen.
     The floor keeps text off the bezel on a 320px phone, where 5.55vw is
     only 18px; the ceiling stops the gutter from eating a 4K screen. */
  --gutter: clamp(1.15rem, 5.55vw, 7rem);
  --maxw: 1440px;

  /* Height of the fixed bar — anchors and the mobile panel both measure
     against it, so it lives in one place. */
  --nav-h: 4.6rem;

  /* Varied radii: tighter inside, softer on containers */
  --r-sm:   6px;
  --r:      12px;
  --r-lg:   24px;
  --r-pill: 999px;

  /* Shadows carry the page hue instead of neutral black */
  --shadow-sm: 0 1px 2px rgba(58, 46, 32, 0.07);
  --shadow-md: 0 10px 28px -14px rgba(58, 46, 32, 0.28);
  --shadow-lg: 0 28px 64px -24px rgba(58, 46, 32, 0.30);

  --z-nav: 100;
  --z-cursor: 9999;
}

*, *::before, *::after { box-sizing: border-box; }

/* Lenis owns scrolling; native smooth-scroll would fight it.
   Kept only as a fallback for users who get no JS at all. */
html:not(.lenis) { scroll-behavior: smooth; }

/* Lenis runtime classes */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* Paper grain. A flat cream fill reads as unfinished digital beige; a faint
   noise layer gives it a printed surface. Fixed, so it never scrolls with
   content, and inert to the pointer. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("../assets/web/noise.svg");
  mix-blend-mode: multiply;
}
/* Everything real sits above the grain */
.nav, main, .footer, .cursor, dialog { position: relative; z-index: 2; }
.nav { z-index: var(--z-nav); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Type scale ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 800;
  /* Editorial scale: big and tight, like waabi's 150px/-8px headline.
     Sentence case, not caps — caps at this size shouts and loses the
     letterforms that make Onest read as a contemporary grotesk. */
  /* Sized to the hero's text column, not the viewport: at 7vw the word
     "рекламный" alone filled the column and orphaned "в" onto its own line. */
  font-size: clamp(2rem, 5.2vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.042em;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}
/* Explicit line control instead of <br>: keeps the em dash attached to its line */
.display > span { display: block; }
.display--sm { font-size: clamp(1.7rem, 4.6vw, 4.4rem); letter-spacing: -0.038em; }

.h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.8vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}

h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; }

.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.1rem;
}
.label--accent { color: var(--accent); }

.lead {
  font-size: clamp(1rem, 1.35vw, 1.3rem);
  color: var(--muted);
  margin: 1.4rem 0 0;
  max-width: 62ch; /* keep the measure readable */
  text-wrap: pretty;
}
.muted { color: var(--muted); }

/* Data reads straight when digits share a width */
.plan__price, .final__facts span, .author__facts span,
.module__num, .skills__num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s cubic-bezier(.2,.8,.3,1), background 0.22s,
              box-shadow 0.22s, border-color 0.22s;
}
.btn:hover { transform: translateY(-2px); background: #A93A16; box-shadow: var(--shadow-md); }
/* Physical press: without it a click feels like nothing happened */
.btn:active { transform: translateY(1px) scale(0.985); box-shadow: var(--shadow-sm); }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); box-shadow: none; }
.btn--ghost:hover { background: var(--surface); border-color: var(--muted); box-shadow: var(--shadow-sm); }

.btn--sm { padding: 0.7rem 1.2rem; font-size: 0.72rem; }
.btn--full { width: 100%; }

/* Keyboard users need to see where they are */
:where(a, button, summary, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  min-height: var(--nav-h);
  padding: 1.1rem var(--gutter);
  backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom-color: var(--line);
}
.nav { transition: transform 0.45s cubic-bezier(.2,.8,.3,1), background 0.3s; }
.nav.is-hidden { transform: translateY(-102%); }

.nav__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; align-items: center; gap: 1.9rem; font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.nav__links a { color: var(--muted); transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
/* The in-panel CTA only exists for the drop-down layout */
.nav__links-cta { display: none; }

/* Burger. Hidden until the links collapse into a panel. */
.nav__burger {
  display: none;
  /* 44px is the smallest comfortable touch target */
  width: 44px; height: 44px;
  margin-right: -0.6rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.nav__burger-box { display: block; position: relative; width: 22px; height: 14px; margin: 0 auto; }
.nav__burger-box i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.34s cubic-bezier(.2,.8,.3,1), opacity 0.2s;
}
.nav__burger-box i:first-child { top: 0; }
.nav__burger-box i:last-child  { bottom: 0; }
.nav.is-open .nav__burger-box i:first-child { transform: translateY(6px) rotate(45deg); }
.nav.is-open .nav__burger-box i:last-child  { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Layout ---------- */

.section { padding: clamp(5rem, 11vw, 11rem) var(--gutter); }
.section--narrow { max-width: 1000px; margin-inline: auto; }

/* Fixed nav must not cover a heading when jumping to an anchor.
   `main` itself carries #top, the logo's target, so it needs the offset too. */
main[id], main > section[id] { scroll-margin-top: calc(var(--nav-h) + 1rem); }

.section__head { max-width: 60ch; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__sub { color: var(--muted); margin: 1.2rem 0 0; }

/* ---------- 01 Hero ---------- */

/* Hero: the cube is a cut-out object sitting on the page, not a dark photo
   behind text. That is the whole reason the renders got their backgrounds
   removed — a full-bleed dark image would break a light page. */
.hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 8rem var(--gutter) clamp(3rem, 6vw, 6rem);
}
.hero__media {
  position: relative;
  order: 2;
  /* Bleed slightly past the container so the object is not politely boxed */
  margin-right: calc(var(--gutter) * -0.6);
}
.hero__media img {
  width: 100%;
  height: auto;
  /* A cut-out needs its own contact shadow or it floats unconvincingly */
  filter: drop-shadow(0 34px 40px rgba(58, 46, 32, 0.24));
}
.hero__content { position: relative; order: 1; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.4rem; }
.hero__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem;
  margin: 2.2rem 0 0;
  font-family: var(--font-mono); font-size: 0.76rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

/* ---------- 02 Statement ---------- */

.statement {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.5vw, 2.4rem);
  line-height: 1.28;
  letter-spacing: -0.02em;
  margin: 0;
}
.statement--muted {
  margin-top: 1.6rem;
  font-size: clamp(0.95rem, 1.5vw, 1.45rem);
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- 03 Skills ---------- */

.skills { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.skills__item {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.7rem 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s;
}
.skills__item:hover { background: var(--surface); }
.skills__num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }
.skills__item p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.05rem, 2.1vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* ---------- 04 Disassembly stage ---------- */

.stage { padding: clamp(5rem, 11vw, 11rem) var(--gutter); background: var(--surface); }
.stage__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
/* Sticky visual — later this becomes the pinned three.js canvas */
.stage__visual {
  position: sticky;
  top: 14vh;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 18%,
      color-mix(in srgb, var(--surface) 92%, white) 0%,
      var(--surface-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), var(--shadow-sm);
  aspect-ratio: 16 / 9;
}
/* Cube states stack on top of each other; JS toggles .is-active */
.stage__state {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* contain, not cover: these are objects with transparent surrounds and
     must not be cropped at the edges */
  object-fit: contain;
  padding: 6%;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.7s ease, transform 1.2s cubic-bezier(.2,.8,.3,1);
  filter: drop-shadow(0 20px 26px rgba(58, 46, 32, 0.20));
}
.stage__state.is-active { opacity: 1; transform: scale(1); }

/* WebGL took over — retire the image fallback.
   The class is only added after the scene renders, so a failure anywhere
   in scene.js leaves the images in place. */
.stage__visual.has-webgl .stage__state { display: none; }

.stage__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}

.stage__caption {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 2;
  padding: 0.45rem 0.9rem;
  border-radius: 100px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.modules { list-style: none; margin: 0; padding: 0; counter-reset: m; }
.module {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 1.2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.module:first-child { border-top: 1px solid var(--line); }
.module__num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); padding-top: 0.35rem; }
.module h3 { margin: 0 0 0.35rem; font-size: clamp(1.05rem, 1.6vw, 1.45rem); transition: color 0.3s; }
.module p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Module nearest the sticky visual gets marked by ScrollTrigger */
.module {
  opacity: 0.62;
  transition: opacity 0.4s ease, border-color 0.4s ease;
}
.module.is-active { opacity: 1; }
.module.is-active h3 { color: var(--accent); }
.module.is-active .module__num { color: var(--accent); }
.module:not(.is-active) .module__num { color: var(--muted); }

/* ---------- 05 Weeks ---------- */

.weeks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.2rem;
}
.week {
  display: flex;
  flex-direction: column;
  padding: 1.9rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.week h3 { margin: 0 0 0.7rem; font-size: 1.3rem; }
.week p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.week__result {
  /* Pin the result line to the card bottom so the row reads as one baseline */
  margin-top: auto !important;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text) !important;
  letter-spacing: 0.02em;
}
.week--zero, .week--diploma { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.week--diploma .week__result { color: var(--accent) !important; }

/* ---------- 06 Cards ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}
.card img,
.card__media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg);
}
.card figcaption { padding: 1.5rem 1.4rem 1.8rem; }
.card figcaption .label { margin-bottom: 0.6rem; color: var(--accent); }
.card figcaption p:last-child { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- 07 Author ---------- */

.author {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: clamp(1.6rem, 4vw, 4rem);
  align-items: start;
}
.author__media { display: flex; flex-direction: column; gap: 0.9rem; }
.author__photo, .author__desk { margin: 0; overflow: hidden; border-radius: var(--r); }
.author__photo { aspect-ratio: 3 / 4; }
.author__desk { aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.author__photo img, .author__desk img { width: 100%; height: 100%; object-fit: cover; display: block; }

.author__name {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  letter-spacing: -0.02em;
}
.author__role { margin: 0 0 1.6rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }
.author__bio { margin: 0 0 2rem; color: var(--muted); max-width: 62ch; }

.author__facts { list-style: none; display: flex; flex-wrap: wrap; gap: 2.2rem; margin: 0 0 2.2rem; padding: 0; }
.author__facts li { display: flex; flex-direction: column; gap: 0.25rem; }
.author__facts span { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.02em; }
.author__facts small { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.author__clients { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 2.2rem; padding: 0; }
.author__clients li {
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- 08 Works gallery ---------- */

.gallery {
  display: grid;
  grid-auto-flow: column;
  /* A single explicit width, not minmax(): once the track list overflows,
     minmax() collapses every column to its minimum and the carousel barely
     scrolls. */
  grid-auto-columns: clamp(280px, 32vw, 520px);
  gap: 1.2rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  /* Wide content scrolls inside its own container, never the page */
  scrollbar-color: var(--line) transparent;
}
.gallery__item {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  /* Grab, not pointer: the card is not a link, the strip is drag-scrolled */
  cursor: grab;
  font: inherit;
}
.gallery.is-dragging, .gallery.is-dragging .gallery__item { cursor: grabbing; }
.gallery__item img {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--r);
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(.2,.8,.3,1);
}
.gallery__item:hover img { transform: scale(1.03); }
.gallery__meta { display: flex; flex-direction: column; gap: 0.2rem; }
.gallery__meta b { font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; }
.gallery__meta i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 09 Compare table ---------- */

.compare { width: 100%; border-collapse: collapse; font-size: clamp(0.95rem, 1.3vw, 1.15rem); }
.compare th, .compare td { padding: 1.25rem 1.2rem; text-align: left; border-bottom: 1px solid var(--line); }
.compare thead th {
  font-family: var(--font-mono); font-size: 0.76rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.compare td:first-child { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.compare td:last-child { color: var(--text); }
.compare thead th:last-child { color: var(--accent); }

/* ---------- 08 Plans ---------- */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; align-items: start; }
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2.1rem 1.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.plan--featured { border-color: var(--accent); background: var(--surface-2); }
.plan__badge {
  position: absolute; top: -0.72rem; left: 1.7rem;
  padding: 0.28rem 0.75rem;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 0.65rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 100px;
}
.plan__name { margin: 0 0 1.1rem; font-size: 1.2rem; }
.plan__price { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 2.3rem; letter-spacing: -0.03em; }
.plan__old { margin: 0.35rem 0 0; font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); text-decoration: line-through; }
.plan__inst { margin: 0.5rem 0 1.6rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }
.plan__list { list-style: none; margin: 0 0 1.9rem; padding: 0; flex: 1; }
.plan__list li { position: relative; padding: 0.55rem 0 0.55rem 1.4rem; color: var(--muted); font-size: 0.93rem; border-bottom: 1px solid var(--line); }
.plan__list li::before { content: ''; position: absolute; left: 0; top: 1.05rem; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.guarantee {
  margin: 2.5rem auto 0;
  max-width: 60ch;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.guarantee strong { color: var(--text); }

/* ---------- 09 FAQ ---------- */

.faq { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  padding: 1.5rem 2.5rem 1.5rem 0;
  cursor: pointer;
  list-style: none;
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  letter-spacing: -0.02em;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: '+';
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1.3rem;
}
.faq__item[open] summary::after { content: '−'; }
.faq__item p { margin: 0 0 1.7rem; max-width: 68ch; color: var(--muted); }

/* ---------- 10 Final ---------- */

.final { position: relative; padding: clamp(5rem, 11vw, 11rem) var(--gutter); overflow: hidden; }
.final__media { position: absolute; inset: 0; z-index: 0; }
.final__media img {
  width: 100%; height: 100%; object-fit: contain; object-position: right center;
  filter: drop-shadow(0 30px 40px rgba(58, 46, 32, 0.22));
}
/* Fade the object out under the copy instead of laying a dark scrim over
   the whole band — a dark scrim is exactly the "random dark section" that
   breaks a light page. */
.final::after {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to right,
    var(--bg) 6%,
    color-mix(in srgb, var(--bg) 82%, transparent) 42%,
    transparent 72%);
}
.final__content { position: relative; z-index: 2; max-width: 660px; }

.final__facts { list-style: none; display: flex; flex-wrap: wrap; gap: 2.2rem; margin: 2.6rem 0 0; padding: 0; }
.final__facts li { display: flex; flex-direction: column; gap: 0.3rem; }
.final__facts span { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; }
.final__facts small { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); max-width: 22ch; }

/* ---------- Forms ---------- */

.form { margin-top: 2.8rem; display: flex; flex-direction: column; gap: 1.1rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }

.field { display: flex; flex-direction: column; gap: 0.5rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  padding: 0;
}
.field i { color: var(--accent); font-style: normal; }

.field input[type="text"], .field input[type="email"] {
  width: 100%;
  padding: 0.95rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s, background 0.2s;
}
.field input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
.field input::placeholder { color: var(--muted); }

.choices { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.choices--col { flex-direction: column; }
.choices label {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: border-color 0.2s, background 0.2s;
}
.choices label:hover { border-color: var(--muted); }
.choices input { accent-color: var(--accent); margin: 0; }
.choices label:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }

.form__note { margin: 0.3rem 0 0; font-size: 0.8rem; color: var(--muted); }

.form--inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem; }
.form--inline .field { flex: 1 1 200px; }

/* ---------- 11 Lead magnet ---------- */

.lead-magnet { padding: clamp(4rem, 9vw, 9rem) var(--gutter); background: var(--surface); border-top: 1px solid var(--line); }
.lead-magnet__inner { max-width: 780px; margin-inline: auto; text-align: center; }
.lead-magnet .lead { margin-inline: auto; max-width: 56ch; }
.lead-magnet .form { margin-inline: auto; max-width: 620px; }
.lead-magnet code {
  font-family: var(--font-mono); font-size: 0.9em;
  padding: 0.1em 0.4em; border-radius: 5px;
  background: var(--surface-2); color: var(--accent);
}

/* ---------- Footer ---------- */

.footer {
  display: flex; flex-wrap: wrap; gap: 2rem;
  align-items: center; justify-content: space-between;
  padding: 3rem var(--gutter);
  border-top: 1px solid var(--line);
}
.footer__brand p { margin: 0; }
.footer__brand .muted { font-size: 0.88rem; margin-top: 0.4rem; }
.footer__links { display: flex; gap: 1.6rem; font-family: var(--font-mono); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.footer__links a:hover { color: var(--text); }

.footer__bottom {
  width: 100%;
  display: flex; flex-wrap: wrap; gap: 0.8rem 1.6rem;
  align-items: center; justify-content: space-between;
}
.footer__copy { margin: 0; font-size: 0.8rem; }
.footer__legal { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.8rem; color: var(--muted); }

/* ---------- Wide screens ----------
   Past --maxw the gutter alone would let a paragraph run 2000px wide.
   Centering with padding rather than an inner wrapper keeps every section
   background full-bleed while the content sits on the same measure as the
   hero. Declared after the section rules so it wins over their padding
   shorthands. */

.section, .stage, .final, .lead-magnet, .footer, .nav {
  padding-inline: max(var(--gutter), (100% - var(--maxw)) / 2);
}

/* ---------- Responsive ----------
   Breakpoints follow the layout, not device names:
   1180 — the hero's two columns stop being comfortable
    900 — two-column sections fold; the nav collapses into a panel
    620 — side-by-side cards and rows fold
    420 — smallest phones: trim horizontal padding and type
   Plus one landscape rule for short viewports.                             */

@media (max-width: 1180px) {
  /* Give the copy column more of the width before it folds outright */
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  /* --- Hero: stack. The cut-out reads as the opening image, capped so the
         headline and the first CTA still land inside the first screen. --- */
  .hero {
    grid-template-columns: 1fr;
    align-content: start;
    min-height: auto;
    gap: 1.8rem;
    padding-top: calc(var(--nav-h) + 1.6rem);
  }
  .hero__media {
    order: 1;
    margin-right: 0;
    justify-self: center;
    width: min(100%, 460px);
  }
  .hero__media img { max-height: 34dvh; object-fit: contain; }
  .hero__content { order: 2; }

  /* --- Nav: links become a panel under the bar --- */
  .nav__burger { display: inline-flex; align-items: center; justify-content: center; }
  .nav__cta { display: none; }

  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.4rem var(--gutter) 1.4rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
    /* Long menu on a short landscape screen must scroll, not overflow */
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.6rem);
    transition: opacity 0.28s ease, transform 0.34s cubic-bezier(.2,.8,.3,1),
                visibility 0.34s;
  }
  .nav.is-open .nav__links {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  .nav__links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: var(--text);
    border-bottom: 1px solid var(--line);
  }
  .nav__links-cta {
    display: inline-flex;
    justify-content: center;
    margin-top: 1.2rem;
    border-bottom: 0;
    color: var(--accent-ink);
  }

  /* --- Sections fold to one column --- */
  .author { grid-template-columns: 1fr; }
  .author__media { flex-direction: row; }
  .author__photo, .author__desk { flex: 1 1 0; min-width: 0; }
  .gallery { grid-auto-columns: min(78vw, 420px); }
  .stage__grid { grid-template-columns: 1fr; }
  .stage__visual { position: relative; top: 0; }
  .form__row { grid-template-columns: 1fr; }

  /* --- Final CTA: the render moves above the copy instead of behind it.
         Text over a contained object only works while there is width to
         spare on the side. --- */
  .final { display: flex; flex-direction: column; gap: 2.2rem; }
  .final__media { position: relative; inset: auto; order: 1; }
  .final__media img { height: auto; max-height: 30dvh; object-position: center; }
  .final::after { display: none; }
  .final__content { order: 2; max-width: none; }
}

@media (max-width: 620px) {
  .skills__item { grid-template-columns: 2.6rem 1fr; gap: 1rem; }
  .module { grid-template-columns: 2.4rem 1fr; gap: 0.9rem; }
  .author__facts, .final__facts { gap: 1.3rem 1.8rem; }

  /* Full-width buttons: a thumb reaches the whole row, and two stacked pills
     of different widths look like a mistake. */
  .btn { width: 100%; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .form--inline { flex-direction: column; align-items: stretch; }

  .compare { table-layout: fixed; }
  .compare th, .compare td { padding: 1rem 0.7rem; overflow-wrap: break-word; }

  .week, .plan, .card figcaption { padding-inline: 1.3rem; }
  .plan__badge { left: 1.3rem; }

  .footer { flex-direction: column; align-items: flex-start; gap: 1.6rem; }
  .footer__links { flex-wrap: wrap; gap: 0.9rem 1.4rem; }
  .footer__links a, .footer__legal a { min-height: 32px; display: inline-flex; align-items: center; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 0.6rem; }

  .legal { padding: 1.5rem; }
  .faq__item summary { padding-right: 2rem; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }

  /* Stacked, the photos size themselves from their aspect ratios. The `flex: 1 1 0`
     used for the side-by-side row would make that a zero basis on the block axis
     and collapse both figures to nothing. */
  .author__media { flex-direction: column; }
  .author__photo, .author__desk { flex: 0 0 auto; }
  .author__facts span { font-size: 1.4rem; }
  .stage__caption { left: 0.6rem; bottom: 0.6rem; font-size: 0.64rem; }
  .gallery { grid-auto-columns: 84vw; }
}

/* Phone held sideways: 100dvh of hero would leave no room for the headline */
@media (max-height: 560px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 1rem); }
  .hero__media img { max-height: 46dvh; }
  .final__media img { max-height: 46dvh; }
}

/* Touch devices keep the hover styles applied after a tap, so the pointer-only
   effects are neutralised rather than left stuck on. */
@media (hover: none) {
  .btn:hover { transform: none; background: var(--accent); box-shadow: var(--shadow-sm); }
  .btn--ghost:hover { background: transparent; border-color: var(--line); box-shadow: none; }
  .skills__item:hover { background: none; }
  .gallery__item:hover img { transform: none; }
  .gallery__item { cursor: default; }
  .card:hover, .choices label:hover { border-color: var(--line); }
}

/* ---------- Line-mask reveal (statement) ---------- */

.line-mask { display: block; overflow: hidden; }
.line-mask__inner { display: block; will-change: transform; }

/* ---------- Custom cursor ---------- */

.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  pointer-events: none;
  display: none;
  will-change: transform;
}
.cursor.is-enabled { display: block; }
.cursor__dot {
  display: block;
  width: 11px; height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.28s cubic-bezier(.2,.8,.3,1), background 0.28s, opacity 0.28s;
}
.cursor.is-hot .cursor__dot { transform: scale(3.1); background: transparent; box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Payment stub + legal dialogs ---------- */

.form__stub {
  margin: 0.4rem 0 0;
  padding: 0.9rem 1.1rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
/* 700, not 500 — <b>/<strong> already pull Onest 700 elsewhere, so reusing it
   here lets the 500 weight be dropped from the font set entirely. */
.form__stub b { display: block; color: var(--accent); font-weight: 700; margin-bottom: 0.25rem; }

.legal {
  max-width: 560px;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
}
.legal::backdrop { background: rgba(32, 26, 18, 0.42); backdrop-filter: blur(4px); }
.legal h3 { margin: 0 0 1rem; font-size: 1.5rem; }
.legal p { color: var(--muted); margin: 0 0 1.6rem; }

.footer__legal a { text-decoration: underline; text-underline-offset: 3px; }
.footer__legal a:hover { color: var(--accent); }

/* ---------- Form confirmation ---------- */

.form__done {
  margin: 0.5rem 0 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

/* Respect users who asked for less motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .module { opacity: 1; }
  .stage__state { transition: none; }
  .cursor { display: none !important; }
}
