@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../assets/fonts/fraunces-normal-560.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 560;
  font-display: swap;
  src: url("../assets/fonts/fraunces-italic-560.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/outfit-normal-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/ibmplexmono-normal-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/ibmplexmono-normal-500.woff2") format("woff2");
}

:root {
  --ink: #14110e;
  --ink-2: #1c1814;
  --panel: #241e19;
  --panel-2: #2c251f;
  --line: rgba(224, 196, 154, 0.18);
  --line-strong: rgba(224, 196, 154, 0.38);
  --brass: #e0c49a;
  --brass-deep: #b28955;
  --wax: #e25b45;
  --paper: #f4efe6;
  --paper-dim: #d2c6b6;
  --muted: #cbbfb2;
  --up: #b7d3ae;
  --down: #f3b2a6;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --radius: 18px;
  --max: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.55;
  background:
    radial-gradient(900px 480px at 100% -10%, rgba(224, 196, 154, 0.16), transparent 55%),
    radial-gradient(700px 420px at -10% 8%, rgba(226, 91, 69, 0.1), transparent 50%),
    var(--ink);
  color-scheme: dark;
}
body.nav-open { overflow: hidden; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--brass); }
::selection { background: var(--brass); color: #24180f; }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.visually-hidden,
select[aria-hidden="true"] {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.narrow { max-width: 22rem; }

.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  background: var(--brass); color: #24180f;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  z-index: 80;
}
.skip:focus { top: 0.7rem; }

.mast {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(20, 17, 14, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.mast-inner, .strip-inner, .wrap, .colophon-inner {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}
.mast-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--paper);
}
.brand-mark { width: 28px; height: 28px; color: var(--brass); flex: none; }
.brand-name {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.primary {
  display: flex;
  gap: 0.15rem;
  margin-left: auto;
}
.primary a, .drawer a {
  text-decoration: none;
  color: var(--paper-dim);
  font-size: 0.86rem;
  padding: 0.35rem 0.42rem;
  border-radius: 999px;
  white-space: nowrap;
}
.primary a[aria-current="page"], .drawer a[aria-current="page"] {
  color: var(--ink);
  background: var(--brass);
}
.mast-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
  margin-left: 0.4rem;
}
.primary + .mast-tools { margin-left: 0.6rem; }
.social {
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--brass);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.burger span:not(.visually-hidden) {
  display: block;
  width: 16px; height: 1.5px;
  background: var(--paper);
}
.drawer[hidden] { display: none; }
.drawer {
  border-top: 1px solid var(--line);
  background: var(--ink-2);
}
.drawer nav {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.4rem 0 1rem;
  display: grid;
}
.drawer a {
  padding: 0.85rem 0.2rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.15rem;
  border-radius: 0;
}

.strip {
  border-bottom: 1px solid var(--line);
  background: rgba(36, 30, 25, 0.65);
}
.strip-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 52px;
  padding: 0.4rem 0;
}
.strip-label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
  white-space: nowrap;
}
.strip dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0;
}
.strip dl div { display: flex; gap: 0.45rem; align-items: baseline; }
.strip dt {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.strip dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #6d645b;
  box-shadow: 0 0 0 0 rgba(183, 211, 174, 0);
}
.dot.ok { background: var(--up); }
.dot.bad { background: var(--wax); }

.page { padding: 2.2rem 0 4rem; }
.kicker {
  margin: 0 0 0.7rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}
.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(3.1rem, 8vw, 6.3rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
}
.display em, .display-sm em {
  font-style: italic;
  font-weight: 560;
  color: var(--brass);
}
.display-sm {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.3rem, 5vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
}
.lede {
  font-size: 1.12rem;
  color: var(--paper-dim);
  max-width: 42rem;
}
h2, .h2 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.1;
  margin: 0 0 0.6rem;
}
h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.02em; margin: 0 0 0.35rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
  padding-bottom: 1rem;
}
.hero-art { display: grid; place-items: center; }
.hero-svg { width: min(100%, 460px); height: auto; }
.hero-svg .orbit { transform-origin: 220px 230px; animation: spin 56s linear infinite; }
.hero-svg .pulse { transform-origin: 220px 230px; animation: breathe 5.5s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: 0.55; } }

.ca {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 1.2rem 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  background: rgba(36, 30, 25, 0.7);
}
.ca-kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--brass);
}
.ca code {
  font-family: var(--mono);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.actions, .row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 0.7rem; }

.btn, .text-btn {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 0.55rem 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn-brass { background: var(--brass); color: #24180f; font-weight: 600; }
.btn-brass:hover { color: #24180f; filter: brightness(1.05); }
.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line-strong);
}
.btn-wax { background: var(--wax); color: #2a100c; font-weight: 600; }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: 0.3rem 0.75rem; font-size: 0.88rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.text-btn {
  min-height: 32px;
  padding: 0;
  background: none;
  color: var(--brass);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.is-wrong { box-shadow: inset 0 0 0 1.5px var(--wax); }

.section { margin-top: 4.2rem; }
.section-head { max-width: 40rem; margin-bottom: 1.3rem; }

.cards, .tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}
.card, .swap-card, .side-card, .panel, .clerk, .shore {
  background: linear-gradient(180deg, rgba(255, 246, 232, 0.045), rgba(255, 246, 232, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card {
  padding: 1.05rem 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
}
.card:hover { border-color: var(--line-strong); color: inherit; }
.card ul, .prose ul { margin: 0.3rem 0 0; padding-left: 1.1rem; color: var(--paper-dim); }
.card p, .clerk p, .shore p { color: var(--paper-dim); margin: 0.2rem 0 0.4rem; }
.index-no {
  font-family: var(--mono);
  color: var(--wax);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  counter-reset: step;
}
.step {
  padding: 1rem;
  border-top: 1px solid var(--line-strong);
}
.step strong { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 560; margin-bottom: 0.3rem; }

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: start;
}
.panel { padding: 1rem 1.05rem 1.1rem; }
.tape { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.8rem; }
.tape-row {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 1fr 0.8fr auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.tape-row a { color: var(--brass); text-decoration: none; }
.tape-row a:hover { text-decoration: underline; }

.tiers { width: 100%; border-collapse: collapse; }
.tiers th, .tiers td, .data th, .data td {
  text-align: left;
  padding: 0.75rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tiers th, .data th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.tiers td:first-child, .data th[scope="row"] {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 560;
}
.num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 0.86rem; text-align: right; }
.up { color: var(--up); }
.down { color: var(--down); }

.token-band {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.2rem;
  align-items: center;
  padding: 1.3rem;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(400px 180px at 100% 0%, rgba(226, 91, 69, 0.16), transparent 60%),
    #1b1713;
}

.page-hero { max-width: 46rem; margin-bottom: 1.6rem; }
.banner, .callout {
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(226, 91, 69, 0.08);
  color: var(--paper);
  margin: 0 0 0.9rem;
}
.callout { background: rgba(224, 196, 154, 0.08); }
.footnote { color: var(--muted); font-size: 0.88rem; }

.desk-layout, .two {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.swap-card, .side-card, .clerk, .shore { padding: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.card-head h2 { font-size: 1.45rem; margin: 0; }
.swap-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.75rem 0.8rem 0.65rem;
  background: rgba(0, 0, 0, 0.18);
  margin-bottom: 0.45rem;
}
.amount {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  padding: 0.15rem 0 0.2rem;
}
.amount:focus { outline: none; }
.swap-row:focus-within { border-color: var(--line-strong); }
.token-btn {
  border: 1px solid var(--line-strong);
  background: rgba(224, 196, 154, 0.08);
  color: var(--paper);
  border-radius: 999px;
  min-height: 36px;
  padding: 0.2rem 0.75rem;
  font-weight: 600;
}
.flip {
  width: 42px; height: 42px;
  margin: -0.2rem auto 0.25rem;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--brass);
  position: relative;
  z-index: 1;
}
.meta { margin: 0.8rem 0; display: grid; gap: 0.35rem; }
.meta div, .spec div { display: flex; justify-content: space-between; gap: 1rem; }
.meta dt, .spec dt { color: var(--muted); }
.meta dd, .spec dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 0.84rem; }
.field, .search { display: grid; gap: 0.3rem; margin-bottom: 0.8rem; }
.field span, legend, .toolbar label { color: var(--muted); font-size: 0.86rem; }
input[type="search"], input[type="text"], input[type="number"], select, textarea, .slip-pop input {
  width: 100%;
  background: #120f0c;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 46px;
  padding: 0.55rem 0.7rem;
}
textarea { min-height: 90px; resize: vertical; }
.help { color: var(--muted); font-size: 0.84rem; margin: 0.25rem 0 0; }
.invalid { color: var(--down); }
fieldset { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 0.8rem; padding: 0.7rem 0.8rem 0.85rem; }
.choices { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.choices label {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.65rem; min-height: 40px;
}
.slip-pop[hidden] { display: none; }
.slip-pop { margin-bottom: 0.8rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: end;
  margin-bottom: 0.8rem;
}
.search { flex: 1 1 220px; margin: 0; }
.toolbar .field { margin: 0; min-width: 180px; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.9rem; }
.chips button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper-dim);
  border-radius: 999px;
  min-height: 36px;
  padding: 0.2rem 0.75rem;
}
.chips button[aria-pressed="true"] { background: var(--brass); color: #24180f; border-color: var(--brass); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.data { width: 100%; border-collapse: collapse; min-width: 720px; }
.data th[scope="row"], .data td:first-child, .data th:first-child {
  position: sticky; left: 0;
  background: #1d1814;
}
.data caption {
  text-align: left;
  padding: 0.8rem 0.8rem 0.2rem;
  color: var(--muted);
  caption-side: top;
}
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--brass);
}

.shores { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.7rem; align-items: stretch; margin-bottom: 1rem; }
.shore h3 { font-size: 1.4rem; }
.ferry-mark {
  align-self: center;
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--brass);
  background: var(--ink);
}
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.4rem 0 0.8rem; }
.check input { margin-top: 0.3rem; width: 1.05rem; height: 1.05rem; }

.clerks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.clerk header { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.status-idle { color: var(--muted); }
.status-on { color: var(--up); }

.prose { max-width: 46rem; }
.prose a, .prose code, .spec dd, .help, .footnote, .lede, .unset-list li, .ai-note, .ai-bubble {
  overflow-wrap: anywhere;
}
.prose h2 { margin-top: 2rem; }
.prose p, .prose li { color: var(--paper-dim); }
.spec { margin: 0.4rem 0 1rem; }
.unset-list { list-style: none; padding: 0; margin: 0; }
.unset-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.82rem;
}

.colophon {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.4rem;
  background: #100e0c;
}
.colophon-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1.4rem;
}
.colophon nav { display: grid; gap: 0.35rem; }
.colophon a { text-decoration: none; color: var(--paper-dim); }
.colophon a:hover { color: var(--brass); }
.fine { color: var(--muted); font-size: 0.84rem; }
.fine-end { width: min(var(--max), calc(100% - 2rem)); margin: 1.4rem auto 0; }

dialog.modal {
  width: min(32rem, calc(100vw - 1.5rem));
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #221c17;
  color: var(--paper);
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow);
}
dialog.modal::backdrop { background: rgba(8, 6, 5, 0.72); }
.provider-list { display: grid; gap: 0.45rem; margin-top: 0.8rem; }
.provider {
  display: flex; align-items: center; gap: 0.7rem;
  width: 100%;
  text-align: left;
  background: #16130f;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.65rem 0.7rem;
  min-height: 56px;
}
.provider img { width: 28px; height: 28px; border-radius: 8px; }
.avatar {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(224, 196, 154, 0.15);
  color: var(--brass);
  font-family: var(--serif);
}
.pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(280px, 82vw);
  background: #221c17;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 0.45rem;
  box-shadow: var(--shadow);
  z-index: 40;
}
.pop[hidden] { display: none; }
.pop button, .pop .pop-note {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--paper);
  min-height: 40px;
  padding: 0.45rem 0.55rem;
}
.pop button:hover { background: rgba(224, 196, 154, 0.08); }
.pop-note { color: var(--muted); font-size: 0.82rem; min-height: 0; }
.icon-x {
  border: 0; background: transparent; color: var(--paper-dim);
  min-width: 44px; min-height: 44px; border-radius: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  translate: -50% 12px;
  background: var(--brass);
  color: #24180f;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, translate 160ms ease;
  z-index: 70;
  font-weight: 600;
}
.toast.is-on { opacity: 1; translate: -50% 0; }

.watch { margin-top: 0.6rem; display: grid; gap: 0.35rem; }
.watch button {
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--brass);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.4rem 0;
}

@media (max-width: 1120px) {
  .primary { display: none; }
  .burger { display: inline-flex; }
  .mast-tools { margin-left: auto; }
  .cards, .tool-grid, .clerks { grid-template-columns: 1fr 1fr; }
  .hero, .split, .token-band, .desk-layout, .two, .colophon-grid, .shores {
    grid-template-columns: 1fr;
  }
  .ferry-mark { justify-self: center; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .social { display: none; }
  .cards, .tool-grid, .clerks { grid-template-columns: 1fr; }
  .strip-inner { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .ca { border-radius: 16px; }
  .display { font-size: clamp(2.6rem, 12vw, 3.6rem); }
  .tape-row { grid-template-columns: 1fr 1fr; }
  .page { padding-top: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
@view-transition { navigation: auto; }

.ai-dock {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 45;
}
.ai-launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--brass);
  color: #24180f;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 0.35rem 0.95rem 0.35rem 0.4rem;
  box-shadow: var(--shadow);
}
.ai-launcher:hover { color: #24180f; filter: brightness(1.05); }
.ai-launcher svg { width: 28px; height: 28px; display: block; }
.ai-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.65rem);
  width: min(400px, calc(100vw - 1.5rem));
  height: min(640px, calc(100vh - 8rem));
  display: flex;
  flex-direction: column;
  background: #221c17;
  color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ai-panel[hidden] { display: none; }
.ai-embedded {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  height: auto;
  min-height: 0;
}
.ai-embedded .ai-log { min-height: 220px; max-height: 420px; flex: 0 1 auto; }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.75rem 0.75rem 0; }
.ai-head h2 { font-size: 1.35rem; margin: 0; }
.ai-note { margin: 0.35rem 0.9rem 0; color: var(--muted); font-size: 0.8rem; }
.ai-log {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.8rem;
}
.ai-bubble {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.45;
}
.ai-bubble.user { align-self: flex-end; background: rgba(224, 196, 154, 0.16); }
.ai-bubble.assistant { align-self: flex-start; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0 0.75rem 0.35rem; }
.ai-suggestions button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper-dim);
  border-radius: 999px;
  min-height: 34px;
  padding: 0.15rem 0.65rem;
  font-size: 0.82rem;
}
.ai-suggestions button:hover { color: var(--paper); border-color: var(--line-strong); }
.ai-form { display: flex; gap: 0.4rem; padding: 0.7rem; border-top: 1px solid var(--line); }
.ai-form input { flex: 1; min-width: 0; }
@media (max-width: 720px) {
  .ai-dock { right: 0.75rem; left: auto; bottom: 0.75rem; }
  .ai-launcher { width: 52px; height: 52px; padding: 0; border-radius: 50%; justify-content: center; }
  .ai-launcher span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .ai-panel { width: min(400px, calc(100vw - 1.5rem)); height: min(70vh, 560px); right: 0; }
}

#ink-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.page, .colophon, .ink-ticker, .banner { position: relative; z-index: 1; }
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 80;
  pointer-events: none;
  background: rgba(244, 239, 230, 0.06);
}
.scroll-progress i {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--wax), var(--brass));
}
.ink-ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(224, 196, 154, 0.045);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.ticker-seq { display: flex; align-items: center; }
.tick {
  padding: 0.42rem 0.95rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--paper-dim);
  white-space: nowrap;
}
.tick b { color: var(--brass); font-weight: 500; margin-right: 0.35rem; }
.tick.is-up { color: var(--up); }
.tick.is-down { color: var(--down); }
html.motion-on .ticker-track { animation: ticker 52s linear infinite; }
.ink-ticker:hover .ticker-track { animation-play-state: paused; }

.primary a { position: relative; }
.primary a::after {
  content: "";
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  bottom: 0.12rem;
  height: 1px;
  background: var(--wax);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s ease;
}
.primary a:hover::after,
.primary a[aria-current="page"]::after { transform: scaleX(1); }

.card, .panel, .swap-card, .side-card, .clerk, .shore, .token-band, .btn, .token-btn, .flip, .ai-launcher, .social {
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease, filter 0.28s ease;
}
.card:hover, .panel:hover, .swap-card:hover, .side-card:hover, .clerk:hover, .shore:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(224, 196, 154, 0.18);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn-brass:hover:not(:disabled) { box-shadow: 0 10px 26px rgba(224, 196, 154, 0.22); }
.token-btn:hover { box-shadow: 0 0 0 1px rgba(224, 196, 154, 0.45); }
.flip:hover { transform: rotate(180deg); }
.ai-launcher:hover { box-shadow: 0 12px 28px rgba(224, 196, 154, 0.28); }
.swap-row { transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.ferry-mark { transition: transform 0.35s ease; }
html.motion-on .ferry-mark { animation: bob 4.8s ease-in-out infinite; }
html.motion-on .hero-svg { filter: drop-shadow(0 0 18px rgba(224, 196, 154, 0.12)); }

html.motion-on .reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(18px);
}
html.motion-on .reveal.is-in {
  animation: rise 0.7s ease backwards;
  animation-delay: var(--stagger, 0ms);
}
html.motion-on .hero-copy { animation: rise 0.8s ease both; }
html.motion-on .page-hero { animation: rise 0.7s ease both; }
html.motion-on .ai-panel:not([hidden]) { animation: panelIn 0.32s ease; }
html.motion-on .ai-bubble.is-fresh { animation: rise 0.35s ease; }
html.motion-on .tape-row.is-new { animation: rowIn 0.45s ease; }
html.motion-on body { animation: pageIn 0.45s ease; }

@keyframes ticker {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
::view-transition-old(root) { animation: pageOut 0.22s ease both; }
::view-transition-new(root) { animation: pageIn 0.32s ease both; }
@keyframes pageOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
