/* bobble.solutions — design system. See /DESIGN.md for the source of truth on tokens. */

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono.woff2') format('woff2');
}

:root {
  --bg:         oklch(11% 0.012 235);
  --surface:    oklch(15% 0.015 235);
  --surface-2:  oklch(18% 0.018 235);
  --line:       oklch(26% 0.020 235);
  --muted:      oklch(62% 0.022 235);
  --fg:         oklch(94% 0.008 235);
  --fg-hi:      oklch(98% 0.004 235);
  --accent:     oklch(78% 0.155 230);
  --accent-dim: oklch(65% 0.135 230);
  --warn:       oklch(78% 0.150 75);
  --danger:     oklch(68% 0.190 25);
  --selection:  oklch(78% 0.155 230 / 0.25);

  --fs-xs:    0.75rem;
  --fs-sm:    0.85rem;
  --fs-base:  1rem;
  --fs-lg:    1.33rem;
  --fs-xl:    1.78rem;
  --fs-2xl:   clamp(2rem, 1.4rem + 2vw, 2.6rem);
  --fs-hero:  clamp(2.4rem, 1.6rem + 3.2vw, 3.6rem);

  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4rem;
  --s7: 6rem;
  --s8: 8rem;

  --shell-w: min(72rem, calc(100vw - 2rem));
  --prose-w: 65ch;
  --radius:  6px;

  --font-stack: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-stack);
  font-size: var(--fs-base);
  font-variation-settings: 'wght' 420;
  letter-spacing: 0.005em;
  line-height: 1.55;
  color: var(--fg);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, oklch(22% 0.04 235 / 0.55), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

::selection { background: var(--selection); color: var(--fg-hi); }

img { max-width: 100%; height: auto; display: block; }
img.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- shell ---------- */
.shell {
  width: var(--shell-w);
  margin-inline: auto;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--bg); color: var(--accent);
  border: 1px solid var(--accent); padding: var(--s1) var(--s2);
  border-radius: var(--radius);
}
.skip:focus { left: var(--s2); top: var(--s2); z-index: 99; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: oklch(11% 0.012 235 / 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
  padding: var(--s2) 0;
}
.brand {
  display: inline-flex; align-items: center; gap: var(--s1);
  color: var(--fg-hi); text-decoration: none;
  font-weight: 700; letter-spacing: 0.01em;
}
.brand img { width: 24px; height: 24px; }
.brand .dot { color: var(--accent); }
.nav { display: flex; gap: var(--s3); }
.nav a {
  color: var(--muted); text-decoration: none;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color .12s, border-color .12s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg-hi); border-bottom-color: var(--accent); }

/* ---------- prompt-prefixed headings ---------- */
h1, h2, h3, h4 {
  font-variation-settings: 'wght' 700;
  color: var(--fg-hi);
  line-height: 1.2;
  margin: 0;
}
h1 { font-size: var(--fs-hero); line-height: 1.08; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-2xl); line-height: 1.18; }
h3 { font-size: var(--fs-xl); line-height: 1.25; }
h4 { font-size: var(--fs-lg); }

.prompt { position: relative; padding-left: 1.5em; }
.prompt::before {
  content: '>'; position: absolute; left: 0;
  color: var(--accent);
  font-variation-settings: 'wght' 700;
}

/* blinking caret */
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  vertical-align: -0.12em;
  margin-left: 0.08em;
  background: var(--accent);
  animation: blink 1.06s steps(2, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* ---------- prose ---------- */
p, ul, ol { margin: 0 0 var(--s2); }
p { max-width: var(--prose-w); color: var(--fg); }
.lede { font-size: var(--fs-lg); color: var(--muted); max-width: var(--prose-w); line-height: 1.55; }
strong { color: var(--fg-hi); font-variation-settings: 'wght' 700; }
em { font-style: italic; color: var(--fg-hi); }
a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover { border-bottom-color: var(--accent); }
hr {
  border: 0; border-top: 1px solid var(--line);
  margin: var(--s5) 0;
}

code, kbd, samp {
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0 0.3em;
  border-radius: 4px;
  font-size: 0.93em;
}

/* ---------- sections ---------- */
section { padding-block: var(--s6); }
section + section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: var(--s4); }
.section-head h2 { margin-bottom: var(--s2); }
.section-head .lede { margin-top: 0; }

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(var(--s5), 8vw, var(--s7)) var(--s6);
}
.hero .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
  align-items: start;
}
@media (min-width: 860px) {
  .hero .grid { grid-template-columns: 1.1fr 0.9fr; gap: var(--s6); }
}
.hero h1 { margin-bottom: var(--s3); }
.hero .lede { margin-bottom: var(--s4); }
.hero .cta { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font: inherit;
  padding: 0.7em 1.1em;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-hi);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-variation-settings: 'wght' 700;
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: var(--bg); }
.btn-primary .arrow { transition: transform .15s; }
.btn-primary:hover .arrow { transform: translateX(2px); }
.btn-lg { font-size: var(--fs-lg); padding: 0.9em 1.7em; }

/* ---------- terminal mock ---------- */
.terminal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  line-height: 1.55;
  overflow: hidden;
  box-shadow: 0 1px 0 oklch(0% 0 0 / 0.4), 0 20px 40px -20px oklch(78% 0.155 230 / 0.18);
}
.terminal .titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
}
.terminal .dots { display: inline-flex; gap: 5px; }
.terminal .dots span {
  width: 9px; height: 9px;
  background: var(--line);
  display: inline-block;
}
.terminal .dots span:first-child { background: oklch(60% 0.18 25); }
.terminal .dots span:nth-child(2) { background: var(--warn); }
.terminal .dots span:nth-child(3) { background: oklch(70% 0.16 145); }
.terminal .body { padding: 1rem 1.1rem; }
.terminal .body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  color: var(--fg);
}
.terminal .prompt-line { color: var(--muted); }
.terminal .prompt-line::before {
  content: '$ '; color: var(--accent);
  font-variation-settings: 'wght' 700;
}
.terminal .rule {
  color: var(--line);
}
.terminal .ok    { color: oklch(75% 0.14 145); }
.terminal .warn  { color: var(--warn); }
.terminal .err   { color: var(--danger); }
.terminal .key   { color: var(--accent); }
.terminal .dim   { color: var(--muted); }

/* ---------- pair / list blocks (replace icon-card grid) ---------- */
.pair {
  display: grid; gap: var(--s5);
}
@media (min-width: 860px) { .pair { grid-template-columns: 1fr 1fr; gap: var(--s6); } }
.pair h2, .pair h3 { margin-bottom: var(--s2); }
.pair h3.prompt::before { content: '##'; }

.bullets {
  list-style: none; padding: 0;
  display: grid; gap: var(--s2);
}
.bullets li {
  padding-left: 1.6em;
  position: relative;
  max-width: var(--prose-w);
}
.bullets li::before {
  content: '·'; position: absolute; left: 0.4em;
  color: var(--accent);
  font-variation-settings: 'wght' 700;
}

/* checklist (used for services) */
.checks {
  list-style: none; padding: 0;
  display: grid; gap: var(--s1);
}
.checks li {
  padding-left: 2.4em;
  position: relative;
}
.checks li::before {
  content: '[x]'; position: absolute; left: 0;
  color: var(--accent);
  font-variation-settings: 'wght' 700;
}

/* labelled definition blocks — services pricing, problems */
.blocks {
  display: grid; gap: var(--s3);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .blocks { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
.block {
  border: 1px solid var(--line);
  background: oklch(13% 0.014 235);
  border-radius: var(--radius);
  padding: var(--s3);
}
.block h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--s1);
}
.block .meta {
  color: var(--accent);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  margin-bottom: var(--s1);
}
.block p { margin: 0; color: var(--muted); }

/* ---------- forms ---------- */
.field { display: grid; gap: 0.35em; margin-bottom: var(--s2); }
.field label {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.field label::before { content: '> '; color: var(--accent); }
.field input, .field textarea, .field select {
  font: inherit; color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6em 0.8em;
  width: 100%;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(78% 0.155 230 / 0.2);
}
.field .hint { color: var(--muted); font-size: var(--fs-xs); }
.field.honey { position: absolute; left: -9999px; opacity: 0; }
.formstatus {
  border: 1px solid var(--line);
  padding: var(--s2) var(--s3);
  border-radius: var(--radius);
  margin-bottom: var(--s3);
  background: var(--surface);
}
.formstatus.ok    { border-color: oklch(60% 0.14 145); color: oklch(86% 0.10 145); }
.formstatus.err   { border-color: var(--danger); color: oklch(82% 0.16 25); }
.formstatus::before { content: '> '; color: var(--accent); }

/* ---------- status line / footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--s7);
  padding-block: var(--s4);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.site-footer .row {
  display: flex; flex-wrap: wrap; gap: var(--s3);
  align-items: center; justify-content: space-between;
}
.site-footer .links a { color: var(--muted); }
.site-footer .links a:hover { color: var(--accent); }
.site-footer .status {
  display: inline-flex; gap: var(--s2); align-items: center;
  font-variant-numeric: tabular-nums;
}
.dot-ok {
  display: inline-block; width: 8px; height: 8px;
  background: oklch(72% 0.16 145);
  box-shadow: 0 0 8px oklch(72% 0.16 145 / 0.6);
}

/* ---------- responsive nav ---------- */
@media (max-width: 640px) {
  .nav { gap: var(--s2); font-size: var(--fs-sm); flex-wrap: wrap; justify-content: flex-end; }
  .brand .wordmark { display: none; }
}

/* ---------- subtle scanline veil on hero ---------- */
.hero-veil {
  position: relative;
  isolation: isolate;
}
.hero-veil::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    oklch(98% 0.004 235 / 0.025) 3px,
    oklch(98% 0.004 235 / 0.025) 4px
  );
  z-index: -1;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

/* ---------- testimonial cards (2x2, larger) ---------- */
.quotes { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 720px) { .quotes { grid-template-columns: 1fr 1fr; } }
.quotes .block { padding: var(--s3); }
.quotes .block p { font-size: var(--fs-sm); line-height: 1.5; }
