/* Wardseed draft C: shared tokens and parts.
   Remix table (DRAFT-BRIEF): navy ground and type system from up:voynich-dev, Spectral from ws:enclip,
   plaster greys from om:V334, frost and keyholes from ws:silado, hairline note tables from up:prismyield-app,
   reeded glass from om:V160. Colour roles: ochre = actions, lime = passed mark, red = failed, grey = pending. */

@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("../fonts/spectral-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("../fonts/spectral-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("../fonts/spectral-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --ground: #05080f;
  --panel: #0a0f19;
  --panel-2: #141c2c;
  --line: #182033;
  --line-2: #26314a;
  --text: #e3e9f4;
  --text-2: #a3b0c8;
  --text-3: #8493b0;
  --glyph: #a8c0e0;
  --slate-1: #141c2c; --slate-2: #223049; --slate-3: #2f4062; --slate-4: #3c4f74;
  --ochre: #d9b45b;      /* actions only */
  --ochre-hi: #e9c871;
  --ochre-2: #8a733a;
  --lime: #ccff00;       /* the passed mark only */
  --red: #f2384f;        /* failed only */
  --pend: #8493b0;       /* pending */
  --paper: #f2f2ef;      /* paper objects only */
  --plaster-1: #575757; --plaster-2: #a7a7a3; --plaster-3: #d1d1cd; --ink: #242424;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --serif: "Spectral", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --step-1: 80ms steps(2, end);
  --step-2: 160ms steps(3, end);
  --step-3: 320ms steps(4, end);
  --reveal: cubic-bezier(0.16, 1, 0.3, 1);
  --hair: inset 0 0 0 1px var(--line-2);
  --rail: 216px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 17px/1.55 var(--sans); letter-spacing: -0.003em; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.mono, code, kbd, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-feature-settings: "tnum" 1; }
::selection { background: var(--ochre); color: var(--ground); }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- buttons: mono, 13 px, uppercase, stepped (voynich) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 14px; border-radius: 3px; border: 0;
  background: var(--panel); box-shadow: var(--hair); color: var(--text);
  font: 500 13px/1 var(--mono); letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background-color var(--step-1), color var(--step-1), box-shadow var(--step-1), transform var(--step-1);
}
.btn:hover { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--text-3); }
.btn:active { transform: scale(0.97); background: var(--text); color: var(--ground); box-shadow: none; }
.btn.primary { background: var(--ochre); color: var(--ground); box-shadow: none; }
.btn.primary:hover { background: var(--ochre-hi); }
.btn.primary:active { background: var(--text); }
.btn.quiet { background: transparent; box-shadow: none; color: var(--text-2); padding: 0 8px; }
.btn.quiet:hover { color: var(--text); background: var(--panel-2); }
.btn[disabled], .btn[aria-disabled="true"] { color: var(--text-3); background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line) 5px 6px); box-shadow: var(--hair); cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn .k { font: 500 13px/1 var(--mono); color: var(--text-3); padding: 3px 5px; border-radius: 2px; box-shadow: var(--hair); text-transform: none; }
.btn.primary .k { color: var(--ground); box-shadow: inset 0 0 0 1px rgba(5, 8, 15, .35); }
kbd { font: 500 13px/1 var(--mono); padding: 3px 6px; border-radius: 2px; box-shadow: var(--hair); color: var(--text-3); background: var(--ground); }

/* ---------- status marks: one fixed family (voynich tile, enclip verdict colours) ---------- */
.mk { display: inline-block; width: 10px; height: 14px; border-radius: 2px; flex: none; vertical-align: -2px; box-shadow: inset 0 0 0 1px var(--line-2); }
.mk.pass { background: var(--lime); box-shadow: none; }
.mk.fail { background: var(--red); box-shadow: none; }
.mk.pend { background: transparent; box-shadow: inset 0 0 0 1px var(--pend); }
.mk.act { background: var(--ochre); box-shadow: none; }
.mk.on { background: var(--text-2); box-shadow: none; }
.mk.off { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--line-2) 3px 4px); }
.mk.seam { background: var(--plaster-1); box-shadow: none; background-image: linear-gradient(90deg, transparent 4px, #fff 4px 5px, transparent 5px), linear-gradient(0deg, transparent 6px, #fff 6px 7px, transparent 7px); }
.mk.run { background: var(--slate-3); box-shadow: none; animation: blink .66s steps(1) infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- the left vertical menu (dice: 머리 메뉴 = left vertical) ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 30;
  display: flex; flex-direction: column; gap: 20px; padding: 20px 16px 18px;
  background: var(--panel); border-right: 1px solid var(--line);
}
.rail .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 500 20px/1 var(--sans); letter-spacing: -0.02em; }
.rail .brand svg { width: 30px; height: 30px; margin: -2px; color: var(--text); }
.rail .connect { width: 100%; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a, .rail nav button.navb {
  display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 10px; min-height: 36px; padding: 0 8px;
  border: 0; border-radius: 3px; background: transparent; text-align: left; cursor: pointer;
  color: var(--text-2); text-decoration: none; font: 400 15px/1.2 var(--sans);
  transition: background-color var(--step-1), color var(--step-1);
}
.rail nav a:hover, .rail nav button.navb:hover { background: var(--panel-2); color: var(--text); }
.rail nav a[aria-current="true"], .rail nav a[aria-current="page"], .rail nav button.navb[aria-current="page"] { background: var(--panel-2); color: var(--text); }
.rail nav .key { font: 500 13px/1 var(--mono); color: var(--text-3); text-align: center; padding: 4px 0; border-radius: 2px; box-shadow: var(--hair); }
.rail .group { font: 500 13px/1 var(--sans); color: var(--text-3); padding: 0 8px; margin-top: 6px; }
.rail nav .closed { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 10px; min-height: 36px; padding: 0 8px; color: var(--text-3); font: 400 14px/1.2 var(--sans); }
.rail .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font: 400 13px/1.45 var(--sans); color: var(--text-3); }
.rail .lamp { display: flex; align-items: center; gap: 8px; font: 500 13px/1 var(--mono); letter-spacing: .02em; color: var(--text); }
.rail .xlink { color: var(--text-2); text-decoration: none; font: 500 13px/1 var(--mono); }
.rail .xlink:hover { color: var(--text); }

/* ---------- W2 side drawer (wallet-kit LOOKS.md) ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(5, 8, 15, .62); opacity: 0; pointer-events: none; transition: opacity var(--step-2); }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(420px, 100vw);
  display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line-2);
  clip-path: inset(0 0 0 100%); visibility: hidden;
  transition: clip-path 250ms var(--reveal), visibility 0s linear 250ms;
}
.drawer.on { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path 250ms var(--reveal), visibility 0s; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer header h2 { font: 400 22px/1.1 var(--sans); letter-spacing: -0.02em; }
.drawer .body { flex: 1; overflow: auto; padding: 8px 12px 16px; }
.drawer .sec { font: 500 13px/1 var(--sans); color: var(--text-3); padding: 16px 8px 8px; }
.wrow {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; width: 100%;
  min-height: 52px; padding: 8px; border: 0; border-radius: 3px; background: transparent; text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color var(--step-1);
}
.wrow:hover { background: var(--panel-2); }
.wrow img { width: 32px; height: 32px; border-radius: 6px; }
.wrow .wn { font: 500 16px/1.2 var(--sans); }
.wrow .ws { font: 500 13px/1 var(--mono); color: var(--text-3); letter-spacing: .02em; }
.wrow.det .ws { color: var(--text); }
.wrow.wait { box-shadow: inset 0 0 0 1px var(--ochre-2); }
.wrow.wait .ws { color: var(--ochre); }
.drawer footer { padding: 14px 20px 18px; border-top: 1px solid var(--line); font: 400 14px/1.5 var(--sans); color: var(--text-2); }
.acct { padding: 12px 8px; display: flex; flex-direction: column; gap: 14px; }
.acct .addr { font: 500 15px/1.4 var(--mono); word-break: break-all; }
.acct table { width: 100%; border-collapse: collapse; }
.acct td { padding: 10px 0; border-top: 1px solid var(--line); font: 400 15px/1.3 var(--sans); }
.acct td:last-child { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- hairline research-note table (prismyield) ---------- */
.note-t { width: 100%; border-collapse: collapse; font: 400 15px/1.4 var(--sans); }
.note-t th { text-align: left; font: 500 13px/1.3 var(--sans); color: var(--text-3); padding: 0 12px 8px 0; border-bottom: 1px solid var(--line-2); }
.note-t td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.note-t td.v, .note-t th.v { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; padding-right: 0; }
.note-t .src { color: var(--text-3); font-size: 13px; }

/* ---------- toast ---------- */
.toast { visibility: hidden; position: fixed; left: 50%; bottom: 20px; z-index: 80; transform: translate(-50%, 140%); padding: 10px 14px; border-radius: 3px; background: var(--panel-2); box-shadow: var(--hair); font: 500 13px/1.3 var(--mono); transition: transform var(--step-2); }
.toast.on { visibility: visible; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  :root { --rail: 0px; }
  .rail { position: sticky; top: 0; inset: auto; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail .connect { width: auto; margin-left: auto; }
  .rail nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: calc(100% + 28px); margin: 0 -14px; padding: 0 10px; gap: 2px 4px; }
  .rail nav::-webkit-scrollbar { display: none; }
  .rail nav a, .rail nav button.navb, .rail nav .closed { flex: none; white-space: nowrap; grid-template-columns: auto; min-height: 44px; padding: 0 10px; font-size: 14px; }
  .rail nav .key, .rail .group { display: none; }
  .rail .foot { margin: 0; width: 100%; flex-direction: row; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
  .rail .foot .keys { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; }
}
