/* =========================================================================
   Wydatki — klip-apps.com
   Design system: paper / ink / leaf / mint / receipt-cream
   Fonts: Fraunces (display), Manrope (body), IBM Plex Mono (numeric + eyebrow)
   Theming: full light palette on bare :root, dark tokens redefined twice
            (prefers-color-scheme guarded + explicit [data-theme="dark"]).
   ========================================================================= */

/* ---------- Tokens: light (complete palette, bare :root) ---------- */
:root {
  color-scheme: light;

  /* raw palette */
  --paper: #f7f9f3;
  --ink: #17251b;
  --leaf: #2e7d32;
  --mint: #a9d8ac;
  --cream: #fbf7ec;

  /* semantic surfaces */
  --bg: var(--paper);
  --surface: #ffffff;
  --surface-2: #eef4ec;
  --band: var(--cream);
  --band-ink: #3d3527;

  /* text */
  --text: var(--ink);
  --text-soft: #4a5a4e;
  --text-faint: #5f6f63; /* AA on --bg at small sizes (4.8:1) */

  /* lines */
  --border: #dde5da;
  --border-strong: #c2d1bf;
  --rule: #cfdccd;

  /* brand */
  --brand: var(--leaf);
  --brand-deep: #1f5f23;
  --on-brand: #ffffff;
  --accent: var(--mint);
  --accent-surface: #e4f1e3;
  --accent-ink: #1f5f23;
  --focus: #1f5f23;

  /* receipt */
  --receipt-bg: var(--cream);
  --receipt-ink: #3d3527;
  --receipt-faint: #756b54; /* AA on --receipt-bg (4.8:1) */
  --receipt-rule: #cbbfa4;

  /* device */
  --bezel-a: #2b352d;
  --bezel-b: #0d130f;
  --bezel-edge: rgba(255, 255, 255, 0.16);
  --screen-bg: #ffffff;

  /* effects */
  --shadow-sm: 0 1px 2px rgba(23, 37, 27, 0.05), 0 2px 8px rgba(23, 37, 27, 0.05);
  --shadow-md: 0 8px 28px rgba(23, 37, 27, 0.09);
  --shadow-lg: 0 26px 60px rgba(23, 37, 27, 0.18);
  --glow: rgba(46, 125, 50, 0.12);
  --overlay: rgba(247, 249, 243, 0.86);
  --receipt-shadow: rgba(23, 37, 27, 0.16);

  /* type */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, "Times New Roman", serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  --step-0: 1.0625rem;
  --step-1: clamp(1.15rem, 0.4vw + 1.05rem, 1.3rem);
  --step-2: clamp(1.35rem, 0.8vw + 1.15rem, 1.65rem);
  --step-3: clamp(1.7rem, 1.5vw + 1.3rem, 2.3rem);
  --step-4: clamp(2.1rem, 2.6vw + 1.4rem, 3.2rem);
  --step-5: clamp(2.5rem, 4.2vw + 1.4rem, 4.4rem);

  /* layout */
  --measure: 65ch;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --maxw: 74rem;
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
}

/* ---------- Tokens: dark (system preference, unless forced light) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #101812;
    --surface: #18241b;
    --surface-2: #1e2c21;
    --band: #1a2318;
    --band-ink: #e6dcc6;

    --text: #e8f0e6;
    --text-soft: #b4c5b5;
    --text-faint: #90a492;

    --border: #2a3a2d;
    --border-strong: #3b4e3e;
    --rule: #2f4132;

    --brand: #66bb6a;
    --brand-deep: #8ed191;
    --on-brand: #0b130d;
    --accent: #335637;
    --accent-surface: #1e3222;
    --accent-ink: #b7e2b9;
    --focus: #8ed191;

    --receipt-bg: #211e17;
    --receipt-ink: #ece2cd;
    --receipt-faint: #a1957c;
    --receipt-rule: #4a4232;

    --bezel-a: #263029;
    --bezel-b: #070a08;
    --bezel-edge: rgba(255, 255, 255, 0.1);
    --screen-bg: #0d130f;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.6);
    --glow: rgba(102, 187, 106, 0.14);
    --overlay: rgba(16, 24, 18, 0.86);
    --receipt-shadow: rgba(0, 0, 0, 0.5);
  }
}

/* ---------- Tokens: dark (explicit user choice) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #101812;
  --surface: #18241b;
  --surface-2: #1e2c21;
  --band: #1a2318;
  --band-ink: #e6dcc6;

  --text: #e8f0e6;
  --text-soft: #b4c5b5;
  --text-faint: #90a492;

  --border: #2a3a2d;
  --border-strong: #3b4e3e;
  --rule: #2f4132;

  --brand: #66bb6a;
  --brand-deep: #8ed191;
  --on-brand: #0b130d;
  --accent: #335637;
  --accent-surface: #1e3222;
  --accent-ink: #b7e2b9;
  --focus: #8ed191;

  --receipt-bg: #211e17;
  --receipt-ink: #ece2cd;
  --receipt-faint: #a1957c;
  --receipt-rule: #4a4232;

  --bezel-a: #263029;
  --bezel-b: #070a08;
  --bezel-edge: rgba(255, 255, 255, 0.1);
  --screen-bg: #0d130f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.6);
  --glow: rgba(102, 187, 106, 0.14);
  --overlay: rgba(16, 24, 18, 0.86);
  --receipt-shadow: rgba(0, 0, 0, 0.5);
}

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

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

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

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand-deep);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--brand);
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0 0 0.5em;
  font-optical-sizing: auto;
  letter-spacing: -0.012em;
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

ul,
ol {
  max-width: var(--measure);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-s) 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
}

.section--tight {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.band {
  background-color: var(--band);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head p {
  color: var(--text-soft);
  font-size: var(--step-1);
  margin-bottom: 0;
}

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

h3 {
  font-size: var(--step-1);
}

/* Mono "receipt code" eyebrow */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--rule);
}

.band .eyebrow {
  color: var(--receipt-faint);
  border-bottom-color: var(--receipt-rule);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--overlay);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--text);
}

.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background-color: var(--brand);
  color: var(--on-brand);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.site-nav {
  margin-left: auto;
  display: none;
  gap: 1.4rem;
}

.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--brand);
}

/* Groups the language switch + theme toggle so they stay together at the
   right edge of the header, whether or not .site-nav is visible (it hides
   below the 62rem breakpoint, see below). Mirrors the auto-margin / fixed
   left-margin pattern .theme-toggle used to carry on its own. */
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.lang-switch a {
  color: var(--text-soft);
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--brand);
}

.lang-switch__current {
  color: var(--text);
  font-weight: 700;
}

.lang-switch__sep {
  color: var(--border-strong);
}

.theme-toggle {
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: 99px;
  cursor: pointer;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--brand);
  border-color: var(--brand);
}

@media (min-width: 62rem) {
  .site-nav {
    display: flex;
  }
  .header-actions {
    margin-left: 0.5rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% 40% 40% -20%;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  gap: clamp(2.5rem, 5vw, 3.5rem);
  align-items: center;
}

.hero h1 {
  font-size: var(--step-5);
  font-weight: 600;
  margin-bottom: 0.5em;
  font-variation-settings: "opsz" 96;
}

.hero__lead {
  font-size: var(--step-1);
  color: var(--text-soft);
  max-width: 34ch;
}

.hero__meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-top: 1.4rem;
  max-width: none;
}

.hero__visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 2rem;
}

@media (min-width: 48rem) {
  .hero__visual {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    gap: 1rem;
  }
}

@media (min-width: 62rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(2rem, 4vw, 4rem);
  }
}

/* ---------- Buttons / store badges ---------- */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.8rem;
}

.store-badge {
  display: grid;
  gap: 0.1rem;
  padding: 0.7rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 12.5rem;
  text-decoration: none;
}

.store-badge__soon {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
}

.store-badge__name {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.98rem;
}

.btn--primary {
  background-color: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background-color: var(--brand-deep);
  color: var(--on-brand);
}

.btn--ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background-color: transparent;
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ---------- Phone frame (pure CSS) ---------- */
.phone {
  position: relative;
  width: 100%;
  max-width: 264px;
  margin-inline: auto;
  padding: 9px;
  border-radius: 38px;
  background: linear-gradient(155deg, var(--bezel-a), var(--bezel-b));
  box-shadow: var(--shadow-lg);
}

.phone::before {
  /* inner bezel highlight */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--bezel-edge);
  pointer-events: none;
}

.phone::after {
  /* side button */
  content: "";
  position: absolute;
  right: -2px;
  top: 27%;
  width: 2px;
  height: 46px;
  border-radius: 2px;
  background: linear-gradient(var(--bezel-a), var(--bezel-b));
}

.phone__screen {
  display: block;
  border-radius: 30px;
  overflow: hidden;
  background-color: var(--screen-bg);
  line-height: 0;
}

.phone__screen img,
.phone__screen video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1080 / 2400;
  object-fit: cover;
  background-color: var(--screen-bg);
}

.phone--hero {
  max-width: 278px;
  transform: rotate(1.1deg);
}

.phone--video {
  max-width: 320px;
}

/* ---------- Video demo ---------- */
.video-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.video-showcase .phone__screen video {
  outline: none;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-align: center;
}

.video-meta::before,
.video-meta::after {
  content: "";
  width: 2.5rem;
  height: 1px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--rule) 0 5px,
    transparent 5px 10px
  );
}

/* ---------- Receipt (the aesthetic risk) ---------- */
/* A receipt is paper: it stays white/light in both themes. These pin the
   component's palette to fixed light values, overriding the theme-reactive
   --receipt-* tokens for this subtree only (tokens themselves are untouched,
   so .band .eyebrow elsewhere keeps following the theme as before). */
.receipt-wrap {
  --receipt-bg: #fdfcf7;
  --receipt-ink: #3d3527;
  --receipt-faint: #756b54;
  --receipt-rule: #cbbfa4;
  --receipt-shadow: rgba(20, 16, 8, 0.34);
  filter: drop-shadow(0 14px 30px var(--receipt-shadow));
  width: 100%;
  max-width: 340px;
  margin-inline: auto;
  container-type: inline-size;
}

.receipt {
  --tooth-w: 16px;
  --tooth-h: 8px;
  background-color: var(--receipt-bg);
  color: var(--receipt-ink);
  font-family: var(--font-mono);
  font-size: 0.715rem;
  line-height: 1.6;
  padding: calc(var(--tooth-h) + 1.2rem) 1.1rem calc(var(--tooth-h) + 1.2rem);
  transform: rotate(-1.4deg);
  -webkit-mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg)
      50% bottom / var(--tooth-w) var(--tooth-h) repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50%
      top / var(--tooth-w) var(--tooth-h) repeat-x,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - 2 * var(--tooth-h))
      no-repeat;
  mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg)
      50% bottom / var(--tooth-w) var(--tooth-h) repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50%
      top / var(--tooth-w) var(--tooth-h) repeat-x,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - 2 * var(--tooth-h))
      no-repeat;
}

.receipt__head {
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.receipt__sub {
  display: flex;
  justify-content: space-between;
  color: var(--receipt-faint);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.receipt__rule {
  height: 1px;
  margin: 0.7rem 0;
  background-image: repeating-linear-gradient(
    90deg,
    var(--receipt-rule) 0 5px,
    transparent 5px 10px
  );
}

.receipt__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.receipt__list li {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.receipt__list li > span:first-child {
  white-space: nowrap;
}

.receipt__dots {
  flex: 1 1 auto;
  min-width: 1.5rem;
  height: 0.7em;
  background-image: repeating-linear-gradient(
    90deg,
    var(--receipt-rule) 0 2px,
    transparent 2px 6px
  );
  background-position: 0 100%;
  background-size: 100% 1px;
  background-repeat: repeat-x;
}

.receipt__amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.receipt__total {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  font-size: 0.86rem;
}

/* second totals line ("POTEM .... subskrypcja") sits right under the first */
.receipt__total + .receipt__total {
  margin-top: 0.15rem;
}

/* closing dotted line about data ownership, below the totals */
.receipt__list--foot {
  margin-top: 0.7rem;
  letter-spacing: 0.02em;
}

.receipt__note {
  margin: 0.55rem 0 0;
  color: var(--receipt-faint);
  font-size: 0.68rem;
  line-height: 1.5;
  max-width: none;
}

.receipt__barcode {
  margin-top: 0.9rem;
  height: 26px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--receipt-ink) 0 2px,
    transparent 2px 4px,
    var(--receipt-ink) 4px 5px,
    transparent 5px 9px,
    var(--receipt-ink) 9px 12px,
    transparent 12px 14px
  );
  opacity: 0.55;
}

.receipt__code {
  text-align: center;
  color: var(--receipt-faint);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  margin-top: 0.3rem;
}

/* Between 62rem and the max layout width the receipt column is squeezed to
   ~220px. Scale the mono type with the paper itself, so no line item and no
   totals row ever spills past the torn edge.
   (Must come after the component rules above — a container query carries no
   extra specificity, so source order decides.) */
@container (max-width: 260px) {
  .receipt {
    font-size: 0.635rem;
    padding-inline: 0.85rem;
  }
  .receipt__head {
    font-size: 0.64rem;
    letter-spacing: 0.06em;
  }
  .receipt__sub,
  .receipt__note {
    font-size: 0.62rem;
  }
  .receipt__total {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }
  .receipt__dots {
    min-width: 0.8rem;
  }
  .receipt__code {
    font-size: 0.56rem;
    letter-spacing: 0.16em;
  }
}

/* narrowest the column ever gets (viewport ≈ 62rem) — extra headroom so a
   fallback mono with wider glyphs still cannot break a dotted line */
@container (max-width: 232px) {
  .receipt {
    font-size: 0.6rem;
  }
  .receipt__total {
    font-size: 0.68rem;
  }
}

/* ---------- Value strip ---------- */
.values {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

@media (min-width: 48rem) {
  .values {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.value__num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--brand);
  display: block;
  margin-bottom: 0.6rem;
}

.value h3 {
  margin-bottom: 0.35em;
}

.value p {
  color: var(--text-soft);
  margin-bottom: 0;
  font-size: 0.97rem;
}

/* ---------- Feature cards ---------- */
.features {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 40rem) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .features {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 1.5rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.card__tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background-color: var(--accent-surface);
  border-radius: 99px;
  padding: 0.2rem 0.6rem;
  display: inline-block;
  margin-bottom: 0.9rem;
}

.card h3 {
  font-size: 1.12rem;
  margin-bottom: 0.4em;
}

.card p {
  color: var(--text-soft);
  font-size: 0.94rem;
  margin-bottom: 0;
}

.card--wide {
  grid-column: span 1;
}

@media (min-width: 64rem) {
  .card--wide {
    grid-column: span 2;
  }
}

/* ---------- Gallery ---------- */
.gallery {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1.5rem;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: thin;
}

.shot {
  flex: 0 0 auto;
  width: min(72vw, 264px);
  scroll-snap-align: center;
}

.shot__caption {
  margin-top: 1rem;
  max-width: 26ch;
}

.shot__caption strong {
  display: block;
  font-size: 0.98rem;
}

.shot__caption span {
  color: var(--text-faint);
  font-size: 0.87rem;
  display: block;
  margin-top: 0.15rem;
}

.shot__os {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

@media (min-width: 64rem) {
  .gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 3rem) 1.5rem;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  .shot {
    width: 100%;
  }
}

.gallery-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  margin-top: 0.5rem;
}

@media (min-width: 64rem) {
  .gallery-hint {
    display: none;
  }
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  gap: 1.5rem;
  counter-reset: step;
}

@media (min-width: 52rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

.step {
  position: relative;
  padding-top: 2.9rem;
}

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background-color: var(--brand);
  color: var(--on-brand);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.step::after {
  content: "";
  position: absolute;
  top: 1.05rem;
  left: 2.6rem;
  right: -1.2rem;
  height: 1px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--rule) 0 6px,
    transparent 6px 12px
  );
}

.step:last-child::after {
  display: none;
}

@media (max-width: 51.99rem) {
  .step::after {
    display: none;
  }
}

.step p {
  color: var(--text-soft);
  margin-bottom: 0;
  font-size: 0.96rem;
}

/* ---------- Sheet section ---------- */
.sheet-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

@media (min-width: 56rem) {
  .sheet-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  }
}

.band h2,
.band h3,
.band p,
.band li {
  color: var(--band-ink);
}

.band .checklist li::marker {
  color: var(--brand);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.checklist li {
  position: relative;
  padding-left: 1.85rem;
  color: var(--text-soft);
  font-size: 0.97rem;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.band .checklist li {
  color: var(--band-ink);
}

/* spreadsheet tab mock */
.tabs-mock {
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  padding: 1rem;
  box-shadow: var(--shadow-md);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.tabs-mock__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

.tabs-mock__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-strong);
}

.tabs-mock__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.9rem;
}

.tabs-mock__tab {
  border: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  padding: 0.25rem 0.55rem;
  color: var(--text-soft);
  background-color: var(--surface-2);
}

.tabs-mock__tab--active {
  background-color: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}

.tabs-mock__tab--special {
  color: var(--accent-ink);
  background-color: var(--accent-surface);
  border-color: var(--accent-surface);
}

.tabs-mock__rows {
  margin-top: 1rem;
  display: grid;
  gap: 0.45rem;
}

.tabs-mock__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-soft);
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 0.35rem;
}

.tabs-mock__row span:last-child {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.tabs-mock__foot {
  margin-top: 0.8rem;
  color: var(--text-faint);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

/* ---------- FAQ ---------- */
.faq {
  display: grid;
  gap: 0.75rem;
  max-width: 52rem;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background-color: var(--surface);
  padding: 0 1.3rem;
  box-shadow: var(--shadow-sm);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 2rem 1.15rem 0;
  font-weight: 600;
  font-size: 1.02rem;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  color: var(--brand);
  font-size: 1.2rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details > p,
.faq details > ul {
  color: var(--text-soft);
  font-size: 0.96rem;
  margin-top: 0;
  padding-bottom: 1.2rem;
}

/* ---------- Final CTA ---------- */
.final-cta {
  text-align: left;
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 56rem) {
  .final-cta {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3rem;
  }
}

.final-cta h2 {
  margin-bottom: 0.3em;
}

.final-cta p {
  color: var(--text-soft);
  margin-bottom: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem 3rem;
  color: var(--text-faint);
  font-size: 0.9rem;
  background-color: var(--bg);
}

.site-footer__inner {
  display: grid;
  gap: 1.2rem;
}

@media (min-width: 48rem) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

.site-footer a {
  color: var(--text-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  margin: 0;
}

/* ---------- Legal page ---------- */
.legal-hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem);
}

.legal-hero h1 {
  font-size: var(--step-4);
  font-variation-settings: "opsz" 72;
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  max-width: none;
}

.legal-layout {
  display: grid;
  /* minmax(0, 1fr): without it an auto track is floored at the widest
     table's min-content and pushes the whole column past a 390px viewport */
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

@media (min-width: 62rem) {
  .legal-layout {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
}

.toc {
  position: static;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background-color: var(--surface);
  padding: 1.2rem 1.3rem;
  font-size: 0.9rem;
}

@media (min-width: 62rem) {
  .toc {
    position: sticky;
    top: 84px;
  }
}

.toc p {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.7rem;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  counter-reset: toc;
}

.toc a {
  color: var(--text-soft);
  text-decoration: none;
}

.toc a:hover {
  color: var(--brand);
}

.toc li::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero) " ";
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.prose {
  max-width: var(--measure);
}

.prose h2 {
  font-size: var(--step-2);
  margin-top: 2.6rem;
  scroll-margin-top: 84px;
}

.prose h2:first-of-type {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.1rem;
  margin-top: 1.8rem;
}

.prose p,
.prose li {
  color: var(--text-soft);
}

.prose strong {
  color: var(--text);
}

.prose ul {
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.prose li::marker {
  color: var(--brand);
}

.callout {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--brand);
  background-color: var(--surface);
  border-radius: var(--radius-s);
  padding: 1.1rem 1.3rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  display: block;
  margin-bottom: 0.4rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1.2rem 0 1.6rem;
}

.table-scroll {
  overflow-x: auto;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom-color: var(--border-strong);
  white-space: nowrap;
}

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .phone--hero,
  .receipt {
    transform: none;
  }
}
