/* Exhibit — base: tokens, shell, shared primitives */

:root {
  --bg: #f4f4ee;
  --paper: #fdfdfa;
  --ink: #191c15;
  --mute: #686d5f;
  --line: #e1e0d4;
  --line-strong: #cbcaba;
  --accent: #2f6a4b;
  --accent-strong: #235238;
  --accent-soft: rgba(47, 106, 75, 0.1);
  --glow: rgba(47, 106, 75, 0.16);
  --sand: #edebe0;
  --ok: #2f6a4b;
  --bad: #ac4034;
  --hl: rgba(47, 106, 75, 0.06);
  --placeholder: #96988a;
  --top-bg: rgba(244, 244, 238, 0.86);
  --btn-on-ink: #f7f7f2;
  --flash-err: #f6e9e6;
  --flash-ok: #e7efe7;
  --status-ready-bg: #e4eee4;
  --status-failed-bg: #f4e6e3;
  --status-wait-bg: #e9eae0;
  --list-hover: rgba(47, 106, 75, 0.05);
  --pre-bg: #1c201a;
  --pre-fg: #d9ddd0;
  --grain-opacity: 0.42;
  --sans: "Instrument Sans", system-ui, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "Fragment Mono", ui-monospace, Menlo, monospace;
  --shadow-sm: 0 1px 2px rgba(25, 28, 21, 0.05), 0 4px 14px -6px rgba(25, 28, 21, 0.08);
  --shadow-lg: 0 2px 4px rgba(25, 28, 21, 0.05), 0 24px 48px -20px rgba(25, 28, 21, 0.22);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.44, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111410;
    --paper: #181c15;
    --ink: #e8ebe0;
    --mute: #97a08c;
    --line: #272c21;
    --line-strong: #38402f;
    --accent: #84bd95;
    --accent-strong: #abd4b5;
    --accent-soft: rgba(132, 189, 149, 0.12);
    --glow: rgba(132, 189, 149, 0.2);
    --sand: #21261c;
    --ok: #84bd95;
    --bad: #e07f6f;
    --hl: rgba(132, 189, 149, 0.08);
    --placeholder: #6d7462;
    --top-bg: rgba(17, 20, 16, 0.82);
    --btn-on-ink: #12150f;
    --flash-err: #2c1d19;
    --flash-ok: #1a241a;
    --status-ready-bg: #1a241a;
    --status-failed-bg: #2c1d19;
    --status-wait-bg: #21261c;
    --list-hover: rgba(132, 189, 149, 0.07);
    --pre-bg: #0c0e0a;
    --pre-fg: #c3c9b8;
    --grain-opacity: 0.3;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px -6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  --bg: #111410;
  --paper: #181c15;
  --ink: #e8ebe0;
  --mute: #97a08c;
  --line: #272c21;
  --line-strong: #38402f;
  --accent: #84bd95;
  --accent-strong: #abd4b5;
  --accent-soft: rgba(132, 189, 149, 0.12);
  --glow: rgba(132, 189, 149, 0.2);
  --sand: #21261c;
  --ok: #84bd95;
  --bad: #e07f6f;
  --hl: rgba(132, 189, 149, 0.08);
  --placeholder: #6d7462;
  --top-bg: rgba(17, 20, 16, 0.82);
  --btn-on-ink: #12150f;
  --flash-err: #2c1d19;
  --flash-ok: #1a241a;
  --status-ready-bg: #1a241a;
  --status-failed-bg: #2c1d19;
  --status-wait-bg: #21261c;
  --list-hover: rgba(132, 189, 149, 0.07);
  --pre-bg: #0c0e0a;
  --pre-fg: #c3c9b8;
  --grain-opacity: 0.3;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px -6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.55);
}

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

html { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) { color-scheme: dark; }
}
html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Film grain — sits above everything, never intercepts input */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--accent-soft); }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--accent-strong); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 560;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0 0 0.65rem;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); font-variation-settings: "SOFT" 80, "WONK" 1; }
h2 { font-size: 1.45rem; font-variation-settings: "SOFT" 55, "WONK" 0; }
h3 { font-size: 1.05rem; font-family: var(--sans); font-weight: 650; letter-spacing: -0.005em; font-variation-settings: normal; }

.mono, code, kbd { font-family: var(--mono); }

kbd {
  font-size: 0.78em;
  padding: 0.08rem 0.4rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--paper);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.45rem 0.8rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 40;
}
.skip:focus { left: 0; top: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ——— Header & footer ——— */

.top, .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--top-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.top.scrolled, .top:hover { border-bottom-color: var(--line); }

.top nav, .foot nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.top nav a, .foot nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  font-weight: 550;
  font-size: 0.92rem;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.top nav a:hover { background: var(--sand); color: var(--accent-strong); }

.nav-toggle {
  display: none;
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
  cursor: pointer;
}

.theme-btn {
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.35s var(--spring);
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); transform: rotate(24deg); }

.theme-icon { width: 1.05rem; height: 1.05rem; }
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
:root[data-theme="light"] .theme-icon-sun { display: none; }
:root[data-theme="light"] .theme-icon-moon { display: block; }

.brand, .brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-variation-settings: "SOFT" 80, "WONK" 1;
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
}
.brand:hover, .brand-mini:hover { color: var(--ink); }

.mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.65rem;
  background: var(--accent);
  color: var(--btn-on-ink);
  transition: border-radius 0.5s var(--spring), transform 0.5s var(--spring);
}
.brand:hover .mark, .brand-mini:hover .mark { border-radius: 50%; transform: rotate(-8deg); }
.mark-inner {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 400;
}

.foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 0.9rem;
  padding-top: 1.7rem;
  padding-bottom: 2.2rem;
}
.foot nav a { color: var(--mute); font-weight: 500; }
.foot nav a:hover { color: var(--accent); background: transparent; }

main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.6rem 1.5rem 5rem;
}
main.wide { max-width: 1160px; }

/* ——— Scroll reveal (JS adds .in; gated on .js so no-JS stays visible) ——— */

@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }
  html.js [data-reveal].in { opacity: 1; transform: none; }
  html.js [data-reveal][data-delay="1"] { transition-delay: 0.08s; }
  html.js [data-reveal][data-delay="2"] { transition-delay: 0.16s; }
  html.js [data-reveal][data-delay="3"] { transition-delay: 0.24s; }
  html.js [data-reveal][data-delay="4"] { transition-delay: 0.32s; }
}

/* ——— Shared utilities & components ——— */

.lede { color: var(--mute); font-size: 1.08rem; max-width: 33rem; margin: 0 0 0.5rem; }
.hint, .fine, .mute { color: var(--mute); font-size: 0.9rem; }
.hint.tight { margin-bottom: 0.6rem; }
.mt { margin-top: 1.1rem; }
.mb { margin-bottom: 1.1rem; }
.pad { padding: 1.3rem; }
.break { word-break: break-all; }
.actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }

/* Horizontal scroll for wide tables on narrow screens */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ——— Buttons ——— */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 0.62rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), transform 0.2s var(--spring), box-shadow 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }

.btn-sm { padding: 0.38rem 0.8rem; font-size: 0.88rem; }
.btn-ink { background: var(--ink); color: var(--btn-on-ink); border-color: var(--ink); }
.btn-ink:hover { background: var(--accent); border-color: var(--accent); color: var(--btn-on-ink); }
.btn-accent { background: var(--accent); color: var(--btn-on-ink); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--btn-on-ink); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--sand); }

.btn-spinner, .spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-spinner { display: none; }
.capture-form.is-loading .btn-label { display: none; }
.capture-form.is-loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ——— Capture form ——— */

.capture-shell { margin: 1.6rem 0 0.4rem; }

.capture-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.4rem 0.4rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.capture-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--glow), var(--shadow-sm);
}

.capture-icon {
  width: 0.6rem;
  height: 0.6rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: breathe 2.6s var(--ease) infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 var(--glow); opacity: 1; }
  50% { box-shadow: 0 0 0 0.4rem transparent; opacity: 0.75; }
}

.capture-form input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 0.75rem 0.4rem;
  min-width: 0;
}
.capture-form input:focus { outline: none; }
.capture-form input::placeholder { color: var(--placeholder); }

.capture-form .btn { border: 0; flex-shrink: 0; }

.capture-hint { margin: 0.7rem 0.3rem 0; color: var(--mute); font-size: 0.87rem; }
.capture-hint a { font-weight: 600; }

/* ——— Forms & auth ——— */

.stack { display: grid; gap: 0.9rem; }
.stack label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.92rem; }
.stack input, .stack select, .auth input {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.stack input:focus, .stack select:focus, .auth input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.auth {
  max-width: 26rem;
  margin: 1.5rem auto;
  padding: 1.7rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.sso { display: grid; gap: 0.65rem; margin: 1.1rem 0 0.4rem; }
.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
}
.btn-sso:hover { border-color: var(--ink); }
.sso-mark { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.auth-or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.7rem;
  color: var(--mute);
  font-size: 0.82rem;
  margin: 1rem 0;
}
.auth-or::before, .auth-or::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.flash {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 0 0 1.1rem;
}
.flash.err { background: var(--flash-err); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.flash.ok { background: var(--flash-ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }

/* ——— Progress ——— */

.progress-track { display: flex; gap: 0.6rem; margin: 1.2rem 0; }
.progress-step { flex: 1; }
.step-dot {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin-bottom: 0.45rem;
  overflow: hidden;
  position: relative;
}
.progress-step.done .step-dot { background: var(--accent); }
.progress-step.active .step-dot { background: var(--line); }
.progress-step.active .step-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 999px;
  transform-origin: left;
  animation: tab-progress 2.2s var(--ease) infinite;
}
.step-label { font-size: 0.8rem; color: var(--mute); }
.progress-step.active .step-label { color: var(--ink); font-weight: 650; }
.progress-step.done .step-label { color: var(--accent); }

@keyframes tab-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ——— Lightbox & toast ——— */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 14, 10, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: none;
  place-items: center;
  padding: 2rem;
  z-index: 50;
  cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img {
  max-height: 90vh;
  max-width: 100%;
  border-radius: var(--radius-sm);
  animation: pop-in 0.3s var(--spring);
}

@keyframes pop-in { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(150%);
  opacity: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 550;
  z-index: 60;
  box-shadow: var(--shadow-lg);
  transition: transform 0.35s var(--spring), opacity 0.3s var(--ease);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.ok { background: var(--accent); color: var(--btn-on-ink); }
.toast.err { background: var(--bad); color: #fff; }

/* ——— Responsive (base components) ——— */

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .top { position: relative; flex-wrap: wrap; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .top nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 1.2rem 1.2rem;
    flex-direction: column;
    align-items: stretch;
    z-index: 19;
  }
  .top nav.open { display: flex; }
  .capture-form { flex-direction: column; align-items: stretch; padding: 0.5rem; border-radius: 1.4rem; }
  .capture-icon { display: none; }
  .capture-form input { padding: 0.7rem 0.6rem; }
}

@media (hover: none) {
  .btn:hover { transform: none; box-shadow: none; }
  .btn-ink:hover { background: var(--ink); color: var(--btn-on-ink); }
  .btn-accent:hover { background: var(--accent); color: var(--btn-on-ink); }
  .btn-ghost:hover { background: transparent; }
}

/* ——— Reduced motion ——— */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; }
  .capture-icon { animation: none; }
}

/* ——— Print ——— */

@media print {
  body::before, .top, .foot, .actions, .theme-btn, .toast, .lightbox { display: none !important; }
  body { background: #fff; color: #000; }
}
