/* ============================================================================
   0x888 · template kit v1
   Shared foundation for the demo templates. No brand of its own: every page
   redefines the tokens below. Only structure, rhythm, states and motion here.
   ========================================================================== */

/* ── Tokens (neutral defaults, always overridden per page) ───────────────── */
:root {
  --bg: oklch(97% 0.01 90);
  --bg-2: oklch(93% 0.012 90);
  --ink: oklch(18% 0.02 90);
  --ink-soft: oklch(42% 0.015 90);
  --line: oklch(18% 0.02 90 / 0.14);
  --accent: oklch(55% 0.19 30);
  --accent-ink: oklch(98% 0.01 30);
  --accent-2: oklch(45% 0.12 220);
  --ok: oklch(55% 0.14 150);
  --warn: oklch(70% 0.15 75);
  --err: oklch(55% 0.2 25);

  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-text: 'Golos Text', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --gutter: clamp(18px, 4.4vw, 44px);
  --maxw: 1280px;
  --radius: 4px;
  --radius-lg: 10px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.33, 1, .68, 1);

  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-base: clamp(1rem, .97rem + .16vw, 1.0625rem);
  --fs-lg: clamp(1.125rem, 1.05rem + .34vw, 1.25rem);
  --fs-xl: clamp(1.3rem, 1.15rem + .7vw, 1.625rem);
  --fs-2xl: clamp(1.65rem, 1.35rem + 1.4vw, 2.4rem);
  --fs-3xl: clamp(2.1rem, 1.55rem + 2.5vw, 3.5rem);
  --fs-4xl: clamp(2.6rem, 1.6rem + 4.2vw, 5.2rem);
  --fs-hero: clamp(2.75rem, 1.4rem + 6.4vw, 7rem);

  --sec-y: clamp(64px, 8.5vw, 132px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-base);
  line-height: 1.55;
  letter-spacing: -.005em;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--sec-y); }
.section--tight { padding-block: clamp(48px, 6vw, 88px); }
.rule { height: 1px; background: var(--line); border: 0; }

/* ── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.025em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); line-height: 1.12; }
h4 { font-size: var(--fs-lg); line-height: 1.2; }
p { text-wrap: pretty; }
p + p { margin-top: .8em; }
strong, b { font-weight: 600; }
em { font-style: italic; }
sub, sup { font-size: .7em; }
small { font-size: var(--fs-sm); }

.lead {
  font-size: var(--fs-lg);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 52ch;
}
.measure { max-width: 62ch; }
.measure-narrow { max-width: 46ch; }

/* House label: the one recurring device of the whole template family. */
.label {
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ── Links & buttons ────────────────────────────────────────────────────── */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 48px;
  padding: 0 1.4em;
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-text);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: transform .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease), opacity .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); opacity: .88; }
.btn--accent { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); }
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--bg); box-shadow: none; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; pointer-events: none; }
.btn .spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-arrow {
  display: inline-flex; align-items: center; gap: .4em;
  font-weight: 600;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: gap .2s var(--ease), opacity .2s var(--ease);
}
.link-arrow:hover { gap: .7em; }
.link-arrow svg { width: 14px; height: 14px; flex: none; }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.site-nav.is-stuck { border-bottom-color: var(--line); }
.nav-inner {
  display: flex; align-items: center; gap: 28px;
  min-height: 68px;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem; letter-spacing: -.02em; white-space: nowrap;
}
.nav-brand svg { width: 22px; height: 22px; flex: none; }
.nav-links {
  display: flex; align-items: center; gap: 24px;
  margin-left: auto;
  font-size: .9375rem;
}
.nav-links a { color: var(--ink-soft); transition: color .15s var(--ease); }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--ink); }
.nav-links a.btn { color: var(--btn-fg); }
.nav-links a.btn:hover, .nav-links a.btn:focus-visible { color: var(--btn-fg); }
.nav-phone { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nav-toggle { display: none; width: 40px; height: 40px; margin-left: auto; place-items: center; }
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 860px) {
  .nav-toggle { display: grid; }
  .nav-links {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    margin: 0; padding: 8px var(--gutter) 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  }
  .nav-links.is-open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; }
  .nav-links a { padding: 13px 0; width: 100%; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav-cta { margin-top: 14px; width: 100%; }
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field { display: grid; gap: 7px; }
.field > label {
  font-size: .875rem; font-weight: 500; color: var(--ink-soft);
}
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in oklab, var(--ink) 34%, transparent); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}
.field .hint { font-size: .8125rem; color: var(--ink-soft); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--err); }
.field .field-error {
  display: none; font-size: .8125rem; color: var(--err);
}
.field.has-error .field-error { display: block; }
.form-note { font-size: .8125rem; color: var(--ink-soft); max-width: 46ch; }

/* ── Rows, prices, chips ────────────────────────────────────────────────── */
.price-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 6px 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.price-row dt { font-weight: 500; }
.price-row .price-note {
  grid-column: 1 / -1;
  font-size: .875rem;
  color: var(--ink-soft);
  max-width: 58ch;
  white-space: normal;
}
.price-row dd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  white-space: nowrap;
}

.chip {
  display: inline-flex; align-items: center; gap: .4em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .8125rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip--on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px 0;
  font-size: var(--fs-lg); font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--font-mono); font-size: 1.25rem;
  flex: none; transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 0 24px; max-width: 62ch; color: var(--ink-soft); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-foot {
  padding-block: clamp(48px, 6vw, 80px) 32px;
  border-top: 1px solid var(--line);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
}
.foot-grid address { font-style: normal; }
.foot-title { font-family: var(--font-display); font-size: var(--fs-xl); line-height: 1.05; }
.foot-links { display: grid; gap: 10px; font-size: .9375rem; color: var(--ink-soft); }
.foot-links a:hover { color: var(--ink); }
.foot-base {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(36px, 5vw, 64px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: .8125rem;
  color: var(--ink-soft);
}
.demo-badge {
  display: inline-flex; align-items: center; gap: .5em;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .75rem;
  color: var(--ink-soft);
}
.demo-badge b { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ── Reveal (opacity + travel only, one observer, once) ─────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity .7s var(--ease) var(--reveal-delay, 0ms),
    transform .7s var(--ease) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }
html.no-js [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* ── Small utilities ────────────────────────────────────────────────────── */
.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: fixed; top: -100px; left: 16px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--bg);
  border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }
.hide { display: none !important; }
