/* itsmarina.tech — one stylesheet for the home page, the docs and the message editor.
   Art direction: a ship's chart and logbook. Parchment and ink by day, a night chart by dark;
   brass for what you can press, sea blue for links, signal red for bans. */

:root {
  --paper: #f3eee2;
  --paper-2: #fbf8f0;
  --paper-3: #e9e2d0;
  --ink: #14223a;
  --ink-2: #434e66;
  --ink-3: #6d7384;
  --rule: #dcd3bf;
  --rule-2: #c5b99d;
  --brass: #94661a;
  --brass-hi: #d7a845;
  --brass-soft: #f1e3bf;
  --sea: #17607a;
  --sea-hi: #2a85a5;
  --sea-soft: #dce9ea;
  --signal: #b5412c;
  --signal-soft: #f5ddd5;
  --kelp: #2d6b46;
  --kelp-soft: #dbe9dc;
  --night: #0a1526;
  --night-ink: #efe8d8;
  --night-ink-2: #a9b2c2;
  --night-rule: rgba(239, 232, 216, .12);
  --edge: var(--ink);
  --drop: var(--ink);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --nav-h: 64px;
  --shadow: 0 1px 0 rgba(20, 34, 58, .04), 0 12px 32px -18px rgba(20, 34, 58, .35);
  --shadow-lg: 0 40px 80px -40px rgba(10, 21, 38, .55);
  --ring: 0 0 0 3px color-mix(in srgb, var(--sea-hi) 35%, transparent);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.13  0 0 0 0 0.22  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --grain-op: .35;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1424; --paper-2: #101b2e; --paper-3: #08101d;
    --ink: #ece5d5; --ink-2: #b6b2a7; --ink-3: #868b96;
    --rule: #1e2b42; --rule-2: #2c3c59;
    --brass: #ddb562; --brass-hi: #e7c272; --brass-soft: #2a2312;
    --sea: #6db7d0; --sea-hi: #8fd0e4; --sea-soft: #10283a;
    --signal: #e57a64; --signal-soft: #34191a; --kelp: #78c595; --kelp-soft: #12291d;
    --edge: #2c3c59; --drop: #000;
    --shadow: 0 1px 0 rgba(0,0,0,.2), 0 14px 34px -18px rgba(0,0,0,.8);
    --grain-op: .12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b1424; --paper-2: #101b2e; --paper-3: #08101d;
  --ink: #ece5d5; --ink-2: #b6b2a7; --ink-3: #868b96;
  --rule: #1e2b42; --rule-2: #2c3c59;
  --brass: #ddb562; --brass-hi: #e7c272; --brass-soft: #2a2312;
  --sea: #6db7d0; --sea-hi: #8fd0e4; --sea-soft: #10283a;
  --signal: #e57a64; --signal-soft: #34191a; --kelp: #78c595; --kelp-soft: #12291d;
  --edge: #2c3c59; --drop: #000;
  --shadow: 0 1px 0 rgba(0,0,0,.2), 0 14px 34px -18px rgba(0,0,0,.8);
  --grain-op: .12;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 18px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.6 var(--font); letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--grain); opacity: var(--grain-op);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--brass-hi) 45%, transparent); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--paper-2); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.label {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--brass);
}
.label::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.kicker { font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }

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

.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 max(20px, calc((100vw - 1320px) / 2));
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}
.nav.on-dark { position: fixed; left: 0; right: 0; background: transparent; border-bottom-color: transparent; color: var(--night-ink); backdrop-filter: none; -webkit-backdrop-filter: none; transition: background .25s, border-color .25s; }
.nav.on-dark.scrolled { background: rgba(10, 21, 38, .86); border-bottom-color: var(--night-rule); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--brass-hi), 0 0 0 4px color-mix(in srgb, var(--brass-hi) 25%, transparent); }
.brand-name { font: 400 26px/1 var(--serif); letter-spacing: -.01em; }
.brand-tag { font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 4px 7px; border: 1px solid var(--rule-2); border-radius: 5px; color: var(--ink-3); }
.nav-links { display: flex; gap: 2px; margin-left: 14px; }
.nav-links a { color: var(--ink-2); font-size: 14.5px; font-weight: 500; padding: 7px 11px; border-radius: 8px; }
.nav.on-dark .nav-links a { color: var(--night-ink-2); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--paper-3); text-decoration: none; }
.nav.on-dark .nav-links a:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-spacer { flex: 1; }
.search-btn {
  display: flex; align-items: center; gap: 10px; min-width: 210px; height: 38px; padding: 0 9px 0 12px;
  background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--rule); border-radius: 10px; cursor: pointer; font-size: 14px;
}
.search-btn:hover { border-color: var(--rule-2); color: var(--ink-2); }
.nav.on-dark .search-btn { background: rgba(255,255,255,.04); border-color: var(--night-rule); color: var(--night-ink-2); }
.search-btn kbd { margin-left: auto; font: 11px var(--mono); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--rule-2); color: var(--ink-3); }
.nav.on-dark .search-btn kbd { border-color: var(--night-rule); color: var(--night-ink-2); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--paper-3); color: var(--ink); }
.nav.on-dark .icon-btn { color: var(--night-ink-2); }
.nav.on-dark .icon-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.icon-btn svg, .btn svg, .search-btn svg { width: 17px; height: 17px; flex: none; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
.menu-btn { display: none; }

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

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 20px; border-radius: 11px; border: 1px solid transparent;
  font: 600 15px/1 var(--font); letter-spacing: -.01em; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 9px; gap: 7px; }
.btn-brass, .btn-gold {
  background: linear-gradient(180deg, #e9c266, #cf9d36); color: #1d1405; border-color: #7f5912;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 0 rgba(0,0,0,.12), 3px 3px 0 #0a1526;
}
.btn-brass:hover, .btn-gold:hover { transform: translate(-1px, -1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 0 rgba(0,0,0,.12), 4px 4px 0 #0a1526; }
.btn-brass:active, .btn-gold:active { transform: translate(2px, 2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 1px 1px 0 #0a1526; }
.btn-sm.btn-brass, .btn-sm.btn-gold { box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 2px 2px 0 #0a1526; }
.btn-line { background: transparent; color: inherit; border-color: currentColor; }
.btn-line:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: color-mix(in srgb, var(--ink) 86%, var(--sea)); }
.btn-outline { background: var(--paper-2); border-color: var(--rule-2); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-primary { background: var(--sea); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #06202b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #06202b; } }
.btn-primary:hover { background: var(--sea-hi); }
.btn .arr { transition: transform .15s; }
.btn:hover .arr { transform: translateX(3px); }

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

.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--night); color: var(--night-ink); padding-top: calc(var(--nav-h) + 54px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: linear-gradient(rgba(239,232,216,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(239,232,216,.045) 1px, transparent 1px);
  background-size: 72px 72px; background-position: center top;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 60% at 78% 40%, rgba(43, 134, 165, .30), transparent 70%), radial-gradient(40% 40% at 10% 100%, rgba(215, 168, 69, .10), transparent 70%);
}
.contours { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; color: #7fb6c9; opacity: .22; }
.hero-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 40px; align-items: center; padding-bottom: 72px; }
.coords { display: flex; gap: 20px; flex-wrap: wrap; font: 500 11.5px/1 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--night-ink-2); margin-bottom: 32px; }
.coords span { display: inline-flex; align-items: center; gap: 8px; }
.coords .live { color: #8fe0b0; }
.coords .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(143,224,176,.15); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(143,224,176,0); } }
.hero h1 { font: 400 clamp(56px, 8.6vw, 124px)/.9 var(--serif); letter-spacing: -.028em; margin: 0 0 30px; }
.hero h1 em { font-style: italic; color: var(--brass-hi); }
.hero h1 .u { position: relative; display: inline-block; }
.hero h1 .u svg { position: absolute; left: -3%; bottom: -.12em; width: 106%; height: .26em; color: var(--brass-hi); opacity: .85; }
.hero h1 .u svg path { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.3s .5s cubic-bezier(.6,.1,.2,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero .lead { font-size: clamp(17px, 1.55vw, 19.5px); line-height: 1.55; color: var(--night-ink-2); max-width: 32em; margin: 0 0 36px; }
.hero .lead b { color: var(--night-ink); font-weight: 500; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero .btn-line { color: var(--night-ink); border-color: rgba(239,232,216,.35); }
.hero .btn-line:hover { border-color: var(--night-ink); background: rgba(255,255,255,.05); }
.hero .fine { margin-top: 22px; font: 12.5px var(--mono); color: rgba(239,232,216,.5); }
.hero .fine a { color: var(--night-ink-2); text-decoration: underline; text-decoration-color: rgba(239,232,216,.3); text-underline-offset: 3px; }

.porthole-wrap { position: relative; justify-self: center; width: min(480px, 100%); aspect-ratio: 1; }
.porthole-wrap .compass { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(239,232,216,.55); animation: turn 180s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.porthole {
  position: absolute; inset: 11%; border-radius: 50%; padding: 4.5%;
  background: conic-gradient(from 210deg, #8a6115, #f3d27f, #b8862a, #6e4b0f, #e8c063, #9c7020, #f3d27f, #8a6115);
  box-shadow: 0 34px 70px -18px rgba(0,0,0,.85), 0 0 0 1px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.35), 0 0 120px -10px rgba(43,134,165,.45);
}
.porthole .glass { position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #0a1526; }
.porthole .glass img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); }
.porthole .glass::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(140deg, rgba(255,255,255,.30), transparent 30%, transparent 72%, rgba(255,255,255,.07));
  box-shadow: inset 0 0 0 6px #0a1526, inset 0 0 50px rgba(10,21,38,.55);
}
.rivets { position: absolute; inset: 11%; pointer-events: none; }
.rivets i { position: absolute; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2c6, #b38428 55%, #5d3f0b); box-shadow: 0 1px 1.5px rgba(0,0,0,.55); }
.stamp {
  position: absolute; right: 0; bottom: 8%; transform: rotate(-8deg);
  padding: 9px 14px 10px; border: 1.5px solid var(--brass-hi); border-radius: 8px; color: var(--brass-hi);
  font: 500 10.5px/1.35 var(--mono); letter-spacing: .15em; text-transform: uppercase; text-align: center;
  background: rgba(10,21,38,.8); backdrop-filter: blur(4px); box-shadow: 0 0 0 4px rgba(10,21,38,.5);
}
.stamp b { display: block; font: 400 24px/1 var(--serif); letter-spacing: 0; text-transform: none; color: var(--night-ink); margin: 4px 0 3px; }

.ticker { position: relative; border-top: 1px solid var(--night-rule); overflow: hidden; background: rgba(0,0,0,.2); }
.ticker-track { display: flex; gap: 46px; width: max-content; padding: 16px 0; animation: tick 70s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker a { font: 400 13.5px/1 var(--mono); color: var(--night-ink-2); white-space: nowrap; }
.ticker a b { color: var(--brass-hi); font-weight: 500; }
.ticker a:hover { color: #fff; text-decoration: none; }
@keyframes tick { to { transform: translateX(-50%); } }
.ticker::before, .ticker::after { content: ""; position: absolute; top: 0; bottom: 0; width: 120px; z-index: 1; pointer-events: none; }
.ticker::before { left: 0; background: linear-gradient(90deg, var(--night), transparent); }
.ticker::after { right: 0; background: linear-gradient(270deg, var(--night), transparent); }
@media (prefers-reduced-motion: reduce) { .ticker-track, .porthole-wrap .compass, .hero h1 .u svg path { animation: none; stroke-dashoffset: 0; } }

/* ------------------------------------------------------------------ sections */

.sec { padding: 120px 0; position: relative; }
.sec + .sec { border-top: 1px solid var(--rule); }
.sec-head { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: end; margin-bottom: 56px; }
.sec-head h2, .h2 { font: 400 clamp(42px, 5.6vw, 76px)/.96 var(--serif); letter-spacing: -.024em; margin: 18px 0 0; }
.sec-head h2 em, .h2 em { font-style: italic; color: var(--brass); }
.sec-head p { margin: 0; color: var(--ink-2); font-size: 18px; max-width: 32em; justify-self: end; }
.lede { font-size: 18px; color: var(--ink-2); margin: 22px 0 0; }

/* ------------------------------------------------------------------ live demo */

.demo { display: grid; grid-template-columns: minmax(0, 1fr) 340px; border: 1.5px solid var(--edge); border-radius: 18px; overflow: hidden; background: var(--paper-2); box-shadow: 8px 8px 0 var(--drop); }
.demo-chat {
  --tg-bg: #0e1621; --tg-head: #17212b; --tg-in: #182533; --tg-out: #2b5278; --tg-text: #f5f5f5; --tg-sub: #7d8b99; --tg-link: #71baf2;
  display: flex; flex-direction: column; height: 660px; background: var(--tg-bg); color: var(--tg-text);
  font: 14.5px/1.42 var(--font); letter-spacing: 0; position: relative; min-width: 0;
}
.demo-chat .tg-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 16px; background: var(--tg-head); border-bottom: 1px solid #0b121b; }
.demo-chat .tg-top .ava { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #2b86a6, #17607a); color: #fff; }
.demo-chat .tg-top .ava svg { width: 21px; height: 21px; }
.demo-chat .tg-top b { display: block; font-size: 15px; font-weight: 600; }
.demo-chat .tg-top small { color: var(--tg-sub); font-size: 13px; }
.demo-chat .tg-top .reset { margin-left: auto; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid #2a3949; background: transparent; color: var(--tg-sub); cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.demo-chat .tg-top .reset svg { width: 14px; height: 14px; }
.demo-chat .tg-top .reset:hover { color: #fff; border-color: #3d5266; }
.feed {
  flex: 1; overflow-y: auto; padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 6px;
  background: radial-gradient(circle at 15% 20%, rgba(43,134,165,.10), transparent 35%), radial-gradient(circle at 85% 75%, rgba(215,168,69,.06), transparent 35%), var(--tg-bg);
  scrollbar-width: thin; scrollbar-color: #2a3949 transparent;
}
.day { align-self: center; font-size: 12.5px; padding: 3px 10px; border-radius: 99px; background: rgba(0,0,0,.35); color: #c9d3dc; margin: 4px 0; }
.svc { align-self: center; font-size: 13px; padding: 4px 11px; border-radius: 99px; background: rgba(0,0,0,.32); color: #d7dee5; max-width: 90%; text-align: center; animation: pop .22s ease-out; }
.row { display: flex; gap: 8px; align-items: flex-end; max-width: 90%; animation: pop .22s ease-out; }
.row.me { align-self: flex-end; flex-direction: row-reverse; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.row .av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 13.5px var(--font); color: #fff; overflow: hidden; }
.row .av img { width: 100%; height: 100%; object-fit: cover; }
.row.me .av { display: none; }
.bubble-col { display: grid; gap: 4px; min-width: 0; }
.bubble { position: relative; padding: 6px 10px; border-radius: 13px; background: var(--tg-in); min-width: 0; overflow-wrap: anywhere; cursor: pointer; transition: box-shadow .15s; }
.row:not(.me) .bubble { border-bottom-left-radius: 4px; }
.row.me .bubble { background: var(--tg-out); border-bottom-right-radius: 4px; }
.bubble:hover { box-shadow: 0 0 0 1.5px rgba(113,186,242,.35); }
.bubble.picked { box-shadow: 0 0 0 2px var(--tg-link); }
.bubble .who { font-weight: 600; font-size: 13.5px; margin-bottom: 1px; }
.bubble .who small { font-weight: 400; color: var(--tg-sub); font-size: 12px; margin-left: 4px; }
.bubble .tx { white-space: pre-wrap; }
.bubble .tm { float: right; margin: 7px -2px -3px 10px; font-size: 11.5px; color: rgba(255,255,255,.42); }
.bubble a, .bubble .mention { color: var(--tg-link); }
.bubble code { font-family: var(--mono); font-size: .9em; color: #f2a97f; }
.bubble pre { margin: 4px 0; padding: 7px 9px; border-radius: 7px; background: rgba(0,0,0,.28); white-space: pre-wrap; font-size: 12.5px; }
.bubble blockquote { margin: 3px 0; padding: 2px 8px; border-left: 3px solid var(--tg-link); background: rgba(113,186,242,.1); border-radius: 4px; }
.bubble .sp { background: rgba(170,180,195,.5); color: transparent; border-radius: 3px; }
.bubble .sp.open { background: transparent; color: inherit; }
.quote-ref { display: block; margin: 1px 0 4px; padding: 2px 8px; border-left: 2.5px solid var(--tg-link); border-radius: 3px; background: rgba(113,186,242,.1); font-size: 13px; }
.quote-ref b { display: block; color: var(--tg-link); font-weight: 600; font-size: 12.5px; }
.quote-ref span { display: block; color: #c3ccd5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.row.deleting { animation: shred .55s ease-in forwards; }
@keyframes shred { 35% { filter: saturate(0) brightness(1.3); } to { opacity: 0; transform: translateX(-14px) scale(.96); filter: blur(2px); } }
.row .kb { display: grid; gap: 4px; }
.row .kb-row { display: flex; gap: 4px; }
.row .kb-btn { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 9px; border: 0; cursor: pointer; background: rgba(24, 37, 51, .92); color: #fff; font: 500 13.5px var(--font); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .kb-btn:hover { background: #22364b; }
.row .kb-btn.primary { background: #3d8ee0; } .row .kb-btn.success { background: #2ea865; } .row .kb-btn.danger { background: #d6514a; }
.typing-row .bubble { padding: 11px 13px; cursor: default; }
.typing-row .bubble:hover { box-shadow: none; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--tg-sub); animation: blink 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .18s; } .dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { background: var(--tg-head); border-top: 1px solid #0b121b; padding-top: 8px; }
.reply-bar { display: none; align-items: center; gap: 10px; padding: 0 14px 6px; font-size: 13px; }
.reply-bar.on { display: flex; }
.reply-bar svg { width: 18px; height: 18px; color: var(--tg-link); flex: none; }
.reply-bar div { flex: 1; min-width: 0; border-left: 2px solid var(--tg-link); padding-left: 9px; }
.reply-bar b { display: block; color: var(--tg-link); font-size: 12.5px; }
.reply-bar span { display: block; color: #c3ccd5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar button { background: none; border: 0; color: var(--tg-sub); cursor: pointer; font-size: 22px; line-height: 1; padding: 2px 6px; }
.suggest { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 8px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest button { flex: none; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid #2a3949; background: #0e1621; color: #b8c4cf; font: 12.5px var(--mono); cursor: pointer; transition: all .12s; }
.suggest button:hover { border-color: var(--tg-link); color: #fff; }
.suggest button.next { border-color: #d7a845; color: #f1d58f; box-shadow: 0 0 0 3px rgba(215,168,69,.15); }
.compose-row { display: flex; align-items: flex-end; gap: 8px; padding: 0 12px 12px; }
.compose-row textarea { flex: 1; resize: none; height: 44px; max-height: 120px; padding: 11px 14px; border-radius: 12px; border: 0; outline: none; background: #0e1621; color: #f5f5f5; font: 14.5px/1.45 var(--font); }
.compose-row textarea::placeholder { color: #6b7b8b; }
.compose-row .send { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: #3d8ee0; color: #fff; cursor: pointer; }
.compose-row .send svg { width: 19px; height: 19px; }
.compose-row .send:hover { background: #5099e6; }
.hint-pop { position: absolute; left: 50%; bottom: 150px; transform: translate(-50%, 6px); z-index: 3; padding: 9px 14px; border-radius: 10px; background: rgba(5,10,18,.88); color: #e9eef3; font-size: 13px; max-width: 86%; text-align: center; opacity: 0; transition: all .2s; pointer-events: none; }
.hint-pop.on { opacity: 1; transform: translate(-50%, 0); }
.hint-pop code { color: #f1d58f; }

.logbook {
  display: flex; flex-direction: column; min-height: 0; height: 660px; border-left: 1.5px solid var(--edge);
  background: repeating-linear-gradient(180deg, transparent 0 27px, color-mix(in srgb, var(--sea) 13%, transparent) 27px 28px) 0 4px, var(--paper-2);
}
.logbook header { padding: 16px 18px 13px; border-bottom: 1.5px solid var(--edge); background: var(--paper-2); }
.logbook header h3 { margin: 0; font: 400 28px/1 var(--serif); }
.logbook header p { margin: 6px 0 0; font: 11.5px/1.45 var(--mono); color: var(--ink-3); }
.log-list { flex: 1; overflow-y: auto; padding: 0 18px 18px; scrollbar-width: thin; }
.log-entry { font: 12.5px/28px var(--mono); color: var(--ink); animation: ink .6s ease-out; }
.log-entry .t { color: var(--ink-3); margin-right: 6px; }
.log-entry .k { font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.log-entry .k.ban { color: var(--signal); background: var(--signal-soft); }
.log-entry .k.warn { color: var(--brass); background: var(--brass-soft); }
.log-entry .k.ok { color: var(--kelp); background: var(--kelp-soft); }
.log-entry .k.set { color: var(--sea); background: var(--sea-soft); }
.log-entry .d { display: block; color: var(--ink-2); padding-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-empty { font: italic 400 20px/28px var(--serif); color: var(--ink-3); margin: 28px 0 0; }
@keyframes ink { from { opacity: 0; filter: blur(3px); transform: translateY(-4px); } }

.demo-notes { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 48px; border-top: 1.5px solid var(--edge); }
.demo-notes div { padding: 22px 26px 0 0; }
.demo-notes div + div { padding-left: 26px; border-left: 1px solid var(--rule); }
.demo-notes .n { font: 500 11px var(--mono); letter-spacing: .12em; color: var(--brass); }
.demo-notes b { display: block; font: 400 26px/1.1 var(--serif); margin: 6px 0 6px; font-weight: 400; }
.demo-notes p { margin: 0; color: var(--ink-2); font-size: 15px; }
.demo-notes code { font-size: 13px; padding: 1px 5px; border-radius: 5px; background: var(--paper-3); }

/* ------------------------------------------------------------------ manifest */

.manifest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 56px; }
.manifest section { padding: 24px 0 34px; border-top: 1.5px solid var(--edge); }
.manifest h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; font: 400 32px/1.05 var(--serif); }
.manifest h3 small { font: 500 11px var(--mono); letter-spacing: .1em; color: var(--ink-3); white-space: nowrap; }
.manifest p { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.manifest ol { list-style: none; margin: 0; padding: 0; }
.manifest li a { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; color: var(--ink); font-size: 15.5px; }
.manifest li a::after { content: ""; order: 2; flex: 1; border-bottom: 1.5px dotted var(--rule-2); transform: translateY(-4px); }
.manifest li a .n { order: 3; font: 12px var(--mono); color: var(--ink-3); }
.manifest li a:hover { color: var(--sea); text-decoration: none; }
.manifest li a:hover::after { border-color: var(--sea); }


.manifest-cta { grid-column: span 2; align-self: start; margin-top: 0; padding: 30px 32px !important; border: 0 !important; border-radius: 16px; background: var(--night); color: var(--night-ink); position: relative; overflow: hidden; }
.manifest-cta::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(239,232,216,.12); box-shadow: 0 0 0 30px rgba(239,232,216,.03), 0 0 0 60px rgba(239,232,216,.02); }
.manifest-cta .kicker { color: var(--brass-hi); }
.manifest-cta p { font: 400 26px/1.25 var(--serif); color: var(--night-ink); margin: 12px 0 22px; max-width: 26em; }
.manifest-cta .btn-line { color: var(--night-ink); border-color: rgba(239,232,216,.35); }
@media (max-width: 1060px) { .manifest-cta { grid-column: span 2; } }
@media (max-width: 640px) { .manifest-cta { grid-column: auto; } .manifest-cta p { font-size: 22px; } }

/* ------------------------------------------------------------------ federations, speed, editor teaser */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.chart-card { position: relative; border: 1.5px solid var(--edge); border-radius: 18px; background: var(--paper-2); overflow: hidden; box-shadow: 8px 8px 0 var(--drop); }
.chart-card svg { width: 100%; height: auto; }
.chart-card .legend { position: absolute; left: 18px; bottom: 14px; font: 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.facts { list-style: none; padding: 0; margin: 34px 0 0; border-top: 1.5px solid var(--edge); }
.facts li { display: grid; grid-template-columns: 140px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; color: var(--ink-2); }
.facts li b { font: 500 13px/1.7 var(--mono); color: var(--ink); }

.lanes { border: 1.5px solid var(--edge); border-radius: 18px; background: var(--paper-2); padding: 22px 24px 18px; box-shadow: 8px 8px 0 var(--drop); }
.lanes h4 { margin: 0 0 6px; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.lane { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; padding: 12px 0; }
.lane + .lane { border-top: 1px dashed var(--rule-2); }
.lane-name { font: 500 12px/1.35 var(--mono); color: var(--ink-2); }
.lane-name small { display: block; color: var(--ink-3); font-size: 11px; }
.lane-track { position: relative; height: 40px; display: flex; align-items: center; gap: 5px; overflow: hidden; }
.chip-msg { flex: none; height: 30px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 7px; font: 12px var(--mono); background: var(--paper-3); color: var(--ink-2); border: 1px solid var(--rule); white-space: nowrap; }
.chip-msg.wait { flex: 1; min-width: 0; justify-content: center; overflow: hidden; background: repeating-linear-gradient(-45deg, var(--brass-soft) 0 6px, transparent 6px 12px); color: var(--brass); border-color: color-mix(in srgb, var(--brass) 40%, transparent); }
.chip-msg.fast { background: var(--signal); color: #fff; border-color: transparent; }
.lane-fast .chip-msg.fast { animation: dart 4s cubic-bezier(.2,.8,.2,1) infinite; }
@keyframes dart { 0% { transform: translateX(-60px); opacity: 0; } 10% { opacity: 1; } 34%, 100% { transform: translateX(0); opacity: 1; } }
.lane-fast .done { font: 12px var(--mono); color: var(--kelp); white-space: nowrap; animation: appear 4s infinite; }
@keyframes appear { 0%, 36% { opacity: 0; } 44%, 100% { opacity: 1; } }
.lanes figcaption { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 13.5px; color: var(--ink-3); }

.teaser { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--edge); border-radius: 18px; overflow: hidden; background: var(--paper-2); box-shadow: 8px 8px 0 var(--drop); }
.teaser .src { padding: 20px 22px; border-right: 1.5px solid var(--edge); display: flex; flex-direction: column; }
.teaser h4 { margin: 0 0 12px; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); display: flex; justify-content: space-between; }
.teaser textarea { flex: 1; width: 100%; min-height: 230px; resize: none; border: 0; outline: none; background: transparent; color: var(--ink); font: 13.5px/1.75 var(--mono); }
.teaser .out { padding: 20px 18px; background: #0e1621; color: #f5f5f5; display: flex; flex-direction: column; }
.teaser .out h4 { color: #7d8b99; }
.teaser .out .row { max-width: 100%; }
.teaser .out .bubble { cursor: default; }
.teaser .out .bubble:hover { box-shadow: none; }

.faq { border-top: 1.5px solid var(--edge); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 22px 0; font: 400 clamp(22px, 2.4vw, 28px)/1.2 var(--serif); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 300 30px/1 var(--font); color: var(--brass); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: -6px 0 24px; color: var(--ink-2); max-width: 46em; font-size: 16.5px; }

.closing { position: relative; overflow: hidden; isolation: isolate; background: var(--night); color: var(--night-ink); padding: 130px 0 0; }
.closing::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(239,232,216,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(239,232,216,.04) 1px, transparent 1px); background-size: 72px 72px; }
.closing h2 { font: 400 clamp(70px, 13vw, 200px)/.82 var(--serif); letter-spacing: -.035em; margin: 0; }
.closing h2 em { color: var(--brass-hi); }
.closing-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 40px; align-items: end; padding-bottom: 80px; }
.closing p { color: var(--night-ink-2); font-size: 18px; margin: 0 0 26px; }
.closing .btn-line { color: var(--night-ink); border-color: rgba(239,232,216,.35); }

.footer { border-top: 1px solid var(--night-rule); background: var(--night); color: var(--night-ink-2); }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 48px 20px 30px; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
.footer .brand { color: var(--night-ink); }
.footer h4 { margin: 0 0 14px; font: 500 11px var(--mono); letter-spacing: .13em; text-transform: uppercase; color: rgba(239,232,216,.45); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer ul a { color: var(--night-ink-2); font-size: 14.5px; }
.footer ul a:hover { color: #fff; }
.footer p { font-size: 14px; margin: 14px 0 0; max-width: 300px; }
.footer-bottom { max-width: 1240px; margin: 0 auto; padding: 18px 20px 30px; border-top: 1px solid var(--night-rule); font: 11.5px var(--mono); letter-spacing: .05em; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: rgba(239,232,216,.45); }

/* ------------------------------------------------------------------ docs */

.docs { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 268px minmax(0, 1fr) 236px; }
.sidebar { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); overflow-y: auto; padding: 28px 16px 48px 20px; border-right: 1px solid var(--rule); scrollbar-width: thin; }
.side-group { margin-bottom: 24px; }
.side-group h5 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 0 10px; font: 500 11px var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--brass); }
.side-group h5 svg { width: 14px; height: 14px; }
.side-group a { display: block; padding: 5px 10px; margin: 1px 0; border-radius: 7px; color: var(--ink-2); font-size: 14.5px; }
.side-group a:hover { color: var(--ink); background: var(--paper-3); text-decoration: none; }
.side-group a[aria-current="page"] { color: var(--ink); background: var(--paper-2); font-weight: 600; box-shadow: inset 2px 0 0 var(--brass), 0 0 0 1px var(--rule); }
.content { padding: 44px 60px 90px; min-width: 0; }
.crumbs { display: flex; gap: 8px; align-items: center; font: 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { color: var(--ink-3); }
.crumbs svg { width: 13px; height: 13px; }
.page-head { display: flex; gap: 20px; align-items: center; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1.5px solid var(--edge); }
.page-head .ic { flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: var(--brass); border: 1.5px solid var(--brass); background: var(--paper-2); box-shadow: inset 0 0 0 4px var(--paper-2), inset 0 0 0 5px color-mix(in srgb, var(--brass) 40%, transparent); }
.page-head .ic svg { width: 25px; height: 25px; }
.content h1 { font: 400 clamp(44px, 5vw, 64px)/1 var(--serif); letter-spacing: -.022em; margin: 0; }
.page-head .sub { color: var(--ink-3); font: 12px var(--mono); margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
.page-head .sub span { display: inline-flex; align-items: center; gap: 6px; }
.page-head .sub svg { width: 14px; height: 14px; }
.page-head .sub code { font-size: 12px; }
.intro { font-size: 19px; color: var(--ink-2); line-height: 1.6; margin: 0 0 10px; }
.intro p { margin: 0 0 12px; }
.prose > .intro p:first-child::first-letter { float: left; font: 400 66px/.8 var(--serif); margin: 7px 10px 0 0; color: var(--brass); }
.prose { max-width: 820px; }
.prose h2 { font: 400 36px/1.1 var(--serif); letter-spacing: -.015em; margin: 54px 0 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prose h3 { font: 600 18px/1.3 var(--font); letter-spacing: -.01em; margin: 32px 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prose h4 { font-size: 16px; margin: 24px 0 8px; }
.prose .anchor { opacity: 0; color: var(--ink-3); font: 400 18px var(--font); transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; text-decoration: none; }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 0; list-style: none; margin: 0 0 16px; display: grid; gap: 9px; }
.prose ul > li { position: relative; padding-left: 24px; }
.prose ul > li::before { content: ""; position: absolute; left: 4px; top: .8em; width: 10px; height: 1.5px; background: var(--brass); }
.prose :not(pre) > code, .prose .c { font-size: .86em; padding: .1em .4em; border-radius: 5px; background: var(--paper-3); border: 1px solid var(--rule); color: var(--ink); white-space: break-spaces; }
.prose a.c { color: var(--sea); }
.prose a.c:hover { border-color: var(--sea); text-decoration: none; }
.prose b { font-weight: 600; color: var(--ink); }
.spoiler { background: var(--ink-3); color: transparent; border-radius: 4px; cursor: pointer; transition: all .2s; }
.spoiler.open { background: var(--paper-3); color: inherit; }
.prose pre, .codeblock { position: relative; margin: 0 0 16px; padding: 14px 52px 14px 16px; border-radius: 10px; overflow-x: auto; background: var(--paper-2); border: 1px solid var(--rule-2); font: 13.5px/1.65 var(--mono); white-space: pre-wrap; }
.role { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; border: 1px solid; }
.role svg { width: 12px; height: 12px; }
.role-user { color: var(--sea); border-color: color-mix(in srgb, var(--sea) 35%, transparent); background: var(--sea-soft); }
.role-admin { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 35%, transparent); background: var(--brass-soft); }
.role-owner { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 35%, transparent); background: var(--signal-soft); }
.cmds { border-top: 1.5px solid var(--edge); margin: 0 0 22px; }
.cmd-row { display: grid; grid-template-columns: minmax(170px, 32%) 1fr; gap: 22px; padding: 15px 4px; border-bottom: 1px solid var(--rule); scroll-margin-top: calc(var(--nav-h) + 20px); transition: background .2s; }
.cmd-row:target { background: var(--brass-soft); box-shadow: inset 3px 0 0 var(--brass); padding-left: 12px; }
.cmd-sig { font: 13.5px/1.6 var(--mono); word-break: break-word; }
.cmd-sig .name { color: var(--ink); font-weight: 500; }
.cmd-sig .args { color: var(--ink-3); }
.cmd-desc { color: var(--ink-2); font-size: 15.5px; }
.examples { margin: 0 0 22px; border: 1px solid var(--rule-2); border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.example { border-bottom: 1px solid var(--rule); }
.example:last-child { border-bottom: 0; }
.example .code { position: relative; display: flex; gap: 10px; padding: 12px 52px 3px 16px; font: 13.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.example .code::before { content: "›"; color: var(--brass); font-weight: 600; }
.example .what { padding: 0 16px 12px 34px; color: var(--ink-3); font-size: 14.5px; }
.copy { position: absolute; top: 7px; right: 8px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--rule-2); background: var(--paper-2); color: var(--ink-3); cursor: pointer; transition: all .15s; }
.copy:hover { color: var(--ink); border-color: var(--ink); }
.copy svg { width: 14px; height: 14px; }
.copy.done { color: var(--kelp); border-color: var(--kelp); }
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: 12px; margin: 0 0 18px; background: var(--sea-soft); border: 1px solid color-mix(in srgb, var(--sea) 25%, transparent); }
.callout svg { flex: none; width: 20px; height: 20px; color: var(--sea); margin-top: 2px; }
.callout p:last-child { margin: 0; }
.tips { padding: 20px 22px 8px; margin-bottom: 18px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--rule-2); }
.subpage { margin-top: 56px; padding-top: 4px; border-top: 3px double var(--rule-2); }
.subpage > h2 { margin-top: 34px; }
.subpage .sub-intro { color: var(--ink-2); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 64px; max-width: 820px; }
.pager a { padding: 18px 20px; border: 1px solid var(--rule-2); border-radius: 12px; color: var(--ink); background: var(--paper-2); transition: all .15s; }
.pager a:hover { border-color: var(--ink); text-decoration: none; transform: translateY(-1px); }
.pager small { display: block; font: 10.5px var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.pager b { font: 400 26px/1.1 var(--serif); }
.pager .next { text-align: right; grid-column: 2; }
.toc { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); overflow-y: auto; padding: 46px 20px 40px 6px; font-size: 13.5px; }
.toc h6 { margin: 0 0 12px; font: 500 11px var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc li a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; color: var(--ink-3); border-left: 2px solid transparent; }
.toc li.l3 a { padding-left: 26px; font-size: 13px; }
.toc li a:hover { color: var(--ink); text-decoration: none; }
.toc li a.active { color: var(--ink); border-left-color: var(--brass); font-weight: 500; }
.toc .toc-cta { margin-top: 26px; padding: 16px; border-radius: 12px; border: 1px solid var(--rule-2); background: var(--paper-2); }
.toc .toc-cta p { margin: 0 0 12px; color: var(--ink-2); font-size: 13px; }
.docs-hero { padding-bottom: 26px; margin-bottom: 0; border-bottom: 1.5px solid var(--edge); }
.docs-hero h1 { font-size: clamp(52px, 6.4vw, 84px) !important; line-height: .95 !important; margin-top: 14px !important; }
.docs-hero h1 em { font-style: italic; color: var(--brass); }
.docs-hero p { margin: 18px 0 0; font-size: 19px; color: var(--ink-2); max-width: 40em; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 44px; border-bottom: 1px solid var(--rule); }
.quick a { display: block; padding: 22px 22px 22px 0; color: var(--ink); }
.quick a + a { padding-left: 22px; border-left: 1px solid var(--rule); }
.quick a:hover { text-decoration: none; }
.quick a:hover b { color: var(--sea); }
.quick .num { font: 500 11px var(--mono); letter-spacing: .12em; color: var(--brass); }
.quick b { display: block; font: 400 27px/1.1 var(--serif); margin: 6px 0 6px; }
.quick small { color: var(--ink-3); font-size: 14px; line-height: 1.45; display: block; }
.docs .manifest { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 44px; }
.filter-box { display: flex; gap: 10px; margin: 20px 0; }
.filter-box input { flex: 1; height: 46px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--rule-2); background: var(--paper-2); color: var(--ink); font: 15px var(--font); }
.filter-box input:focus { outline: none; box-shadow: var(--ring); border-color: var(--sea); }
.cmd-table { width: 100%; border-collapse: collapse; font-size: 14.5px; border-top: 1.5px solid var(--edge); }
.cmd-table th { text-align: left; font: 500 10.5px var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); padding: 12px 12px 10px 4px; border-bottom: 1px solid var(--rule-2); }
.cmd-table td { padding: 11px 12px 11px 4px; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--ink-2); }
.cmd-table td:first-child { font: 13.5px var(--mono); white-space: nowrap; }
.cmd-table td:first-child a { color: var(--ink); }
.cmd-table td:nth-child(2) a { font-size: 13.5px; white-space: nowrap; }
.cmd-table tbody tr:hover td { background: var(--paper-2); }
.cmd-table.syntax { margin: 0 0 18px; table-layout: fixed; }
.cmd-table.syntax td:first-child { white-space: normal; font-family: var(--font); width: 50%; }
.cmd-table.syntax code { word-break: break-all; }

/* ------------------------------------------------------------------ search */

.search-modal { position: fixed; inset: 0; z-index: 200; display: none; }
.search-modal.open { display: block; }
.search-backdrop { position: absolute; inset: 0; background: rgba(10, 21, 38, .5); backdrop-filter: blur(3px); }
.search-panel { position: relative; width: min(660px, calc(100% - 24px)); margin: 11vh auto 0; background: var(--paper-2); border: 1.5px solid var(--edge); border-radius: 16px; box-shadow: 8px 8px 0 var(--drop), var(--shadow-lg); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--rule); }
.search-field svg { width: 19px; height: 19px; color: var(--ink-3); flex: none; }
.search-field input { flex: 1; height: 60px; border: 0; background: transparent; color: var(--ink); font: 18px var(--font); outline: none; }
.search-field kbd { font: 11px var(--mono); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--rule-2); color: var(--ink-3); }
.search-results { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; }
.search-results a { display: flex; gap: 14px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.search-results a:hover, .search-results a.sel { background: var(--paper-3); text-decoration: none; }
.search-results .kind { flex: none; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 0; color: var(--ink-3); min-width: 64px; }
.search-results .kind.cmd { color: var(--brass); }
.search-results b { display: block; font-size: 15px; font-weight: 600; }
.search-results b code { font-size: 13.5px; }
.search-results small { display: block; color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.search-results mark { background: color-mix(in srgb, var(--brass-hi) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 30px 16px; text-align: center; color: var(--ink-3); }
.search-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 12.5px; }
.search-foot kbd { font: 11px var(--mono); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--rule-2); }

/* ------------------------------------------------------------------ message editor */

.studio-head { max-width: 1320px; margin: 0 auto; padding: 48px 20px 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.studio-head h1 { font: 400 clamp(48px, 6.4vw, 84px)/.95 var(--serif); letter-spacing: -.024em; margin: 14px 0 14px; }
.studio-head h1 em { font-style: italic; color: var(--brass); }
.studio-head p { margin: 0; color: var(--ink-2); max-width: 600px; font-size: 17px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.studio { max-width: 1320px; margin: 0 auto; padding: 22px 20px 90px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 24px; align-items: start; }
.panel { background: var(--paper-2); border: 1px solid var(--rule-2); border-radius: 16px; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.panel-head h2 { margin: 0; font: 400 24px/1 var(--serif); display: flex; align-items: center; gap: 9px; }
.panel-head h2 svg { width: 16px; height: 16px; color: var(--brass); }
.panel-body { padding: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 8px; border-bottom: 1px solid var(--rule); background: var(--paper-3); border-radius: 16px 16px 0 0; }
.toolbar .sep { width: 1px; background: var(--rule-2); margin: 5px 4px; }
.tb { height: 34px; min-width: 34px; padding: 0 9px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; }
.tb:hover { background: var(--paper-2); border-color: var(--rule-2); color: var(--ink); }
.tb svg { width: 16px; height: 16px; }
.tb.wide { padding: 0 11px; font-weight: 500; }
.editor-area { display: block; width: 100%; min-height: 300px; resize: vertical; border: 0; outline: none; padding: 18px 20px; background: var(--paper-2); color: var(--ink); font: 14.5px/1.75 var(--mono); tab-size: 2; }
.editor-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 16px; border-top: 1px solid var(--rule); font: 12px var(--mono); color: var(--ink-3); }
.editor-foot .warn { color: var(--signal); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--paper-2); font: 12.5px var(--mono); color: var(--ink-2); cursor: pointer; transition: all .12s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--brass); color: var(--brass); background: var(--brass-soft); }
.field-label { display: block; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 7px; }
.chip-group + .chip-group { margin-top: 16px; }
.btn-rows { display: grid; gap: 8px; }
.btn-row { display: flex; gap: 8px; align-items: stretch; padding: 8px; border-radius: 12px; border: 1px dashed var(--rule-2); background: var(--paper); }
.btn-row .row-n { flex: none; width: 22px; display: grid; place-items: center; font: 11px var(--mono); color: var(--ink-3); }
.btn-row .items { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.bpill { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 9px 6px 11px; border-radius: 9px; background: var(--paper-2); border: 1px solid var(--rule-2); font-size: 13.5px; cursor: pointer; }
.bpill:hover { border-color: var(--ink); }
.bpill .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--rule-2); flex: none; }
.bpill .sw.primary { background: #3d8ee0; } .bpill .sw.success { background: #2ea865; } .bpill .sw.danger { background: #d6514a; }
.bpill .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.bpill .tgt { color: var(--ink-3); font: 11.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.bpill.bad { border-color: var(--signal); }
.empty-note { color: var(--ink-3); font-size: 14px; padding: 6px 2px 2px; margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.input, .select { width: 100%; height: 42px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--rule-2); background: var(--paper); color: var(--ink); font: 14.5px var(--font); }
.input:focus, .select:focus { outline: none; border-color: var(--sea); box-shadow: var(--ring); }
.seg { display: flex; padding: 3px; border-radius: 10px; background: var(--paper-3); border: 1px solid var(--rule); gap: 3px; }
.seg button { flex: 1; height: 32px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button svg { width: 15px; height: 15px; }
.seg button[aria-pressed="true"] { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 0 0 1px var(--rule-2); font-weight: 600; }
.seg .sw { width: 9px; height: 9px; border-radius: 3px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--sea); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.form-actions .left { margin-right: auto; }
.btn-danger-ghost { background: transparent; color: var(--signal); border-color: color-mix(in srgb, var(--signal) 40%, transparent); }
.btn-danger-ghost:hover { background: var(--signal-soft); }
.preview-wrap { position: sticky; top: calc(var(--nav-h) + 16px); }
.tg { --tg-bg: #0e1621; --tg-head: #17212b; --tg-in: #182533; --tg-out: #2b5278; --tg-text: #f5f5f5; --tg-sub: #7f91a4; --tg-link: #6ab3f3; color: var(--tg-text); font: 14.5px/1.42 var(--font); letter-spacing: 0; }
.preview-stage { padding: 18px 14px 20px; background: var(--tg-bg); }
.tg-head { display: flex; align-items: center; gap: 11px; padding: 11px 14px; background: var(--tg-head); }
.tg-head img { width: 38px; height: 38px; border-radius: 50%; }
.tg-head b { display: block; font-size: 15px; }
.tg-head small { color: var(--tg-sub); font-size: 13px; }
.tg-body { display: flex; flex-direction: column; gap: 7px; }
.msg { max-width: 86%; padding: 7px 11px 6px; border-radius: 14px; position: relative; overflow-wrap: anywhere; background: var(--tg-in); }
.msg .who { font-weight: 600; font-size: 13.5px; margin-bottom: 1px; }
.msg .who.c1 { color: #f0c96c; }
.msg .t { float: right; margin: 6px 0 -2px 10px; font-size: 11.5px; color: rgba(255,255,255,.45); }
.msg a { color: var(--tg-link); }
.msg-group { align-self: flex-start; max-width: 86%; display: grid; }
.msg-group .msg { max-width: 100%; border-bottom-left-radius: 5px; }
.kb { display: grid; gap: 4px; }
.msg-group .kb { margin-top: 4px; }
.kb-row { display: flex; gap: 4px; }
.kb-btn { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 9px; text-align: center; background: rgba(24, 37, 51, .92); color: #fff; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.kb-btn.primary { background: #3d8ee0; } .kb-btn.success { background: #2ea865; } .kb-btn.danger { background: #d6514a; }
.kb-btn .arrow { position: absolute; top: 4px; right: 5px; width: 8px; height: 8px; opacity: .7; }
.tg.light { --tg-bg: #dbe6ee; --tg-head: #ffffff; --tg-in: #ffffff; --tg-text: #000; --tg-sub: #8a98a6; --tg-link: #168acd; }
.tg.light .msg .t { color: rgba(0,0,0,.35); }
.tg.light .msg .who.c1 { color: #c47d00; }
.tg.light.preview-stage { background: linear-gradient(160deg, #cfe1d0, #b9d3e2); }
.tg.light .tg-head { color: #000; border-bottom: 1px solid #e3e8ee; }
.tg.light .kb-btn { background: rgba(62, 92, 118, .42); }
.tg.light .kb-btn.primary { background: #3d8ee0; } .tg.light .kb-btn.success { background: #2ea865; } .tg.light .kb-btn.danger { background: #d6514a; }
.preview-msg.msg-group { max-width: 94%; }
.preview-msg .msg { min-width: 200px; }
.preview-msg .body { white-space: pre-wrap; }
.preview-msg code { font-family: var(--mono); font-size: .9em; color: #f0a37a; }
.tg.light .preview-msg code { color: #c2410c; }
.preview-msg pre { margin: 4px 0; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.25); white-space: pre-wrap; font-size: 13px; }
.tg.light .preview-msg pre { background: rgba(0,0,0,.06); }
.preview-msg pre .lang { display: block; font: 600 11.5px var(--font); color: var(--tg-link); margin-bottom: 3px; }
.preview-msg blockquote { margin: 3px 0; padding: 3px 8px 3px 10px; border-left: 3px solid var(--tg-link); background: rgba(106,179,243,.12); border-radius: 4px; }
.preview-msg blockquote.exp { position: relative; max-height: 4.4em; overflow: hidden; cursor: pointer; }
.preview-msg blockquote.exp.open { max-height: none; }
.preview-msg blockquote.exp::after { content: "⌄"; position: absolute; right: 6px; bottom: 0; color: var(--tg-link); font-weight: 700; }
.preview-msg blockquote.exp.open::after { content: "⌃"; }
.preview-msg .sp { background: rgba(160,170,185,.55); color: transparent; border-radius: 3px; cursor: pointer; }
.preview-msg .sp.open { background: transparent; color: inherit; }
.preview-msg .mention { color: var(--tg-link); }
.preview-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--paper-3); color: var(--ink-2); border: 1px solid var(--rule); }
.pchip svg { width: 13px; height: 13px; }
.variant-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.variant-tabs button { height: 28px; min-width: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--paper-2); font: 12.5px var(--mono); cursor: pointer; color: var(--ink-2); }
.variant-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.problems { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--signal-soft); border: 1px solid color-mix(in srgb, var(--signal) 35%, transparent); font-size: 13.5px; }
.problems ul { margin: 6px 0 0; padding-left: 18px; }
.output { position: relative; }
.output pre { margin: 0; padding: 14px 52px 14px 14px; border-radius: 10px; background: var(--paper); border: 1px solid var(--rule-2); font: 13px/1.65 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.output .copy { top: 8px; right: 8px; }
.use-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 300; opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 500; box-shadow: var(--shadow); transition: all .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
dialog.sheet { border: 1.5px solid var(--edge); border-radius: 16px; padding: 0; width: min(520px, calc(100% - 24px)); background: var(--paper-2); color: var(--ink); box-shadow: 8px 8px 0 var(--drop); }
dialog.sheet::backdrop { background: rgba(10, 21, 38, .45); backdrop-filter: blur(3px); }
dialog.sheet h2 { font: 400 28px/1.1 var(--serif) !important; }
.templates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.templates button { text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--rule-2); background: var(--paper); cursor: pointer; }
.templates button:hover { border-color: var(--ink); }
.templates b { display: block; font-size: 14px; }
.templates small { color: var(--ink-3); font-size: 12.5px; }

/* ------------------------------------------------------------------ 404 */
.lost { min-height: calc(100vh - var(--nav-h)); display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.lost img { width: 130px; height: 130px; border-radius: 50%; margin: 0 auto 24px; box-shadow: 0 0 0 3px var(--brass-hi), 0 0 0 9px color-mix(in srgb, var(--brass-hi) 20%, transparent); }
.lost h1 { font: 400 76px/1 var(--serif); margin: 0 0 10px; }
.lost h1 em { color: var(--brass); }
.lost p { color: var(--ink-2); margin: 0 0 26px; font-size: 18px; }

/* reveal on scroll (only when JS has run) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1240px) {
  .docs { grid-template-columns: 252px minmax(0, 1fr); }
  .toc { display: none; }
  .content { padding: 40px 44px 90px; }
}
@media (max-width: 1060px) {
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .porthole-wrap { width: min(380px, 84%); order: -1; margin: -10px 0 26px; }
  .demo { grid-template-columns: 1fr; }
  .logbook { border-left: 0; border-top: 1.5px solid var(--edge); height: 300px; }
  .manifest { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 44px; }
  .studio { grid-template-columns: minmax(0, 1fr); }
  .preview-wrap { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .search-btn { min-width: 0; }
  .search-btn .sb-text, .search-btn kbd { display: none; }
  .closing-grid { grid-template-columns: 1fr; }
  .sec-head { grid-template-columns: 1fr; gap: 18px; }
  .sec-head p { justify-self: start; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .menu-btn { display: grid; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: var(--nav-h); left: 0; bottom: 0; height: auto; width: min(300px, 86vw); z-index: 40; background: var(--paper); transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: var(--nav-h) 0 0; background: rgba(10,21,38,.45); z-index: 39; }
  .content { padding: 30px 20px 70px; }
  .quick { grid-template-columns: 1fr; }
  .quick a + a { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .docs .manifest { grid-template-columns: 1fr; }
  .mobile-links { display: block !important; }
  .demo-notes { grid-template-columns: 1fr; }
  .demo-notes div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); margin-top: 18px; }
  .teaser { grid-template-columns: 1fr; }
  .teaser .src { border-right: 0; border-bottom: 1.5px solid var(--edge); }
}
@media (max-width: 640px) {
  .sec { padding: 80px 0; }
  .manifest { grid-template-columns: 1fr; }
  .demo-chat { height: 580px; }
  .demo, .chart-card, .lanes, .teaser { box-shadow: 5px 5px 0 var(--drop); }
  .cmd-row { grid-template-columns: 1fr; gap: 6px; }
  .form-grid, .use-row, .templates { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .nav .add-btn { display: none; }
  .brand-tag { display: none; }
  .cmd-table td:nth-child(3), .cmd-table th:nth-child(3) { display: none; }
  .facts li { grid-template-columns: 1fr; gap: 2px; }
  .lane { grid-template-columns: 1fr; gap: 6px; }
  .coords { gap: 12px; margin-bottom: 22px; }
  .coords span:nth-child(3) { display: none; }
  .prose > .intro p:first-child::first-letter { font-size: 54px; }
  .row { max-width: 94%; }
}
.mobile-links { display: none; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.mobile-links a { display: block; padding: 6px 10px; color: var(--ink); font-weight: 600; font-size: 15px; }
