/* Barcify — design system
   Identity: document/credential tooling · warm paper · ink chrome · signal accent
   Not a template: hairline structure, mono data labels, restrained motion */

:root {
  /* color */
  --paper: #f4f3ef;
  --surface: #ffffff;
  --ink: #12151a;
  --ink-2: #1c1f27;
  --text: #16181d;
  --muted: #5f636d;
  --faint: #8b8f98;
  --line: #e2e0d8;
  --line-strong: #c9c6bb;
  --accent: #0f6b68;
  --accent-hover: #0a5451;
  --accent-soft: #e4efee;
  --signal: #c2410c;
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --on-ink: #f5f4f0;
  --on-ink-muted: #9a9da6;

  /* type */
  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* geometry — sharp, technical */
  --r: 3px;
  --r-lg: 4px;
  --shadow-none: none;

  /* layout */
  --max: 1120px;
  --topbar-h: 52px;
  --ease: 120ms ease;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

code, .mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Top bar ─── */
.topbar {
  background: var(--ink);
  color: var(--on-ink);
  padding: 0 24px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid #000;
}

.brand {
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { color: #fff; }
.brand .word { font-weight: 650; }
.brand .word i {
  font-style: normal;
  color: #69c6bc; /* teal echo of accent on dark */
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: var(--r);
  display: block;
  flex-shrink: 0;
}
.brand-tag {
  display: none;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--on-ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-left: 12px;
  border-left: 1px solid #2e323b;
  margin-left: 4px;
}
@media (min-width: 760px) { .brand-tag { display: inline; } }

.topnav {
  display: flex;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
}
.topnav a {
  color: #a8abb3;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 550;
  padding: 6px 11px;
  border-radius: var(--r);
  transition: color var(--ease), background var(--ease);
}
.topnav a:hover { color: #fff; background: #1e2129; }
.topnav a.on {
  color: #fff;
  background: #252933;
  box-shadow: inset 0 -2px 0 #7dd3c8;
}

.top-right {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-ink-muted);
  flex-shrink: 0;
}

/* ─── Signed-in controls: balance, buy, name, sign out ───
   These live in the top bar on every page, so they are defined here rather
   than inline in auth.js — that is what lets the narrow-screen rules below
   win without !important. */
.top-right.auth-on {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.auth-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-credits {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: #c5c8cf;
  text-decoration: none;
  border: 1px solid #33373f;
  border-radius: var(--r);
  padding: 4px 9px;
  line-height: 1.4;
  white-space: nowrap;
}
.nav-credits:hover { color: #fff; border-color: #4a4f5a; }
.nav-credits .lbl { color: #7d8290; }
.nav-credits[data-low] .lbl { color: #7d8290; }

.nav-buy {
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #0f1a19;
  background: #7dd3c8;
  border: 1px solid #7dd3c8;
  border-radius: var(--r);
  padding: 4px 9px;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  transition: background var(--ease);
}
.nav-buy:hover { background: #9adfd6; color: #0f1a19; }
.nav-buy .short { display: none; }

.auth-name {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: #c5c8cf;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.auth-name:hover { color: #fff; }

.auth-out {
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: transparent;
  color: #7dd3c8;
  border: 1px solid #33373f;
  border-radius: var(--r);
  padding: 4px 9px;
  cursor: pointer;
  line-height: 1.4;
}
.auth-out:hover { border-color: #4a4f5a; }

/* Narrow screens: brand and controls share the first row, the nav drops to a
   second row and scrolls sideways instead of wrapping into a column. */
@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    flex-wrap: wrap;
    padding: 8px 14px;
    row-gap: 6px;
    column-gap: 12px;
  }
  .brand { order: 1; }
  .top-right.auth-on { order: 2; margin-left: auto; }
  .topnav {
    order: 3;
    flex-basis: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 5px 8px; font-size: 0.8rem; white-space: nowrap; }
  .auth-name { display: none; }
}

@media (max-width: 480px) {
  .nav-credits .lbl { display: none; }
  .nav-buy .full { display: none; }
  .nav-buy .short { display: inline; }
  .top-right.auth-on { gap: 9px; }
  .auth-left { gap: 7px; }
}

/* ─── Page shell ─── */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 24px 56px;
}
.wrap.tight { padding-top: 28px; }

/* ─── Hero (editorial, not gradient blob) ─── */
.hero {
  background: var(--ink);
  color: var(--on-ink);
  padding: 48px 24px 52px;
  border-bottom: 1px solid #000;
  position: relative;
  overflow: hidden;
}
.hero::after {
  /* intentional barcode motif — structural, not decorative floating junk */
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(38%, 420px);
  opacity: 0.07;
  background-image: repeating-linear-gradient(
    90deg,
    #fff 0 3px,
    transparent 3px 7px,
    #fff 7px 8px,
    transparent 8px 14px,
    #fff 14px 19px,
    transparent 19px 22px
  );
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: grid;
  gap: 28px;
}
@media (min-width: 880px) {
  .hero-inner {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: end;
    gap: 48px;
  }
  .hero.center-only .hero-inner { grid-template-columns: 1fr; max-width: 720px; text-align: left; }
}

.hero-kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7dd3c8;
  margin: 0 0 14px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: #fff;
  max-width: 18ch;
}
.hero h1 .fy { color: #7dd3c8; }
.hero.center-only h1 { max-width: none; }

.hero p {
  margin: 0;
  max-width: 42rem;
  font-size: 1.02rem;
  line-height: 1.6;
  color: #b8bbc3;
}
.hero p strong { color: #e8e6e0; font-weight: 600; }

.hero-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--r);
  display: block;
  margin-bottom: 20px;
  border: 1px solid #2e323b;
}

.hero .cta-row {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-aside {
  border: 1px solid #2e323b;
  background: #181b22;
  padding: 18px 20px;
  border-radius: var(--r);
}
.hero-aside h2 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-ink-muted);
}
.hero-aside dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 0.84rem;
}
.hero-aside dt {
  font-family: var(--mono);
  color: #7dd3c8;
  font-size: 0.78rem;
}
.hero-aside dd { margin: 0; color: #c5c8cf; }

/* Generator hero — compact */
.hero.compact { padding: 28px 24px 30px; }
.hero.compact h1 {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  max-width: none;
  margin-bottom: 8px;
}
.hero.compact p { font-size: 0.92rem; max-width: 52rem; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
  line-height: 1.2;
}
.btn-primary {
  background: #7dd3c8;
  color: #0a2e31;
  border-color: #7dd3c8;
}
.btn-primary:hover { background: #9ae0d8; color: #0a2e31; }

.btn-ghost {
  background: transparent;
  color: #e8e6e0;
  border-color: #3a3f4a;
}
.btn-ghost:hover { background: #1e2129; color: #fff; border-color: #4a5060; }

.btn-blue {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-blue:hover { background: var(--ink-2); color: #fff; }

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--ink); }

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-none);
  overflow: hidden;
}
.card-h {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 650;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fafaf8;
  color: var(--ink);
}
.card-b { padding: 20px 18px 22px; }

/* ─── Section labels (form + page) ─── */
.section-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 22px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.section-label:first-child { margin-top: 0; }
.section-label span {
  font-weight: 450;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.78rem;
}

/* ─── Grids ─── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Feature cells — hairline grid, not floating shadow cards */
.feature {
  background: var(--surface);
  padding: 22px 20px 24px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}
.feature .icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature .icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}
.feature code {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0 4px;
  border-radius: 2px;
  font-size: 0.8em;
}

/* ─── Steps (how it works) ─── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.steps > div {
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}
.steps > div:last-child { border-right: none; }
.steps .step-n {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.steps h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.steps p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps > div {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .steps > div:last-child { border-bottom: none; }
}

/* ─── States directory ─── */
.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.state-tile {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 14px 12px;
  color: var(--text);
  transition: background var(--ease);
  min-height: 92px;
}
.state-tile:hover,
.state-tile:focus-visible {
  background: var(--accent-soft);
  color: var(--text);
}
.state-tile .code {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--line-strong);
  padding: 1px 6px;
  border-radius: 2px;
  margin-bottom: 8px;
}
.state-tile:hover .code { border-color: var(--accent); }
.state-tile .name {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.3;
}
.state-tile .meta {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* ─── Notice / legal ─── */
.notice {
  background: var(--warn-soft);
  border: 1px solid #f0e0b0;
  border-left: 3px solid var(--warn);
  color: #6b4a12;
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 0.84rem;
  line-height: 1.5;
  margin: 0;
}
.notice b { color: #4a3208; }

/* ─── Help / prose ─── */
.help h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.help p,
.help li {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.55;
}
.help p:last-child,
.help li:last-child { margin-bottom: 0; }
.help ul, .help ol {
  margin: 0;
  padding-left: 1.15rem;
}
.help li + li { margin-top: 6px; }
.help a { font-weight: 600; }

/* ─── Tables ─── */
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  background: var(--surface);
}
.ref-table th,
.ref-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.ref-table th {
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.ref-table td:first-child {
  font-family: var(--mono);
  white-space: nowrap;
  color: var(--ink);
  font-weight: 500;
}
.ref-table tbody tr:nth-child(even) td { background: #fafaf8; }

/* ─── Footer ─── */
footer {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0;
}
.footer-brand .brand-mark { width: 24px; height: 24px; }
.footer-brand .word i { font-style: normal; color: var(--accent); }
.footer-meta {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--faint);
  max-width: 36rem;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.82rem;
}
.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
}
.footer-nav a:hover { color: var(--accent); text-decoration: underline; }
.footer-legal {
  width: 100%;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  text-transform: uppercase;
}

/* ─── Utilities ─── */
.muted { color: var(--muted); }
.mt { margin-top: 20px; }
.center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Icon button (calculator etc.) — shared with generator */
.calc-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Page title blocks inside content */
.page-head {
  margin-bottom: 28px;
  max-width: 40rem;
}
.page-head h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Inline code block */
.code-block {
  font-family: var(--mono);
  background: var(--ink);
  color: #a7f3d0;
  padding: 14px 16px;
  border-radius: var(--r);
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.55;
  border: 1px solid #000;
  margin: 0;
}

/* Section spacing on marketing pages */
.section + .section { margin-top: 32px; }

/* Motion — restrained */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ─── Access chip: keep sign-out reachable on small screens ───
   The cap belongs on the name, not on every span in the cluster. `.auth-left`
   is a span too, so `span { max-width: 84px }` capped the whole credits+buy
   group at 84px while its children could not shrink (they are nowrap) — the
   Buy button then spilled 8px into the Sign out button on a 360px phone. */
@media (max-width: 640px) {
  .auth-name { max-width: 84px; }
}

/* ─── Splash / entry screen ───────────────────────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--ink);
  background-image:
    radial-gradient(60% 50% at 50% 46%, rgba(15, 107, 104, 0.30) 0%, rgba(15, 107, 104, 0) 70%),
    linear-gradient(180deg, #12151a 0%, #0c0e12 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms ease, visibility 420ms ease;
}
.splash.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* skip flag set before first paint on repeat visits */
.bc-splash-skip .splash { display: none !important; }

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

/* the mark: two full turns, decelerating to rest upright */
.splash-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  transform-origin: 50% 50%;
  will-change: transform;
  animation: splash-spin 2.35s cubic-bezier(0.16, 0.84, 0.24, 1) forwards;
}
.splash-mark img {
  width: 100%;
  height: 100%;
  display: block;
}
@keyframes splash-spin {
  0%   { transform: rotate(0deg) scale(0.86); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: rotate(720deg) scale(1); opacity: 1; }
}

.splash-word {
  margin-top: 26px;
  font-family: var(--font);
  font-size: 1.22rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--on-ink);
  opacity: 0;
  animation: splash-rise 620ms cubic-bezier(0.2, 0.7, 0.2, 1) 780ms forwards;
}
.splash-word i { font-style: italic; color: #7dd3c8; }

.splash-tag {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-ink-muted);
  opacity: 0;
  animation: splash-rise 620ms cubic-bezier(0.2, 0.7, 0.2, 1) 980ms forwards;
}
@keyframes splash-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.splash-bar {
  margin-top: 30px;
  width: 132px;
  height: 2px;
  background: rgba(245, 244, 240, 0.14);
  border-radius: 2px;
  overflow: hidden;
}
.splash-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: #7dd3c8;
  transform-origin: 0 50%;
  transform: scaleX(0);
  animation: splash-progress 2.35s cubic-bezier(0.35, 0.1, 0.25, 1) forwards;
}
@keyframes splash-progress {
  0%   { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .splash-mark { animation: none; opacity: 1; transform: none; }
  .splash-word, .splash-tag { animation: none; opacity: 1; }
  .splash-bar i { animation-duration: 0.4s; }
}

/* ─── Page gradient (replaces flat paper background) ─── */
html { background: #eef1ec; }
body {
  background-color: #eef1ec;
  background-image:
    radial-gradient(1100px 620px at 12% -8%, rgba(105, 198, 188, 0.38), transparent 62%),
    radial-gradient(900px 560px at 100% 110%, rgba(15, 107, 104, 0.20), transparent 60%),
    linear-gradient(165deg, #e3f0ec 0%, #f1f3ee 42%, #f4f2ec 68%, #e7ece6 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
}

/* ─── Legal / prose pages ─────────────────────────────────────────── */
.doc {
  max-width: 46rem;
  color: var(--ink-2, #2b2f36);
  font-size: 0.95rem;
  line-height: 1.72;
}
.doc h2 {
  margin: 34px 0 10px;
  padding-top: 18px;
  border-top: 1px solid #e2e0d9;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.doc h2:first-of-type { margin-top: 8px; border-top: 0; padding-top: 0; }
.doc h2 .num {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent);
  margin-right: 10px;
  letter-spacing: 0.06em;
}
.doc h3 { margin: 22px 0 6px; font-size: 0.92rem; font-weight: 650; color: var(--ink); }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 14px; padding-left: 20px; }
.doc li { margin: 0 0 7px; }
.doc li::marker { color: #9aa0aa; }
.doc strong { font-weight: 650; color: var(--ink); }
.doc a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.doc code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: #ecebe6;
  border-radius: 4px;
  padding: 1px 5px;
}
.doc .doc-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7c828c;
  margin: 0 0 26px;
}
.doc .rule-note {
  background: #f7f6f2;
  border: 1px solid #e4e2db;
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
  padding: 14px 16px;
  margin: 0 0 18px;
}
.doc .rule-note p:last-child { margin-bottom: 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 0.88rem; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e6e4dd; vertical-align: top; }
.doc th { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.07em; text-transform: uppercase; color: #6d737d; font-weight: 500; }
.doc-footer-nav {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid #e2e0d9;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.86rem;
}
.doc-footer-nav a { color: var(--accent); text-decoration: none; font-weight: 600; }
.doc-footer-nav a:hover { text-decoration: underline; }
.footer-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.auth-consent {
  margin: 12px 0 0;
  font-size: 0.72rem;
  line-height: 1.55;
  color: #6d737d;
}
.auth-consent a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Public document pages (terms, privacy, 404) keep the footer at the bottom
   even when the content is shorter than the viewport. */
.page-doc { display: flex; flex-direction: column; min-height: 100vh; }
.page-doc > main { flex: 1 0 auto; }

/* ── accessibility: skip link ─────────────────────────────────────────── */
.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;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--ink); color: var(--on-ink);
  padding: 10px 14px; border-radius: var(--r);
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
  transition: top var(--ease);
}
.skip-link:focus { top: 8px; color: #fff; }
main:focus { outline: none; }

/* ── cookie consent ───────────────────────────────────────────────────── */
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: var(--ink); color: var(--on-ink);
  border-top: 1px solid #2a2e38;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 30px rgba(10, 12, 16, 0.18);
}
.cookie-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; gap: 18px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
}
.cookie-text {
  margin: 0; font-size: 0.82rem; line-height: 1.5; color: #d8d6cf; max-width: 62ch;
}
.cookie-text strong { color: #fff; font-weight: 650; }
.cookie-text a { color: #7dd3c8; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-btn { padding: 8px 14px; font-size: 0.78rem; }
.cookie-bar .btn-outline { color: var(--on-ink); border-color: #3a3f4a; background: transparent; }
.cookie-bar .btn-outline:hover { border-color: #6b7280; color: #fff; }

/* ── sticky mobile call to action ─────────────────────────────────────── */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  transform: translateY(110%);
  transition: transform 180ms ease;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(244, 243, 239, 0.97);
  border-top: 1px solid var(--line-strong);
  backdrop-filter: none;
}
.sticky-cta.show { transform: translateY(0); }
.sticky-cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: var(--max); margin: 0 auto;
}
.sticky-cta-label {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.sticky-cta .btn { padding: 10px 16px; font-size: 0.82rem; white-space: nowrap; }
body.page-marketing { padding-bottom: 0; }
@media (max-width: 760px) {
  .cookie-inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sticky-cta { transition: none; }
}

/* ── payment confirmation ─────────────────────────────────────────────── */
.confirm-card {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--ok);
  background: var(--surface);
  padding: 18px 20px;
  margin: 0 0 20px;
  max-width: 640px;
}
.confirm-card[hidden] { display: none; }
.confirm-kicker {
  margin: 0 0 6px; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--ok);
}
.confirm-card h2 { margin: 0 0 8px; font-size: 1.15rem; color: var(--ink); }
.confirm-line { margin: 0 0 4px; font-size: 0.92rem; }
.confirm-ref { margin: 0 0 14px; font-size: 0.78rem; color: var(--muted); }
.confirm-ref code { font-family: var(--mono); font-size: 0.76rem; }
.confirm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
