/* Keel site. Colours are the client palette (client/features/palette.gd) and nothing else.
   Sizes: 56 / 28 / 18 / 14 on desktop, 36 / 22 / 17 / 13 on a phone.
   Spacing: 4, 8, 12, 16, 24, 32, 48, 64, 96.
   Motion (design-quality.md section 5, website): the hero clip and one soft reveal per section, both off under reduced motion. */

@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #0A0A12;
  --ink-900: #12121D;
  --ink-800: #1A1A29;
  --ink-600: #34344F;
  --ink-400: #6E6E94;
  --ink-300: #9C9CBC;
  --ink-200: #C7C7DD;
  --ink-100: #E8E6F0;
  --pearl: #F4EEDF;
  --azure: #6FA8FF;
  --sea: #6BD6B5;
  --lantern: #F2CC6B;
  --flare: #FF5A4E;

  --raiders: #D9774A;
  --sentries: #8FD0EA;
  --breakers: #C98AE0;
  --humans: #C3C8D4;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;

  --t1: 56px;
  --t2: 28px;
  --t3: 18px;
  --t4: 14px;
  --gutter: var(--s6);
  --section: calc(var(--s9) + var(--s8));

  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: 180ms ease-out;
}

@media (max-width: 600px) {
  :root {
    --t1: 36px;
    --t2: 22px;
    --t3: 17px;
    --t4: 13px;
    --gutter: var(--s4);
    --section: var(--s9);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: dark;
  background: var(--void);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--s5);
}

body {
  margin: 0;
  background: var(--void);
  color: var(--ink-200);
  font-family: var(--body);
  font-size: var(--t3);
  line-height: 1.5;
  overflow-x: hidden;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink-100);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
h1 { font-size: var(--t1); color: var(--pearl); }
h2 { font-size: var(--t2); }
h3 { font-size: var(--t3); }

p { margin: 0 0 var(--s4); max-width: 56ch; }
ul, ol { margin: 0 0 var(--s4); padding-left: var(--s5); max-width: 56ch; }
li { margin-bottom: var(--s2); }
small { font-size: var(--t4); color: var(--ink-300); }
img { max-width: 100%; }

a {
  color: var(--azure);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--ease), border-color var(--ease), background-color var(--ease);
}
a:hover { color: var(--pearl); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--pearl);
  outline-offset: 2px;
}

/* Skip link */
.skip {
  position: absolute;
  z-index: 10;
  left: var(--s4);
  top: var(--s2);
  padding: var(--s3) var(--s4);
  background: var(--pearl);
  color: var(--void);
  border-radius: 6px;
  font-family: var(--display);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; color: var(--void); }

/* Header: a plain bar on inner pages; on the front page it sits over the hero. */
.site-header {
  position: relative;
  z-index: 3;
  border-bottom: 1px solid var(--ink-600);
  background: var(--void);
}
.over-hero .site-header {
  position: absolute;
  inset: 0 0 auto;
  border-bottom-color: transparent;
  background: transparent;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s5);
  min-height: 72px;
  max-width: 1400px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  min-height: 44px;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pearl);
  text-decoration: none;
}
.brand img { width: 28px; height: 28px; }
.brand:hover { color: var(--ink-100); }
nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s5);
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}
nav li { margin: 0; }
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-200);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
nav a:hover { color: var(--pearl); border-bottom-color: var(--ink-400); }
nav a[aria-current="page"] { color: var(--pearl); border-bottom-color: var(--pearl); }
@media (max-width: 600px) {
  nav ul { gap: 0 var(--s3); }
}

/* Hero: the clip fills the first screen; the copy sits low on the left, over a Void scrim. */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--s9) + var(--s5)) 0 var(--s8);
  overflow: hidden;
  background: var(--void);
}
/* On a phone the nav wraps to a second row, so the copy starts below it. */
@media (max-width: 600px) { .hero { padding-top: calc(var(--s9) + var(--s8)); } }
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img,
.hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
}
.hero-media video { opacity: 0; transition: opacity 600ms ease-out; }
.hero-media video.playing { opacity: 1; }
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 10, 18, 0.94) 0%, rgba(10, 10, 18, 0.78) 34%, rgba(10, 10, 18, 0.18) 72%, rgba(10, 10, 18, 0.3) 100%),
    linear-gradient(0deg, var(--void) 0%, rgba(10, 10, 18, 0) 34%),
    linear-gradient(180deg, rgba(10, 10, 18, 0.92) 0%, rgba(10, 10, 18, 0.6) 12%, rgba(10, 10, 18, 0) 30%);
}
.clip-toggle {
  position: absolute;
  right: var(--gutter);
  bottom: var(--s5);
  z-index: 2;
  min-height: 44px;
  padding: 0 var(--s4);
  background: rgba(10, 10, 18, 0.6);
  color: var(--ink-200);
  border: 1px solid var(--ink-600);
  border-radius: 6px;
  font: inherit;
  font-size: var(--t4);
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease);
}
.clip-toggle:hover { color: var(--pearl); border-color: var(--ink-400); }
.clip-toggle[hidden] { display: none; }
.hero-copy { position: relative; z-index: 1; width: 100%; max-width: 1400px; }
.hero .mark { display: block; width: 98px; height: 88px; margin-bottom: var(--s5); }
.hero h1 { font-size: var(--t1); letter-spacing: 0.32em; margin-right: -0.32em; }
.hook {
  margin: var(--s4) 0 var(--s5);
  max-width: 24ch;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t2);
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-100);
}
.hero .pitch { max-width: 54ch; color: var(--ink-200); }
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s5);
  margin-top: var(--s6);
}
.build {
  margin: var(--s5) 0 0;
  font-size: var(--t4);
  color: var(--ink-300);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 var(--s6);
  background: var(--pearl);
  color: var(--void);
  border: 1px solid var(--pearl);
  border-radius: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}
.btn:hover { background: var(--ink-100); border-color: var(--ink-100); color: var(--void); }
.quiet, .tap {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: var(--t4);
}
.quiet { color: var(--ink-100); text-decoration-color: var(--ink-400); }

/* First-load reveal of the hero copy: opacity and transform only, 300 ms, 60 ms apart */
.rise { animation: rise 300ms ease-out both; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Section reveal: only once the script has set it up (html.reveal-ready), once per section, 400 ms. */
.reveal-ready .reveal { transition: opacity 400ms ease-out, transform 400ms ease-out; }
.reveal-ready .reveal:not(.in) { opacity: 0; transform: translateY(16px); }

/* Sections */
section { padding: var(--section) 0 0; }
.section-head { margin-bottom: var(--s7); }
.section-head h2 { margin-bottom: var(--s4); }
.lead { color: var(--ink-100); font-size: var(--t3); }

/* The fleet: one Dreadnought at a time on a full-width stage. Without the script all four stack. */
.fleet { padding-top: var(--section); }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0;
  padding: 0;
}
.tabs[hidden] { display: none; }
.tab {
  min-height: 44px;
  padding: 0 var(--s4);
  background: transparent;
  color: var(--ink-300);
  border: 1px solid var(--ink-600);
  border-radius: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease), background-color var(--ease);
}
.tab:hover { color: var(--ink-100); border-color: var(--ink-400); }
.tab[aria-selected="true"] { color: var(--pearl); border-color: var(--f, var(--pearl)); background: var(--ink-900); }
.tab[data-f="humans"] { --f: var(--humans); }
.tab[data-f="raiders"] { --f: var(--raiders); }
.tab[data-f="sentries"] { --f: var(--sentries); }
.tab[data-f="breakers"] { --f: var(--breakers); }

.stage {
  margin-top: var(--s6);
  border-top: 1px solid var(--ink-600);
  border-bottom: 1px solid var(--ink-600);
  background: radial-gradient(ellipse 60% 70% at 50% 55%, var(--ink-800) 0%, var(--void) 70%);
}
.hull {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  margin: 0;
  padding: var(--s6) 0;
}
.hull + .hull { border-top: 1px solid var(--ink-600); }
.js .hull + .hull { border-top: 0; }
.hull[hidden] { display: none; }
.hull img { display: block; width: 100%; height: auto; }
.hull figcaption { padding: 0 var(--gutter); }
.hull h3 { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.hull h3::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--f, var(--pearl));
}
.hull[data-f="humans"] { --f: var(--humans); }
.hull[data-f="raiders"] { --f: var(--raiders); }
.hull[data-f="sentries"] { --f: var(--sentries); }
.hull[data-f="breakers"] { --f: var(--breakers); }
.hull .type { margin-bottom: var(--s2); font-size: var(--t4); color: var(--ink-300); }
.hull p:last-child { margin-bottom: 0; }
@media (min-width: 960px) {
  .hull { grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr); max-width: 1400px; margin: 0 auto; }
  .hull figcaption { padding: 0 var(--gutter) 0 0; }
}
.fleet-note { margin-top: var(--s4); font-size: var(--t4); color: var(--ink-300); max-width: 72ch; }

/* Split rows: text and a capture side by side, alternating; stacked on a phone. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s5);
  align-items: center;
  margin-bottom: var(--s9);
}
.split:last-child { margin-bottom: 0; }
.split-text h3 { margin-bottom: var(--s3); }
.split-text p:last-child { margin-bottom: 0; }
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: var(--s8); }
  .split.flip { grid-template-columns: minmax(0, 8fr) minmax(0, 5fr); }
  .split.flip .split-text { order: 2; }
}

/* Captures */
.shot {
  margin: 0;
  background: var(--ink-900);
  border: 1px solid var(--ink-600);
  border-radius: 6px;
  padding: var(--s2);
}
.shot a { display: block; border-radius: 4px; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.shot figcaption {
  padding: var(--s3) var(--s2) var(--s1);
  font-size: var(--t4);
  line-height: 1.5;
  color: var(--ink-300);
  max-width: 60ch;
}
.shot.full { margin-bottom: var(--s7); }

/* Short facts beside each other: text with a top rule, not cards. */
.notes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s6) var(--s7);
}
@media (min-width: 760px) { .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.note { padding-top: var(--s4); border-top: 1px solid var(--ink-600); }
.note h3 { margin-bottom: var(--s3); }
.note p:last-child { margin-bottom: 0; }

/* 0.6.0 */
.release-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--s7);
}
@media (min-width: 760px) { .release-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.release-list li { margin: 0; padding: var(--s4) 0; border-top: 1px solid var(--ink-600); }
.release-list strong { display: block; margin-bottom: var(--s1); font-family: var(--display); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-100); font-size: var(--t4); }

/* Alpha */
.panel {
  background: var(--ink-900);
  border: 1px solid var(--ink-600);
  border-radius: 6px;
  padding: var(--s6);
}
.panel > :last-child { margin-bottom: 0; }
@media (max-width: 600px) { .panel { padding: var(--s5) var(--s4); } }
.alpha-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
@media (min-width: 960px) { .alpha-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s8); } }

/* Download and play: the browser row, then one row per build file. Sizes and sums come from latest.json. */
.play-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4) var(--s6);
  align-items: center;
  padding-bottom: var(--s5);
}
.play-row h3, .dl-name h3 { margin-bottom: var(--s2); }
.play-row p { margin: 0; }
@media (min-width: 760px) { .play-row { grid-template-columns: minmax(0, 1fr) auto; } }
.dl-list { list-style: none; padding: 0; margin: 0; max-width: none; }
.dl-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s3) var(--s5);
  align-items: center;
  margin: 0;
  padding: var(--s5) 0;
  border-top: 1px solid var(--ink-600);
}
.dl-list li:last-child { padding-bottom: 0; }
@media (min-width: 760px) { .dl-list li { grid-template-columns: 180px minmax(0, 1fr) auto; } }
.dl-name p { margin: 0; font-size: var(--t4); color: var(--ink-300); }
.dl-file { margin: 0; color: var(--ink-100); overflow-wrap: anywhere; }
.dl-check {
  margin: var(--s1) 0 0;
  max-width: none;
  font-size: var(--t4);
  color: var(--ink-300);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.dl-check[hidden], .dl-status[hidden] { display: none; }
.btn.line {
  min-height: 44px;
  padding: 0 var(--s5);
  background: transparent;
  color: var(--pearl);
  border-color: var(--ink-600);
  font-size: var(--t4);
}
.btn.line:hover { background: var(--ink-800); border-color: var(--pearl); color: var(--pearl); }
.dl-status { margin: var(--s5) 0 0; font-size: var(--t4); color: var(--ink-300); max-width: 72ch; }
.steps { margin-top: var(--s7); }
.steps ol { margin: 0; padding-left: var(--s5); }
.steps li { margin-bottom: var(--s2); }
.steps li:last-child { margin-bottom: 0; }
code { font-size: 0.9em; color: var(--ink-100); overflow-wrap: anywhere; }

dl.facts { font-variant-numeric: tabular-nums; margin: 0 0 var(--s5); display: grid; grid-template-columns: 1fr; gap: var(--s2) var(--s5); }
@media (min-width: 700px) { dl.facts { grid-template-columns: 140px 1fr; gap: var(--s3) var(--s5); } }
dl.facts dt {
  font-size: var(--t4);
  color: var(--ink-300);
}
dl.facts dd { margin: 0 0 var(--s2); color: var(--ink-100); }
@media (min-width: 700px) { dl.facts dt { padding-top: var(--s1); } dl.facts dd { margin: 0; } }

.warn { margin: 0 0 var(--s5); color: var(--ink-100); }
.warn::before { content: "!"; display: inline-block; width: 1.4em; font-family: var(--display); font-weight: 600; color: var(--flare); }

/* Dev log list (front page and devlog.html) */
.posts { list-style: none; padding: 0; margin: 0 0 var(--s5); max-width: none; }
.posts li {
  margin: 0;
  padding: var(--s4) 0;
  border-top: 1px solid var(--ink-600);
}
.posts li:last-child { border-bottom: 1px solid var(--ink-600); }
.posts .title {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.posts .meta { display: block; font-variant-numeric: tabular-nums; font-size: var(--t4); color: var(--ink-300); margin: var(--s1) 0 var(--s2); }
.posts p { margin: 0; }

/* Closing call */
.closing { padding-bottom: var(--section); }
.closing .wrap { text-align: left; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--ink-600);
  padding: var(--s7) 0 var(--s8);
  font-size: var(--t4);
  color: var(--ink-300);
}
.site-footer .wrap { max-width: 1400px; }
.site-footer p { margin-bottom: var(--s3); max-width: 72ch; }
.site-footer strong { color: var(--ink-100); font-weight: 600; }

.page-title { padding: var(--s8) 0 var(--s6); }
.page-title h1 { font-size: var(--t2); color: var(--pearl); }
.page-title p { margin-top: var(--s4); }

/* Policy pages (privacy.html, terms.html, support.html) */
.draft-banner {
  margin: var(--s6) 0 0;
  padding: var(--s4) var(--s5);
  max-width: 72ch;
  background: var(--ink-900);
  border: 1px solid var(--lantern);
  border-radius: 6px;
  font-size: var(--t4);
  color: var(--ink-100);
}
.draft-banner p { margin: 0; max-width: none; }
.draft-banner strong { color: var(--lantern); font-weight: 600; }
.legal { padding-bottom: var(--section); }
.legal h2 { margin: var(--s7) 0 var(--s4); font-size: var(--t3); }
.legal h2:first-child { margin-top: 0; }
.legal .meta { font-size: var(--t4); color: var(--ink-300); font-variant-numeric: tabular-nums; }
.ph { color: var(--lantern); font-weight: 600; }
.legal-links a { margin-right: var(--s4); }

::selection { background: rgba(244, 238, 223, 0.28); color: var(--pearl); }
html { scrollbar-color: var(--ink-600) var(--void); }

@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-media video, .clip-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal-ready .reveal:not(.in) { opacity: 1; transform: none; }
  .hero-media video, .clip-toggle { display: none; }
}

