/* =========================================================
   BEANTECH — design tokens & global styles
   ========================================================= */
:root {
  --bg: #f5f4f0;
  --bg-alt: #efede7;
  --bg-deep: #222;
  --ink: #222;
  --ink-soft: #2a2a2a;
  --ink-mute: #6b6b6b;
  --ink-faint: #b8b6ae;
  --line: #d9d6cc;
  --line-soft: #e6e3d9;
  --accent: oklch(0.82 0.13 55);
  --accent-deep: oklch(0.62 0.16 50);
  --accent-soft: oklch(0.95 0.05 60);
  --danger: oklch(0.62 0.22 28);

  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Geist Mono", ui-monospace, Menlo, monospace;

  --max: 1440px;
  --pad: clamp(20px, 4vw, 48px);

  --t-fast: 180ms cubic-bezier(.2,.7,.2,1);
  --t-base: 320ms cubic-bezier(.2,.7,.2,1);
  --t-slow: 600ms cubic-bezier(.2,.7,.2,1);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent); color: var(--ink); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.hairline { border: 0; border-top: 1px solid var(--line); }
.hairline-v { width: 1px; background: var(--line); align-self: stretch; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--ink-mute);
}

.display {
  font-size: clamp(48px, 7.4vw, 112px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0;
}
.display .outline {
  -webkit-text-stroke: 1.2px var(--ink);
  color: transparent;
}
.h2 {
  font-size: clamp(32px, 4.2vw, 56px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
}
.h3 {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}
.mono { font-family: var(--font-mono); }
.lede {
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 0;
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}
.btn:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn .arr { transition: transform var(--t-base); }
.btn:hover .arr { transform: translateX(4px); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad);
  max-width: var(--max);
  margin: 0 auto;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 15px;
}
.logo-mark {
  width: 22px; height: 22px;
  position: relative;
  display: inline-block;
}
.logo-mark::before, .logo-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--ink);
}
.logo-mark::before { transform: rotate(0); }
.logo-mark::after { transform: rotate(45deg); border-color: var(--accent-deep); }

.nav-links {
  display: flex; gap: 28px;
  font-size: 13px;
}
.nav-links a {
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color var(--t-fast);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--ink);
  transition: width var(--t-base);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 16px; }

/* Mobile burger button */
.nav-burger {
  display: none;
  width: 36px; height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-burger span {
  display: block;
  width: 16px; height: 1.5px;
  background: var(--ink);
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.lang-switch button {
  padding: 6px 10px;
  background: transparent;
  border: 0;
  color: var(--ink-mute);
  text-transform: uppercase;
  transition: all var(--t-fast);
}
.lang-switch button.is-active {
  background: var(--ink);
  color: var(--bg);
}
.lang-switch button:hover:not(.is-active) { color: var(--ink); }

@media (max-width: 860px) {
  .nav-burger { display: inline-flex; }
  .nav-links {
    position: fixed;
    top: 56px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: color-mix(in oklab, var(--bg) 96%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 12px var(--pad) 20px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--t-base), opacity var(--t-base);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }
  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a {
    padding: 14px 0;
    font-size: 16px;
    color: var(--ink);
    border-bottom: 1px solid var(--line-soft);
  }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a::after { display: none; }
}

/* ---------- Sections ---------- */
section {
  position: relative;
  padding: clamp(72px, 9vw, 128px) 0;
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}
@media (max-width: 760px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- HERO ---------- */
.hero {
  padding-top: 104px;
  padding-bottom: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-bg canvas { display: block; width: 100%; height: 100%; }

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: calc(100vw / 12) calc(100vw / 12);
  mask-image: radial-gradient(ellipse 70% 55% at 70% 40%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 70% 40%, #000 40%, transparent 100%);
  z-index: 0;
  pointer-events: none;
  will-change: transform, mask-image;
  transition: mask-image 300ms ease;
}

/* Interactive hero cursor crosshair */
.hero-cursor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 220ms ease;
  font-family: var(--font-mono);
}
.hero.hero--hot .hero-cursor { opacity: 1; }
.hero-cursor .hc-line {
  position: absolute;
  background: color-mix(in oklab, var(--accent) 60%, transparent);
}
.hero-cursor .hc-h { left: 0; right: 0; height: 1px; top: 0; }
.hero-cursor .hc-v { top: 0; bottom: 0; width: 1px; left: 0; }
.hero-cursor .hc-ring {
  position: absolute;
  width: 60px; height: 60px;
  margin-left: -30px; margin-top: -30px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  left: 0; top: 0;
  mix-blend-mode: difference;
  transition: width 200ms, height 200ms;
}
.hero-cursor .hc-ring::before,
.hero-cursor .hc-ring::after {
  content: "";
  position: absolute;
  background: var(--accent);
}
.hero-cursor .hc-ring::before { left: 50%; top: -6px; width: 1px; height: 6px; }
.hero-cursor .hc-ring::after  { left: 50%; bottom: -6px; width: 1px; height: 6px; }
.hero-cursor .hc-readout {
  position: absolute;
  left: 0; top: 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  padding: 4px 8px;
  border: 1px solid color-mix(in oklab, var(--accent) 50%, transparent);
  white-space: nowrap;
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding-top: 40px;
  padding-bottom: 40px;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 48px;
  align-items: end;
}
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 16px;
}
.hero-meta .dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%  { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100%{ box-shadow: 0 0 0 0 transparent; }
}

.hero-title-wrap .eyebrow { margin-bottom: 36px; }
.display .line { display: block; overflow: hidden; }
.display .line > span {
  display: inline-block;
  transform: translateY(110%);
  animation: rise 1.1s cubic-bezier(.2,.7,.2,1) 0.05s forwards;
  animation-play-state: running !important;
}
.display .line:nth-child(2) > span { animation-delay: .17s; }
.display .line:nth-child(3) > span { animation-delay: .29s; }
@keyframes rise { from { transform: translateY(110%); } to { transform: translateY(0); } }

.hero-sub {
  margin-top: 28px;
  max-width: 44ch;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.55;
}

.hero-ctas {
  display: flex; gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
}

/* Hero right column — code terminal */
.terminal {
  background: var(--bg-deep);
  color: #e6e6e6;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  border: 1px solid var(--ink);
  box-shadow: 0 30px 60px -30px rgba(10,10,10,.35);
  position: relative;
  min-height: 360px;
  overflow: hidden;
  margin-right: -50px;
}
@media (max-width: 960px) {
  .terminal { margin-right: 0; }
}
.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #111;
  border-bottom: 1px solid #1f1f1f;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
}
.terminal-bar .dots { display: inline-flex; gap: 6px; }
.terminal-bar .dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #2a2a2a;
  border: 1px solid #333;
}
.terminal-bar .label { color: #888; }
.terminal-body {
  padding: 18px 18px 22px;
  white-space: pre;
  min-height: 340px;
}
.terminal-body .k { color: oklch(0.85 0.13 55); }   /* keyword */
.terminal-body .c { color: #6b6b6b; font-style: italic; } /* comment */
.terminal-body .s { color: #d4a574; }                 /* string */
.terminal-body .t { color: #9abbff; }                 /* type */
.terminal-body .f { color: #e6e6e6; }                 /* fn/name */
.terminal-body .n { color: #d46b6b; }                 /* number */
.terminal-body .caret {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Hero stats — bottom rail */
.hero-stats {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.hero-stats .cell {
  padding: 22px var(--pad);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-stats .cell:last-child { border-right: 0; }
.hero-stats .v {
  font-size: clamp(24px, 2.6vw, 36px);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}
.hero-stats .l {
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
@media (max-width: 760px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats .cell:nth-child(2) { border-right: 0; }
  .hero-stats .cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  padding: 14px 0;
}
.marquee-track {
  display: flex;
  gap: 24px;
  white-space: nowrap;
  animation: scroll 50s linear infinite;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.marquee-track span { flex: 0 0 auto; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
@media (max-width: 860px) { .services-grid { grid-template-columns: 1fr; } }
.service {
  position: relative;
  padding: 44px 36px 40px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: background var(--t-base);
}
.service:hover { background: var(--bg-alt); }
.service .tag {
  position: absolute;
  top: 20px; right: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
}
.service h3 { margin-top: 18px; }
.service-desc {
  color: var(--ink-soft);
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 1.55;
  max-width: 48ch;
}
.service ul {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  border-top: 1px solid var(--line-soft);
}
.service li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
  color: var(--ink-soft);
}
.service li .mark {
  font-family: var(--font-mono);
  color: var(--accent-deep);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ---------- Stack ---------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
@media (max-width: 960px) { .stack-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .stack-grid { grid-template-columns: 1fr; } }

.stack-col {
  padding: 28px 24px 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stack-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 20px;
  font-weight: 500;
}
.stack-col ul { list-style: none; padding: 0; margin: 0; }
.stack-col li {
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
}
.stack-col li:first-child { border-top: 0; }
.stack-col li .ver {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

/* ---------- Architecture diagram ---------- */
.arch {
  background: var(--bg-deep);
  color: #e6e6e6;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.arch .eyebrow { color: #8e8e8e; }
.arch .eyebrow::before { background: #8e8e8e; }
.arch .h2 { color: #f5f4f0; }
.arch .lede { color: #bdbdbd; }
.arch .section-head { border-bottom-color: #1f1f1f; }
.arch-frame {
  border: 1px solid #1f1f1f;
  background:
    linear-gradient(to right, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / calc(100% / 24) 100%,
    linear-gradient(to bottom, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 100% calc(100% / 12);
  padding: 28px;
  position: relative;
}
.arch-legend {
  display: flex;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8e8e8e;
  margin-top: 20px;
}
.arch-legend .lg { display: inline-flex; align-items: center; gap: 8px; }
.arch-legend .lg .sw {
  width: 10px; height: 10px; border: 1px solid #8e8e8e;
}
.arch-legend .lg.ev .sw { background: var(--accent); border-color: var(--accent); }
.arch-legend .lg.sv .sw { background: transparent; border-color: #e6e6e6; }
.arch-legend .lg.st .sw { background: transparent; border: 1px dashed #e6e6e6; }

/* ---------- Process ---------- */
.process-list {
  border-top: 1px solid var(--line);
}
.process-item {
  display: grid;
  grid-template-columns: 120px 1fr 2fr;
  gap: 32px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  transition: background var(--t-base);
}
.process-item:hover { background: var(--bg-alt); }
.process-item .num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  padding-top: 6px;
}
.process-item h3 { font-size: 28px; }
.process-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
  max-width: 56ch;
}
@media (max-width: 760px) {
  .process-item { grid-template-columns: 1fr; gap: 10px; padding: 26px 0; }
  .process-item .num { padding-top: 0; }
}

/* ---------- Cases ---------- */
.cases {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 960px) { .cases-grid { grid-template-columns: 1fr; } }
.case {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 28px 26px 26px;
  transition: transform var(--t-base), box-shadow var(--t-base);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  position: relative;
  overflow: hidden;
}
.case:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px -24px rgba(10,10,10,.18);
}
.case-visual {
  height: 150px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  position: relative;
  overflow: hidden;
}
.case-client {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.case h3 { margin: 8px 0 0; font-size: 22px; }
.case-metrics {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.case-metrics .m .v {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.case-metrics .m .l {
  font-size: 11px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ---------- CTA / Contact ---------- */
.cta {
  background: var(--bg-deep);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}
.cta .eyebrow { color: #8e8e8e; }
.cta .eyebrow::before { background: #8e8e8e; }
.cta-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: calc(100vw / 14) calc(100vw / 14);
  mask-image: radial-gradient(ellipse 60% 60% at 30% 50%, #000 20%, transparent 90%);
  pointer-events: none;
}
.cta-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 960px) { .cta-inner { grid-template-columns: 1fr; gap: 40px; } }
.cta-lead { position: sticky; top: 96px; }
.cta h2.h2 { color: var(--bg); font-size: clamp(40px, 5vw, 72px); }
.cta-sub { color: #bdbdbd; margin-top: 20px; max-width: 44ch; }
.cta-info {
  border-top: 1px solid #2a2a2a;
  padding-top: 20px;
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cta-info .row { display: flex; align-items: baseline; gap: 14px; }
.cta-info .lbl {
  font-family: var(--font-mono); font-size: 11px;
  color: #8e8e8e; text-transform: uppercase; letter-spacing: 0.08em;
  min-width: 60px;
}
.cta-info .val {
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--bg);
}
.cta-info a.val { border-bottom: 1px solid #2a2a2a; transition: border-color var(--t-fast); }
.cta-info a.val:hover { border-bottom-color: var(--accent); }
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--t-base);
  font-family: var(--font-sans);
  cursor: pointer;
}
.cta-btn:hover { background: transparent; color: var(--accent); }
.cta-btn .arr { transition: transform var(--t-base); }
.cta-btn:hover .arr { transform: translateX(4px); }

/* ---------- Brief form ---------- */
.field input.is-invalid,
.field textarea.is-invalid {
  border-bottom-color: oklch(0.65 0.22 28) !important;
  animation: shake 0.3s cubic-bezier(.36,.07,.19,.97);
}
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}

.brief,
.brief * {
  font-family: var(--font-sans);
}
.brief input,
.brief textarea,
.brief button {
  font-family: var(--font-sans) !important;
}
.brief .mono,
.brief .flabel,
.brief .req,
.brief .chip,
.brief .brief-meta,
.brief .brief-title,
.brief .brief-step {
  font-family: var(--font-mono) !important;
  font-style: normal !important;
}
.brief {
  position: relative;
  background: #0e0e0e;
  border: 1px solid #1f1f1f;
  padding: 28px 28px 24px;
  color: #e6e6e6;
}
.brief-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #1f1f1f;
  margin-bottom: 22px;
}
.brief-title { font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bg); }
.brief-step  { font-size: 11px; color: #8e8e8e; margin-top: 6px; letter-spacing: 0.04em; }
.brief-progress { width: 140px; height: 3px; background: #1f1f1f; position: relative; overflow: hidden; }
.brief-progress span {
  display: block; height: 100%; width: 0%;
  background: var(--accent);
  transition: width var(--t-base);
}
.brief .brief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 20px;
  width: 100%;
}
.brief .brief-grid > .field { grid-column: span 1; }
.brief .brief-grid > .field--wide { grid-column: 1 / -1; }
@media (max-width: 520px) {
  .brief .brief-grid { grid-template-columns: 1fr; }
  .brief .brief-grid > .field { grid-column: 1 / -1; }
}

.brief .field {
  display: block;
  min-width: 0;
  margin: 0;
}
.brief .flabel {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px 0;
  font-family: var(--font-mono) !important;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8e8e8e;
}
.brief .flabel > span:first-child { flex: 0 0 auto; }
.brief .flabel .req {
  color: #666;
  font-size: 9px;
  font-style: normal !important;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  opacity: 0.7;
  margin-left: auto;
  padding-left: 12px;
  font-family: var(--font-mono) !important;
}

.brief .field > input[type="text"],
.brief .field > textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #2a2a2a;
  color: var(--bg);
  padding: 10px 0;
  font-family: var(--font-sans) !important;
  font-size: 15px;
  letter-spacing: -0.005em;
  outline: 0;
  border-radius: 0;
  resize: none;
  transition: border-color var(--t-fast);
  margin: 0;
}
.brief .field > textarea { min-height: 96px; }
.brief .field > input:focus,
.brief .field > textarea:focus { border-bottom-color: var(--accent); }
.brief .field > input::placeholder,
.brief .field > textarea::placeholder { color: #555; }

/* overlay done: must be HIDDEN unless .is-done on form */
.brief .brief-done {
  position: absolute;
  inset: 0;
  background: #0e0e0e;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 40px;
  gap: 18px;
  z-index: 2;
}
.brief.is-done .brief-done { display: flex; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px;
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #bdbdbd;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  transition: all var(--t-fast);
  cursor: pointer;
}
.chip:hover { border-color: #555; color: var(--bg); }
.chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.field.nda {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 13.5px;
  color: #bdbdbd;
  padding-top: 4px;
}
.field.nda input { position: absolute; opacity: 0; pointer-events: none; }
.ndabox {
  width: 16px; height: 16px;
  border: 1px solid #2a2a2a;
  position: relative;
  flex: 0 0 auto;
  transition: all var(--t-fast);
}
.field.nda:hover .ndabox { border-color: #555; }
.field.nda input:checked + .ndabox { background: var(--accent); border-color: var(--accent); }
.field.nda input:checked + .ndabox::after {
  content: ""; position: absolute; inset: 3px;
  background: var(--ink);
  clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 20%, 84% 6%, 38% 68%);
}

.brief-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #1f1f1f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brief-meta {
  font-size: 10.5px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brief-meta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s infinite;
}

.brief.is-sending .cta-btn .lbl-send { display: none; }
.brief.is-sending .cta-btn .lbl-sending { display: inline !important; }
.brief.is-sending .cta-btn { pointer-events: none; opacity: 0.8; }

.brief-done {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 40px;
  gap: 18px;
}
.brief.is-done .brief-done {
  display: flex;
  position: absolute;
  inset: 0;
  background: #0e0e0e;
  border: 1px solid #1f1f1f;
  z-index: 3;
}
.done-mark {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.done-title { color: var(--bg); }
.done-sub { color: #bdbdbd; max-width: 48ch; font-size: 15px; }
.brief-done .btn--ghost { color: var(--bg); border-color: #2a2a2a; }
.brief-done .btn--ghost:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* ---------- Footer ---------- */
.foot {
  background: var(--bg-deep);
  color: #8e8e8e;
  border-top: 1px solid #1a1a1a;
  padding: 28px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--t-slow), transform .9s var(--t-slow);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ---------- Tweaks panel ---------- */
.tweaks {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 200;
  background: var(--bg);
  border: 1px solid var(--ink);
  box-shadow: 0 24px 40px -20px rgba(0,0,0,.2);
  font-family: var(--font-mono);
  font-size: 12px;
  width: 260px;
  display: none;
}
.tweaks.is-on { display: block; }
.tweaks-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tweaks-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.tweak-row { display: flex; flex-direction: column; gap: 6px; }
.tweak-row label {
  text-transform: uppercase;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  font-size: 10px;
}
.tweak-row input[type="range"] { width: 100%; }
.swatches { display: flex; gap: 6px; }
.swatches button {
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  background: var(--c, #fff);
  cursor: pointer;
}
.swatches button.is-on { outline: 2px solid var(--ink); outline-offset: 2px; }

.toggle-row { display: flex; gap: 8px; }
.toggle-row button {
  flex: 1;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}
.toggle-row button.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Architecture SVG horizontal scroll ---------- */
.arch-svg-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.arch-svg-wrap > svg { min-width: 100%; }

/* =========================================================
   Responsive refinements
   ========================================================= */

/* Tablet & below */
@media (max-width: 960px) {
  .hero { padding-top: 88px; }
  .hero-inner { padding-top: 24px; padding-bottom: 24px; }
  .terminal { min-height: 280px; font-size: 12px; }
  .terminal-body { padding: 14px; min-height: 260px; overflow-x: auto; }
  .arch-frame { padding: 18px; }
  .arch-svg-wrap > svg { min-width: 880px; }
}

/* Small tablet / large phone */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .hero-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
    word-break: break-word;
  }
  .hero-stats .cell { padding: 18px var(--pad); }
  .service { padding: 32px 24px 28px; }
  .service .tag { top: 16px; right: 16px; }
  .stack-col { padding: 22px 18px 24px; }
  .process-item { padding: 24px 0; }
  .process-item h3 { font-size: 22px; }
  .case { min-height: auto; padding: 24px 22px; }
  .case-visual { height: 130px; }
  .cta-inner { gap: 32px; }
  .cta-lead { position: static; }
  .brief { padding: 22px 20px 20px; }
  .brief-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .brief-progress { width: 100%; }
  .brief-foot { flex-direction: column-reverse; align-items: stretch; }
  .brief-foot .cta-btn { justify-content: center; }
  .brief-foot .brief-meta { justify-content: center; }
  .foot-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Phone */
@media (max-width: 540px) {
  .nav-inner { padding-top: 10px; padding-bottom: 10px; }
  .logo span:not(.logo-mark) { font-size: 14px; }
  .lang-switch button { padding: 5px 8px; }
  .nav-links { top: 52px; max-height: calc(100vh - 52px); }
  .hero { padding-top: 72px; }
  .hero-title-wrap .eyebrow { margin-bottom: 24px; }
  .hero-sub { font-size: 15.5px; margin-top: 20px; }
  .hero-ctas { margin-top: 28px; gap: 10px; }
  .hero-ctas .btn { flex: 1 1 auto; justify-content: center; padding: 13px 18px; }
  .terminal { min-height: 240px; font-size: 11.5px; }
  .terminal-body { min-height: 220px; padding: 12px; }
  .terminal-bar { padding: 8px 12px; font-size: 10px; }
  .hero-stats .cell { padding: 16px 18px; }
  .hero-stats .v { font-size: 22px; }
  .hero-stats .l { font-size: 11px; }
  .service { padding: 28px 20px 24px; }
  .service li { font-size: 14px; padding: 12px 0; }
  .stack-col { padding: 20px 16px; }
  .arch-frame { padding: 12px; }
  .arch-legend { gap: 16px; flex-wrap: wrap; }
  .case-metrics .m .v { font-size: 18px; }
  .cta h2.h2 { font-size: clamp(32px, 8vw, 44px); }
  .cta-info .row { flex-wrap: wrap; gap: 6px 14px; }
  .cta-info .lbl { min-width: 50px; }
  .cta-info .val { font-size: 15px; }
}

/* Hide tweaks panel on touch / small screens to free space */
@media (max-width: 760px) {
  .tweaks {
    right: 8px; bottom: 8px;
    width: calc(100vw - 16px);
    max-width: 280px;
  }
}

/* Avoid horizontal page overflow from absolute hero overlays on very small screens */
@media (max-width: 380px) {
  :root { --pad: 16px; }
}
