/* Project Sierra site. Precise grid and hairlines, warm neutrals.
   Colour names are shared with the hero canvas in site.js. */
:root {
  --bg: #FBFAF7; --panel: #FFFFFF; --ink: #16130F; --muted: #6B655C; --faint: #948D82;
  --line: #E7E3DA; --line-strong: #D2CCC0; --tint: #F4F1EA;
  --leaf: #0F7A55; --leaf-ink: #0B6646; --amber: #B97A06;
  --block: #DBD7CD; --slab: #EFECE4;
  --agent-a: #6A5AE0; --agent-b: #E3A01B; --agent-c: #DB5237;
  --term-bg: #16130F; --term-ink: #EDE9E0; --term-dim: #8F887C; --term-line: #2C2823;
  --sans: "Geist", "Inter", "Helvetica Neue", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: 32px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0D0B; --panel: #151412; --ink: #F3F0E9; --muted: #A69F93; --faint: #7A7469;
    --line: #262420; --line-strong: #38352F; --tint: #151412;
    --leaf: #4FCB9A; --leaf-ink: #6AD9AC; --amber: #E9B44C;
    --block: #3B3832; --slab: #191816;
    --agent-a: #9D91FF; --agent-b: #F0BC5A; --agent-c: #F58A72;
    --term-bg: #090807; --term-line: #262420;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
code, pre, kbd, .mono { font-family: var(--mono); font-size: 0.875em; font-feature-settings: "liga" 0; }
p { margin: 0 0 1em; max-width: 64ch; }
p code, li code, td code, dd code { background: var(--tint); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 20; border-radius: 6px; }
.skip:focus { left: 8px; }

h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.25rem); letter-spacing: -0.045em; line-height: 1.02; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 0.5em; }
h3 { font-size: 1.0625rem; letter-spacing: -0.012em; line-height: 1.35; margin-bottom: 0.4em; }
.lead { font-size: clamp(1.06rem, 1.5vw, 1.22rem); line-height: 1.55; color: var(--muted); max-width: 54ch; }
.lead strong { color: var(--ink); font-weight: 500; }
.small { font-size: 0.9rem; color: var(--muted); }

/* The frame: two rails down the page, a rule between sections, a mark where they cross. */
.wrap { position: relative; max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); border-inline: 1px solid var(--line); }
main > section > .wrap, main > .band > .wrap { padding-block: 76px; border-top: 1px solid var(--line); }
main > section > .wrap::before, main > section > .wrap::after {
  content: ""; position: absolute; top: -6px; width: 11px; height: 11px; pointer-events: none;
  background: linear-gradient(var(--line-strong), var(--line-strong)) center / 11px 1px no-repeat, linear-gradient(var(--line-strong), var(--line-strong)) center / 1px 11px no-repeat;
}
main > section > .wrap::before { left: -6px; } main > section > .wrap::after { right: -6px; }
main > section:first-of-type > .wrap { border-top: 0; }
main > section:first-of-type > .wrap::before, main > section:first-of-type > .wrap::after { display: none; }
.bleed { margin-inline: calc(var(--pad) * -1); }

/* Header and footer */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; border-inline-color: transparent; flex-wrap: wrap; }
.org { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; }
.top nav { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.top nav a { text-decoration: none; font-size: 0.92rem; color: var(--muted); padding: 6px 10px; border-radius: 6px; }
.top nav a:hover { color: var(--ink); background: var(--tint); }
.top nav .gh { color: var(--ink); border: 1px solid var(--line-strong); background: var(--panel); margin-left: 6px; }
.btn { display: inline-flex; align-items: center; height: 42px; padding: 0 18px; border-radius: 8px; font-weight: 500; font-size: 0.95rem; text-decoration: none; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); }
.btn:hover { border-color: var(--ink); }
.btn.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.solid:hover { background: color-mix(in srgb, var(--ink) 84%, var(--bg)); }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.foot .wrap { padding-block: 44px 56px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; font-size: 0.92rem; color: var(--muted); }
.foot strong { color: var(--ink); font-weight: 600; }
.foot h4 { margin: 0 0 10px; font-size: 0.85rem; font-weight: 500; color: var(--ink); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.foot a { text-decoration: none; } .foot a:hover { color: var(--ink); }
.foot .fine { grid-column: 1 / -1; margin: 8px 0 0; font-size: 0.85rem; max-width: none; }

/* Small parts */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; padding: 0; list-style: none; }
.pill { display: inline-flex; align-items: center; gap: 7px; font: 500 0.78rem/1 var(--mono); color: var(--muted); border: 1px solid var(--line-strong); background: var(--panel); border-radius: 999px; padding: 6px 11px; text-decoration: none; }
a.pill:hover { color: var(--ink); border-color: var(--ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); }
.dot.amber { background: var(--amber); }

.term { position: relative; background: var(--term-bg); color: var(--term-ink); border: 1px solid var(--term-line); border-radius: 10px; overflow: hidden; }
.term header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--term-line); font: 500 0.78rem var(--mono); color: var(--term-dim); }
.term pre { margin: 0; padding: 16px 18px; overflow-x: auto; line-height: 1.7; font-size: 0.82rem; white-space: pre; }
.term pre.wrapline { white-space: pre-wrap; overflow-wrap: anywhere; }
.term .c { color: var(--term-dim); } .term .g { color: #5FD3A2; } .term .y { color: #F0BC5A; } .term .r { color: #F58A72; }
.term button { font: 500 0.75rem var(--mono); background: transparent; color: var(--term-ink); border: 1px solid #3B362F; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.term button:hover { background: var(--term-ink); color: var(--term-bg); }
.oneline { display: flex; align-items: center; gap: 12px; padding: 0 8px 0 16px; height: 46px; margin-top: 26px; max-width: 460px; }
.oneline code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 0.84rem; }
.oneline code::before { content: "$ "; color: var(--term-dim); }

/* Cells: content divided by hairlines, not boxed in cards */
.cells { display: grid; border-top: 1px solid var(--line); margin-top: 40px; }
.cells.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cells.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cells.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .cells.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cells > * { padding: 28px var(--pad); border-right: 1px solid var(--line); min-width: 0; margin: 0; }
.cells > *:last-child { border-right: 0; }
.cells p, .cells dd { color: var(--muted); margin: 0; font-size: 0.96rem; }
.cells dt { font-weight: 600; letter-spacing: -0.012em; margin-bottom: 6px; }
.cells.end { margin-bottom: -76px; }
.fact b { display: block; font: 600 clamp(1.7rem, 3vw, 2.3rem)/1.1 var(--sans); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.fact span { display: block; color: var(--muted); font-size: 0.93rem; margin: 6px 0 12px; }
.fact a, .src { font: 500 0.76rem var(--mono); color: var(--faint); text-decoration-color: var(--line); }
.fact a:hover, .src:hover { color: var(--ink); }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center; padding-block: 72px 64px; }
.hero .wrap > * { min-width: 0; }
.hero.solo .wrap { grid-template-columns: 1fr; padding-block: 96px 80px; }
.scene { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 18px 18px 16px; }
.scene canvas { width: 100%; }
.scene figcaption { min-height: 3.2em; font-size: 0.92rem; color: var(--ink); padding: 12px 0 0; border-top: 1px solid var(--line); margin-top: 8px; }
.legend { list-style: none; padding: 0; margin: 10px 0 0; display: flex; gap: 16px; font: 500 0.75rem var(--mono); color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

/* Steps, diagram, tables, shots */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 40px calc(var(--pad) * -1) 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps li { counter-increment: s; padding: 28px var(--pad); border-right: 1px solid var(--line); }
.steps li:last-child { border-right: 0; }
.steps li::before { content: "0" counter(s); display: block; font: 500 0.8rem var(--mono); color: var(--leaf-ink); margin-bottom: 14px; }
.steps p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.diagram { margin: 40px 0 0; overflow-x: auto; }
.diagram svg { min-width: 720px; width: 100%; height: auto; }
.diagram figcaption, .shot figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 14px; }
.tablewrap { overflow-x: auto; margin-top: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 13px 16px; border-bottom: 1px solid var(--line); }
tr:last-child > * { border-bottom: 0; }
thead th { font-weight: 500; color: var(--muted); font-size: 0.85rem; background: var(--tint); }
tbody th { font-weight: 500; width: 27%; }
td.us, th.us { background: color-mix(in srgb, var(--leaf) 7%, transparent); color: var(--ink); }
td.num { font-family: var(--mono); font-size: 0.84rem; white-space: nowrap; }
td .src { display: block; margin-top: 4px; }
.yes { color: var(--leaf-ink); font-weight: 500; } .no { color: var(--faint); }
.shot { margin: 40px 0 0; }
.shot img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; }
.split > * { min-width: 0; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 36px; }
.split h3 { margin-bottom: 12px; }

.band { background: var(--tint); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { border-top: 1px solid var(--line); padding: 14px 0; }
.list li:last-child { border-bottom: 1px solid var(--line); }
.list strong { display: block; font-weight: 500; }
.list span { color: var(--muted); font-size: 0.94rem; }
.tag { font: 500 0.72rem var(--mono); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: 0.15em; white-space: nowrap; }

.faq { margin-top: 24px; max-width: 800px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 500; padding: 15px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--faint); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); margin: 0 0 16px; }

/* Home */
.project { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 32px; margin-top: 32px; }
.project h3 { font-size: 1.6rem; letter-spacing: -0.03em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.project h3 a { text-decoration: none; } .project h3 img { width: 34px; height: 34px; }
.project p { color: var(--muted); }
.project .links { display: flex; gap: 18px; flex-wrap: wrap; margin: 0; font-size: 0.94rem; align-items: baseline; }
.project .links span { font: 500 0.78rem var(--mono); color: var(--faint); }
.project figure { margin: 0; } .project figure img { border: 1px solid var(--line); border-radius: 10px; width: 100%; height: auto; }
.slot, .empty { border: 1px dashed var(--line-strong); border-radius: 14px; padding: 24px 28px; margin-top: 16px; color: var(--muted); max-width: none; }
.slot p { margin: 0; max-width: none; } .empty { text-align: center; margin-top: 28px; }
.wall { list-style: none; padding: 0; margin: 14px 0 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.wall li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: grid; gap: 10px; justify-items: center; font-size: 0.82rem; color: var(--muted); }
.plain { padding-left: 1.2em; max-width: 64ch; } .plain li { margin-bottom: 0.5em; }
.page .wrap { padding-block: 80px 64px; }
.sub { border-bottom: 1px solid var(--line); }
.sub .wrap { display: flex; gap: 4px; align-items: center; min-height: 48px; overflow-x: auto; white-space: nowrap; font-size: 0.88rem; }
.sub img { height: 22px; width: auto; margin-right: 14px; }
.sub a { color: var(--muted); text-decoration: none; padding: 5px 9px; border-radius: 6px; }
.sub a:hover { color: var(--ink); background: var(--tint); }
.only-dark { display: none; }
@media (prefers-color-scheme: dark) { .only-dark { display: block; } .only-light { display: none; } .shot img, .project figure img { filter: brightness(0.9); } }

@media (max-width: 940px) {
  :root { --pad: 24px; }
  .hero .wrap, .project, .split { grid-template-columns: 1fr; }
  .cells.c3, .cells.c4, .cells.c5, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cells > *, .steps li { border-bottom: 1px solid var(--line); }
  .cells > *:nth-child(2n), .steps li:nth-child(2n) { border-right: 0; }
  .steps { border-bottom: 0; }
  main > section > .wrap, main > .band > .wrap { padding-block: 60px; }
  .cells.end { margin-bottom: -60px; }
  .foot .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  :root { --pad: 18px; }
  .wrap { border-inline: 0; }
  main > section > .wrap::before, main > section > .wrap::after { display: none; }
  .cells.c2, .cells.c3, .cells.c4, .cells.c5, .steps { grid-template-columns: 1fr; }
  .cells > *, .steps li { border-right: 0; }
  .project { padding: 22px; }
  .top nav a:not(.gh) { padding: 6px 7px; }
}
