/**
 * Styles of the Codjiva landing page. Plain CSS, no build step.
 *
 * The page uses the app's own look: four base colours on a blueprint grid, and
 * JetBrains Mono for every word. The dark palette is the default. The root
 * element has data-mode="light" when the visitor chose the light theme or their
 * system asks for it (see app.js).
 */
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --ground: #14181f;
  --main: #f2b33d;
  --second: #e8ecf1;
  --accent: #4fb0c6;
  --bar: #101318;
  --window: #0c0e12;
  --button: #1b2029;
  --hover: #252c38;
  --border: #2a313d;
  --tick: #5b6575;
  --text-2: #aab3c0;
  --ink: color-mix(in srgb, var(--second) 72%, var(--ground));
  --line: color-mix(in srgb, var(--second) 45%, var(--ground));
  --muted: color-mix(in srgb, var(--second) 60%, var(--ground));
  --faint: color-mix(in srgb, var(--second) 9%, var(--ground));
  --fainter: color-mix(in srgb, var(--second) 5%, var(--ground));
  --panel: color-mix(in srgb, var(--second) 4%, var(--ground));
  --chip: color-mix(in srgb, var(--second) 12%, var(--ground));
  --amberdim: color-mix(in srgb, var(--main) 35%, var(--ground));
  --cyandim: color-mix(in srgb, var(--accent) 35%, var(--ground));
  --font:
    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
:root[data-mode='light'] {
  color-scheme: light;
  --ground: #f7f5ef;
  --main: #a05f00;
  --second: #1a202b;
  --accent: #0e7490;
  --bar: #efede6;
  --window: #e3e0d8;
  --button: #e2dfd6;
  --hover: #d6d2c8;
  --border: #c6c2b6;
  --tick: #868c97;
  --text-2: #505866;
  --shadow: 0 24px 70px rgba(26, 32, 43, 0.18);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
body {
  margin: 0;
  background-color: var(--ground);
  color: var(--ink);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--faint) 1px, transparent 1px),
    linear-gradient(var(--fainter) 1px, transparent 1px),
    linear-gradient(90deg, var(--fainter) 1px, transparent 1px);
  background-size:
    120px 120px,
    120px 120px,
    24px 24px,
    24px 24px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 2px solid var(--main);
  outline-offset: 2px;
}
::selection {
  background: color-mix(in srgb, var(--main) 35%, transparent);
}
code {
  font: inherit;
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--chip);
  color: var(--second);
  white-space: nowrap;
}
h1,
h2,
h3 {
  color: var(--second);
  margin: 0;
  line-height: 1.2;
}
p {
  margin: 0;
}
img {
  max-width: 100%;
  display: block;
}
.wrap {
  width: min(1180px, 100% - 48px);
  margin: 0 auto;
}

/* ---------- navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bar) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--second);
  font-weight: 700;
  font-size: 16px;
}
.brand:hover {
  text-decoration: none;
}
.navlinks {
  display: flex;
  gap: 20px;
  margin-left: 18px;
  font-size: 13px;
}
.navlinks a {
  color: var(--text-2);
}
.navlinks a:hover {
  color: var(--second);
  text-decoration: none;
}
.nav .grow {
  flex: 1;
}
.dev {
  font-size: 12px;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--button);
  color: var(--second);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--hover);
  text-decoration: none;
}
.btn.primary {
  background: var(--main);
  border-color: var(--main);
  color: var(--ground);
}
.btn.primary:hover {
  background: color-mix(in srgb, var(--main) 88%, white);
}
.btn.small {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 400;
}
.btn.icon {
  width: 32px;
  padding: 0;
  justify-content: center;
}
.btn svg {
  flex: none;
}
/* The theme button shows a sun in the dark theme and a moon in the light theme:
   the theme it switches to. */
.icon-moon {
  display: none;
}
:root[data-mode='light'] .icon-moon {
  display: block;
}
:root[data-mode='light'] .icon-sun {
  display: none;
}

/* ---------- shared pieces ---------- */
.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.section {
  padding: 84px 0 0;
}
.section > h2 {
  font-size: 30px;
  margin: 10px 0 12px;
  max-width: 22em;
}
.section > .lead {
  max-width: 46em;
  color: var(--muted);
}
.plate {
  display: inline-block;
  padding: 2px 10px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--ground);
  color: var(--second);
  font-size: 12px;
  font-weight: 700;
}

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: 46px;
  letter-spacing: -0.01em;
  margin: 14px 0 18px;
}
.hero h1 .accent {
  color: var(--main);
}
.hero .lead {
  font-size: 16px;
  color: var(--ink);
  max-width: 34em;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 14px;
}
.meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footnote {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  max-width: 38em;
}

/* A screenshot of the app, framed like a sheet on the blueprint. Each shot has
   a dark and a light picture, and only the one for the current theme is shown.
   */
.shot {
  margin: 0;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--window);
  box-shadow: var(--shadow);
}
.shot img {
  width: 100%;
  height: auto;
}
.shot .light {
  display: none;
}
:root[data-mode='light'] .shot .light {
  display: block;
}
:root[data-mode='light'] .shot .light + .dark,
:root[data-mode='light'] .shot .dark:has(+ .light),
:root[data-mode='light'] .shot.themed .dark {
  display: none;
}
.shot figcaption {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bar);
}

/* ---------- live demo ---------- */
.demo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
}
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bar);
}
.tab {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.tab:hover {
  color: var(--second);
}
.tab[aria-selected='true'] {
  background: var(--button);
  color: var(--second);
  font-weight: 700;
}
.demo-head .note {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
/* The frame is as tall as the film's stage plus its player bar: 1920 by 1136
   pixels. The example inside is drawn in the page's theme (see showDemo in
   app.js). */
.stage {
  position: relative;
  aspect-ratio: 1920 / 1136;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--window);
  box-shadow: var(--shadow);
}
.stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  color-scheme: light;
}
.stage .missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}
.demo-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.demo-foot kbd {
  font: inherit;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bar);
  color: var(--second);
}

/* ---------- three modes ---------- */
.modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.mode {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 22px;
}
.mode h3 {
  font-size: 18px;
  margin: 12px 0 8px;
}
.mode p {
  font-size: 14px;
  color: var(--ink);
}
.mode ul {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}
.mode .n {
  color: var(--main);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
}

/* ---------- how it works ---------- */
.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.steps li::before {
  content: counter(step);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--main);
  border-radius: 50%;
  color: var(--main);
  font-weight: 700;
}
.steps.single {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}
.steps b {
  display: block;
  color: var(--second);
  margin-bottom: 4px;
}
.steps span {
  font-size: 14px;
  color: var(--ink);
}
.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 32px;
}

/* ---------- facts ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 28px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.fact {
  padding: 20px 22px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.fact:nth-child(3n) {
  border-right: 0;
}
.fact:nth-last-child(-n + 3) {
  border-bottom: 0;
}
.fact b {
  display: block;
  color: var(--second);
  margin-bottom: 6px;
}
.fact span {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- agents ---------- */
.agents {
  width: 100%;
  border-collapse: collapse;
  margin-top: 26px;
  font-size: 14px;
}
.agents th,
.agents td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.agents th {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  font-weight: 400;
}
.agents td:first-child {
  color: var(--second);
  font-weight: 700;
  white-space: nowrap;
}
.pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}
.pill.ok {
  border-color: var(--accent);
  color: var(--accent);
}
.tablewrap {
  overflow-x: auto;
}

/* ---------- download ---------- */
.dl {
  margin-top: 28px;
  border: 1.5px solid var(--main);
  border-radius: 10px;
  background: var(--panel);
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
}
.dl h3 {
  font-size: 20px;
  margin-bottom: 8px;
}
.dl p {
  font-size: 14px;
  color: var(--ink);
}
.assets {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}
.asset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--ground);
  color: var(--second);
  font-size: 13px;
}
.asset:hover {
  border-color: var(--main);
  text-decoration: none;
}
.asset.mine {
  border-color: var(--main);
}
.asset small {
  color: var(--muted);
  font-size: 11px;
}
pre {
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--ground);
  color: var(--second);
  font: 13px/1.6 var(--font);
  overflow-x: auto;
}
pre .c {
  color: var(--tick);
}

/* ---------- footer, and the text pages ---------- */
.footer {
  margin-top: 96px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bar) 92%, transparent);
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 22px 0;
  font-size: 12px;
  color: var(--muted);
}
.footer .grow {
  flex: 1;
}
.footer a {
  color: var(--text-2);
}
.doc {
  max-width: 780px;
  padding: 56px 0 0;
}
.doc h1 {
  font-size: 32px;
  margin-bottom: 6px;
}
.doc h2 {
  font-size: 18px;
  margin: 34px 0 10px;
}
.doc p,
.doc li {
  font-size: 14px;
  color: var(--ink);
}
.doc p {
  margin: 0 0 12px;
}
.doc ul {
  margin: 0 0 12px;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}
.doc .updated {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
}
.doc .short {
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

@media (max-width: 980px) {
  .hero-grid,
  .two,
  .dl {
    grid-template-columns: minmax(0, 1fr);
  }
  .modes,
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .fact,
  .fact:nth-child(3n) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .fact:last-child {
    border-bottom: 0;
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero h1 {
    font-size: 34px;
  }
  .navlinks,
  .dev {
    display: none;
  }
  .demo-head .note {
    margin-left: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
