/* rakengine.com — one stylesheet, no framework, no build step. */

:root {
  --paper: #F4F6F7;
  --surface: #FFFFFF;
  --surface-2: #EDF1F3;
  --ink: #0F161B;
  --ink-soft: #4C5A64;
  --ink-faint: #7C8B95;
  --rule: #D3DBE0;
  --rule-soft: #E4EAED;
  --blueprint: #0F4C64;
  --blueprint-2: #2E7E9B;
  --blueprint-wash: #E3EDF1;
  --flame: #C25510;
  --flame-wash: #F7E9DF;
  --pass: #3B7D57;
  --warn: #B08214;
  --fail: #A63B2C;
  --cal: #7A5AA8;

  --font-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  --measure: 66ch;
  --gutter: 28px;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B1116;
    --surface: #111A20;
    --surface-2: #16222A;
    --ink: #E7EDF0;
    --ink-soft: #9DACB6;
    --ink-faint: #6E7F8A;
    --rule: #233039;
    --rule-soft: #1A252C;
    --blueprint: #6FBCD6;
    --blueprint-2: #4E9DB8;
    --blueprint-wash: #142933;
    --flame: #E9853F;
    --flame-wash: #2A190F;
    --pass: #5EA97C;
    --warn: #D3A63A;
    --fail: #D2604E;
    --cal: #A98BD6;
  }
}

:root[data-theme="dark"] {
  --paper: #0B1116;
  --surface: #111A20;
  --surface-2: #16222A;
  --ink: #E7EDF0;
  --ink-soft: #9DACB6;
  --ink-faint: #6E7F8A;
  --rule: #233039;
  --rule-soft: #1A252C;
  --blueprint: #6FBCD6;
  --blueprint-2: #4E9DB8;
  --blueprint-wash: #142933;
  --flame: #E9853F;
  --flame-wash: #2A190F;
  --pass: #5EA97C;
  --warn: #D3A63A;
  --fail: #D2604E;
  --cal: #A98BD6;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
  letter-spacing: -0.015em;
}

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

a { color: var(--blueprint); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--flame); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; border-radius: 2px; }

img, svg { max-width: 100%; }
figure { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: var(--measure); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blueprint);
  margin: 0 0 14px;
}

.lede { font-size: 20px; color: var(--ink-soft); max-width: var(--measure); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--ink);
  padding: 12px 18px; z-index: 100;
  font-family: var(--font-display); font-size: 15px;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 40;
}
.masthead-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 14px var(--gutter);
  max-width: var(--wrap); margin: 0 auto;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display); font-weight: 700;
  letter-spacing: -0.01em; font-size: 18px;
  color: var(--ink); text-decoration: none;
}
.brand span { color: var(--blueprint); }
.brand:hover { color: var(--ink); }

.nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.nav a {
  font-family: var(--font-display); font-weight: 500; font-size: 15px;
  color: var(--ink-soft); text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--flame); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule);
  border-radius: 2px; padding: 7px 12px; color: var(--ink);
  font-family: var(--font-mono); font-size: 12px; cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; width: 100%; order: 3;
    flex-direction: column; align-items: flex-start; gap: 0;
    border-top: 1px solid var(--rule-soft); margin-top: 12px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--rule-soft); }
}

/* ---------- sections ---------- */

.hero { padding: 78px 0 60px; border-bottom: 1px solid var(--rule); }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.05; max-width: 20ch;
}
.hero h1 em { font-style: normal; color: var(--blueprint); }
.hero .lede { margin-top: 22px; font-size: 21px; }

section { padding: 62px 0; border-bottom: 1px solid var(--rule); }
section > .wrap > h2 { font-size: clamp(24px, 3vw, 33px); margin-bottom: 16px; }
section.tint { background: var(--surface); }

.facts {
  display: flex; flex-wrap: wrap; gap: 0;
  margin-top: 38px; border-top: 1px solid var(--rule);
}
.fact { flex: 1 1 200px; padding: 18px 22px 16px 0; border-right: 1px solid var(--rule-soft); }
.fact:last-child { border-right: 0; }
.fact dt {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint);
}
.fact dd {
  margin: 6px 0 0; font-family: var(--font-display);
  font-weight: 600; font-size: 16.5px; line-height: 1.35;
}

/* ---------- product cards ---------- */

/* Rules are drawn by the cards, not by a coloured gap showing through: an
   incomplete last row then reads as whitespace rather than a hole. */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0; margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--rule); border-radius: 2px;
}
.card {
  padding: 26px 24px 24px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin: 0 -1px -1px 0;
}
.card .tag {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--flame);
}
.card h3 { font-size: 21px; margin: 8px 0 4px; }
.card h3 a { text-decoration: none; color: var(--ink); }
.card h3 a:hover { color: var(--blueprint); }
.card .role { font-size: 14.5px; color: var(--ink-faint); margin-bottom: 12px; }
.card > p { font-size: 15.5px; color: var(--ink-soft); }
.card ul { margin: 14px 0 0; padding: 0; list-style: none; }
.card li {
  font-size: 14px; color: var(--ink-soft); padding: 6px 0 6px 16px;
  position: relative; border-top: 1px solid var(--rule-soft);
}
.card li::before {
  content: ""; position: absolute; left: 0; top: 15px;
  width: 6px; height: 1px; background: var(--blueprint);
}
.card .more {
  margin-top: 18px; font-family: var(--font-display); font-weight: 600;
  font-size: 15px; text-decoration: none;
}

@media (min-width: 980px) {
  .cards.n2, .cards.n4 { grid-template-columns: repeat(2, 1fr); }
  .cards.n3, .cards.n6 { grid-template-columns: repeat(3, 1fr); }
}

.pill {
  display: inline-block; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px;
  border-radius: 2px; border: 1px solid var(--rule);
  color: var(--ink-faint); background: var(--surface-2);
}
.card > .pill { align-self: flex-start; }
.pill.included { color: var(--pass); border-color: var(--pass); }
.pill.optional { color: var(--blueprint); border-color: var(--blueprint); }

/* ---------- plain blocks ---------- */

.twocol {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 26px 42px; margin-top: 28px;
}
.point h4 { font-size: 16.5px; margin-bottom: 6px; }
.point p { font-size: 15.5px; color: var(--ink-soft); }

.rulelist { margin: 24px 0 0; padding: 0; list-style: none; max-width: var(--measure); }
.rulelist li {
  padding: 14px 0; border-top: 1px solid var(--rule-soft);
  color: var(--ink-soft); font-size: 16px;
}
.rulelist li b { color: var(--ink); font-family: var(--font-display); font-weight: 600; }

.callout {
  margin-top: 34px; padding: 24px 26px; background: var(--blueprint-wash);
  border-left: 3px solid var(--blueprint); border-radius: 0 2px 2px 0;
  max-width: var(--measure);
}

.steps { margin-top: 34px; border-top: 1px solid var(--rule); }
.step {
  display: grid; grid-template-columns: 74px 1fr;
  border-bottom: 1px solid var(--rule-soft); padding: 22px 0;
}
.step-n { font-family: var(--font-mono); font-size: 12px; color: var(--blueprint); padding-top: 5px; letter-spacing: 0.08em; }
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--ink-soft); max-width: 62ch; }
.step .owner {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-faint); margin-top: 8px;
}
.step .owner b { color: var(--ink); font-weight: 500; }

.figure { margin: 34px 0 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 2px; }
.figure .scroll { overflow-x: auto; padding: 22px; }
.figure svg { display: block; width: 100%; height: auto; }
.figcap {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint);
  padding: 0 22px 16px; letter-spacing: 0.03em;
}

.cta { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: baseline; margin-top: 24px; }
.button {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: 16px; text-decoration: none; padding: 12px 22px; border-radius: 2px;
  background: var(--blueprint); color: var(--paper); border: 1px solid var(--blueprint);
}
.button:hover { background: var(--blueprint-2); border-color: var(--blueprint-2); color: var(--paper); }
.button.ghost { background: transparent; color: var(--blueprint); }
.button.ghost:hover { background: var(--blueprint-wash); color: var(--blueprint); }

/* ---------- footer ---------- */

footer.site {
  padding: 52px 0 64px; background: var(--surface);
  border-top: 1px solid var(--rule);
}
.foot-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 32px;
}
.foot-cols h4 {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 500; margin-bottom: 12px;
}
.foot-cols ul { list-style: none; margin: 0; padding: 0; }
.foot-cols li { padding: 5px 0; }
.foot-cols a { font-size: 15px; text-decoration: none; color: var(--ink-soft); }
.foot-cols a:hover { color: var(--blueprint); }
.stamp {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint);
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule-soft);
  letter-spacing: 0.03em;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 54px 0 44px; }
  section { padding: 46px 0; }
  .step { grid-template-columns: 52px 1fr; }
  .fact { border-right: 0; border-bottom: 1px solid var(--rule-soft); padding-right: 0; flex-basis: 100%; }
}

@media print {
  body { background: #fff; }
  .masthead, .nav-toggle { position: static; }
  section { break-inside: avoid; }
}

/* ---------- diagram type ---------- */

.svg-station { font-family: var(--font-display); font-weight: 600; font-size: 15px; fill: var(--ink); }
.svg-sub { font-family: var(--font-body); font-size: 12.5px; fill: var(--ink-soft); }
.svg-artifact { font-family: var(--font-mono); font-size: 11px; fill: var(--blueprint); letter-spacing: 0.02em; }
.svg-band { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.06em; }
.svg-note { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-soft); letter-spacing: 0.04em; }

.figure .scroll svg { min-width: 900px; }

/* ---------- three faces ---------- */

.faces {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0; margin-top: 30px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 2px; overflow: hidden;
}
.face {
  padding: 24px 22px 20px;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin: 0 -1px -1px 0;
}
.face h4 { font-size: 15.5px; margin-bottom: 4px; }
.face .who {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--blueprint); margin-bottom: 14px;
}
.face p { font-size: 14.5px; color: var(--ink-soft); margin: 14px 0 0; line-height: 1.5; }
.face svg { width: 100%; height: auto; max-width: 190px; display: block; margin: 0 auto; overflow: visible; }

/* ---------- screenshots and split blocks ---------- */

.shot {
  margin: 28px 0 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
}
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption {
  font-size: 14px; color: var(--ink-soft);
  padding: 14px 18px; border-top: 1px solid var(--rule-soft);
  line-height: 1.5;
}

.split {
  display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr);
  gap: 34px; align-items: start; margin-top: 26px;
}
.split > div > p { color: var(--ink-soft); max-width: 54ch; }
.split .shot { margin-top: 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 20px; } }

.outputs-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); margin: 22px 0 8px;
}
.outputs { margin: 0; padding: 0; list-style: none; max-width: 54ch; }
.outputs li {
  font-size: 15px; color: var(--ink-soft);
  padding: 7px 0 7px 16px; position: relative;
  border-top: 1px solid var(--rule-soft);
}
.outputs li::before {
  content: ""; position: absolute; left: 0; top: 16px;
  width: 6px; height: 1px; background: var(--blueprint);
}

.gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px; margin-top: 28px;
}
.gallery .shot { margin-top: 0; display: flex; flex-direction: column; }
.gallery .shot img { object-fit: cover; }

.face-note {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.03em; margin: 12px 0 0; line-height: 1.5;
}
.hero-note { font-size: 15.5px; color: var(--ink-faint); margin-top: 16px; }
.hero-pill { margin-top: 20px; }

.hero-email {
  margin-top: 18px; font-family: var(--font-mono); font-size: 15px;
}
.hero-email a { text-decoration: none; }

.stamp-contact {
  font-family: var(--font-mono); font-size: 12px; margin-top: 8px;
}
.stamp-contact a { color: var(--ink-soft); text-decoration: none; }
