/* ============================================================
   styles.css — structural styles, no hardcoded brand colors.
   Uses tokens from theme.css only.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s-5);
}

.hidden { display: none !important; }

/* ============ NAV ============ */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in oklab, var(--c-bg) 75%, transparent);
  border-bottom: 1px solid var(--c-line);
}
.nav-inner {
  display: flex; align-items: center; gap: var(--s-5);
  height: 64px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.nav-logo svg { width: 28px; height: 28px; }
.nav-links { display: flex; gap: var(--s-5); margin-left: var(--s-6); color: var(--c-text-dim); font-size: 14px; }
.nav-links a:hover { color: var(--c-text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
/* ============ HEADER SOCIALS ============ */
.nav-socials { display: inline-flex; align-items: center; gap: 6px; }
.nav-soc {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  color: var(--c-text-dim);
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.nav-soc:hover {
  color: var(--c-text);
  background: var(--c-surface-2);
  border-color: color-mix(in oklab, var(--c-line) 50%, var(--c-accent) 40%);
}
.nav-soc:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
@media (max-width: 820px) {
  .nav-socials { display: none; }
}

/* ============ LANGUAGE DROPDOWN ============ */
.lang-dd { position: relative; }
.lang-dd-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-line); border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.lang-dd-btn:hover { background: var(--c-surface-2); border-color: color-mix(in oklab, var(--c-line) 60%, var(--c-text) 10%); }
.lang-dd-btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.lang-dd-caret { font-size: 9px; opacity: .6; transition: transform .15s var(--ease); }
.lang-dd[data-open="true"] .lang-dd-caret { transform: rotate(180deg); opacity: .9; }

.lang-dd-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 64px;
  background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: 10px;
  padding: 3px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: opacity .12s var(--ease), transform .12s var(--ease);
  z-index: 50;
  list-style: none; margin: 0;
}
.lang-dd[data-open="true"] .lang-dd-menu {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.lang-dd-menu li { margin: 0; }
.lang-dd-item {
  display: block;
  padding: 6px 12px; border-radius: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--c-text-dim);
  text-decoration: none; text-align: center;
  transition: background .1s var(--ease), color .1s var(--ease);
}
.lang-dd-item:hover { background: var(--c-surface-2); color: var(--c-text); }
.lang-dd-item.is-current { color: var(--c-text); background: var(--c-surface-2); }
@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  font-weight: 500; font-size: 14px; letter-spacing: .01em;
  transition: transform .15s var(--ease), background .15s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--c-accent); color: var(--c-accent-ink); }
.btn-primary:hover { background: color-mix(in oklab, var(--c-accent) 88%, white); }
.btn-ghost { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-line); }
.btn-ghost:hover { background: var(--c-surface-2); }
.btn-lg { padding: 14px 22px; font-size: 15px; }

/* ============ HERO ============ */
.hero {
  position: relative;
  padding: calc(var(--s-8) + 24px) 0 var(--s-9);
  border-bottom: 1px solid var(--c-line);
  overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--s-8);
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase;
  color: var(--c-text-dim); letter-spacing: .1em;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--c-accent) 25%, transparent);
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--c-accent) 25%, transparent); }
  50%      { box-shadow: 0 0 0 10px color-mix(in oklab, var(--c-accent) 0%,  transparent); }
}

.h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 6.5vw, 88px);
  line-height: .98;
  letter-spacing: -.02em;
  margin: var(--s-5) 0 var(--s-5);
}
.h1 em { font-style: italic; color: var(--c-accent); }
.hero-sub {
  color: var(--c-text-dim); font-size: 18px; max-width: 52ch; margin-bottom: var(--s-6);
}
.hero-cta { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.hero-points {
  display: flex; gap: var(--s-5); margin-top: var(--s-7); flex-wrap: wrap;
  color: var(--c-text-mute); font-family: var(--font-mono); font-size: 12px;
}
.hero-points span::before { content: "▸ "; color: var(--c-accent); }

/* ---- tracer card ---- */
.tracer {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: 0 30px 60px -30px color-mix(in oklab, black 50%, transparent);
}
.tracer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 14px;
  border-bottom: 1px dashed var(--c-line);
  font-family: var(--font-mono); font-size: 11px; color: var(--c-text-dim);
  text-transform: uppercase; letter-spacing: .08em;
}
.tracer-head .dots { display: flex; gap: 6px; }
.tracer-head .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-line-2); display: block; }
.tracer-head .dots i:nth-child(2) { background: var(--c-warn); }
.tracer-head .dots i:nth-child(3) { background: var(--c-ok); }
.tracer-body { position: relative; aspect-ratio: 16/11; }
.tracer-body svg { width: 100%; height: 100%; }
.tracer-foot {
  display: flex; justify-content: space-between;
  padding: 12px 10px 4px;
  font-family: var(--font-mono); font-size: 11px; color: var(--c-text-mute);
  border-top: 1px dashed var(--c-line);
}
.tracer-foot b { color: var(--c-text); font-weight: 500; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ============ TICKER ============ */
.ticker {
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
  background: var(--c-bg-2);
  overflow: hidden; white-space: nowrap;
  font-family: var(--font-mono); font-size: 12px; color: var(--c-text-dim);
}
.ticker-track {
  display: inline-flex; gap: 48px; padding: 14px 0;
  animation: scroll 40s linear infinite;
}
.ticker-track span::before { content: "●"; color: var(--c-accent); margin-right: 10px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ============ SECTION ============ */
.section { padding: var(--s-9) 0; border-bottom: 1px solid var(--c-line); }
.section-head { margin-bottom: var(--s-7); }
.section-head .h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(32px, 4.2vw, 56px); line-height: 1.02;
  letter-spacing: -.02em; margin: var(--s-4) 0 var(--s-3);
}
.section-head p { color: var(--c-text-dim); font-size: 17px; max-width: 58ch; }

/* ============ TIMER ============ */
.timer-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s-7);
  align-items: stretch;
}
.timer-card {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-lg); padding: var(--s-6);
}
.timer-row { display: flex; justify-content: space-between; gap: var(--s-5); }
.timer-row + .timer-row { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px dashed var(--c-line); }
.timer-label { color: var(--c-text-dim); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-mono); }
.timer-val {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(36px, 5vw, 56px); line-height: 1; letter-spacing: -.02em;
  color: var(--c-text);
}
.timer-val small { font-size: 14px; color: var(--c-text-mute); margin-left: 6px; }
.timer-windows { display: flex; gap: 6px; margin-top: var(--s-5); flex-wrap: wrap; }
.timer-windows i {
  font-style: normal; font-family: var(--font-mono); font-size: 11px;
  padding: 6px 10px; border-radius: 999px; background: var(--c-surface-2); color: var(--c-text-dim);
  border: 1px solid var(--c-line);
}
.timer-windows i.hot { background: var(--c-accent); color: var(--c-accent-ink); border-color: transparent; }

.timer-chart {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  padding: var(--s-6); display: flex; min-height: 360px;
}
.timer-chart svg { width: 100%; height: 100%; display: block; }
@media (max-width: 900px) { .timer-grid { grid-template-columns: 1fr; } }

/* ============ STATS ============ */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--c-line); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden;
}
.stat {
  background: var(--c-bg); padding: var(--s-6);
  display: flex; flex-direction: column; gap: var(--s-2); min-height: 180px;
}
.stat b {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(32px, 4vw, 48px); line-height: 1; letter-spacing: -.02em;
}
.stat span { color: var(--c-text); font-size: 15px; }
.stat small { color: var(--c-text-mute); font-size: 13px; margin-top: auto; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ PROCESS ============ */
.process-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4);
}
.process-card {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-lg); padding: var(--s-6);
  display: flex; flex-direction: column; gap: var(--s-3);
  min-height: 260px; position: relative;
}
.process-card .k { font-family: var(--font-mono); font-size: 12px; color: var(--c-accent); letter-spacing: .08em; }
.process-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin: 0; letter-spacing: -.01em; }
.process-card p { color: var(--c-text-dim); font-size: 14px; margin: 0; }
.process-card::after {
  content: ""; position: absolute; right: 18px; top: 18px; width: 18px; height: 18px;
  border: 1px solid var(--c-line-2); border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--c-accent) 30%, transparent 31%);
}
@media (max-width: 960px) { .process-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .process-grid { grid-template-columns: 1fr; } }

/* ============ FORM ============ */
.form-grid {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: var(--s-7);
  align-items: start;
}
.form-side { position: sticky; top: 96px; }
.form-side ul { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: grid; gap: var(--s-2); }
.form-side li { color: var(--c-text-dim); font-size: 14px; }
.form-side li::before { content: "✓"; color: var(--c-accent); margin-right: 10px; }

.form-card {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--s-6);
}
.form-steps {
  display: flex; gap: 4px; margin-bottom: var(--s-5);
}
.form-steps i {
  flex: 1; height: 3px; border-radius: 999px; background: var(--c-line);
  transition: background .3s var(--ease);
}
.form-steps i.active { background: var(--c-accent); }
.form-step-label { font-family: var(--font-mono); font-size: 12px; color: var(--c-text-mute); margin-bottom: var(--s-4); }

.form-row { display: grid; gap: var(--s-4); }
.form-row.two { grid-template-columns: 1fr 1fr; align-items: start; }

/* Every field has exactly: 16px label + 8px gap + 44px control = 68px tall.
   Fixed, simple, no grid magic — so rows always line up. */
.form-field { display: block; min-width: 0; }

.form-field label {
  display: block;
  height: 16px; line-height: 16px;
  font-size: 11px; color: var(--c-text-mute);
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .12em;
  font-weight: 500;
  margin: 0 0 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.form-field {
  color-scheme: dark;
  accent-color: var(--c-accent);
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  background-color: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 0 14px;
  color: var(--c-text);
  font: inherit; font-size: 14px; line-height: 1.4;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.form-field textarea {
  height: auto; min-height: 96px; padding: 12px 14px; resize: vertical;
}

/* Kill native number spinners — they push layout and look awful in dark theme */
.form-field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.form-field input[type="number"]::-webkit-outer-spin-button,
.form-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* Required-field asterisk */
.form-field label .req { color: var(--c-accent); margin-left: 2px; font-weight: 600; }
.form-field.has-err label .req { color: var(--c-danger); }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--c-text-mute); opacity: .7; }
.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover { border-color: color-mix(in oklab, var(--c-line) 40%, var(--c-text-mute)); }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-accent) 22%, transparent);
  background-color: color-mix(in oklab, var(--c-bg) 60%, var(--c-surface));
}

/* Native select — strip OS styling + inline SVG chevron.
   IMPORTANT: we use background-color (not background shorthand) on :focus,
   so the chevron image isn't wiped out. */
.form-field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%239aa29f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  cursor: pointer;
}
.form-field select:focus {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2300B6F9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M1 1l5 5 5-5'/></svg>");
}
.form-field select option { background-color: var(--c-bg); color: var(--c-text); }
.form-field select.is-placeholder { color: var(--c-text-mute); }

.form-field .err { display: none; } /* legacy node, not used anymore — error shown inline in placeholder/option */
.form-field.has-err label { color: var(--c-danger); }
.form-field.has-err input,
.form-field.has-err select,
.form-field.has-err textarea { border-color: var(--c-danger); }
.form-field.has-err input::placeholder,
.form-field.has-err textarea::placeholder { color: var(--c-danger); opacity: 1; }
.form-field.has-err select.is-placeholder { color: var(--c-danger); }
.form-field.has-err input:focus,
.form-field.has-err select:focus,
.form-field.has-err textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-danger) 22%, transparent);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 8px 12px; border-radius: 999px;
  background: var(--c-bg); border: 1px solid var(--c-line);
  font-family: var(--font-mono); font-size: 12px; color: var(--c-text-dim);
  cursor: pointer; transition: all .15s var(--ease);
}
.chip:hover { color: var(--c-text); border-color: var(--c-line-2); }
.chip.on { background: var(--c-accent); color: var(--c-accent-ink); border-color: transparent; }

.form-nav { display: flex; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-5); }

/* Gap between step blocks (rows, standalone fields, checkboxes) — applied as
   grid gap so it only acts on DIRECT children of #form-body and does NOT
   leak into .form-row.two (where siblings are side-by-side columns). */
#form-body { display: grid; gap: var(--s-4); }

/* Checkbox row */
.form-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; line-height: 1.4; color: var(--c-text-dim);
  cursor: pointer; user-select: none;
}
.form-check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px;
  border: 1px solid var(--c-line); border-radius: 4px;
  background: var(--c-bg); cursor: pointer; position: relative;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.form-check input[type="checkbox"]:checked {
  background: var(--c-accent); border-color: var(--c-accent);
}
.form-check input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid var(--c-accent-ink); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.form-check.has-err input[type="checkbox"] { border-color: var(--c-danger); }
.form-check.is-required span::after {
  content: " *"; color: var(--c-accent);
}

/* File picker */
.form-files-hint {
  font-size: 12px; color: var(--c-text-mute); margin: -2px 0 10px; line-height: 1.45;
}
.form-files-add {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 13px;
}
.form-files-list {
  list-style: none; padding: 0; margin: 10px 0 0;
  display: grid; gap: 6px;
}
.form-files-empty {
  font-size: 12px; color: var(--c-text-mute); font-family: var(--font-mono);
  padding: 6px 0;
}
.form-files-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--c-bg); border: 1px solid var(--c-line);
  border-radius: var(--r-md); padding: 8px 10px;
  font-size: 13px;
}
.form-files-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-files-size { font-family: var(--font-mono); font-size: 11px; color: var(--c-text-mute); }
.form-files-rm {
  width: 22px; height: 22px; border-radius: 50%;
  background: transparent; border: 1px solid var(--c-line); color: var(--c-text-dim);
  cursor: pointer; display: grid; place-items: center; font-size: 14px; line-height: 1;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.form-files-rm:hover { border-color: var(--c-danger); color: var(--c-danger); }
.form-files-err {
  color: var(--c-danger); font-size: 12px; margin-top: 8px; font-family: var(--font-mono);
}
.form-files-err:empty { display: none; }

.form-done {
  text-align: center; padding: var(--s-7) var(--s-4);
}
.form-done .tick {
  width: 56px; height: 56px; border-radius: 50%; background: var(--c-accent); color: var(--c-accent-ink);
  display: grid; place-items: center; margin: 0 auto var(--s-4); font-size: 28px;
}
.form-done h3 { font-family: var(--font-display); font-size: 34px; margin: 0 0 var(--s-3); font-weight: 400; }
.form-done p { color: var(--c-text-dim); max-width: 44ch; margin: 0 auto var(--s-5); }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-side { position: static; }
  .form-row.two { grid-template-columns: 1fr; }
}

/* ============ SERVICES ============ */
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--c-line); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden;
}
.service {
  background: var(--c-bg); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-3);
  min-height: 220px; transition: background .2s var(--ease);
}
.service:hover { background: var(--c-surface); }
.service .tag {
  align-self: flex-start; font-family: var(--font-mono); font-size: 11px;
  padding: 3px 8px; border-radius: 4px; background: var(--c-surface-2); color: var(--c-text-dim);
}
.service h3 { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin: 0; }
.service p { color: var(--c-text-dim); font-size: 14px; margin: 0; }
.service .meta { margin-top: auto; font-family: var(--font-mono); font-size: 12px; color: var(--c-accent); }
@media (max-width: 900px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .services-grid { grid-template-columns: 1fr; } }

/* ============ CASES ============ */
.cases-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.cases-table thead th {
  text-align: left; font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .08em; color: var(--c-text-mute);
  padding: 14px 16px; border-bottom: 1px solid var(--c-line);
  font-weight: 500;
}
.cases-table tbody td {
  padding: 20px 16px; border-bottom: 1px solid var(--c-line);
}
.cases-table tbody tr { transition: background .15s var(--ease); }
.cases-table tbody tr:hover { background: var(--c-surface); }
.cases-table .y { font-family: var(--font-mono); color: var(--c-text-mute); }
.cases-table .n { font-family: var(--font-display); font-size: 20px; }
.cases-table .chain { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--c-text-mute); margin-top: 2px; }
.cases-table .c { font-family: var(--font-mono); color: var(--c-text-dim); }
.cases-table .s { font-family: var(--font-mono); font-weight: 500; }
.cases-table .r {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; color: var(--c-text-dim);
}
.cases-table .r::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c-accent); }
.cases-table .arrow { color: var(--c-text-mute); text-align: right; }
@media (max-width: 720px) {
  .cases-table .c, .cases-table thead th:nth-child(3), .cases-table thead th:nth-child(6) { display: none; }
  .cases-table tbody td:nth-child(3), .cases-table tbody td:nth-child(6) { display: none; }
}

/* ============ FAQ ============ */
.faq-list { border-top: 1px solid var(--c-line); }
.faq-item { border-bottom: 1px solid var(--c-line); }
.faq-q {
  width: 100%; text-align: left; padding: var(--s-5) 0;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  font-family: var(--font-display); font-size: 22px; letter-spacing: -.01em;
}
.faq-q .plus {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--c-line-2);
  display: grid; place-items: center; transition: transform .3s var(--ease);
  flex: 0 0 auto; color: var(--c-text-dim);
}
.faq-item.open .faq-q .plus { transform: rotate(45deg); color: var(--c-accent-ink); background: var(--c-accent); border-color: transparent; }
.faq-a {
  max-height: 0; overflow: hidden; transition: max-height .3s var(--ease);
}
.faq-a-inner { padding: 0 0 var(--s-5); color: var(--c-text-dim); max-width: 68ch; font-size: 16px; }
.faq-a-text { margin: 0 0 var(--s-3); }
.faq-more {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--c-accent); font-family: var(--font-mono);
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
}
.faq-more:hover { text-decoration: underline; }
.faq-item.open .faq-a { max-height: 500px; }

/* ============ FEATURED IN MEDIA ============ */
.section-head--center { max-width: none; text-align: center; margin: 0 auto var(--s-7); }
.section-head--center .eyebrow { color: var(--c-accent); }
.media-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5);
}
.media-grid .is-extra { display: none; }
.media-grid.is-open .is-extra { display: flex; }
.media-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  overflow: hidden;
  color: inherit;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.media-card:hover { transform: translateY(-2px); border-color: var(--c-line-2); }
.media-thumb {
  aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--c-bg); border-bottom: 1px solid var(--c-line);
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.media-card:hover .media-thumb img { transform: scale(1.03); }
.media-title {
  padding: var(--s-4) var(--s-5) var(--s-5);
  font-size: 15px; line-height: 1.35; color: var(--c-text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.media-foot { display: flex; justify-content: center; margin-top: var(--s-6); }
.media-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--c-line-2); border-radius: 999px;
  background: transparent; color: var(--c-text);
  font-family: var(--font-mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: .08em;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.media-toggle:hover { border-color: var(--c-accent); color: var(--c-accent); }
@media (max-width: 1024px) {
  .media-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .media-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
  .media-title { font-size: 14px; padding: var(--s-3) var(--s-4) var(--s-4); }
}
@media (max-width: 480px) {
  .media-grid { grid-template-columns: 1fr; }
}

/* ============ FOOTER ============ */
.footer { padding: var(--s-9) 0 var(--s-5); }
.footer-top {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s-6);
  margin-bottom: var(--s-8);
}
.footer-brand .h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(36px, 5vw, 64px); line-height: 1; margin: 0 0 var(--s-3);
  letter-spacing: -.02em;
}
.footer-brand p { color: var(--c-text-dim); max-width: 34ch; }
.footer-col h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--c-text-mute); margin: 0 0 var(--s-4); font-weight: 500; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--c-text-dim); font-size: 14px; }
.footer-col a:hover { color: var(--c-text); }
.footer-bot {
  border-top: 1px solid var(--c-line); padding-top: var(--s-5);
  display: flex; justify-content: space-between; gap: var(--s-4);
  font-family: var(--font-mono); font-size: 12px; color: var(--c-text-mute);
}
.footer-bot .status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c-ok); margin-right: 8px; vertical-align: middle; }
@media (max-width: 820px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-bot { flex-direction: column; }
}

/* ============ TWEAKS PANEL ============ */
.tweaks {
  position: fixed; right: 16px; bottom: 16px; z-index: 100;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  padding: var(--s-4); width: 260px; display: none;
  box-shadow: 0 30px 60px -20px color-mix(in oklab, black 60%, transparent);
}
.tweaks.open { display: block; }
.tweaks h4 { margin: 0 0 var(--s-3); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--c-text-dim); }
.tweaks label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 10px; }
.tweaks input[type="color"] { width: 40px; height: 28px; border: 1px solid var(--c-line); border-radius: 6px; padding: 2px; background: var(--c-bg); }
.tweaks select { background: var(--c-bg); border: 1px solid var(--c-line); border-radius: 6px; padding: 4px 8px; font-size: 12px; }

/* ============================================================
   Geist-tuned overrides (single-family, unified type)
   ============================================================ */

/* Display headings — Geist needs heavier weight than the old serif */
.h1, .h2, .section-head .h2, .footer-brand .h2,
.process-card h3, .service h3, .form-done h3,
.cases-table .n, .faq-q {
  font-weight: 500;
  letter-spacing: -0.025em;
}

/* Hero title — bigger weight for punch */
.h1 { font-weight: 600; }

/* Hero accent — replaces the old <em> italic.
   Same family, bolder + accent color. */
.h1 em, .h1 .h-accent {
  font-style: normal;
  font-weight: 700;
  color: var(--c-accent);
}

/* Footer — brand + 3 cols (was 1.4 + 3×1 grid for H2 brand, now logo is compact) */
.footer-brand .footer-tag { color: var(--c-text-dim); font-size: 15px; max-width: 30ch; margin: var(--s-3) 0 0; }
.footer-logo-link { display: inline-block; }
.footer-bot { display: flex; justify-content: space-between; align-items: center; padding-top: var(--s-5); border-top: 1px solid var(--c-line); color: var(--c-text-mute); font-family: var(--font-mono); font-size: 12px; }
.footer-bot .status::before { content: "●"; color: var(--c-ok); margin-right: 6px; }

/* Mono blocks — Geist Mono looks great a touch lighter than Inter-mono */
.tracer-head, .tracer-foot, .ticker, .form-step-label,
.form-field label, .chip, .service .tag, .service .meta,
.cases-table thead th, .cases-table .y, .cases-table .c,
.cases-table .s, .cases-table .r, .cases-table .chain,
.hero-points, .form-field .err,
.form-steps + .form-step-label {
  font-feature-settings: "tnum" 1, "ss02" 1;
}

/* ============================================================
   Footer — brand + 3 cols (admin nav_menu parent → children)
   ============================================================ */
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s-7);
  margin-bottom: var(--s-7);
  align-items: start;
}
.footer-brand img { max-height: 48px; margin-bottom: var(--s-3); }
.footer-logo-link { display: inline-block; }
.footer-brand .footer-tag {
  color: var(--c-text-dim); font-size: 15px; max-width: 32ch; margin: var(--s-2) 0 0;
}
.footer-legal {
  display: grid; gap: 4px; margin: var(--s-4) 0 0;
  font-style: normal; font-size: 13px; line-height: 1.5;
  color: var(--c-text-mute); max-width: 34ch;
}
.footer-legal-name { color: var(--c-text-dim); }
.footer-col h4 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--c-text-mute); margin: 0 0 var(--s-4);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.footer-col a,
.footer-col .footer-link {
  color: var(--c-text); text-decoration: none; font-size: 15px;
  transition: color .15s var(--ease);
}
.footer-col a:hover { color: var(--c-accent); }

.footer-link--ico {
  display: inline-flex; align-items: center; gap: 10px;
}
.footer-link-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: 0 0 26px;
  border: 1px solid var(--c-line); border-radius: 50%;
  color: var(--c-text-dim);
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.footer-link--ico:hover .footer-link-ico {
  color: var(--c-accent); border-color: var(--c-accent);
}

@media (max-width: 960px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; gap: var(--s-6); }
}

/* ============================================================
   Static page (pages/page.php) — Terms, Privacy и т.п.
   ============================================================ */
.page-article { padding-top: var(--s-6); padding-bottom: var(--s-8); }

.breadcrumbs {
  font-family: var(--font-mono); font-size: 12px; color: var(--c-text-mute);
  text-transform: uppercase; letter-spacing: .08em;
  display: flex; gap: var(--s-2); align-items: center;
  margin-bottom: var(--s-5);
}
.breadcrumbs a { color: var(--c-text-mute); text-decoration: none; }
.breadcrumbs a:hover { color: var(--c-accent); }
.breadcrumbs .sep { opacity: .4; }
.breadcrumbs [aria-current="page"] { color: var(--c-text-dim); }

.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 3.8vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 var(--s-6);
}

.page-body { font-size: 16px; line-height: 1.7; color: var(--c-text-dim); }
.page-body p { margin: 0 0 var(--s-4); }
.page-body h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.015em;
  color: var(--c-text); margin: var(--s-7) 0 var(--s-3);
}
.page-body h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 18px; color: var(--c-text); margin: var(--s-5) 0 var(--s-2);
}
.page-body a { color: var(--c-accent); text-decoration: none; }
.page-body a:hover { text-decoration: underline; }
.page-body ul, .page-body ol { padding-left: 1.4em; margin: 0 0 var(--s-4); }
.page-body li { margin-bottom: var(--s-1); }
.page-body img { max-width: 100%; height: auto; border-radius: 12px; margin: var(--s-4) 0; }
.page-body blockquote {
  border-left: 3px solid var(--c-accent);
  padding: var(--s-2) var(--s-4);
  margin: var(--s-4) 0;
  color: var(--c-text-dim);
  background: var(--c-surface);
  border-radius: 0 8px 8px 0;
}

/* ============================================================
   Blog list + single post
   ============================================================ */
.blog-list { padding-top: var(--s-6); padding-bottom: var(--s-8); }
.blog-empty { font-size: 15px; color: var(--c-text-mute); padding: var(--s-6) 0; }
.blog-cat-desc { font-size: 16px; color: var(--c-text-dim); margin: -8px 0 var(--s-6); max-width: 72ch; }

/* Category pills (above post grid) */
.cat-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: -4px 0 var(--s-6);
}
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 999px;
  color: var(--c-text-dim); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.cat-pill:hover { color: var(--c-text); border-color: color-mix(in oklab, var(--c-line) 50%, var(--c-accent) 40%); }
.cat-pill.is-current { background: var(--c-accent); color: var(--c-accent-ink); border-color: var(--c-accent); }
.cat-pill-count {
  font-family: var(--font-mono); font-size: 11px; opacity: .55;
  padding: 0 4px;
}
.cat-pill.is-current .cat-pill-count { opacity: .75; }

.post-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.post-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.post-card:hover { border-color: color-mix(in oklab, var(--c-line) 40%, var(--c-accent) 40%); transform: translateY(-2px); }
.post-card-link { display: block; color: inherit; text-decoration: none; }
.post-card-cover {
  aspect-ratio: 16 / 10; background: var(--c-surface-2);
  overflow: hidden;
}
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-cover--empty {
  background: linear-gradient(135deg, var(--c-surface) 0%, var(--c-surface-2) 100%);
}
.post-card-body { padding: var(--s-4) var(--s-4) var(--s-5); }
.post-card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: var(--s-2);
}
.post-card-cat {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: color-mix(in oklab, var(--c-surface-2) 50%, var(--c-accent) 20%);
  color: var(--c-text);
}
.post-card-date {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  color: var(--c-text-mute); text-transform: uppercase;
}
.post-card-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 18px; line-height: 1.3; letter-spacing: -0.01em;
  color: var(--c-text); margin: 0 0 var(--s-3);
}
.post-card-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: var(--s-2);
}
.post-card-tag {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--c-text-mute);
}

.pager { display: flex; gap: 6px; margin-top: var(--s-7); justify-content: center; }
.pager-btn {
  min-width: 34px; padding: 6px 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 8px;
  color: var(--c-text-dim); text-decoration: none;
  font-size: 13px; font-weight: 600;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.pager-btn:hover { color: var(--c-text); border-color: color-mix(in oklab, var(--c-line) 40%, var(--c-accent) 40%); }
.pager-btn.is-current { background: var(--c-accent); color: var(--c-accent-ink); border-color: var(--c-accent); }

/* Single post — full site width, like /terms */
.blog-post { padding-top: var(--s-6); padding-bottom: var(--s-8); }
.post-meta-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em;
  color: var(--c-text-mute); text-transform: uppercase;
  margin-bottom: var(--s-3);
}
.post-cat-chip {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: color-mix(in oklab, var(--c-surface-2) 50%, var(--c-accent) 25%);
  color: var(--c-text); text-decoration: none;
  transition: background .15s var(--ease);
}
.post-cat-chip:hover { background: var(--c-accent); color: var(--c-accent-ink); }
.post-cover {
  margin: 0 0 var(--s-6); border-radius: 14px; overflow: hidden;
  background: var(--c-surface);
  max-height: 420px;
}
.post-cover img {
  width: 100%; height: 100%; display: block;
  aspect-ratio: 21 / 9;
  max-height: 420px;
  object-fit: cover;
}

.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s-6) 0 0; }
.post-tag {
  font-family: var(--font-mono); font-size: 11px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--c-surface); border: 1px solid var(--c-line);
  color: var(--c-text-mute);
}

.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4);
  margin-top: var(--s-8); padding-top: var(--s-5);
  border-top: 1px solid var(--c-line);
}
.post-nav-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--s-4);
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 12px;
  color: inherit; text-decoration: none;
  transition: border-color .15s var(--ease);
}
.post-nav-link:hover { border-color: color-mix(in oklab, var(--c-line) 40%, var(--c-accent) 40%); }
.post-nav-next { text-align: right; }
.post-nav-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  color: var(--c-text-mute); text-transform: uppercase;
}
.post-nav-title { font-size: 14px; font-weight: 500; color: var(--c-text); }

@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }
}
