/* Runaway Studio Inc. — site design system. Self-hosted-free (system fonts), CSP-clean.
   Identity: blueprint-cool paper, ultramarine signature, mono-inflected technical labels,
   launch-trajectory motif. Single committed light theme. */

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---- tokens ---- */
:root {
  --ink: #101014;
  --ink-2: #2A2A33;
  --paper: #EBECEF;      /* cool blueprint paper — deliberately not cream */
  --card: #FBFBFD;
  --brand: #2438E6;      /* ultramarine — the signature */
  --brand-ink: #1826AE;
  --brand-wash: #E4E6FB;
  --muted: #5B5B69;
  --line: #D6D7DE;
  --line-2: #C7C8D1;
  --ink-band: #101018;

  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
  --radius: 6px;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.006em;
}

/* ---- layout ---- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 9vw, 116px); }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }
.rule { height: 1px; background: var(--line); border: 0; }

/* ---- shared type ---- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before { content: "↗"; font-size: 13px; }
.eyebrow--muted { color: var(--muted); }
.eyebrow--muted::before { color: var(--brand); }

h1, h2, h3 { line-height: 1.08; letter-spacing: -0.03em; font-weight: 680; }
.display { font-size: clamp(40px, 7vw, 76px); line-height: 1.02; letter-spacing: -0.038em; }
.h2 { font-size: clamp(26px, 3.6vw, 40px); }
.h3 { font-size: clamp(19px, 2vw, 23px); letter-spacing: -0.02em; }
.lede { font-size: clamp(17px, 1.7vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 42ch; }
.measure { max-width: 66ch; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 680; letter-spacing: -0.02em; font-size: 16px; text-decoration: none; }
.brand:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 3px; }
.brand-mark {
  width: 22px; height: 22px; flex: none;
  border: 1.6px solid var(--ink); border-radius: 5px;
  display: grid; place-items: center; color: var(--brand);
}
.brand-mark svg { width: 13px; height: 13px; }
.brand .co { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; margin-left: 1px; }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  text-decoration: none; font-size: 14px; color: var(--ink-2); font-weight: 500;
  padding: 7px 12px; border-radius: var(--radius);
}
.nav-links a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav-links a[aria-current="page"] { color: var(--brand-ink); }
.nav-cta {
  text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 15px; border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
}
.nav-cta:hover { background: var(--brand); }
.nav-toggle { display: none; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  padding: 12px 20px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, background .16s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); }
.btn .arw { transition: transform .16s ease; }
.btn:hover .arw { transform: translate(2px, -2px); }
.btn:focus-visible, .nav-cta:focus-visible, .nav-links a:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr); gap: 40px; align-items: center; }
.hero .display { margin-top: 18px; }
.hero .lede { margin-top: 22px; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.chip {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em;
  color: var(--ink-2); background: var(--card); border: 1px solid var(--line);
  padding: 6px 11px; border-radius: 100px;
}
/* trajectory panel */
.traj { position: relative; aspect-ratio: 1 / 1; min-height: 260px; }
.traj svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.traj-path { fill: none; stroke: var(--brand); stroke-width: 2; opacity: 0.9; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.5s .25s cubic-bezier(.6,.02,.2,1) forwards;
  /* pathLength normalized to 1 via attribute */ }
.traj-ghost { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 5; }
.traj-node { fill: var(--brand); opacity: 0; animation: pop .4s 1.5s ease forwards; }
.traj-node--start { fill: var(--ink); }
.traj-label { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); letter-spacing: 0.06em; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

/* ---- capability strip ---- */
.caps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cap { background: var(--paper); padding: 22px 20px; }
.cap .n { font-family: var(--font-mono); font-size: 11px; color: var(--brand-ink); letter-spacing: 0.08em; }
.cap .t { font-weight: 620; margin-top: 8px; letter-spacing: -0.01em; }
.cap .d { font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* ---- section head ---- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 34px; }
.sec-head .h2 { max-width: 20ch; }
.sec-head p { color: var(--muted); max-width: 40ch; }

/* ---- work index ---- */
.index { border-top: 1px solid var(--line-2); }
.row {
  display: grid; grid-template-columns: 68px minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
  gap: 24px; align-items: baseline;
  padding: 26px 8px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; position: relative; transition: background .16s ease;
}
.row:hover { background: var(--card); }
.row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--brand); transform: scaleY(0); transform-origin: top; transition: transform .18s ease; }
.row:hover::before { transform: scaleY(1); }
.row .cat { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.row .name { font-size: clamp(20px, 2.2vw, 26px); font-weight: 660; letter-spacing: -0.025em; }
.row .tag { font-family: var(--font-mono); font-size: 11.5px; color: var(--brand-ink); letter-spacing: 0.04em; margin-top: 6px; text-transform: uppercase; }
.row .blurb { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.row .meta { display: flex; align-items: center; gap: 14px; justify-self: end; white-space: nowrap; }
.status { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 100px; padding: 4px 10px; }
.status--live { color: var(--brand-ink); border-color: var(--brand); background: var(--brand-wash); }
.row .go { color: var(--muted); transition: transform .16s ease, color .16s ease; }
.row:hover .go { color: var(--brand); transform: translate(2px, -2px); }
.row .go--none { opacity: 0; }
.row--static { cursor: default; }
.row--static::before { display: none; }
.row--static:hover { background: transparent; }

/* small spacing utilities (keeps markup lean; style-src allows attrs but classes stay tidy) */
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.mt-28 { margin-top: 28px; }
.maxw-24 { max-width: 24ch; }

/* ---- capabilities (v2) — editorial top-ruled columns ---- */
.caps2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.cap2 { border-top: 2px solid var(--ink); padding-top: 16px; }
.cap2 .k { font-family: var(--font-mono); font-size: 11px; color: var(--brand-ink); letter-spacing: 0.1em; }
.cap2 .t { font-weight: 660; font-size: 17px; letter-spacing: -0.02em; margin-top: 10px; }
.cap2 .d { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 8px; }

/* ---- credibility band (v2) — one strong claim, not a stat row ---- */
.cred { background: var(--ink-band); color: var(--paper); }
.cred .wrap { display: flex; align-items: baseline; gap: clamp(16px, 4vw, 48px); flex-wrap: wrap; }
.cred .big-num { font-size: clamp(44px, 7vw, 84px); font-weight: 700; letter-spacing: -0.04em; color: #fff; line-height: 1; }
.cred .big-num .u { color: #A9AEF6; }
.cred .claim { max-width: 46ch; color: #C4C5CE; font-size: clamp(15px, 1.7vw, 19px); line-height: 1.5; }
.cred .claim strong { color: #fff; font-weight: 600; }

/* ---- work blocks (v2) — richer than the index rows ---- */
.work-list { border-top: 1px solid var(--line-2); }
.work-item { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); padding: clamp(32px, 4vw, 46px) 0; border-bottom: 1px solid var(--line); }
.work-item .rail { display: flex; flex-direction: column; gap: 12px; }
.work-item .rail .cat { font-family: var(--font-mono); font-size: 13px; color: var(--muted); letter-spacing: 0.06em; }
.work-item .body .name { font-size: clamp(24px, 3vw, 34px); font-weight: 660; letter-spacing: -0.03em; }
.work-item .body .name a { text-decoration: none; }
.work-item .body .name a:hover { color: var(--brand-ink); }
.work-item .body .tags { font-family: var(--font-mono); font-size: 12px; color: var(--brand-ink); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 8px; }
.work-item .body .desc { color: var(--ink-2); font-size: clamp(15px, 1.6vw, 16.5px); line-height: 1.6; margin-top: 16px; max-width: 64ch; }
.work-item .body .desc + .desc { margin-top: 12px; }
.tech-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.tech-chip { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); padding: 4px 9px; border-radius: 5px; }
.work-item .visit { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; font-weight: 600; font-size: 14px; color: var(--brand-ink); text-decoration: none; }
.work-item .visit:hover { text-decoration: underline; text-underline-offset: 3px; }
.work-item .visit .arw { transition: transform .16s ease; }
.work-item .visit:hover .arw { transform: translate(2px, -2px); }
/* pending placeholder marker — visually loud so it can never ship silently */
.pending { background: repeating-linear-gradient(135deg, #FFF3D6, #FFF3D6 8px, #FDE9B8 8px, #FDE9B8 16px); border: 1px dashed #C9922B; color: #7A5A12; font-family: var(--font-mono); font-size: 12px; padding: 2px 7px; border-radius: 4px; }

/* ---- about story (v2) ---- */
.story { max-width: 60ch; }
.story p { font-size: clamp(16px, 1.7vw, 18px); line-height: 1.62; color: var(--ink-2); }
.story p + p { margin-top: 18px; }
.story p.lead-para { font-size: clamp(18px, 2vw, 22px); line-height: 1.5; color: var(--ink); letter-spacing: -0.01em; }

@media (max-width: 760px) {
  .caps2 { grid-template-columns: 1fr 1fr; }
  .work-item { grid-template-columns: 1fr; gap: 14px; }
  .work-item .rail { flex-direction: row; align-items: center; gap: 14px; }
}
@media (max-width: 440px) {
  .caps2 { grid-template-columns: 1fr; }
}

/* featured cards (home) */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: border-color .16s ease, transform .16s ease;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card .cat { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
.card .name { font-size: 22px; font-weight: 660; letter-spacing: -0.025em; margin-top: 12px; }
.card .tag { font-family: var(--font-mono); font-size: 11px; color: var(--brand-ink); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }
.card .blurb { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; margin-top: 14px; flex: 1; }
.card .foot { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; }

/* ---- ink band (about / cta) ---- */
.band { background: var(--ink-band); color: var(--paper); }
.band .eyebrow { color: #A9AEF6; }
.band .eyebrow::before { color: #A9AEF6; }
.band .lede, .band p { color: #C4C5CE; }
.band .h2 { color: #fff; }
.band a.inline { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--brand); }

/* ---- about ---- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 72px); }
.facts { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line-2); }
.fact { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.fact dt { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.fact dd { font-size: 15px; }
.principles { display: grid; gap: 2px; margin-top: 8px; }
.principle { padding: 20px 0; border-bottom: 1px solid var(--line); }
.principle .h3 { display: flex; align-items: baseline; gap: 12px; }
.principle .h3 .k { font-family: var(--font-mono); font-size: 13px; color: var(--brand-ink); }
.principle p { color: var(--muted); margin-top: 8px; max-width: 60ch; }

/* ---- contact ---- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.contact-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 3vw, 34px); }
.contact-card .big { font-size: clamp(22px, 2.4vw, 28px); font-weight: 660; letter-spacing: -0.02em; }
.contact-card .email { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; font-family: var(--font-mono); font-size: clamp(15px, 1.6vw, 18px); color: var(--brand-ink); text-decoration: none; word-break: break-all; }
.contact-card .email:hover { text-decoration: underline; text-underline-offset: 3px; }
.legalbox { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.legalbox strong { color: var(--ink); font-weight: 640; }

/* ---- legal prose ---- */
.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(20px, 2.2vw, 26px); margin-top: 44px; margin-bottom: 12px; letter-spacing: -0.02em; }
.prose h2:first-of-type { margin-top: 8px; }
.prose p { margin-top: 14px; color: var(--ink-2); }
.prose ul { margin-top: 14px; padding-left: 22px; color: var(--ink-2); }
.prose li { margin-top: 8px; }
.prose a { color: var(--brand-ink); text-underline-offset: 3px; }
.doc-meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); letter-spacing: 0.03em; }
.callout { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); padding: 16px 18px; margin-top: 20px; font-size: 14.5px; color: var(--ink-2); }

/* ---- footer ---- */
.site-footer { background: var(--ink-band); color: #B7B8C4; padding-block: clamp(44px, 6vw, 72px); margin-top: 8px; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.8fr)); gap: 32px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 680; letter-spacing: -0.02em; text-decoration: none; }
.footer-brand .brand-mark { border-color: #3A3A48; color: #A9AEF6; }
.footer-note { margin-top: 14px; font-size: 13.5px; max-width: 34ch; line-height: 1.6; }
.fcol h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #6E6F7E; font-weight: 600; }
.fcol ul { list-style: none; margin-top: 14px; display: grid; gap: 9px; }
.fcol a { color: #C4C5CE; text-decoration: none; font-size: 14px; }
.fcol a:hover { color: #fff; }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid #26262F; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; font-size: 12.5px; color: #7C7D8B; }
.footer-bottom .legal { font-family: var(--font-mono); letter-spacing: 0.02em; }
.footer-bottom nav { display: flex; gap: 18px; }
.footer-bottom nav a { color: #7C7D8B; text-decoration: none; }
.footer-bottom nav a:hover { color: #C4C5CE; }

/* ---- page intro (interior pages) ---- */
.page-intro { padding-top: clamp(44px, 6vw, 84px); padding-bottom: clamp(28px, 4vw, 44px); }
.page-intro .display { font-size: clamp(34px, 5.4vw, 60px); margin-top: 16px; }
.page-intro .lede { margin-top: 20px; max-width: 54ch; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .traj { max-width: 380px; order: -1; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav-links, .nav-cta { display: none; }
  .nav[data-open="true"] .nav-links {
    display: flex; position: absolute; left: 0; right: 0; top: 66px; flex-direction: column; align-items: stretch;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px var(--gutter) 18px; gap: 2px;
  }
  .nav[data-open="true"] .nav-links a { padding: 12px 8px; font-size: 16px; }
  .nav-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); cursor: pointer; }
  .nav-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
  .caps { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
  .row { grid-template-columns: 52px 1fr; gap: 6px 16px; }
  .row .blurb { grid-column: 2; }
  .row .meta { grid-column: 2; justify-self: start; margin-top: 10px; }
  .fact { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 440px) {
  .caps { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
}

/* ---- a11y: motion ---- */
@media (prefers-reduced-motion: reduce) {
  .traj-path { animation: none; stroke-dashoffset: 0; }
  .traj-node { animation: none; opacity: 1; }
  * { scroll-behavior: auto !important; }
  .btn, .card, .row, .go, .arw { transition: none !important; }
}
