/* ==========================================================================
   North Wales AI Platform — design system
   Dark premium theme. All shared styles live here; page-specific rules are
   grouped by section at the bottom. Edit tokens in :root to rebrand.
   ========================================================================== */

:root {
  /* palette */
  --bg: #04070f;
  --bg-2: #080e1c;
  --bg-3: #0c1526;
  --panel: rgba(148, 197, 255, .05);
  --panel-2: rgba(148, 197, 255, .09);
  --line: rgba(148, 197, 255, .14);
  --line-soft: rgba(148, 197, 255, .08);
  --ink: #e8eefc;
  --ink-dim: #9fb0cc;
  --ink-faint: #7d92b3;
  --emerald: #2dd4a7;
  --cyan: #38bdf8;
  --indigo: #7c8cf8;
  --amber: #fbbf24;
  --rose: #fb7185;
  --grad: linear-gradient(100deg, var(--emerald), var(--cyan) 55%, var(--indigo));
  --grad-soft: linear-gradient(160deg, rgba(45, 212, 167, .16), rgba(56, 189, 248, .10) 50%, rgba(124, 140, 248, .12));
  --shadow: 0 18px 60px rgba(2, 6, 18, .55);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --nav-h: 72px;

  /* type */
  --font-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  overflow-x: hidden;
  max-width: 100vw;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  overflow-x: hidden;
  max-width: 100vw;
  background:
    radial-gradient(1100px 500px at 85% -100px, rgba(56, 189, 248, .08), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(45, 212, 167, .05), transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open {
  overflow: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #7dd7ff; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.35em; }
li { margin: .3em 0; }
strong { color: #f4f8ff; font-weight: 600; }
::selection { background: rgba(56, 189, 248, .35); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--cyan); color: #04121f; padding: 10px 18px; border-radius: 0 0 10px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid rgba(56, 189, 248, .9); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(18px, 4vw, 36px); }
.section { padding-block: clamp(56px, 9vw, 110px); position: relative; }
.section-tight { padding-block: clamp(40px, 6vw, 72px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-size: .8rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--emerald);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--grad); border-radius: 2px; }

.lead { font-size: clamp(1.05rem, 1.8vw, 1.22rem); color: var(--ink-dim); max-width: 62ch; }
.muted { color: var(--ink-dim); }
.small { font-size: .86rem; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: 600 1rem/1 var(--font-head); letter-spacing: .01em;
  padding: 15px 26px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s;
  text-decoration: none;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--grad); color: #031320; box-shadow: 0 8px 30px rgba(45, 212, 167, .28); }
.btn-primary:hover { color: #031320; transform: translateY(-2px); box-shadow: 0 14px 40px rgba(45, 212, 167, .4); }
.btn-ghost { background: rgba(148, 197, 255, .05); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: rgba(56, 189, 248, .55); background: rgba(148, 197, 255, .1); color: var(--ink); transform: translateY(-2px); }
.btn-sm { padding: 11px 20px; font-size: .92rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- header / nav ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(4, 7, 15, .55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--line-soft); background: rgba(4, 7, 15, .82); }
.nav-inner { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 24px); width: 100%; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-family: var(--font-head); font-weight: 700; font-size: 1.04rem; letter-spacing: .01em; flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: 0 0 auto; }
.brand small { display: block; font: 500 .62rem/1.3 var(--font-body); color: var(--ink-faint); letter-spacing: .11em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; list-style: none; padding: 0; }
.nav-links a {
  display: block; padding: 8px 11px; border-radius: 8px; white-space: nowrap;
  color: var(--ink-dim); font: 500 .91rem/1 var(--font-body); transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--ink); background: var(--panel); }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--panel-2); }
.nav-cta { margin-left: 6px; }
.nav-cta .btn { padding: 8px 14px; font-size: .88rem; white-space: nowrap; }
.nav-toggle {
  display: none; margin-left: auto; width: 46px; height: 40px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); cursor: pointer; position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; margin: -1px 0 0 -9px;
  background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .2s;
}
.nav-toggle span::before { top: -6px; margin-top: 0; }
.nav-toggle span::after { top: 6px; margin-top: 0; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav-toggle {
    display: block;
    width: 44px;
    height: 40px;
    flex-shrink: 0;
  }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100dvh - var(--nav-h));
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(4, 7, 15, .98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px clamp(18px, 4vw, 32px) 36px;
    border-bottom: 1px solid var(--line);
    display: none;
    z-index: 101;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 13px 16px;
    font-size: 1.04rem;
    white-space: normal;
    border-radius: 10px;
    border: 1px solid transparent;
  }
  .nav-links a:hover, .nav-links a:focus {
    background: var(--panel-2);
    border-color: var(--line-soft);
  }
  .nav-cta {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
  }
  .nav-cta .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 1rem;
  }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: min(96vh, 940px); display: flex; align-items: center; padding-top: var(--nav-h); overflow: clip; }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; opacity: .5; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(70% 90% at 20% 100%, rgba(4, 7, 15, .96), transparent 70%),
    linear-gradient(180deg, rgba(4, 7, 15, .62) 0%, rgba(4, 7, 15, .2) 40%, rgba(4, 7, 15, .9) 100%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: -1; opacity: .5;
  background: linear-gradient(rgba(148,197,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(148,197,255,.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(75% 65% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(75% 65% at 50% 40%, #000 30%, transparent 100%);
}
.hero-inner { position: relative; padding-block: clamp(70px, 10vh, 130px); }
.hero h1 { max-width: 17ch; margin-bottom: .35em; }
.hero .lead { max-width: 58ch; margin-bottom: 2em; }
.hero-badge {
  display: inline-flex; gap: 9px; align-items: center; margin-bottom: 26px;
  padding: 8px 16px 8px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(4, 7, 15, .5); backdrop-filter: blur(6px);
  font-size: .85rem; color: var(--ink-dim);
}
.hero-badge b { color: var(--ink); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 12px var(--emerald); flex: 0 0 auto; }
.dot.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* page hero (interior pages) */
.page-hero { padding: calc(var(--nav-h) + clamp(52px, 8vw, 92px)) 0 clamp(30px, 5vw, 54px); position: relative; overflow: clip; }
.page-hero::before {
  content: ""; position: absolute; z-index: -1; inset: -40% -20% auto; height: 170%;
  background: radial-gradient(45% 55% at 65% 35%, rgba(56, 189, 248, .13), transparent 70%),
              radial-gradient(40% 60% at 20% 60%, rgba(45, 212, 167, .10), transparent 70%);
}
.page-hero h1 { max-width: 24ch; }
.breadcrumbs { font-size: .84rem; color: var(--ink-faint); margin-bottom: 20px; }
.breadcrumbs a { color: var(--ink-faint); }
.breadcrumbs a:hover { color: var(--cyan); }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 22px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 940px) { .g-3, .g-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } }

.card {
  position: relative; background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 26px 24px; overflow: hidden;
  transition: transform .22s ease, border-color .22s, background .22s;
}
.card:hover { transform: translateY(-4px); border-color: var(--line); background: var(--panel-2); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-dim); font-size: .95rem; margin-bottom: 0; }
.card .icon { width: 46px; height: 46px; margin-bottom: 16px; }
.card .icon svg { width: 100%; height: 100%; }

.card-img { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); background: var(--bg-3); }
.card-img img { aspect-ratio: 4/3; width: 100%; object-fit: cover; transition: transform .5s ease; }
.card-img:hover img { transform: scale(1.045); }
.card-img .shade { position: absolute; inset: 0; background: linear-gradient(185deg, transparent 30%, rgba(4, 7, 15, .92) 88%); }
.card-img .cap { position: absolute; inset: auto 0 0; padding: 18px 20px; }
.card-img .cap h3 { margin-bottom: 4px; font-size: 1.12rem; }
.card-img .cap p { color: var(--ink-dim); font-size: .88rem; margin: 0; }
.chip {
  display: inline-block; padding: 4px 11px; border-radius: 999px; font: 600 .72rem/1.5 var(--font-head);
  letter-spacing: .09em; text-transform: uppercase; background: rgba(45, 212, 167, .13); color: var(--emerald);
  border: 1px solid rgba(45, 212, 167, .3); margin-bottom: 10px;
}

.stat-card { text-align: center; padding: 26px 18px; }
.stat-num { font: 700 clamp(1.9rem, 4vw, 2.7rem)/1.1 var(--font-head); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-num small { font-size: .55em; }
.stat-label { color: var(--ink-dim); font-size: .88rem; margin-top: 8px; }

/* split sections */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(30px, 5vw, 64px); align-items: center; }
.split.flip > :first-child { order: 2; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .split.flip > :first-child { order: 0; } }
.figure { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.figure img { width: 100%; }

/* checklist */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.checks .tick {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; margin-top: 2px;
  background: rgba(45, 212, 167, .14); border: 1px solid rgba(45, 212, 167, .4);
  display: inline-flex; align-items: center; justify-content: center;
}
.checks .tick svg { width: 12px; height: 12px; stroke: var(--emerald); }

/* numbered steps */
.steps { display: grid; gap: 20px; counter-reset: step; }
.step { display: flex; gap: 20px; align-items: flex-start; padding: 24px; }
.step-num {
  counter-increment: step; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
  background: var(--grad-soft); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font: 700 1.15rem/1 var(--font-head); color: var(--cyan);
}
.step-num::before { content: counter(step); }
.step h3 { margin-bottom: 5px; }
.step p { margin: 0; }

/* callout / quote */
.callout {
  border: 1px solid var(--line); border-left: 4px solid var(--emerald); border-radius: var(--radius-sm);
  background: var(--panel); padding: 22px 24px; color: var(--ink-dim); margin: 26px 0;
}
.callout b { color: var(--ink); }
.callout.info { border-left-color: var(--cyan); }
.callout.warn { border-left-color: var(--amber); }

.banner-note { font-size: .82rem; color: var(--ink-faint); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 16px; display: inline-block; background: rgba(4, 7, 15, .5); }

/* band (full-width tinted section) */
.band { background: linear-gradient(180deg, var(--bg-2), var(--bg-3)); border-block: 1px solid var(--line-soft); }
.band-dark { background: var(--bg-2); }

.cta-band { position: relative; overflow: clip; }
.cta-band .glow { position: absolute; z-index: -1; inset: auto -20% -120%; height: 220%; background: radial-gradient(50% 50% at 50% 50%, rgba(56, 189, 248, .16), transparent 70%); }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .09s; }
.reveal[data-delay="2"] { transition-delay: .18s; }
.reveal[data-delay="3"] { transition-delay: .27s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot.pulse { animation: none; }
  * { animation-duration: .001s !important; }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); background: var(--bg-2); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-block: 52px 40px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.footer-grid h4, .footer-grid .footer-head { font-family: var(--font-head); font-size: .82rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-grid a { color: var(--ink-dim); font-size: .93rem; }
.footer-grid a:hover { color: var(--cyan); }
.funder-note { font-size: .82rem; color: var(--ink-faint); line-height: 1.7; max-width: 46ch; }
.footer-bottom { border-top: 1px solid var(--line-soft); padding-block: 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: .82rem; color: var(--ink-faint); }
.footer-bottom a { color: var(--ink-faint); }
.footer-bottom a:hover { color: var(--cyan); }

/* ==========================================================================
   Page-specific components
   ========================================================================== */

/* ---- interactive flow diagram (Why Private AI) ---- */
.flow-demo { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); overflow: hidden; }
.flow-tabs { display: flex; border-bottom: 1px solid var(--line-soft); }
.flow-tab {
  flex: 1; padding: 16px 12px; background: transparent; border: 0; cursor: pointer;
  font: 600 1rem/1.3 var(--font-head); color: var(--ink-dim); position: relative; transition: color .2s, background .2s;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.flow-tab:hover { color: var(--ink); background: var(--panel); }
.flow-tab[aria-selected="true"] { color: var(--ink); background: var(--panel-2); }
.flow-tab[aria-selected="true"]::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--grad); }
.flow-stage { padding: 18px clamp(16px, 3vw, 34px) 26px; }
.flow-svg { width: 100%; height: auto; display: block; }
.flow-svg text { font-family: var(--font-body); }
.flow-caption { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 10px; }
.flow-status { font-size: .92rem; color: var(--ink-dim); min-height: 2.6em; max-width: 66ch; }
.flow-status b { color: var(--ink); }
.flow-packet { transition: none; }
.privacy-gauge { display: grid; gap: 8px; }
.gauge-row { display: grid; grid-template-columns: 190px 1fr 74px; gap: 14px; align-items: center; font-size: .88rem; color: var(--ink-dim); }
.gauge-bar { height: 9px; border-radius: 99px; background: rgba(148, 197, 255, .08); overflow: hidden; }
.gauge-fill { height: 100%; width: 0; border-radius: 99px; transition: width 1s cubic-bezier(.2, .7, .2, 1); }
.gauge-fill.good { background: var(--grad); }
.gauge-fill.bad { background: linear-gradient(90deg, #f472b6, #fb7185); }
.gauge-val { font-family: var(--font-head); font-weight: 600; color: var(--ink); text-align: right; font-size: .85rem; }
@media (max-width: 700px) { .gauge-row { grid-template-columns: 1fr; gap: 5px; } .gauge-val { text-align: left; } }

/* comparison table */
.compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .93rem; }
.compare th, .compare td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.compare thead th { font-family: var(--font-head); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.compare tbody th { font-weight: 600; color: var(--ink); width: 26%; }
.compare td { color: var(--ink-dim); }
.compare .yes { color: var(--emerald); font-weight: 600; }
.compare .no { color: var(--rose); font-weight: 600; }
.compare .part { color: var(--amber); font-weight: 600; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.table-scroll .compare { min-width: 640px; }

/* ---- use-case explorer ---- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 30px; }
.filter-btn {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-dim); font: 500 .92rem/1.4 var(--font-body); cursor: pointer;
  transition: all .18s ease;
}
.filter-btn:hover { color: var(--ink); border-color: rgba(56, 189, 248, .5); }
.filter-btn[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #031320; font-weight: 600; }
.usecase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 980px) { .usecase-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .usecase-grid { grid-template-columns: 1fr; } }
.usecase { display: flex; flex-direction: column; }
.usecase .metric {
  margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: rgba(45, 212, 167, .07);
  border: 1px solid rgba(45, 212, 167, .22); font-size: .85rem; color: var(--ink-dim);
}
.usecase .metric b { color: var(--emerald); font-family: var(--font-head); font-weight: 700; }
.usecase[hidden] { display: none; }
.usecase .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { font: 600 .68rem/1.6 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); background: rgba(56, 189, 248, .1); border: 1px solid rgba(56, 189, 248, .25); padding: 2px 9px; border-radius: 6px; }

/* ---- terminal (infrastructure) ---- */
.terminal { border-radius: var(--radius-sm); border: 1px solid var(--line); background: #03060d; overflow: hidden; box-shadow: var(--shadow); font-family: var(--font-mono); }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 11px 15px; background: #0a101d; border-bottom: 1px solid var(--line-soft); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #1d2a44; }
.terminal-bar i:nth-child(1) { background: #fb7185; } .terminal-bar i:nth-child(2) { background: #fbbf24; } .terminal-bar i:nth-child(3) { background: #2dd4a7; }
.terminal-bar span { margin-left: 8px; color: var(--ink-faint); font-size: .78rem; }
.terminal-body { padding: 18px 20px 24px; font-size: .84rem; line-height: 1.75; min-height: 330px; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.terminal-body .t-cmd { color: #d7e6ff; }
.terminal-body .t-out { color: #7ed4c3; }
.terminal-body .t-dim { color: #52648a; }
.terminal-body .t-flag { color: #fbbf24; }
.t-caret { display: inline-block; width: 8px; height: 1.05em; background: var(--emerald); vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .t-caret { animation: none; } }
.spec-list { display: grid; gap: 0; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); overflow: hidden; }
.spec-row { display: grid; grid-template-columns: 250px 1fr; gap: 20px; padding: 15px 20px; border-bottom: 1px solid var(--line-soft); background: var(--panel); font-size: .93rem; }
.spec-row:last-child { border-bottom: 0; }
.spec-row dt { color: var(--ink-faint); font-weight: 500; margin: 0; }
.spec-row dd { margin: 0; color: var(--ink); }
@media (max-width: 700px) { .spec-row { grid-template-columns: 1fr; gap: 3px; } }

/* layered stack diagram */
.stack { display: grid; gap: 10px; }
.stack-layer {
  display: flex; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 20px; background: var(--panel); transition: transform .2s, background .2s, border-color .2s; cursor: default;
}
.stack-layer:hover, .stack-layer:focus-within { transform: translateX(6px); background: var(--panel-2); border-color: rgba(56, 189, 248, .4); }
.stack-layer .l-icon { width: 40px; height: 40px; flex: 0 0 auto; }
.stack-layer .l-icon svg { width: 100%; height: 100%; }
.stack-layer h3 { font-size: 1.02rem; margin-bottom: 2px; }
.stack-layer p { font-size: .88rem; color: var(--ink-dim); margin: 0; }
.stack .arrow-down { text-align: center; color: var(--ink-faint); font-size: 1.1rem; line-height: 1; margin: -4px 0; }

/* ---- contact form ---- */
.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); }
.field { margin-bottom: 18px; }
.field label { display: block; font: 600 .9rem/1.4 var(--font-body); margin-bottom: 7px; color: var(--ink); }
.field .req { color: var(--rose); }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 15px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(4, 7, 15, .6); color: var(--ink); font: 400 .98rem/1.5 var(--font-body);
  transition: border-color .18s, box-shadow .18s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56, 189, 248, .22); }
.field .hint { font-size: .8rem; color: var(--ink-faint); margin-top: 6px; }
.field .error-msg { display: none; font-size: .8rem; color: var(--rose); margin-top: 6px; }
.field.invalid input, .field.invalid textarea { border-color: rgba(251, 113, 133, .7); }
.field.invalid .error-msg { display: block; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 24px; }
.form-note { font-size: .82rem; color: var(--ink-faint); }
.copy-ok { font-size: .85rem; color: var(--emerald); }

.contact-method { display: flex; gap: 18px; align-items: flex-start; padding: 20px; }
.contact-method .cm-icon { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 13px; background: var(--grad-soft); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.contact-method .cm-icon svg { width: 22px; height: 22px; stroke: var(--cyan); fill: none; }
.contact-method h3 { font-size: 1.05rem; margin-bottom: 4px; }
.contact-method p { margin: 0; font-size: .9rem; }
.mail-address { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.3rem, 3vw, 1.8rem); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; word-break: break-all; }

/* ---- logo/ack strip ---- */
.ack-strip { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(24px, 5vw, 60px); padding-block: 30px; }
.ack-item { display: flex; flex-direction: column; gap: 3px; }
.ack-item b { font-family: var(--font-head); font-size: 1.05rem; color: var(--ink); }
.ack-item span { font-size: .8rem; color: var(--ink-faint); }

/* ---- misc ---- */
.card .as-h3, h2.as-h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.12; }
.divider { border: 0; border-top: 1px solid var(--line-soft); margin: 0; }
.tagline-underline { position: relative; }
.anchor-offset { scroll-margin-top: calc(var(--nav-h) + 20px); }
.badge-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: .8rem; color: var(--ink-dim); }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 30px 40px; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline li:last-child { padding-bottom: 4px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 3px solid var(--cyan); }
.timeline li.done::before { border-color: var(--emerald); background: var(--emerald); }
.timeline .t-date { font: 700 .8rem/1.5 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.timeline .t-title { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; margin: 2px 0 4px; }
.timeline p { color: var(--ink-dim); font-size: .92rem; margin: 0; }

.no-prose p { color: var(--ink-dim); }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose ul { color: var(--ink-dim); }

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Optimisations
   ========================================================================== */

@media (max-width: 768px) {
  /* Use-case filter pills: smooth horizontal swipe strip like native mobile apps */
  .filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    margin: 16px -16px 22px;
    padding: 4px 16px 12px;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter-btn {
    flex: 0 0 auto;
    padding: 8px 15px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  
  /* Timeline spacing on mobile */
  .timeline li {
    padding: 0 0 24px 26px;
    margin-left: 4px;
  }
  .timeline li::before {
    left: -6px;
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 62px;
  }

  /* Header on small screens */
  .site-header {
    height: var(--nav-h);
  }
  .brand {
    gap: 8px;
    font-size: 0.94rem;
    min-width: 0;
    flex-shrink: 1;
  }
  .brand-mark {
    width: 28px;
    height: 28px;
  }
  .brand span {
    min-width: 0;
  }
  .brand small {
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }
  .nav-toggle {
    width: 42px;
    height: 38px;
    flex-shrink: 0;
  }

  /* Typography scale */
  h1 { font-size: clamp(1.82rem, 7.5vw, 2.35rem); line-height: 1.15; }
  h2 { font-size: clamp(1.4rem, 5.5vw, 1.78rem); line-height: 1.2; }
  h3 { font-size: 1.14rem; }
  .lead { font-size: 1.02rem; line-height: 1.58; }
  .eyebrow { font-size: 0.74rem; letter-spacing: 0.12em; margin-bottom: 10px; }
  .eyebrow::before { width: 18px; }

  /* Layout & Section Spacing */
  .wrap { padding-inline: 16px; }
  .section { padding-block: 42px 38px; }
  .section-tight { padding-block: 28px 24px; }
  
  /* Hero section */
  .hero {
    min-height: auto;
    padding-top: var(--nav-h);
  }
  .hero-inner {
    padding-block: 36px 44px;
  }
  .hero-badge {
    border-radius: 12px;
    padding: 7px 12px;
    font-size: 0.78rem;
    line-height: 1.35;
    margin-bottom: 18px;
    max-width: 100%;
  }
  .page-hero {
    padding: calc(var(--nav-h) + 24px) 0 20px;
  }
  
  /* Buttons on mobile */
  .hero .btn-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }
  .hero .btn-row .btn {
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
  }
  .btn-row:not(.hero .btn-row) {
    gap: 10px;
  }

  /* Stats grid: clean 2x2 layout instead of 4 giant stacked rows */
  .section-tight .grid.g-4,
  .grid.g-4:has(.stat-card) {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .stat-card {
    padding: 16px 10px;
    border-radius: 14px;
  }
  .stat-num {
    font-size: clamp(1.65rem, 6.5vw, 2.1rem);
  }
  .stat-label {
    font-size: 0.78rem;
    line-height: 1.35;
    margin-top: 4px;
  }

  /* Cards */
  .card {
    padding: 20px 16px;
    border-radius: 14px;
  }
  .card p {
    font-size: 0.92rem;
  }
  
  /* Dual-Engine & CTA Cards */
  .split {
    gap: 26px;
  }
  .card.split {
    padding: 22px 18px !important;
  }
  .card.split .btn-row {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .card.split .btn {
    width: 100%;
    justify-content: center;
  }

  /* Interactive Flow Diagram (Why Private AI) */
  .flow-demo {
    border-radius: 14px;
  }
  .flow-tabs {
    flex-direction: row;
  }
  .flow-tab {
    padding: 11px 8px;
    font-size: 0.82rem;
    line-height: 1.25;
    text-align: center;
  }
  .flow-stage {
    padding: 14px 12px 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .flow-svg {
    min-width: 520px;
    height: auto;
  }
  .flow-caption {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .flow-status {
    font-size: 0.88rem;
    min-height: auto;
  }
  .privacy-gauge {
    min-width: 100% !important;
    width: 100%;
  }

  /* Comparison Table */
  .table-scroll .compare {
    min-width: 560px;
    font-size: 0.86rem;
  }
  .compare th, .compare td {
    padding: 10px 12px;
  }

  /* Terminal & Specs */
  .terminal-body {
    padding: 13px 12px 16px;
    font-size: 0.74rem;
    line-height: 1.55;
    min-height: 230px;
  }
  .spec-row {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 11px 14px;
    font-size: 0.88rem;
  }
  .stack-layer {
    padding: 13px 14px;
    gap: 12px;
  }
  .stack-layer .l-icon {
    width: 32px;
    height: 32px;
  }
  .stack-layer h3 {
    font-size: 0.98rem;
  }
  .stack-layer p {
    font-size: 0.84rem;
  }

  /* Form & Contact Page */
  .form-card {
    padding: 20px 16px;
    border-radius: 14px;
  }
  .field input, .field textarea, .field select {
    padding: 12px 13px;
    font-size: 0.95rem;
  }
  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .form-note {
    text-align: center;
  }
  #form-success {
    padding: 18px 16px !important;
  }
  .contact-method {
    padding: 16px 14px;
    gap: 14px;
  }
  .contact-method .cm-icon {
    width: 38px;
    height: 38px;
  }
  .mail-address {
    font-size: 1.25rem;
  }

  /* Steps and Callouts */
  .step {
    padding: 18px 14px;
    gap: 14px;
  }
  .step-num {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: 10px;
  }
  .callout {
    padding: 16px 16px;
    margin: 20px 0;
  }

  /* Footer */
  .footer-grid {
    padding-block: 36px 26px;
    gap: 22px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding-block: 16px;
  }
}
