/* Panopticon project site. Palette follows panopticon-diagrams:
   warm neutral surfaces, blue for telemetry, orange for the response loop. */
:root {
  --bg: #f5f4f2;
  --surface: #ffffff;
  --surface-2: #efeeeb;
  --ink: #1d2230;
  --ink-2: #4a5263;
  --ink-3: #6f7686;
  --line: #dcdad5;
  --blue: #2f56a0;
  --blue-soft: #e6ecf7;
  --orange: #c4531f;
  --orange-soft: #f7e7de;
  --green: #1f7a52;
  --green-soft: #e1f1e9;
  --amber: #8a6200;
  --amber-soft: #f6edd3;
  --red: #b3261e;
  --shadow: 0 1px 2px rgba(20, 24, 33, .05), 0 4px 16px rgba(20, 24, 33, .05);
  --radius: 10px;
  --max: 1160px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151c; --surface: #1a1e27; --surface-2: #222734; --ink: #e8eaf0; --ink-2: #b4bac8;
    --ink-3: #8b92a3; --line: #2e3442; --blue: #7ea2e6; --blue-soft: #1f2a40; --orange: #f08a57;
    --orange-soft: #3a261c; --green: #5cc497; --green-soft: #183026; --amber: #e2b84f;
    --amber-soft: #352c14; --red: #f07a72; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151c; --surface: #1a1e27; --surface-2: #222734; --ink: #e8eaf0; --ink-2: #b4bac8;
  --ink-3: #8b92a3; --line: #2e3442; --blue: #7ea2e6; --blue-soft: #1f2a40; --orange: #f08a57;
  --orange-soft: #3a261c; --green: #5cc497; --green-soft: #183026; --amber: #e2b84f;
  --amber-soft: #352c14; --red: #f07a72; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 750; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 16px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand small { display: block; font-weight: 500; letter-spacing: .12em; font-size: .62rem; color: var(--ink-3); text-transform: uppercase; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--ink-2); text-decoration: none; padding: 7px 11px; border-radius: 7px; font-size: .93rem; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.theme-btn {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); width: 36px; height: 36px;
  border-radius: 8px; cursor: pointer; display: grid; place-items: center;
}
.theme-btn svg { width: 17px; height: 17px; }
@media (max-width: 760px) {
  .site-header .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 6px; gap: 8px 12px; }
  .nav { order: 3; width: 100%; margin-left: -8px; }
  .theme-btn { margin-left: auto; }
}

/* Sections */
main section { padding: 64px 0; }
main section + section { border-top: 1px solid var(--line); }
.eyebrow { font: 600 .74rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--orange); margin-bottom: 14px; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 760px; }
.muted { color: var(--ink-3); }
.small { font-size: .9rem; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero h1 span { color: var(--orange); }
.hero .lede { font-size: 1.22rem; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 600;
  border: 1px solid var(--line); color: var(--ink); background: var(--surface); box-shadow: var(--shadow);
}
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn:hover { text-decoration: none; transform: translateY(-1px); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 40px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; }
.stat b { display: block; font-size: 1.85rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-3); font-size: .88rem; }

/* Cards */
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-width: 0;
}
.card p:last-child { margin-bottom: 0; }
.card .tag { align-self: flex-start; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--blue); }
.card ul { margin: 0 0 1em; padding-left: 1.1em; }
.card .foot { margin-top: auto; padding-top: 10px; font-size: .9rem; }
.tag {
  display: inline-block; font: 600 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 7px;
  border-radius: 5px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2); margin-bottom: 12px;
}
.tag.blue { color: var(--blue); background: var(--blue-soft); border-color: transparent; }
.tag.orange { color: var(--orange); background: var(--orange-soft); border-color: transparent; }
.tag.green { color: var(--green); background: var(--green-soft); border-color: transparent; }
.tag.amber { color: var(--amber); background: var(--amber-soft); border-color: transparent; }

/* Pipeline */
.pipeline { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; counter-reset: step; }
.pipeline li { position: relative; padding: 0 18px 0 0; counter-increment: step; }
.pipeline li::before {
  content: counter(step, decimal-leading-zero); display: block; font: 600 .78rem/1 var(--mono); color: var(--orange); margin-bottom: 10px;
}
.pipeline li::after {
  content: ""; position: absolute; top: 5px; left: 34px; right: 14px; height: 1px; background: var(--line);
}
.pipeline li:last-child::after { display: none; }
.pipeline h3 { font-size: 1rem; margin-bottom: 4px; }
.pipeline p { font-size: .92rem; color: var(--ink-2); margin: 0; }
@media (max-width: 860px) {
  .pipeline { grid-template-columns: 1fr; gap: 18px; }
  .pipeline li { padding: 0 0 0 44px; }
  .pipeline li::before { position: absolute; left: 0; top: 3px; }
  .pipeline li::after { display: none; }
}

/* Figures */
figure { margin: 0; }
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); min-width: 0; }
.figure img { border-radius: 6px; background: #f4f4f3; }
.figure figcaption { font-size: .9rem; color: var(--ink-3); padding: 12px 6px 4px; }
.figure figcaption b { color: var(--ink); font-weight: 600; }
.zoom { cursor: zoom-in; }
.shots { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .shots { grid-template-columns: 1fr; } }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 .74rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; background: var(--surface-2); }
td code { white-space: nowrap; }

/* Split layout */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 24px; } }

/* Callout */
.callout { border-left: 3px solid var(--orange); background: var(--orange-soft); padding: 14px 18px; border-radius: 0 8px 8px 0; color: var(--ink); }
.callout.blue { border-color: var(--blue); background: var(--blue-soft); }
.callout p:last-child { margin: 0; }

/* Bars */
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 70px; gap: 12px; align-items: center; font-size: .94rem; }
.bar-row .track { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--blue); border-radius: 99px; }
.bar-row:nth-child(2) .fill { background: var(--orange); }
.bar-row:nth-child(3) .fill { background: var(--green); }
.bar-row:nth-child(4) .fill { background: var(--amber); }
.bar-row:nth-child(5) .fill { background: var(--ink-3); }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 110px 1fr 54px; font-size: .86rem; } }

/* People */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.person { display: flex; gap: 14px; align-items: center; }
.person img { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); }
.person b { display: block; }
.person a { font-size: .9rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 18px; }
.gallery .figure img { aspect-ratio: 16 / 10.5; object-fit: contain; width: 100%; }
.gallery figcaption a { font-size: .85rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.filters button {
  font: inherit; font-size: .9rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 6px 12px; border-radius: 99px; cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(10, 12, 18, .86); display: none; place-items: center; z-index: 100; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 92vh; width: auto; max-width: 96vw; border-radius: 6px; background: #f4f4f3; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--ink-3); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.site-footer a { color: var(--ink-2); }

/* States list */
.states { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font: 600 .78rem/1 var(--mono); }
.states span { padding: 7px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.states .arrow { background: none; border: 0; padding: 0 2px; color: var(--ink-3); }
.states .ok { color: var(--green); background: var(--green-soft); border-color: transparent; }
.states .bad { color: var(--red); background: var(--surface-2); }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.toc a { font-size: .9rem; padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--ink-2); background: var(--surface); }
.toc a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn:hover { transform: none; } }
