/* Raybits: "Precision in every byte."
   Dark-first; light theme via [data-theme="light"] (set by /js/theme.js). */

:root {
  --bg: #07080b;
  --bg-raised: #0d0f14;
  --surface: #12151c;
  --surface-2: #181c25;
  --border: #232835;
  --border-strong: #323949;
  --text: #f3f4f7;
  --text-body: #b6bbc7;
  --text-muted: #7c8394;
  --accent: #ff6a3d;
  --accent-2: #ffb347;
  --accent-ink: #120a06;
  --accent-soft: rgb(255 106 61 / .12);
  --accent-line: rgb(255 106 61 / .35);
  --ok: #3ccf8e;
  --warn: #f5b84a;
  --danger: #ff5c63;
  --grid-line: rgb(255 255 255 / .045);
  --glow: rgb(255 106 61 / .22);
  --shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 20px 40px -24px rgb(0 0 0 / .8);

  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --max: 1160px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f6f3;
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --border: #e4e1da;
  --border-strong: #d2cec5;
  --text: #121317;
  --text-body: #3c3f47;
  --text-muted: #6b6f79;
  --accent: #e2531f;
  --accent-2: #f08a1c;
  --accent-ink: #ffffff;
  --accent-soft: rgb(226 83 31 / .09);
  --accent-line: rgb(226 83 31 / .3);
  --grid-line: rgb(0 0 0 / .05);
  --glow: rgb(226 83 31 / .14);
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 16px 32px -20px rgb(0 0 0 / .18);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1em; }
code, kbd, .mono { font-family: var(--font-mono); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 32px; } }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- Header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.site-header .bar { display: flex; align-items: center; gap: 16px; height: 68px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.03em;
}
.brand svg { width: 30px; height: 30px; flex-shrink: 0; }
.brand .dot { color: var(--accent); }
.brand:hover { text-decoration: none; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  position: relative;
  color: var(--text-body); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 14px; border-radius: 999px;
  transition: color .15s ease, background-color .15s ease;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface); }
.nav .btn { margin-left: 8px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 999px;
  background: transparent; border: 1px solid var(--border); color: var(--text-body);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }

.menu-toggle { display: none; }

@media (max-width: 800px) {
  .menu-toggle { display: inline-grid; margin-left: auto; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 16px 20px;
    background: var(--bg-raised); border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: var(--radius-sm); }
  .nav .btn { margin: 8px 0 0; justify-content: center; }
  .site-header .theme-toggle { order: 2; }
}

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -10px var(--accent); }
.btn-primary:hover { box-shadow: 0 10px 30px -8px var(--accent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }

/* ---------------------------------------------------------------- Shared bits */

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--accent); letter-spacing: .02em;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.muted { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
.pill.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }

.grid-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
}
.glow {
  position: absolute; z-index: -1; pointer-events: none;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 65%);
  filter: blur(10px);
}

/* ---------------------------------------------------------------- Hero */

.hero { position: relative; isolation: isolate; overflow: hidden; padding: 72px 0 64px; }
@media (min-width: 900px) { .hero { padding: 120px 0 104px; } }
.hero .glow { top: -260px; right: -160px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 64px; } }

.hero h1 { font-size: clamp(44px, 8vw, 84px); font-weight: 700; margin-top: 20px; letter-spacing: -0.045em; }
.hero h1 .accent {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: clamp(17px, 2vw, 20px); max-width: 52ch; margin: 24px 0 0; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.caret { display: inline-block; width: .5em; height: .9em; margin-left: .08em; background: var(--accent); vertical-align: -0.04em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Terminal card */
.terminal {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow), 0 0 0 1px rgb(255 255 255 / .02);
  overflow: hidden; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75;
}
.terminal .chrome { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.terminal .chrome span { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.terminal .chrome span:first-child { background: #ff5f57; }
.terminal .chrome span:nth-child(2) { background: #febc2e; }
.terminal .chrome span:nth-child(3) { background: #28c840; }
.terminal .chrome em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-muted); }
.terminal pre { margin: 0; padding: 20px 22px 24px; white-space: pre-wrap; word-break: break-word; color: var(--text-body); }
.terminal .p { color: var(--accent); }
.terminal .c { color: var(--text-muted); }
.terminal .ok { color: var(--ok); }
.terminal .k { color: var(--accent-2); }

/* Interactive terminal (hero) */
.term { display: flex; flex-direction: column; cursor: text; }
.term-body { height: 340px; overflow-y: auto; padding: 18px 22px 14px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
@media (max-width: 600px) { .term-body { height: 300px; padding: 16px 16px 12px; } }
.term .term-out { margin: 0; padding: 0; white-space: pre-wrap; word-break: break-word; font: inherit; color: var(--text-body); }
.term-line { white-space: pre-wrap; word-break: break-word; min-height: 1.75em; }
.term .err { color: var(--danger); }
.term-link { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); }
.term-cmd {
  font: inherit; color: var(--accent-2); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--border-strong);
}
.term-cmd:hover { color: var(--accent); text-decoration-color: var(--accent); }
.term-input { display: flex; align-items: center; gap: 10px; }
.term-input input {
  flex: 1; min-width: 0; padding: 0; margin: 0;
  font: inherit; font-size: 16px; color: var(--text); caret-color: var(--accent);
  background: transparent; border: 0; outline: none;
}
@media (min-width: 600px) { .term-input input { font-size: inherit; } }
.term-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.term-chips button {
  font: 500 12.5px var(--font-mono); color: var(--text-body);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--bg-raised); border: 1px solid var(--border);
  transition: border-color .15s, color .15s;
}
.term-chips button::before { content: "$ "; color: var(--accent); }
.term-chips button:hover { border-color: var(--accent-line); color: var(--text); }
.term.is-live:focus-within { border-color: var(--accent-line); box-shadow: var(--shadow), 0 0 0 3px var(--accent-soft); }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 56px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats > div { background: var(--bg-raised); padding: 20px 22px; }
.stats strong { display: block; font-family: var(--font-display); font-size: 28px; color: var(--text); letter-spacing: -0.03em; }
.stats span { font-size: 13.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------- Sections */

.section { position: relative; padding: 72px 0; }
@media (min-width: 900px) { .section { padding: 104px 0; } }
.section.alt { background: var(--bg-raised); border-block: 1px solid var(--border); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(30px, 4.5vw, 46px); font-weight: 700; margin-top: 12px; max-width: 18ch; }
.section-head p { margin: 0; color: var(--text-muted); max-width: 46ch; }

/* Page header for inner pages */
.page-head { position: relative; isolation: isolate; overflow: hidden; padding: 72px 0 48px; border-bottom: 1px solid var(--border); }
@media (min-width: 900px) { .page-head { padding: 104px 0 64px; } }
.page-head .glow { top: -340px; left: 50%; transform: translateX(-50%); }
.page-head h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 700; margin-top: 16px; letter-spacing: -0.04em; }
.page-head .lead { font-size: 18px; max-width: 58ch; margin: 18px 0 0; }

/* ---------------------------------------------------------------- Cards */

.card-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }

.app-card {
  position: relative; display: flex; flex-direction: column; gap: 18px;
  padding: 26px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  color: inherit; text-decoration: none; overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
}
.app-card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 45%);
  opacity: 0; transition: opacity .25s ease;
}
a.app-card:hover { border-color: var(--accent-line); transform: translateY(-3px); text-decoration: none; }
a.app-card:hover::after { opacity: 1; }
.app-card .top { display: flex; align-items: center; gap: 16px; }
.app-card img { width: 64px; height: 64px; border-radius: 16px; }
.app-card h3 { font-size: 22px; font-weight: 600; }
.app-card .meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.app-card p { margin: 0; font-size: 15.5px; }
.app-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.app-card .more { font-weight: 600; font-size: 14px; color: var(--accent); }

.app-card.placeholder { border-style: dashed; background: transparent; justify-content: center; }
.app-card.placeholder .mark { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); font: 500 26px var(--font-mono); }

.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.feature {
  padding: 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.feature h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature p { margin: 0; font-size: 15px; }
.feature .num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); display: block; margin-bottom: 14px; }
.feature .icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); margin-bottom: 18px; }
.feature .icon svg { width: 20px; height: 20px; }

/* Process steps */
.steps { display: grid; gap: 16px; counter-reset: step; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.step { position: relative; padding: 24px 22px 22px; border-top: 1px solid var(--border-strong); }
.step::before { counter-increment: step; content: "0" counter(step); display: block; font-family: var(--font-mono); font-size: 13px; color: var(--accent); margin-bottom: 12px; }
.step h3 { font-size: 19px; margin-bottom: 6px; }
.step p { margin: 0; font-size: 15px; color: var(--text-muted); }

/* CTA band */
.cta {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; gap: 24px; align-items: center;
  padding: 48px 32px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
}
@media (min-width: 820px) { .cta { grid-template-columns: 1fr auto; padding: 56px 56px; } }
.cta .glow { right: -200px; top: -300px; }
.cta h2 { font-size: clamp(28px, 4vw, 40px); }
.cta p { margin: 12px 0 0; max-width: 50ch; }
.cta .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------------------------------------------------------- App detail */

.app-hero { position: relative; isolation: isolate; overflow: hidden; padding: 64px 0 56px; border-bottom: 1px solid var(--border); }
@media (min-width: 900px) { .app-hero { padding: 96px 0 72px; } }
.app-hero .glow { top: -320px; left: -200px; }
.app-hero .head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.app-hero .head img { width: 104px; height: 104px; border-radius: 26px; box-shadow: 0 20px 40px -18px rgb(0 0 0 / .6); }
.app-hero h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 700; letter-spacing: -0.04em; }
.app-hero .tagline { font-size: 18px; color: var(--text-muted); margin-top: 8px; }
.app-hero .lead { font-size: 18px; max-width: 62ch; margin-top: 28px; }
.app-hero .lead p:last-child { margin-bottom: 0; }
.app-hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.app-hero blockquote { margin: 20px 0 0; padding: 14px 18px; border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14.5px; color: var(--text-muted); }
.app-hero blockquote p { margin: 0; }

.shots { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .shots { grid-template-columns: repeat(var(--count, 3), 72%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .shots img { scroll-snap-align: start; }
}
.shots img { width: 100%; height: auto; aspect-ratio: 9 / 20; object-fit: cover; border-radius: 22px; border: 1px solid var(--border); background: var(--surface-2); }

.link-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------------------------------------------------------------- Prose (legal, about) */

.prose { max-width: 740px; }
.prose h2 { font-size: 24px; margin: 44px 0 14px; padding-top: 8px; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; }
.prose p, .prose li { color: var(--text-body); }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); }
.prose blockquote { margin: 28px 0; padding: 16px 20px; border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-muted); font-size: 15px; }
.prose blockquote p { margin: 0; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 20px; font-size: 14.5px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--surface-2); color: var(--text); font: 600 12px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.prose td { background: var(--surface); }
.prose td:first-child { width: 32%; }
.prose code { font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
@media (max-width: 560px) {
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100% !important; }
  .prose thead { display: none; }
  .prose td:first-child { border-bottom: 0; padding-bottom: 2px; }
}

.legal-layout { display: grid; gap: 40px; padding: 56px 0 96px; }
@media (min-width: 1000px) { .legal-layout { grid-template-columns: 220px 1fr; gap: 64px; } }
.legal-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 96px; align-self: start; }
.legal-nav .label { font: 500 12px var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.legal-nav a { color: var(--text-body); text-decoration: none; font-size: 14.5px; padding: 7px 12px; border-radius: var(--radius-sm); border-left: 2px solid transparent; }
.legal-nav a:hover { background: var(--surface); color: var(--text); }
.legal-nav a[aria-current="page"] { color: var(--text); border-left-color: var(--accent); background: var(--surface); }
@media (max-width: 999px) { .legal-nav { position: static; flex-direction: row; flex-wrap: wrap; } .legal-nav .label { width: 100%; } }

.meta-line { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); margin-top: 14px; }

/* ---------------------------------------------------------------- Forms */

.form { display: grid; gap: 18px; }
.form .row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form .row.two { grid-template-columns: 1fr 1fr; } }
.field label, .field .label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.field .hint { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=number], .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  font: 15px var(--font-body); color: var(--text);
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.field textarea.code { font: 13.5px/1.65 var(--font-mono); min-height: 420px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .error, .field-validation-error { display: block; color: var(--danger); font-size: 13px; margin-top: 6px; }
.input-validation-error { border-color: var(--danger) !important; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-body); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 15px; border: 1px solid; }
.alert.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert.err { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }

.contact-grid { display: grid; gap: 32px; padding: 56px 0 96px; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 1.4fr .8fr; gap: 56px; } }
.panel { padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.panel h2, .panel h3 { font-size: 20px; margin-bottom: 10px; }
.side-stack { display: grid; gap: 16px; align-content: start; }

/* ---------------------------------------------------------------- Footer */

.site-footer { border-top: 1px solid var(--border); padding: 56px 0 40px; font-size: 14.5px; background: var(--bg-raised); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-grid .about { grid-column: 1 / -1; }
@media (min-width: 820px) { .footer-grid .about { grid-column: auto; } }
.footer-grid .about p { margin: 14px 0 0; color: var(--text-muted); max-width: 34ch; }
.footer-grid h4 { font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-body); text-decoration: none; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------- Reveal on scroll */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
