/*
 * css/site.css: aibundle.app's one look, the picture gallery at night.
 * Black glaze ground, Pompeian red walls, terracotta, reserved cream, gilt hairlines. Cormorant Garamond for display,
 * DM Sans for reading, Geist Mono for numbers. Cards are museum wall labels (placards) on cream paper.
 * Tokens first; every page (landing, app, receipt, burn, docs) builds on them.
 */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("/fonts/cormorant-garamond-latin.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 300 700; font-display: swap; src: url("/fonts/cormorant-garamond-italic-latin.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url("/fonts/dm-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url("/fonts/dm-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/geist-mono-latin.woff2") format("woff2"); }

:root {
  --glaze: #17110d;
  --pit: #0e0a08;
  --glaze-2: #211812;
  --glaze-3: #2c2019;
  --wall: #6f2418;
  --red: #7e2a1c;
  --red-hi: #a53a26;
  --clay: #c4683f;
  --clay-deep: #a8532f;
  --clay-hi: #e08a5c;
  --cream: #f0dcc0;
  --white: #f7efe2;
  --paper: #f3e6cf;
  --paper-2: #e9d8bb;
  --gilt: #c9a35a;
  --gilt-hi: #ecd08a;
  --gilt-lo: #8a6a2f;
  --ink: #1b130e;
  --ink-2: #4a3a2e;
  --ink-3: #7a6653;
  --dim: rgba(240, 220, 192, 0.66);
  --faint: rgba(240, 220, 192, 0.4);
  --line: rgba(201, 163, 90, 0.28);
  --line-2: rgba(240, 220, 192, 0.14);
  --ok: #7fae6a;
  --bad: #e0694a;

  --display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1180px;
  --gut: clamp(18px, 4vw, 44px);
  --head-h: 64px;
  --r: 3px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 12px); }
body {
  margin: 0; min-height: 100vh; background: var(--pit); color: var(--cream);
  font-family: var(--body); font-size: 16px; line-height: 1.55; font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 500; line-height: 1.04; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--clay); color: var(--pit); }
:focus-visible { outline: 2px solid var(--gilt-hi); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 1; letter-spacing: -0.01em; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gut)); margin-inline: auto; }

/* ---------------------------------------------------------------- icons */
.ic { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic.lg { width: 28px; height: 28px; stroke-width: 1.4; }
.ic.xl { width: 44px; height: 44px; stroke-width: 1.25; }

/* ---------------------------------------------------------------- the meander (Greek key) rule */
.key {
  height: 14px; border: 0; margin: 0; background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='14' viewBox='0 0 32 14'%3E%3Cpath d='M32 12.5H1.5v-11h23v7h-15v-3h9' fill='none' stroke='%23c9a35a' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-position: center; opacity: 0.75;
}
.key.clay { filter: hue-rotate(-18deg) saturate(1.4); }

/* ---------------------------------------------------------------- header */
.head {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--head-h);
  display: flex; align-items: center; transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.head.edge, .head.solid { background: rgba(14, 10, 8, 0.9); border-bottom-color: var(--line); }
.head .wrap { display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); margin-right: auto; min-height: 44px; }
.brand .mark { width: 30px; height: 30px; color: var(--clay); }
.brand b { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: 0.01em; }
.brand b i { font-style: normal; color: var(--gilt); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 10px 12px; font-size: 14px; color: var(--dim); text-decoration: none; border-radius: var(--r); min-height: 40px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--cream); }
.nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--gilt); }
.icon-btn.menu-btn { display: none; }

/* ---------------------------------------------------------------- buttons: a gilt double frame */
.btn {
  --bg: var(--clay); --fg: var(--pit); --bd: var(--gilt-hi);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 22px; border: 1px solid var(--bd); border-radius: var(--r);
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap; transition: transform 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
  box-shadow: 0 0 0 3px var(--pit), 0 0 0 4px rgba(201, 163, 90, 0.5);
}
.btn:hover { background: var(--clay-hi); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { --bg: rgba(14, 10, 8, 0.55); --fg: var(--cream); --bd: var(--line); box-shadow: none; }
.btn.ghost:hover { background: rgba(240, 220, 192, 0.08); border-color: var(--gilt); }
.btn.ink { --bg: var(--ink); --fg: var(--cream); --bd: var(--ink); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--ink); }
.btn.ink:hover { background: #2c2019; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r); background: transparent; color: var(--cream); }
.icon-btn:hover { border-color: var(--gilt); }
.icon-btn.sm { width: 40px; height: 40px; }

/* ---------------------------------------------------------------- type */
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gilt); }
.display { font-size: clamp(46px, 8.2vw, 116px); font-weight: 500; letter-spacing: -0.025em; line-height: 0.94; }
.display em { font-style: italic; color: var(--clay-hi); font-weight: 400; }
.title { font-size: clamp(34px, 4.6vw, 60px); }
.title em { font-style: italic; color: var(--clay-hi); }
.lede { font-size: clamp(16px, 1.5vw, 19px); color: var(--dim); max-width: 46ch; }
.note { font-size: 13.5px; color: var(--faint); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- the placard: a museum wall label */
.placard {
  position: relative; background: var(--paper); color: var(--ink); border-radius: 2px;
  padding: clamp(20px, 2.6vw, 30px) clamp(20px, 2.8vw, 34px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 0 0 1px rgba(27, 19, 14, 0.12), 0 22px 50px -18px rgba(0, 0, 0, 0.85), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.placard::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(27, 19, 14, 0.16); pointer-events: none; }
.placard .room { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--clay-deep); }
.placard .room .ic { color: var(--red); }
.placard h2, .placard h3 { color: var(--ink); margin-top: 12px; }
.placard h2 { font-size: clamp(32px, 3.6vw, 48px); font-weight: 600; }
.placard h2 em { font-style: italic; font-weight: 500; color: var(--red); }
.placard p { color: var(--ink-2); margin-top: 12px; font-size: 15.5px; }
.placard .facts { margin-top: 16px; border-top: 1px solid rgba(27, 19, 14, 0.16); }
.placard .facts li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid rgba(27, 19, 14, 0.1); font-size: 14px; color: var(--ink-2); }
.placard .facts b { font-family: var(--mono); font-weight: 500; color: var(--ink); white-space: nowrap; font-size: 13.5px; }
.placard .credit { margin-top: 14px; font-size: 12px; color: var(--ink-3); font-style: italic; font-family: var(--display); font-size: 15px; line-height: 1.3; }
.placard .credit a { color: inherit; }
.placard a.more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 600; font-size: 14px; color: var(--red); text-decoration: none; min-height: 40px; }
.placard a.more:hover { text-decoration: underline; }

/* a dark panel with a gilt hairline, for the flat pages */
.panel { background: var(--glaze); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(18px, 2.4vw, 28px); position: relative; }
.panel.frame { box-shadow: 0 0 0 4px var(--pit), 0 0 0 5px rgba(201, 163, 90, 0.35); }
.panel h3 { font-size: 26px; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--dim); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; background: var(--pit); color: var(--cream);
  border: 1px solid var(--line-2); border-radius: var(--r); font-size: 16px;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gilt); box-shadow: 0 0 0 3px rgba(201, 163, 90, 0.18); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }

/* ---------------------------------------------------------------- chips, pills, tables */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 12.5px; color: var(--dim); font-family: var(--mono); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gilt); }
.chip.ok .dot { background: var(--ok); }
.chip.bad .dot { background: var(--bad); }
.rule { border: 0; height: 1px; background: var(--line); margin: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-family: var(--mono); font-weight: 500; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gilt); padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line-2); color: var(--dim); vertical-align: top; }
.tbl td.num, .tbl th.num { text-align: right; padding-right: 0; }
.tbl-wrap { overflow-x: auto; }

/* ---------------------------------------------------------------- toasts and dialog */
.toasts { position: fixed; z-index: 90; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--paper); color: var(--ink); border-radius: 2px; font-size: 14px; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.8); transition: opacity 0.3s; }
.toast.bad { border-left: 3px solid var(--red-hi); }
.toast .ic { margin-top: 2px; color: var(--red); }
.dlg-back { position: fixed; inset: 0; z-index: 80; background: rgba(8, 5, 4, 0.78); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.dlg { width: min(520px, 100%); background: var(--glaze); border: 1px solid var(--gilt); border-radius: var(--r); padding: 22px; box-shadow: 0 0 0 4px var(--pit), 0 0 0 5px rgba(201, 163, 90, 0.4), 0 40px 80px -20px #000; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dlg-head h2 { font-size: 28px; }

/* ---------------------------------------------------------------- footer */
.foot { position: relative; z-index: 2; background: var(--pit); border-top: 1px solid var(--line); padding: 44px 0 36px; color: var(--dim); font-size: 14px; }
.foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.foot h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gilt); font-weight: 500; margin-bottom: 10px; }
.foot li a { display: inline-flex; min-height: 34px; align-items: center; text-decoration: none; color: var(--dim); }
.foot li a:hover { color: var(--cream); }
.foot .fine { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 12.5px; color: var(--faint); }
.foot .brand { margin: 0 0 10px; }

/* ---------------------------------------------------------------- flat page scaffold (app, burn, docs, receipt) */
.page { padding: calc(var(--head-h) + clamp(28px, 5vw, 60px)) 0 clamp(48px, 7vw, 90px); min-height: 70vh; background:
  radial-gradient(120% 60% at 50% -10%, rgba(126, 42, 28, 0.38), transparent 60%), var(--pit); }
.page-head { margin-bottom: clamp(22px, 3vw, 38px); }
.page-head .title { margin-top: 10px; }
.page-head .lede { margin-top: 12px; }
.prose { max-width: 72ch; color: var(--dim); }
.prose h2 { font-size: clamp(28px, 3vw, 38px); color: var(--cream); margin: 44px 0 12px; }
.prose h3 { font-size: 24px; color: var(--cream); margin: 28px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul { list-style: none; margin: 0 0 14px; }
.prose ul li { position: relative; padding-left: 20px; margin-bottom: 7px; }
.prose ul li::before { content: ""; position: absolute; left: 2px; top: 0.7em; width: 7px; height: 1px; background: var(--gilt); }
.prose code, .md code { font-family: var(--mono); font-size: 0.88em; background: rgba(240, 220, 192, 0.08); padding: 1px 5px; border-radius: 2px; }
.prose b, .prose strong { color: var(--cream); font-weight: 600; }

/* rendered run reports */
.md { color: var(--dim); font-size: 15.5px; overflow-wrap: anywhere; }
.md h3, .md h4, .md h5 { font-size: 22px; color: var(--cream); margin: 20px 0 8px; }
.md p { margin: 0 0 12px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; list-style: revert; }
.md li { margin-bottom: 5px; }
.md a { color: var(--clay-hi); }
.md pre { background: var(--pit); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; overflow-x: auto; margin: 0 0 12px; }
.md pre code { background: none; padding: 0; font-size: 13px; line-height: 1.5; color: var(--cream); }
.md blockquote { margin: 0 0 12px; padding-left: 14px; border-left: 2px solid var(--gilt); }
.md strong { color: var(--cream); }

@media (max-width: 760px) {
  :root { --head-h: 58px; }
  .nav { display: none; }
  .nav.open { display: flex; position: fixed; inset: var(--head-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--pit); border-bottom: 1px solid var(--line); padding: 8px var(--gut) 16px; }
  .nav.open a { min-height: 48px; font-size: 16px; border-bottom: 1px solid var(--line-2); border-radius: 0; }
  .nav.open a.btn { margin-top: 14px; border-bottom: 1px solid var(--bd); border-radius: var(--r); }
  .icon-btn.menu-btn { display: inline-grid; }
  .foot .cols { grid-template-columns: 1fr; }
  .brand b { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.wrap.narrow { width: min(860px, 100% - 2 * var(--gut)); }
.after-run { margin-top: 26px; }

/* ---------------------------------------------------------------- the fog behind the flat pages (js/ui/fog.js) */
.fog { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease); }
.fog-on .fog { opacity: 1; }
.flat main, .app main { position: relative; z-index: 1; }
.fog-on .flat .page, .fog-on .app .page { background: transparent; }
