/* =========================================================================
   Talehaven - home page prototype
   Visual language taken from the Figma file "DS Talehaven".
   Every colour below is sampled from that file; nothing is invented here.
   ========================================================================= */

@import url('./fonty/fonty.css');

/* -------------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------------- */

:root {
  --header-h: 4.5rem;

  /* ---- Surfaces -------------------------------------------------------
     Przeniesione 1:1 z aplikacji (`frontend/src/app/globals.css`), zeby
     przejscie ze strony do produktu nie bylo zmiana swiata. Papier jest
     cieplejszy niz w pierwszej wersji prototypu, karty maja odcien kremu,
     a nie czysta biel. */
  --bg: #fffaec;          /* --th-bg-light */
  --bg-page: #f5eeda;     /* --th-bg-warm */
  --bg-soft: #f4ebd8;     /* --th-paper-soft */
  --bg-tint: #ede3cb;
  --bg-sunken: #e2d9c0;   /* --th-border jako plaszczyzna wklesla */
  --night: #1a1410;       /* --th-surface-deep */
  --night-2: #1e1e1e;     /* --th-nav */

  /* ---- Ink ------------------------------------------------------------
     Wartosci aplikacji, z jednym wyjatkiem: `--th-ink-faint` (#9C8E72) ma na
     papierze 2,78:1, wiec nie moze niesc tekstu. Zostaje tu wylacznie jako
     znacznik dekoracyjny, a trzeci stopien tekstu jest przyciemniony. */
  --ink: #1a1a1a;         /* --th-ink, 15,02:1 na papierze */
  --ink-2: #5a5240;       /* --th-ink-muted, 6,67:1 */
  --ink-3: #6b6252;       /* przyciemniony faint, 5,02:1 */
  --ink-faint: #9c8e72;   /* --th-ink-faint, TYLKO dekoracja */
  --ink-on-dark: rgba(244, 235, 216, 0.72);  /* --th-ink-on-dark */

  /* ---- Lines ----------------------------------------------------------
     Aplikacja rysuje pelnymi kolorami, nie alfa - stad dwa stale odcienie. */
  --line: #e2d9c0;        /* --th-border */
  --line-2: #c9bc9e;      /* --th-border-strong */
  --line-on-dark: rgba(244, 235, 216, 0.14);

  /* ---- Brand ----------------------------------------------------------
     Karmazyn to ten sam kolor, co `--th-type-npc` w aplikacji i jej kolor
     dzialania. Zielen zastapila oliwke, bo w aplikacji „udalo sie" i „wlasne"
     niesie rodzina zieleni (`--th-type-location`, `--th-type-confirm`). */
  --crimson: #b84b4b;       /* --th-type-npc */
  --crimson-deep: #a13d3d;
  --olive: #379963;         /* --th-type-location */
  --olive-deep: #1d6d44;    /* --th-type-confirm, 5,45:1 na papierze */
  --sage: #8a7e6a;          /* --th-type-document */

  /* ---- Menu boczne ----------------------------------------------------
     W aplikacji menu jest CIEMNE w kazdym motywie - to ono decyduje, czy
     produkt wyglada tak, a nie inaczej. Prototyp mial je kremowe. */
  --nav-surface: #171410;
  --nav-ink: #f0e6d8;
  --nav-ink-soft: rgba(255, 255, 255, 0.55);
  /* Aplikacja ma tu 0,4, co na #171410 daje 3,83:1 - pod AA dla tekstu.
     Naglowki grup i liczniki NIOSA informacje, wiec jeden stopien wyzej. */
  --nav-ink-faint: rgba(255, 255, 255, 0.52);
  --nav-line: rgba(255, 255, 255, 0.06);
  --nav-hover: rgba(255, 255, 255, 0.06);
  --nav-active: #e8a0a0;
  --nav-active-bg: rgba(184, 75, 75, 0.16);

  /* ---- Kolory typow wpisu --------------------------------------------
     Caly zestaw z aplikacji. Zadnego z nich NIE uzywamy jako koloru tekstu
     na papierze - wiekszosc ma tam ponizej 4,5:1 (przedmiot 2,60, karta 2,99,
     zloto 2,04). Sa od tego, od czego sa w produkcie: ikony, kropki, obwodki
     i wypelnienia z bialym tekstem. */
  --typ-npc: #b84b4b;
  --typ-potwor: #6e2a5b;
  --typ-lokacja: #379963;
  --typ-przedmiot: #c08a43;
  --typ-dokument: #8a7e6a;
  --typ-tablica: #5a7a3a;
  --typ-kampania: #7b5ea7;
  --typ-muzyka: #3a8fa8;
  --typ-mapa: #4c7a8a;
  --typ-karta: #a9843e;
  --typ-slownik: #5a5240;
  --typ-magazyn: #9c8e72;
  --typ-zloto: #d69f3a;

  /* Tints, wszystkie mieszane nad papierem, zeby zostaly w jednej rodzinie. */
  --tint-crimson: rgba(184, 75, 75, 0.1);
  --tint-crimson-2: rgba(184, 75, 75, 0.17);
  --tint-olive: rgba(55, 153, 99, 0.13);
  --tint-olive-2: rgba(55, 153, 99, 0.22);
  --tint-sage: rgba(138, 126, 106, 0.14);
  --tint-ink: rgba(26, 26, 26, 0.05);

  /* Older names kept so nothing downstream breaks. */
  --crimson-tint: var(--tint-crimson);
  --olive-tint: var(--tint-olive);
  --sage-tint: var(--tint-sage);
  --paper: var(--bg);
  --surface: var(--bg);
  --surface-sunken: var(--bg-sunken);
  --soot: var(--night);
  --bark: var(--night-2);
  --white: #fffaec;
  --black: #1a1a1a;
  --grey: var(--ink-3);
  --hairline: var(--line);
  --hairline-strong: var(--line-2);
  --hairline-on-dark: var(--line-on-dark);
  --ink-soft: var(--ink-2);

  /* ---- Type ----------------------------------------------------------- */
  --font: 'Montserrat', 'Montserrat fallback', system-ui, -apple-system,
    'Segoe UI', Arial, sans-serif;

  --step-display: clamp(2.05rem, 0.95rem + 3.9vw, 4.4rem);
  --step-display-sub: clamp(1.7rem, 0.78rem + 3.2vw, 3.6rem);
  --step-h2: clamp(1.85rem, 1.1rem + 2.1vw, 2.9rem);
  --step-h3: clamp(1.1rem, 0.98rem + 0.4vw, 1.3rem);
  --step-lead: clamp(1.05rem, 0.98rem + 0.35vw, 1.22rem);
  --step-body: 1.0625rem;
  --step-small: 0.9375rem;
  --step-label: 0.78rem;

  /* ---- Shape ----------------------------------------------------------
     Skala promieni z aplikacji (`--radius-sm/md/lg/xl` = 6/10/16/24).
     Pastylka zostaje tylko tam, gdzie aplikacja tez jej uzywa: plakietki
     i przelaczniki. Guziki maja 10 px, nie 999 - to pierwsza rzecz, po
     ktorej widac, ze strona i produkt to dwa rozne systemy. */
  --radius-pill: 999px;
  --radius-block: 24px;   /* --radius-xl */
  --radius-frame: 16px;   /* --radius-lg */
  --radius-card: 16px;    /* --radius-lg, jak `.th-panel` */
  --radius-chip: 10px;    /* --radius-md */
  --radius-btn: 10px;     /* --radius-md, promien guzika w aplikacji */
  --radius-xs: 6px;       /* --radius-sm */

  /* ---- Rhythm --------------------------------------------------------- */
  --shell: 1200px;
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  --section-space: clamp(4.5rem, 2.5rem + 6vw, 8.5rem);

  /* ---- Depth ----------------------------------------------------------
     Cienie aplikacji sa CIEPLE - rgba(30, 20, 10), nie szare. Ta jedna
     roznica decyduje o tym, czy karta lezy na pergaminie, czy na nim wisi.
     Ramka zostaje szesciostopniowa, bo rozciaga sie na pol ekranu, ale bierze
     ten sam odcien. */
  --shadow-frame:
    0 1px 3.5px rgba(30, 20, 10, 0.016),
    0 3px 7px rgba(30, 20, 10, 0.025),
    0 7px 14px rgba(30, 20, 10, 0.032),
    0 14px 28px rgba(30, 20, 10, 0.04),
    0 23px 52px rgba(30, 20, 10, 0.05),
    0 36px 89px rgba(30, 20, 10, 0.068);
  --shadow-lift:
    0 2px 6px rgba(25, 23, 20, 0.04),
    0 10px 24px rgba(30, 20, 10, 0.068),
    0 30px 70px rgba(25, 23, 20, 0.09);
  --shadow-card: 0 1px 2px rgba(25, 23, 20, 0.04), 0 6px 18px rgba(25, 23, 20, 0.05);

  /* ---- Motion --------------------------------------------------------- */
  --t-fast: 160ms;
  --t-mid: 280ms;
  --t-slow: 620ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Hero state colours, rewritten per phrase by app.js. */
  --hero-highlight: rgba(180, 185, 76, 0.4);
  --hero-dot: #b4b94c;
  --hero-glow: rgba(180, 185, 76, 0.5);
}

/* Metric-matched fallback so the first paint does not reflow the hero.
   Numbers measured against Montserrat with the same method the v2 page uses. */
@font-face {
  font-family: 'Montserrat fallback';
  src: local('Arial');
  size-adjust: 108.6%;
  ascent-override: 89.3%;
  descent-override: 23%;
  line-gap-override: 0%;
}

/* -------------------------------------------------------------------------
   2. Base
   ------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* KAZDE ZDANIE ZACZYNA SIE OD NOWEGO WIERSZA.
   Lead ma cztery zdania i czytalo sie go jak jeden blok tekstu, w ktorym
   zdania zaczynaly sie w przypadkowych miejscach wiersza. Jako osobne bloki
   kazde ma swoj poczatek, a dluzsze zawijaja sie w obrebie samego siebie. */
.hero__zdanie {
  display: block;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.dark :focus-visible,
.plate :focus-visible {
  outline-color: var(--sage);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 100;
  transform: translate(-50%, -120%);
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--white);
  border-radius: 0 0 var(--radius-chip) var(--radius-chip);
  font-weight: 700;
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

/* -------------------------------------------------------------------------
   3. Layout helpers
   ------------------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-space);
}

.section--tight {
  padding-block: clamp(3rem, 1.8rem + 4vw, 5.5rem);
}

.section-head {
  max-width: 46ch;
}

.section-head--wide {
  max-width: 60ch;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: var(--step-label);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

h2.section-title {
  font-size: var(--step-h2);
}

.section-lead {
  margin-top: 1.25rem;
  font-size: var(--step-lead);
  line-height: 1.62;
  color: var(--ink-soft);
  max-width: 58ch;
}

/* -------------------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------------------- */

/* Guzik aplikacji, co do wartosci: promien 10 px, obwodka, wewnetrzne
   rozjasnienie u gory i `scale(0.98)` przy wcisnieciu. Wczesniej byla tu
   pastylka 999 px - po niej najszybciej bylo widac, ze strona i produkt to
   dwa rozne systemy. Glowny guzik jest KARMAZYNOWY, bo taki jest w aplikacji;
   czarny zostal drugim wariantem. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  background: transparent;
  font-size: var(--step-small);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 150ms var(--ease),
    background-color 150ms var(--ease),
    color 150ms var(--ease),
    border-color 150ms var(--ease),
    opacity 150ms var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--crimson);
  color: #fff;
  box-shadow:
    0 1px 3px rgba(184, 75, 75, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn--primary:hover {
  opacity: 0.9;
}

.btn--dark {
  background: var(--night-2);
  color: #fff;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn--dark:hover {
  opacity: 0.85;
}

.btn--ghost {
  border-color: var(--line-2);
  color: var(--ink-2);
}

.btn--ghost:hover {
  background: var(--line);
  color: var(--ink);
}

.btn--on-dark.btn--primary {
  background: var(--bg);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn--on-dark.btn--primary:hover {
  opacity: 0.9;
}

.btn--on-dark.btn--ghost {
  border-color: rgba(244, 235, 216, 0.4);
  color: var(--bg);
}

.btn--on-dark.btn--ghost:hover {
  background: rgba(244, 235, 216, 0.1);
}

.btn--small {
  min-height: 2.25rem;
  padding: 0 0.9rem;
  font-size: 0.8125rem;
}

/* Text link that carries an arrow. Crimson is only safe above 24px on paper
   (3.61:1), so link text stays ink and the arrow carries the colour. */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: var(--step-small);
  border-bottom: 1.5px solid var(--hairline-strong);
  padding-bottom: 2px;
  transition: border-color var(--t-fast) var(--ease), gap var(--t-fast) var(--ease);
}

.link-arrow::after {
  content: '';
  width: 1.1em;
  height: 1.1em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13M12 5l7 7-7 7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
  color: var(--crimson);
  background: var(--crimson);
}

.link-arrow:hover {
  border-color: var(--ink);
  gap: 0.7rem;
}

.dark .link-arrow,
.plate .link-arrow {
  border-color: var(--hairline-on-dark);
}

.dark .link-arrow::after,
.plate .link-arrow::after {
  background: var(--sage);
}

/* -------------------------------------------------------------------------
   5. Header
   ------------------------------------------------------------------------- */

/* Fixed, not sticky: ScrollSmoother transforms the content, and a sticky
   element inside a transformed ancestor has nothing to stick to. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(250, 247, 240, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-mid) var(--ease);
}

.site-header[data-stuck='true'] {
  border-bottom-color: var(--hairline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.wordmark {
  display: flex;
  align-items: center;
}

.wordmark img {
  width: 148px;
  height: auto;
}

.wordmark--small img {
  width: 120px;
}

/* -------------------------------------------------------------------------
   6. Hero
   Centred column, one giant headline, the rotating phrase living inside it
   as a pill, then the illustration on a wide block underneath. The verb and
   the phrase are locked onto their own line, so a longer phrase widens the
   pill and nothing else on the page moves.
   ------------------------------------------------------------------------- */

.hero {
  padding-block: clamp(3rem, 1.5rem + 5vw, 6rem) clamp(3.5rem, 2rem + 5vw, 6.5rem);
}

.hero__inner {
  width: 100%;
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
  text-align: center;
}

.hero__headline {
  font-size: var(--step-display);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin: 0;
}

/* The verb and the pill sit on one line while they fit, and the pill drops to
   its own row on a narrow phone rather than being squeezed. Wrapping here is
   free of consequence: the pill is the last thing on the row, so its width
   still moves nothing else. */
.hero__line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.1em 0.22em;
  white-space: nowrap;
}

.hero__verb {
  display: inline-block;
}

/* The tail is a step down, the way Figma sets 50px over 41px. */
.hero__tail {
  display: block;
  font-size: var(--step-display-sub);
  margin-top: 0.1em;
  text-wrap: balance;
}

/* The pill. Its width is set in pixels by app.js from a hidden copy of the
   phrase, so the change is animated rather than snapped. */
.hero__slot {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.22em;
  padding: 0.1em 0.4em 0.14em;
  border-radius: var(--radius-pill);
  background: var(--hero-highlight);
  overflow: hidden;
  transition:
    background-color var(--t-slow) var(--ease),
    width 420ms var(--ease);
}

/* The dot is the saturated version of the pill fill: the same colour at full
   strength, which is what keeps the pair legible on every state. */
.hero__dot {
  flex: none;
  width: 0.36em;
  height: 0.36em;
  border-radius: 50%;
  background: var(--hero-dot, var(--olive));
  transition: background-color var(--t-slow) var(--ease);
}

.hero__label {
  position: relative;
  display: inline-grid;
  place-items: center;
  transition: width 420ms var(--ease);
}

.hero__phrase {
  grid-area: 1 / 1;
  font-weight: 500;
  letter-spacing: -0.025em;
  white-space: nowrap;
  transition:
    opacity var(--t-mid) var(--ease),
    transform var(--t-mid) var(--ease),
    filter var(--t-mid) var(--ease);
}

.hero__phrase[data-role='ghost'] {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.hero__phrase[data-state='out'] {
  opacity: 0;
  transform: translateY(-0.2em);
  filter: blur(1px);
}

.hero__phrase[data-state='in'] {
  opacity: 1;
  transform: none;
  filter: none;
}

/* The engraving that travels with the phrase. It is a flex item on the same
   row as the pill, so it never reflows the line below and it wraps together
   with the pill on a narrow screen. Its box is a fixed square, so swapping a
   tall plate for a wide one moves nothing. */
.hero__plate {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.46em;
  height: 1.46em;
  margin-left: 0.08em;
  border-radius: 0.38em;
  background: var(--hero-highlight);
  overflow: hidden;
  transition: background-color var(--t-slow) var(--ease);
}

.hero__plate .cut {
  width: 74%;
  height: 74%;
  color: var(--ink);
  opacity: 0.92;
}

@media (max-width: 560px) {
  .hero__plate {
    display: none;
  }
}

.hero__copy {
  margin: clamp(1.25rem, 0.9rem + 1.2vw, 1.75rem) auto 0;
  font-size: var(--step-lead);
  line-height: 1.55;
  max-width: 64ch;
  color: var(--ink-soft);
  /* Na szerokim ekranie kazde zdanie miesci sie w jednym wierszu i `balance`
     nie robi nic. Pracuje dopiero na telefonie: zdanie, ktore musi zajac trzy
     wiersze, dostaje je rownej dlugosci zamiast konczyc sie sierota w rodzaju
     „podczas gry." - tak wlasnie lamal je `pretty`. */
  text-wrap: balance;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
}

.hero__note {
  margin-top: 1rem;
  font-size: var(--step-small);
  color: var(--ink-soft);
}

/* The second colour block: a wide stage the illustration plays on. */
.hero__media {
  margin-top: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
}

.hero__stage {
  position: relative;
  aspect-ratio: 12 / 5;
  border-radius: var(--radius-block);
  background: var(--hero-block);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: background-color var(--t-slow) var(--ease);
  box-shadow: var(--shadow-frame);
}

.hero__stage::after {
  /* A faint engraving-paper tooth, so the flat block is not dead flat. */
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(29, 29, 29, 0.09) 1px,
    transparent 1px
  );
  background-size: 7px 7px;
  opacity: 0.45;
  pointer-events: none;
}

.hero__stage-grid {
  display: grid;
  grid-area: 1 / 1;
  /* Stretch, not centre: a centred grid item sizes itself from its content,
     and the illustration would then resolve its own 100% height against an
     auto track and spill past the block. */
  place-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(1.5rem, 1rem + 2vw, 3rem);
}

.hero__scene {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 60rem;
  margin-inline: auto;
  color: var(--hero-block-ink);
  transition:
    opacity var(--t-mid) var(--ease),
    transform var(--t-mid) var(--ease);
}

.hero__scene svg {
  width: 100%;
  height: 100%;
}

.hero__scene[hidden] {
  display: none;
}

.hero__scene[data-state='out'] {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

.hero__scene[data-state='in'] {
  opacity: 1;
  transform: none;
}

.hero__pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.25rem;
  justify-content: center;
}

.hero__dot-btn {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--hairline-strong);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.hero__dot-btn[aria-current='true'] {
  background: var(--crimson);
  transform: scale(1.4);
}

/* -------------------------------------------------------------------------
   7. Cards and feature rows
   ------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
}

.card__title {
  font-size: var(--step-h3);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.card__text {
  margin-top: 0.6rem;
  color: var(--ink-soft);
  font-size: var(--step-small);
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 0.6rem + 1.2vw, 1.5rem);
  margin-top: clamp(2rem, 1.4rem + 2vw, 3rem);
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1.4rem;
  border-top: 2px solid var(--ink);
}

.feature__title {
  font-size: var(--step-h3);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.feature__text {
  color: var(--ink-soft);
  font-size: var(--step-small);
  line-height: 1.6;
}

.feature__glyph {
  width: 2.6rem;
  height: 2.6rem;
  color: var(--ink);
}

/* -------------------------------------------------------------------------
   8. Dark plate sections
   ------------------------------------------------------------------------- */

.plate {
  background: var(--soot);
  color: var(--white);
}

.plate .section-lead,
.plate .card__text,
.plate .feature__text {
  color: var(--ink-on-dark);
}

.plate .eyebrow {
  color: var(--sage);
}

.plate .feature {
  border-top-color: var(--sage);
}

.plate .card {
  background: var(--bark);
  border-color: var(--hairline-on-dark);
}

/* -------------------------------------------------------------------------
   9. Community strip (deliberately lighter in weight)
   ------------------------------------------------------------------------- */

.strip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.strip-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.35rem;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-card);
  transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.strip-card:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.strip-card__title {
  font-size: 1.05rem;
  font-weight: 800;
}

.strip-card__text {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.55;
  flex: 1;
}

.strip-card__cta {
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.strip-card__cta::after {
  content: '→';
  color: var(--crimson);
}

/* -------------------------------------------------------------------------
   10. Testimonial - the torn sheet from the Figma brand page
   ------------------------------------------------------------------------- */

.quote-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  align-items: center;
}

.quote-sheet {
  position: relative;
  background: var(--white);
  padding: clamp(2rem, 1.4rem + 2vw, 3.25rem);
  /* Torn paper edge, drawn rather than imported, so it keeps vector crispness
     at any width. */
  clip-path: polygon(
    0% 2%, 4% 0.4%, 9% 2.2%, 15% 0.6%, 22% 2.4%, 29% 0.8%, 36% 2.6%, 44% 1%,
    52% 2.8%, 60% 1.2%, 68% 2.6%, 76% 0.9%, 84% 2.5%, 92% 1%, 97% 2.4%, 100% 1.4%,
    99.2% 8%, 100% 16%, 98.8% 26%, 100% 36%, 99% 46%, 100% 56%, 98.9% 66%,
    100% 76%, 99.1% 86%, 100% 96%,
    96% 98.4%, 89% 100%, 81% 97.8%, 73% 99.6%, 65% 97.6%, 57% 99.4%, 48% 97.5%,
    40% 99.3%, 32% 97.4%, 24% 99.2%, 16% 97.6%, 8% 99.4%, 2% 97.8%, 0% 99%,
    0.9% 90%, 0% 80%, 1.1% 70%, 0% 60%, 1% 50%, 0% 40%, 1.1% 30%, 0% 20%, 0.9% 10%
  );
}

.quote-sheet__mark {
  font-size: 2.6rem;
  line-height: 1;
  color: var(--crimson);
  font-weight: 900;
}

.quote-sheet__text {
  margin-top: 0.75rem;
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.55rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.quote-sheet__who {
  margin-top: 1.5rem;
  font-weight: 800;
}

.quote-sheet__context {
  margin-top: 0.3rem;
  font-size: var(--step-small);
  color: var(--ink-soft);
  max-width: 44ch;
}

/* -------------------------------------------------------------------------
   11. Pricing note
   ------------------------------------------------------------------------- */

.free-block {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 1.4rem + 3vw, 3.5rem);
  background: var(--sage);
  border-radius: var(--radius-block);
}

.free-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.free-block .section-lead {
  color: rgba(29, 29, 29, 0.78);
}

.free-block__aside {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.free-fact {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-chip);
  font-size: var(--step-small);
  line-height: 1.5;
}

.free-fact__key {
  font-weight: 800;
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   12. FAQ
   ------------------------------------------------------------------------- */

.faq {
  margin-top: 2.5rem;
  border-top: 1px solid var(--hairline-strong);
}

.faq__item {
  border-bottom: 1px solid var(--hairline-strong);
}

.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 0;
  background: none;
  border: 0;
  text-align: left;
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.faq__sign {
  position: relative;
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
}

.faq__sign::before,
.faq__sign::after {
  content: '';
  position: absolute;
  inset: 50% 0 auto 0;
  height: 2px;
  background: var(--crimson);
  transform: translateY(-50%);
  transition: transform var(--t-mid) var(--ease);
}

.faq__sign::after {
  transform: translateY(-50%) rotate(90deg);
}

.faq__q[aria-expanded='true'] .faq__sign::after {
  transform: translateY(-50%) rotate(0deg);
}

.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-mid) var(--ease);
}

.faq__a[data-open='true'] {
  grid-template-rows: 1fr;
}

.faq__a > div {
  overflow: hidden;
}

.faq__a p {
  padding-bottom: 1.5rem;
  max-width: 62ch;
  color: var(--ink-soft);
}

/* -------------------------------------------------------------------------
   13. Closing call to action
   ------------------------------------------------------------------------- */

.closing {
  position: relative;
  background: var(--soot);
  color: var(--white);
  overflow: hidden;
}

.closing__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  align-items: end;
}

.closing h2 {
  font-size: var(--step-h2);
}

.closing p {
  margin-top: 1.1rem;
  color: var(--ink-on-dark);
  font-size: var(--step-lead);
  max-width: 44ch;
}

.closing__cut {
  position: absolute;
  right: 6%;
  bottom: -6%;
  width: min(240px, 20%);
  height: 86%;
  color: #fff;
  opacity: 0.11;
  pointer-events: none;
}

/* -------------------------------------------------------------------------
   14. Footer
   ------------------------------------------------------------------------- */

.site-footer {
  background: var(--bark);
  color: var(--white);
  padding-block: clamp(3rem, 2rem + 3vw, 4.5rem) 2.5rem;
}

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 1rem + 2vw, 3rem);
}

.site-footer__brand img {
  width: 150px;
  filter: invert(1);
}

.site-footer__tagline {
  margin-top: 1rem;
  color: var(--ink-on-dark);
  font-size: var(--step-small);
  max-width: 28ch;
  border-left: 3px solid var(--crimson);
  padding-left: 0.9rem;
}

.site-footer__group-title {
  font-size: var(--step-label);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1rem;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: var(--step-small);
}

.site-footer__links a {
  color: var(--ink-on-dark);
  transition: color var(--t-fast) var(--ease);
}

.site-footer__links a:hover {
  color: var(--white);
}

.site-footer__bottom {
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline-on-dark);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--ink-on-dark);
}

/* -------------------------------------------------------------------------
   15. Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 1040px) {
  .quote-wrap,
  .free-block,
  .closing__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .closing__inner {
    align-items: start;
  }

  .strip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__headline {
    letter-spacing: -0.028em;
  }

  .btn {
    flex: 1 1 auto;
  }

  /* On a phone the wide stage would squash the illustration into a strip. */
  .hero__stage {
    aspect-ratio: 5 / 4;
  }
}

@media (max-width: 520px) {
  .strip-grid,
  .site-footer__top {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* -------------------------------------------------------------------------
   16. Reduced motion
   ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* -------------------------------------------------------------------------
   17. Motion inside the hero illustrations
   Each loop shows the thing the phrase names doing its one job: a token
   breathing on a map, a poll bar filling, a branch being drawn.
   The reduced-motion block above switches all of this off.
   ------------------------------------------------------------------------- */

@keyframes hero-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.22); opacity: 0.55; }
}

@keyframes hero-grow {
  0% { transform: scaleX(0.35); }
  55%, 100% { transform: scaleX(1); }
}

@keyframes hero-draw {
  0% { stroke-dashoffset: 120; }
  60%, 100% { stroke-dashoffset: 0; }
}

@keyframes hero-caret {
  0%, 45% { opacity: 1; }
  50%, 95% { opacity: 0; }
  100% { opacity: 1; }
}

.hero-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: hero-pulse 2.6s var(--ease) infinite;
}

.hero-grow {
  transform-box: fill-box;
  transform-origin: left center;
  animation: hero-grow 3.4s var(--ease) infinite;
}

.hero-grow--late {
  animation-delay: 0.45s;
}

.hero-draw {
  stroke-dasharray: 120;
  animation: hero-draw 3.6s var(--ease) infinite;
}

.hero-caret {
  animation: hero-caret 1.1s steps(1, end) infinite;
}

/* ScrollSmoother keeps the page inside a transformed wrapper, so the fixed
   header needs the content pushed down by its own height. */
#smooth-content {
  padding-top: var(--header-h);
}

/* -------------------------------------------------------------------------
   18. Field: grain and aurora
   Flat colour is what makes a page look printed from a template. A press
   grain over everything and a slow wash of the brand colours behind the
   fold give the field some air without adding a single new hue.
   ------------------------------------------------------------------------- */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.26;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.hero {
  position: relative;
  isolation: isolate;
  /* The two washes are wider than a phone. `clip` trims them without making a
     scroll container, so the floating cards keep their vertical overhang and
     the perspective on the frame still works. */
  overflow-x: clip;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}

.hero::before {
  width: 46rem;
  height: 30rem;
  top: -8rem;
  left: 50%;
  transform: translateX(-62%);
  background: radial-gradient(circle, rgba(180, 185, 76, 0.22) 0%, transparent 70%);
}

.hero::after {
  width: 38rem;
  height: 26rem;
  top: 2rem;
  left: 50%;
  transform: translateX(-4%);
  background: radial-gradient(circle, rgba(185, 76, 76, 0.15) 0%, transparent 70%);
}

/* The workspace runs wider than the text column and past the gutters, the way
   the product shot does on the pages this is measured against. */
.hero__media {
  max-width: min(1480px, 95vw);
}

@media (max-width: 760px) {
  .hero::before,
  .hero::after {
    width: 24rem;
    height: 18rem;
    filter: blur(60px);
  }
}

/* The header keeps both pieces on one line on a phone by shrinking, not by
   letting the button run off the edge. */
@media (max-width: 560px) {
  :root {
    --header-h: 3.9rem;
  }

  .site-header__inner {
    min-height: 3.9rem;
    gap: 0.6rem;
  }

  .wordmark img {
    width: 108px;
  }

  .site-header .btn {
    min-height: 2.3rem;
    padding: 0 0.85rem;
    font-size: 0.76rem;
    flex: none;
  }
}
