/* ============================================================
   Guildhall — TODI.WTF design system
   See ~/.claude/skills/todi-wtf-design-system/SKILL.md
   ============================================================ */

/* Both fonts self-hosted — no third-party traffic. */

@font-face {
  font-family: "Reactor7";
  src: url("/fonts/Reactor7.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "VT323";
  src: url("/fonts/VT323-latin.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  --ps-blue-900:  #060d2e;
  --ps-blue-800:  #0a1e5c;
  --ps-blue-700:  #1a3a8a;
  --ps-blue-600:  #2756c4;
  --ps-blue-500:  #3b74e0;
  --ps-blue-300:  #6c8fc8;
  --ps-blue-100:  #c8d4ea;
  --ps-yellow-500: #f2c14e;
  --ps-yellow-300: #ffd870;
  --ps-green-500: #6ac674;
  --ps-red-500:   #e04e4e;
  --ps-black:     #000000;
  --ps-ink:       #0a0a12;
  --ps-paper:     #f5f0e5;
  --ps-paper-2:   #e8e2d0;

  --bg-page:    var(--ps-blue-900);
  --bg-hero:    linear-gradient(180deg, #0a1e5c 0%, #060d2e 55%, #000 100%);
  --bg-surface: rgba(6, 13, 46, 0.72);
  --bg-deep:    rgba(0, 0, 0, 0.72);

  --fg-1: var(--ps-paper);
  --fg-2: var(--ps-blue-100);
  --fg-3: var(--ps-blue-300);

  --font-display: "Reactor7", ui-monospace, "Courier New", monospace;
  --font-body:    "VT323", ui-monospace, "Courier New", monospace;
  --font-mono:    "VT323", ui-monospace, "Courier New", monospace;

  --bevel-out:
    inset 2px 2px 0 0 rgba(255,255,255,0.18),
    inset -2px -2px 0 0 rgba(0,0,0,0.6);
  --bevel-in:
    inset -2px -2px 0 0 rgba(255,255,255,0.30),
    inset 2px 2px 0 0 rgba(0,0,0,0.50);
  --drop-hard:    4px 4px 0 0 #000;
  --drop-hard-sm: 2px 2px 0 0 #000;

  --s-1:  4px;
  --s-2:  8px;
  --s-3:  16px;
  --s-4:  24px;
  --s-5:  40px;
  --s-6:  64px;

  --content-max: 880px;
}

/* Page shell — apply by adding `class="todi"` on <body>. */

* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; }

body.todi {
  min-height: 100vh;
  background: var(--bg-hero);
  background-attachment: fixed;
  background-color: #060d2e;
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.3;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  image-rendering: pixelated;
  position: relative;
}
body.todi::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.14) 0 2px, transparent 2px 4px);
}
body.todi > * { position: relative; z-index: 2; }

.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.page.wide { max-width: 1280px; }

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

.hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 32px;
  background: var(--bg-surface);
  border: 2px solid #000;
  box-shadow: var(--bevel-out), 3px 3px 0 0 #000;
  backdrop-filter: blur(2px);
  flex-wrap: wrap;
  gap: 12px;
}
.word {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--ps-paper);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.word .dot { color: var(--ps-yellow-500); }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--ps-blue-100);
  text-decoration: none;
  padding: 6px 10px;
  border: 2px solid transparent;
  transition: color 80ms linear;
}
.nav a:hover { color: var(--ps-yellow-300); }
.nav a.on {
  background: var(--ps-blue-700);
  color: var(--ps-paper);
  border-color: #000;
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.25), inset -2px -2px 0 0 rgba(0,0,0,.5);
}

/* ---- Hero --------------------------------------------------- */

h1.big {
  font-family: var(--font-display);
  font-size: 64px;
  letter-spacing: 5px;
  color: var(--ps-paper);
  text-shadow: 4px 4px 0 #000;
  line-height: 1;
  margin: 0 0 12px;
}
h1.big .dot { color: var(--ps-yellow-500); }
.sub { font-size: 24px; color: var(--ps-blue-100); margin: 0 0 28px; }

/* ---- Container (workhorse panel) --------------------------- */

.container {
  position: relative;
  background: var(--bg-surface);
  color: var(--fg-1);
  border: 2px solid #000;
  padding: 28px 24px 22px;
  margin-bottom: 28px;
  box-shadow: var(--bevel-out), var(--drop-hard);
  backdrop-filter: blur(2px);
}
.container.deep { background: var(--bg-deep); }

.container > .ctitle {
  position: absolute;
  top: -13px;
  left: 16px;
  padding: 2px 8px;
  background: var(--ps-blue-800);
  color: var(--ps-yellow-500);
  border: 2px solid #000;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
}
.container.deep > .ctitle { background: #000; }

/* ---- Headings ---------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: normal;
  letter-spacing: 1px;
  line-height: 1.1;
  color: var(--ps-paper);
}
h1 { font-size: 36px; margin: 0 0 16px; }
h2 {
  font-size: 22px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #000;
  margin: 0 0 16px;
}
h2.section::before { content: "▸ "; color: var(--ps-yellow-500); }
h3 { font-size: 18px; margin: 0 0 12px; }
h4 { font-size: 16px; margin: 0 0 10px; }

p, li { font-family: var(--font-body); font-size: 22px; line-height: 1.3; }
p + p { margin-top: 12px; }

a { color: var(--ps-yellow-300); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; transition: color 80ms linear; }
a:hover { color: var(--ps-yellow-500); }
a:focus-visible { outline: 2px dashed var(--ps-blue-500); outline-offset: 2px; }

code, kbd {
  font-family: var(--font-mono);
  font-size: 20px;
  background: #000;
  color: var(--ps-blue-100);
  padding: 0 8px;
  border: 2px solid #000;
}

hr { border: none; border-top: 2px dashed var(--ps-blue-500); margin: 24px 0; }

/* ---- Buttons ------------------------------------------------ */

.btn {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  line-height: 1;
  padding: 14px 20px;
  background: var(--ps-blue-800);
  color: var(--ps-paper);
  border: 2px solid #000;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  box-shadow: var(--bevel-out), 2px 2px 0 0 #000;
  transition: background 80ms linear, transform 80ms linear, box-shadow 80ms linear;
  text-transform: none;
  font-weight: normal;
}
.btn:hover { background: #12297a; color: var(--ps-paper); }
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--bevel-in);
}
.btn:focus-visible { outline: 2px dashed var(--ps-blue-500); outline-offset: 3px; }
.btn.primary  { background: var(--ps-blue-700); color: var(--ps-paper); }
.btn.primary:hover  { background: var(--ps-blue-600); color: #fff; }
.btn.accent   { background: var(--ps-yellow-500); color: var(--ps-ink); }
.btn.accent:hover   { background: var(--ps-yellow-300); color: var(--ps-ink); }
.btn.danger   { background: var(--ps-red-500); color: var(--ps-paper); }
.btn.danger:hover   { background: #c93939; }
.btn.success  { background: var(--ps-green-500); color: var(--ps-ink); }
.btn.muted    { background: #1a1a3a; color: var(--ps-blue-100); }
.btn.muted:hover { background: #25254a; color: var(--ps-paper); }
.btn.sm { font-size: 16px; padding: 8px 12px; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---- Chips / badges ---------------------------------------- */

.chip {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  padding: 6px 10px;
  background: var(--ps-blue-800);
  color: var(--ps-paper);
  border: 2px solid #000;
  box-shadow: var(--bevel-out);
}
.chip.dark { background: var(--ps-blue-700); }
.chip.accent { background: var(--ps-yellow-500); color: var(--ps-ink); }
.chip.success { background: var(--ps-green-500); color: var(--ps-ink); }
.chip.danger { background: var(--ps-red-500); color: var(--ps-paper); }
.chip.warn { background: #d4a046; color: var(--ps-ink); }
.chip.muted { background: #1a1a3a; color: var(--ps-blue-100); }
.chip .dot { display: inline-block; width: 8px; height: 8px; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.chip.live .dot { background: var(--ps-green-500); }

/* ---- Card grid --------------------------------------------- */

.card {
  position: relative;
  background: var(--bg-surface);
  border: 2px solid #000;
  padding: 18px;
  color: var(--fg-1);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--bevel-out), var(--drop-hard);
  backdrop-filter: blur(2px);
  transition: transform 80ms linear, box-shadow 80ms linear;
}
a.card:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--bevel-out), 5px 5px 0 0 #000;
  color: var(--fg-1);
}

/* ---- Forms ------------------------------------------------- */

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
select,
textarea {
  font-family: var(--font-body);
  font-size: 20px;
  background: #000;
  border: 2px solid #000;
  color: var(--ps-paper);
  padding: 8px 10px;
  width: 100%;
  box-shadow: var(--bevel-in);
  font-weight: normal;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: 2px dashed var(--ps-blue-500);
  outline-offset: 2px;
}
label {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--ps-blue-100);
  display: block;
  margin-bottom: 6px;
}

/* ---- Tables ------------------------------------------------ */

table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px dashed var(--ps-blue-500);
  font-size: 20px;
}
th {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--ps-yellow-300);
  font-weight: normal;
}

/* ---- Alerts ------------------------------------------------ */

.alert {
  border: 2px solid #000;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--bevel-out), var(--drop-hard-sm);
  font-size: 20px;
}
.alert-error   { background: rgba(224,78,78,0.18); color: #ffb3b3; }
.alert-success { background: rgba(106,198,116,0.18); color: #b3ffc3; }
.alert-info    { background: rgba(59,116,224,0.18); color: var(--ps-blue-100); }

/* ---- Footer ------------------------------------------------ */

footer.todi-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 2px dashed var(--ps-blue-500);
  color: var(--ps-blue-300);
  font-size: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- Toast ------------------------------------------------- */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ps-blue-700);
  color: var(--ps-paper);
  padding: 10px 18px;
  border: 2px solid #000;
  box-shadow: var(--bevel-out), var(--drop-hard-sm);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 200ms linear;
  pointer-events: none;
  z-index: 100;
}
.toast.show { opacity: 1; }

/* ---- Idle blink (memory-card save vibe) -------------------- */

@keyframes mc-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.4; } }
.blink { animation: mc-blink 1s steps(2, end) infinite; }
