/* ============================================================================
   TrustGate — landing page
   ----------------------------------------------------------------------------
   Design notes, so future edits don't drift:

   - Warm paper, not white. Ink, not black. The whole palette is pulled toward
     yellow so nothing reads as a default Bootstrap page.
   - Signal colours are oxide pigments (iron red, ochre, pine), not screen
     primaries. A security tool that glows neon looks like a toy.
   - No gradients anywhere. No glass. No glow. Depth comes from 1px rules and
     whitespace, the way a printed report gets it.
   - Display face is a high-contrast serif, which is unusual in developer tools
     and is most of why this doesn't look generated.
   ========================================================================== */

:root {
  --paper:      #f4f1ea;
  --paper-2:    #ebe6db;
  --paper-3:    #e2dccf;
  --card:       #fbfaf7;
  --ink:        #16181c;
  --ink-2:      #4c5158;
  --ink-3:      #7d838c;
  --rule:       #d9d3c6;
  --rule-2:     #c6bfae;

  --deny:       #b0341f;
  --deny-bg:    #f6e7e3;
  --ask:        #9c6510;
  --ask-bg:     #f7edda;
  --allow:      #2c6a4c;
  --allow-bg:   #e5efe8;
  --redact:     #58419e;
  --redact-bg:  #eeeaf8;

  --night:      #101216;
  --night-2:    #171a1f;
  --night-3:    #1f242b;
  --night-rule: #2b3138;
  --night-ink:  #e8e4db;
  --night-ink2: #939aa4;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 62ch;
  --gut: clamp(20px, 5vw, 64px);
  --maxw: 1180px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Paper grain. Fixed, so it reads as the surface the page is printed on rather
   than as a texture scrolling past. Kept extremely faint on purpose. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

main, header, footer { position: relative; z-index: 1; }

img, svg { max-width: 100%; display: block; }

::selection { background: #16181c; color: #f4f1ea; }

a { color: inherit; }

/* ---------- type ---------------------------------------------------------- */

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.012em; margin: 0; }

h1 { font-size: clamp(2.5rem, 4.6vw, 4.05rem); line-height: 1.04; }
h2 { font-size: clamp(2rem, 4.1vw, 3.15rem); line-height: 1.08; }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.24; }

p { margin: 0 0 1.1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lede { font-size: clamp(1.08rem, 1.6vw, 1.28rem); color: var(--ink-2); line-height: 1.58; }

em { font-style: italic; }
strong { font-weight: 600; }

code, kbd, .mono { font-family: var(--mono); font-size: .88em; font-variant-ligatures: none; }

.eyebrow {
  font-family: var(--mono);
  font-size: .69rem;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: .8em;
  margin: 0 0 1.6rem;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.eyebrow .num { color: var(--ink); font-weight: 500; }

/* ---------- layout -------------------------------------------------------- */

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }

section { padding-block: clamp(72px, 10vw, 132px); }
section + section { border-top: 1px solid var(--rule); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); gap: clamp(32px, 6vw, 84px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- nav ----------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(9px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.nav.stuck { border-bottom-color: var(--rule); }
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 62px; }

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--serif); font-size: 1.28rem; letter-spacing: -.01em; }
.brand .mark { width: 17px; height: 17px; flex: none; }
.brand .ver { font-family: var(--mono); font-size: .6rem; letter-spacing: .08em; color: var(--ink-3); border: 1px solid var(--rule-2); padding: 1px 5px; border-radius: 3px; transform: translateY(-1px); }

.nav nav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.nav nav a { font-size: .89rem; color: var(--ink-2); text-decoration: none; transition: color .16s; }
.nav nav a:hover { color: var(--ink); }
@media (max-width: 780px) { .nav nav a.hide-sm { display: none; } }

/* ---------- buttons ------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: .92rem; font-weight: 500;
  padding: 11px 19px; border-radius: 3px;
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: transform .14s var(--ease), background .16s, color .16s, border-color .16s;
}
.btn:hover { transform: translateY(-1px); background: #000; }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn.ghost:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn.sm { padding: 8px 14px; font-size: .84rem; }
.btn svg { width: 15px; height: 15px; flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- hero ---------------------------------------------------------- */

.hero { padding-top: clamp(56px, 9vw, 104px); padding-bottom: clamp(60px, 8vw, 100px); }
.hero h1 em { font-style: italic; }
.hero .lede { margin-top: 1.6rem; max-width: 54ch; }
.hero .btn-row { margin-top: 2.3rem; }
.hero-note { margin-top: 1.5rem; font-size: .82rem; color: var(--ink-3); font-family: var(--mono); }

/* the little verdict ticker in the hero's right column */
.ticker { border: 1px solid var(--rule); background: var(--card); border-radius: 5px; overflow: hidden; }
.ticker-head { display: flex; align-items: center; gap: 7px; padding: 9px 13px; border-bottom: 1px solid var(--rule); background: var(--paper-2); font-family: var(--mono); font-size: .69rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ink-3); }
.ticker-body { padding: 6px 0; }
.ticker-foot { padding: 8px 13px; border-top: 1px solid var(--rule); background: var(--paper-2); font-family: var(--mono); font-size: .65rem; letter-spacing: .04em; color: var(--ink-3); }
.trow { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 13px; font-family: var(--mono); font-size: .78rem; animation: rise .42s var(--ease-out) both; }
.trow .surf { font-size: .63rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .cmd { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-family: var(--mono); font-size: .66rem; letter-spacing: .09em; text-transform: uppercase; padding: 2px 7px; border-radius: 2px; white-space: nowrap; font-weight: 500; }
.tag.allow { color: var(--allow); background: var(--allow-bg); }
.tag.deny  { color: var(--deny);  background: var(--deny-bg); }
.tag.ask   { color: var(--ask);   background: var(--ask-bg); }
.tag.redact{ color: var(--redact); background: var(--redact-bg); }

/* ---------- the dark theatre --------------------------------------------- */

.theatre { background: var(--night); color: var(--night-ink); border-top: 1px solid var(--night); }
.theatre .eyebrow { color: var(--night-ink2); }
.theatre .eyebrow::after { background: var(--night-rule); }
.theatre .eyebrow .num { color: var(--night-ink); }
.theatre h2 { color: var(--night-ink); }
.theatre .lede { color: var(--night-ink2); }

.mode {
  display: inline-flex; padding: 3px; gap: 3px;
  border: 1px solid var(--night-rule); border-radius: 4px; background: var(--night-2);
  margin: 2.2rem 0 1.6rem;
}
.mode button {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .05em;
  padding: 8px 15px; border: 0; border-radius: 3px; cursor: pointer;
  background: transparent; color: var(--night-ink2);
  transition: background .18s, color .18s;
}
.mode button[aria-pressed="true"] { background: var(--night-ink); color: var(--night); font-weight: 500; }
.mode button:hover:not([aria-pressed="true"]) { color: var(--night-ink); }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--night-rule);
  border: 1px solid var(--night-rule);
  border-radius: 6px;
  overflow: hidden;
  min-height: 470px;
}
@media (max-width: 1000px) { .stage { grid-template-columns: minmax(0, 1fr); min-height: 0; } }

.pane { background: var(--night-2); padding: 16px; display: flex; flex-direction: column; min-width: 0; }
.pane-title {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--night-ink2); padding-bottom: 11px; margin-bottom: 13px;
  border-bottom: 1px solid var(--night-rule); display: flex; align-items: center; gap: 7px;
}

/* --- pane 1: the call --- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 9px 12px; border-radius: 9px; font-size: .855rem; line-height: 1.5; animation: rise .36s var(--ease-out) both; }
.msg .who { display: block; font-family: var(--mono); font-size: .6rem; letter-spacing: .11em; text-transform: uppercase; opacity: .62; margin-bottom: 3px; }
.msg.caller { align-self: flex-start; background: var(--night-3); border: 1px solid var(--night-rule); border-bottom-left-radius: 2px; }
.msg.bot { align-self: flex-end; background: #232a33; border: 1px solid #303844; border-bottom-right-radius: 2px; }
.msg.hostile { border-color: #5e2b22; background: #241714; }
.msg.hostile .inject { color: #e0836f; text-decoration: underline; text-decoration-style: wavy; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.typing { display: inline-flex; gap: 3px; align-items: center; height: 1em; }
.typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--night-ink2); animation: bob 1.05s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%,60%,100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* the tool call the agent decides to make */
.toolcall {
  margin-top: 14px; border: 1px solid #4a3a1d; background: #1d1a12; border-radius: 5px;
  padding: 11px 12px; font-family: var(--mono); font-size: .76rem; line-height: 1.55;
  animation: rise .38s var(--ease-out) both;
}
.toolcall .tc-h { color: #c99a3f; letter-spacing: .09em; text-transform: uppercase; font-size: .62rem; margin-bottom: 6px; }
.toolcall .k { color: var(--night-ink2); }
.toolcall .v { color: #e8c98a; }
.toolcall .fn { color: #e8e4db; }

/* --- pane 2: the gate --- */
.gate { display: flex; flex-direction: column; gap: 7px; position: relative; flex: 1; }

.guard {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 11px; border: 1px solid var(--night-rule); border-radius: 4px;
  background: #1a1e24; font-size: .82rem;
  transition: border-color .3s var(--ease), background .3s var(--ease), transform .3s var(--ease);
}
.guard .idx { font-family: var(--mono); font-size: .66rem; color: var(--night-ink2); }
.guard .nm { min-width: 0; }
.guard .st {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: #575e68; transition: color .3s;
}
.guard.scan { border-color: #4a5462; background: #1e242c; }
.guard.scan .st { color: var(--night-ink2); }
.guard.pass .st { color: #57a37c; }
.guard.uncertain { border-color: #6b5322; background: #221d13; }
.guard.uncertain .st { color: #d3a24e; }
.guard.fire { border-color: #8a3a27; background: #26150f; transform: translateX(3px); }
.guard.fire .st { color: #e0745a; font-weight: 500; }
.guard.skip { opacity: .38; }

/* the sweep bar that shows a guard being evaluated */
.guard::after {
  content: ""; position: absolute; left: 0; right: 0; height: 100%;
  pointer-events: none; opacity: 0;
}
.guard.scan { position: relative; }
.guard.scan::before {
  content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px;
  background: #6d9bd1; border-radius: 4px 0 0 4px;
  animation: pulse-edge 1s ease-in-out infinite;
}
@keyframes pulse-edge { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.verdict {
  margin-top: auto; padding-top: 14px;
  animation: rise .44s var(--ease-out) both;
}
.verdict-card { border: 1px solid var(--night-rule); border-radius: 5px; padding: 13px; background: #1a1e24; }
.verdict-card .vtop { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.vbadge {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 500; padding: 4px 10px; border-radius: 3px;
}
.vbadge.deny  { background: #3a1611; color: #f0917a; border: 1px solid #6d2d1f; }
.vbadge.ask   { background: #33260e; color: #e5b360; border: 1px solid #6b5323; }
.vbadge.allow { background: #12291e; color: #62c294; border: 1px solid #24543c; }
.verdict-card .vrule { font-family: var(--mono); font-size: .73rem; color: var(--night-ink2); word-break: break-word; }
.verdict-card .vrule b { color: var(--night-ink); font-weight: 500; }
.verdict-card .vwhy { font-size: .82rem; color: var(--night-ink2); margin-top: 9px; line-height: 1.5; }
.vlat { margin-left: auto; font-family: var(--mono); font-size: .68rem; color: #575e68; }

/* --- pane 3: ledger / aftermath --- */
.ledger { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: .72rem; }
.lrow {
  border: 1px solid var(--night-rule); border-left-width: 2px; border-radius: 3px;
  padding: 8px 10px; background: #1a1e24; line-height: 1.5;
  animation: rise .36s var(--ease-out) both;
}
.lrow.deny  { border-left-color: #8a3a27; }
.lrow.ask   { border-left-color: #8a6a23; }
.lrow.allow { border-left-color: #2c6a4c; }
.lrow .lseq { color: #575e68; }
.lrow .lhash { color: #4d7ca8; word-break: break-all; font-size: .68rem; }
.lrow .lmain { color: var(--night-ink); margin: 3px 0; word-break: break-word; }

.aftermath {
  border: 1px solid #6d2d1f; background: #22120e; border-radius: 5px; padding: 15px;
  animation: rise .46s var(--ease-out) both;
}
.aftermath h4 { margin: 0 0 8px; font-family: var(--serif); font-size: 1.24rem; font-weight: 400; color: #f0917a; }
.aftermath p { font-size: .855rem; color: #c9a89f; margin-bottom: .7em; max-width: none; }
.aftermath ul { margin: 0; padding-left: 17px; font-size: .82rem; color: #c9a89f; }
.aftermath li { margin-bottom: 5px; }

.replay { display: flex; align-items: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.replay button {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .05em;
  background: transparent; border: 1px solid var(--night-rule); color: var(--night-ink2);
  padding: 8px 14px; border-radius: 3px; cursor: pointer; transition: color .16s, border-color .16s;
  display: inline-flex; align-items: center; gap: 7px;
}
.replay button:hover { color: var(--night-ink); border-color: #4a5462; }
.replay .cap { font-size: .77rem; color: #6d747e; }

/* ---------- the live gate strip ------------------------------------------ */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  font-family: var(--mono); font-size: .8rem;
  padding: 7px 12px; border: 1px solid var(--rule-2); border-radius: 3px;
  background: var(--card); cursor: pointer; color: var(--ink-2);
  transition: border-color .16s, color .16s, background .16s, transform .12s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.readout {
  border: 1px solid var(--rule); border-radius: 5px; background: var(--card); overflow: hidden;
}
.readout-head { padding: 9px 14px; border-bottom: 1px solid var(--rule); background: var(--paper-2); font-family: var(--mono); font-size: .68rem; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); }
.readout-body { padding: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 20px; align-items: start; }
@media (max-width: 620px) { .readout-body { grid-template-columns: minmax(0, 1fr); } }
.readout .lbl { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.readout .val { font-family: var(--mono); font-size: .87rem; overflow-wrap: anywhere; }
.readout .why { font-size: .9rem; color: var(--ink-2); max-width: 58ch; }

/* ---------- ledger tamper demo -------------------------------------------- */

.chain { border: 1px solid var(--rule); border-radius: 5px; background: var(--card); overflow: hidden; font-family: var(--mono); font-size: .78rem; }
.centry { padding: 11px 14px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; transition: background .3s; }
.centry:last-child { border-bottom: 0; }
.centry .cseq { color: var(--ink-3); }
.centry .cbody { min-width: 0; }
.centry .cact { color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.centry .chash { color: #5b7fa8; font-size: .7rem; overflow-wrap: anywhere; }
.centry .cstat { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--allow); }
.centry.broken { background: var(--deny-bg); }
.centry.broken .cstat { color: var(--deny); font-weight: 500; }
.centry.edited { background: #fdf6e6; }
.centry.edited .cact { color: var(--deny); }
.centry.edited .cstat { color: var(--ask); }

/* ---------- numbers ------------------------------------------------------- */

.figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; }
@media (max-width: 760px) { .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fig { background: var(--card); padding: 22px 18px; }
.fig .n { font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1; letter-spacing: -.02em; }
.fig .n small { font-size: .42em; color: var(--ink-3); letter-spacing: 0; }
.fig .l { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: 9px; }

.caveat {
  margin-top: 22px; border-left: 2px solid var(--ask); padding: 2px 0 2px 16px;
  font-size: .93rem; color: var(--ink-2); max-width: 66ch;
}
.caveat b { color: var(--ink); font-weight: 600; }

/* ---------- flow / architecture ------------------------------------------- */

.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; margin-top: 8px; }
@media (max-width: 820px) { .flow { grid-template-columns: minmax(0, 1fr); } }
.fcard { background: var(--card); padding: 24px 20px; }
.fcard .fnum { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; color: var(--ink-3); margin-bottom: 12px; }
.fcard h3 { margin-bottom: 9px; }
.fcard p { font-size: .92rem; color: var(--ink-2); }

.notlist { list-style: none; padding: 0; margin: 0; }
.notlist li { padding: 15px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 13px; }
.notlist li:last-child { border-bottom: 0; }
.notlist .x { font-family: var(--mono); color: var(--ink-3); font-size: .9rem; }
.notlist b { display: block; margin-bottom: 3px; }
.notlist span { font-size: .92rem; color: var(--ink-2); }

/* ---------- agencies ------------------------------------------------------ */

.agency { background: var(--paper-2); }
.usecases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 34px; }
@media (max-width: 860px) { .usecases { grid-template-columns: minmax(0, 1fr); } }
.uc { border: 1px solid var(--rule); border-radius: 5px; background: var(--card); padding: 22px 20px; }
.uc .ico { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 11px; }
.uc h3 { font-size: 1.2rem; margin-bottom: 8px; }
.uc p { font-size: .9rem; color: var(--ink-2); }

/* ---------- final cta ----------------------------------------------------- */

.finale { background: var(--night); color: var(--night-ink); text-align: center; }
.finale h2 { color: var(--night-ink); max-width: 20ch; margin-inline: auto; }
.finale p { color: var(--night-ink2); margin-inline: auto; margin-top: 1.2rem; }
.finale .btn-row { justify-content: center; margin-top: 2.2rem; }
.finale .btn { background: var(--night-ink); color: var(--night); border-color: var(--night-ink); }
.finale .btn:hover { background: #fff; }
.finale .btn.ghost { background: transparent; color: var(--night-ink); border-color: var(--night-rule); }
.finale .btn.ghost:hover { background: var(--night-2); border-color: #4a5462; }

/* ---------- footer -------------------------------------------------------- */

footer { background: var(--night); color: var(--night-ink2); border-top: 1px solid var(--night-rule); padding-block: 42px; font-size: .87rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 34px; align-items: center; }
footer a { color: var(--night-ink2); text-decoration: none; transition: color .16s; }
footer a:hover { color: var(--night-ink); }
footer .sp { margin-left: auto; font-family: var(--mono); font-size: .74rem; color: #575e68; }

/* ---------- contact page -------------------------------------------------- */

.form { display: grid; gap: 17px; }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.field label .req { color: var(--deny); }
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: .96rem; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--rule-2); border-radius: 3px;
  background: var(--card); width: 100%;
  transition: border-color .16s, box-shadow .16s;
}
.field textarea { resize: vertical; min-height: 132px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22,24,28,.07);
}
.field.bad input, .field.bad textarea { border-color: var(--deny); }
.field .err { font-size: .8rem; color: var(--deny); display: none; }
.field.bad .err { display: block; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 17px; }
@media (max-width: 620px) { .two { grid-template-columns: minmax(0, 1fr); } }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.formnote { font-size: .85rem; color: var(--ink-3); }

.status { padding: 13px 15px; border-radius: 4px; font-size: .92rem; display: none; }
.status.show { display: block; }
.status.ok   { background: var(--allow-bg); color: var(--allow); border: 1px solid #b9d5c5; }
.status.err  { background: var(--deny-bg);  color: var(--deny);  border: 1px solid #e0bcb3; }
.status a { color: inherit; font-weight: 600; }

.sidecard { border: 1px solid var(--rule); border-radius: 5px; background: var(--card); padding: 22px; }
.sidecard + .sidecard { margin-top: 18px; }
.sidecard h3 { font-size: 1.18rem; margin-bottom: 9px; }
.sidecard p { font-size: .9rem; color: var(--ink-2); }
.sidecard .btn { margin-top: 14px; }

.deets { list-style: none; padding: 0; margin: 14px 0 0; font-size: .9rem; }
.deets li { padding: 7px 0; border-top: 1px solid var(--rule); display: flex; gap: 12px; }
.deets li:first-child { border-top: 0; }
.deets .dk { font-family: var(--mono); font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); min-width: 78px; padding-top: 3px; }

/* ---------- reveal on scroll ---------------------------------------------- */

.rv { opacity: 0; transform: translateY(15px); }
.rv.seen { opacity: 1; transform: none; transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }

/* ---------- reduced motion ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .rv { opacity: 1; transform: none; }
}

/* ---------- overflow containment ------------------------------------------
   Wide content scrolls inside its own box. The page body never does. */
pre, .chain, .figs, .flow { max-width: 100%; }
pre { overflow-x: auto; }
.stage, .readout, .ticker { max-width: 100%; }

/* On a phone the three-column ticker row squeezes the action into an ellipsis,
   which hides the exact thing the surface labels were added to show. Stack it:
   domain and verdict on one line, the full action wrapping underneath. */
@media (max-width: 520px) {
  .trow {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "surf tag" "cmd cmd";
    row-gap: 4px;
    padding: 10px 13px;
  }
  .trow .surf { grid-area: surf; }
  .trow .tag  { grid-area: tag; justify-self: end; }
  .trow .cmd  { grid-area: cmd; white-space: normal; overflow: visible; overflow-wrap: anywhere; font-size: .75rem; }
}

/* ---- v0.2.0 additions: overview video, comparison table ---- */
.overview { padding-top: 0; }
.video-frame { border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--paper-2); aspect-ratio: 16 / 9; }
.video-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cmp { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--card); border: 1px solid var(--rule); border-radius: 5px; }
.cmp th, .cmp td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cmp th { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; background: var(--paper-2); }
.cmp td:first-child { color: var(--ink-2); }
.cmp tr:last-child td { border-bottom: 0; }
@media (max-width: 620px) { .cmp { font-size: .82rem; } .cmp th, .cmp td { padding: 8px; } }

/* ---- Pro redesign ---- */
.qa { border-top: 1px solid var(--rule); }
.qa-row { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); padding: 22px 0; border-bottom: 1px solid var(--rule); }
.qa .q { font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.25; }
.qa .a { color: var(--ink-2); font-size: .98rem; }
@media (max-width: 760px) { .qa-row { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

.pro-grid { display: grid; gap: 22px; }
.pro-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(20px, 3vw, 34px); }
.pro-card .ico { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 11px; }
.pro-card h3 { font-size: 1.45rem; margin-bottom: 10px; }
.pro-card p { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 860px) { .pro-card { grid-template-columns: minmax(0, 1fr); } }

.term { margin: 0; padding: 18px; overflow-x: auto; font-size: .8rem; line-height: 1.7; color: var(--ink-2); }
.term .c { color: #7d838c; } .term .ok { color: var(--allow); } .term .no { color: var(--deny); } .term .ask { color: var(--ask); }

.pill { display: inline-block; font-family: var(--mono); font-size: .68rem; letter-spacing: .04em; padding: 3px 8px; border-radius: 3px; white-space: nowrap; }
.pill.allow { color: var(--allow); background: var(--allow-bg); }
.pill.deny { color: var(--deny); background: var(--deny-bg); }
.pill.ask { color: var(--ask); background: var(--ask-bg); }

.inbox, .pack { border: 1px solid var(--rule); border-radius: 5px; background: var(--paper); overflow: hidden; font-size: .86rem; }
.inbox-head, .pack-head { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--paper-2); border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.inbox-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.inbox-row b { display: block; font-weight: 500; font-size: .82rem; overflow-wrap: anywhere; }
.inbox-row span { color: var(--ink-3); font-size: .78rem; }
.inbox-btns { display: flex; gap: 6px; flex: none; }
.inbox-foot { padding: 10px 14px; color: var(--ink-3); font-size: .78rem; }
.inbox-foot b { color: var(--ink); font-weight: 500; }
.pack-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
.pack-figs div { padding: 14px; border-right: 1px solid var(--rule); }
.pack-figs div:last-child { border-right: 0; }
.pack-figs b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 400; line-height: 1; }
.pack-figs span { font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.pack-line { padding: 10px 14px; border-bottom: 1px solid var(--rule); color: var(--ink-2); display: flex; gap: 10px; align-items: center; }
.pack-line:last-child { border-bottom: 0; }
@media (max-width: 480px) { .inbox-row { flex-direction: column; align-items: flex-start; } }

.flow.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .flow.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .flow.four { grid-template-columns: minmax(0, 1fr); } }

.faq details { border-bottom: 1px solid var(--rule); padding: 16px 0; }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 500; 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(--ink-3); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 10px; color: var(--ink-2); font-size: .95rem; }

/* ---- wider, better balanced layout on large screens ---- */
:root { --maxw: 1440px; --gut: clamp(20px, 5vw, 96px); }
.nav .wrap { max-width: 1600px; height: 72px; }
.brand { font-size: 1.6rem; gap: 11px; }
.brand .mark { width: 26px; height: 26px; }
.brand .ver { font-size: .66rem; }
h1 { font-size: clamp(2.5rem, 4.6vw, 4.9rem); }
h2 { font-size: clamp(2rem, 3.6vw, 3.4rem); }
.hero .split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; }
.hero .lede { max-width: 60ch; }
.ticker-body { padding: 10px 0; }
@media (min-width: 1300px) {
  .lede { font-size: 1.3rem; }
  .pro-card { padding: 40px 48px; }
}
:root { --maxw: 1600px; }
.hero h1 em { white-space: nowrap; }
@media (min-width: 1300px) {
  .trow { font-size: .9rem; padding: 10px 16px; grid-template-columns: 90px minmax(0, 1fr) auto; }
  .trow .surf { font-size: .7rem; }
  .ticker-head, .ticker-foot { font-size: .74rem; }
}
