/* Critical Snail — "Halo" theme
   Dark sci-fi, polished corporate HUD. No build step, no JS. */

/* Self-hosted fonts (SIL OFL 1.1, see /fonts/LICENSE-*.txt) */
@font-face { font-family: 'League Gothic'; src: url('/fonts/league-gothic-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --bg: #060A12;
  --bg-deep: #04070D;
  --panel: #0B121D;
  --panel-glass: rgba(10, 18, 30, 0.85);
  --text: #EAF2F8;
  --text-2: #C3D0DB;
  --text-3: #A9B8C5;
  --muted: #8EA0B0;
  --line: rgba(234, 242, 248, 0.12);
  --line-strong: rgba(234, 242, 248, 0.18);
  --accent: #5CC8F2;
  --accent-ink: #04121B;
  --accent-wash: rgba(92, 200, 242, 0.14);
  --amber: #F0AE48;
  --ok: #6FE3A1;

  --display: 'League Gothic', 'Oswald', 'Arial Narrow', sans-serif;
  --sans: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --wrap: 1280px;
  --gutter: clamp(20px, 4vw, 32px);
  --radius: 12px;
  --notch: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.skip:focus { top: 12px; color: var(--accent-ink); }

/* ---------- type ---------- */
.display { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; line-height: 0.9; margin: 0; }
.h-hero { font-size: clamp(56px, 8vw, 112px); }
.h-xl { font-size: clamp(48px, 6vw, 72px); }
.h-lg { font-size: clamp(44px, 5vw, 64px); }
.lede { margin: 0; max-width: 560px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--text-2); }
.body-lg { margin: 0; font-size: 18px; line-height: 1.65; color: var(--text-2); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.muted-hi { color: var(--text-2); }
.accent { color: var(--accent); }
.amber { color: var(--amber); }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 14px; }

/* ---------- nav ---------- */
.site-header { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 20px; padding-block: 28px; }
.brand img { display: block; height: 24px; width: auto; }
.pill-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid rgba(234,242,248,0.14); border-radius: 999px; background: rgba(10,18,30,0.55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: 15px; font-weight: 500; }
.pill-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; }
.pill-nav a[aria-current="page"] { background: rgba(255,255,255,0.08); }
.pill-nav .pill-cta { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill-nav .pill-cta:hover { color: var(--accent-ink); filter: brightness(1.1); }

.subhead { position: relative; border-bottom: 1px solid var(--line); background: var(--bg-deep); overflow: hidden; }

/* ---------- shared HUD bits ---------- */
.grid-bg { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(92,200,242,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(92,200,242,0.06) 1px, transparent 1px);
  background-size: 64px 64px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); flex: none; }
.dot-amber { width: 6px; height: 6px; background: var(--amber); box-shadow: none; }
.dot-ok { width: 6px; height: 6px; background: var(--ok); box-shadow: none; }
.corner { position: absolute; width: 18px; height: 18px; border: 0 solid var(--accent); pointer-events: none; }
.corner.tl { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }
.sep { color: rgba(234,242,248,0.4); }

/* section header strip: [ 01 ] Label ———|||||——— CODE */
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 48px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.sec-head .rule { flex: 1; min-width: 24px; height: 1px; background: var(--line-strong); }
.sec-head .rule.ticks { height: 8px; background:
  linear-gradient(var(--line-strong), var(--line-strong)) 0 100% / 100% 1px no-repeat,
  repeating-linear-gradient(90deg, rgba(234,242,248,0.3) 0 1px, transparent 1px 10px) 0 0 / 100% 5px no-repeat; }

/* notched (cut-corner) buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 0 32px; font-size: 16px; font-weight: 600; }
.notch { clip-path: polygon(var(--notch) 0, 100% 0, 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, 0 100%, 0 var(--notch)); }
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { color: var(--accent-ink); filter: brightness(1.12); }
.btn-ghost { background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.btn-ghost:hover { background: rgba(92,200,242,0.24); color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.mono-link { font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: min(820px, 100svh); display: flex; flex-direction: column; overflow: hidden; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; filter: saturate(0.35) brightness(0.55) hue-rotate(160deg); }
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,10,18,0.6) 0%, rgba(6,10,18,0.2) 40%, rgba(6,10,18,0.96) 100%); }
.hud { position: absolute; inset: 0; pointer-events: none; }
.scanlines { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px); }
.sweep { position: absolute; left: 0; right: 0; top: 0; height: 90px; background: linear-gradient(180deg, transparent, rgba(92,200,242,0.07) 85%, rgba(92,200,242,0.22)); animation: sweep 9s linear infinite; }
.reticle { position: absolute; right: -60px; top: 120px; width: 520px; height: 520px; color: var(--accent); opacity: 0.22; }
.ruler-v { position: absolute; left: 20px; top: 120px; bottom: 120px; width: 22px;
  background: repeating-linear-gradient(180deg, rgba(234,242,248,0.35) 0 1px, transparent 1px 12px) 0 0 / 14px 100% no-repeat,
              repeating-linear-gradient(180deg, rgba(234,242,248,0.5) 0 1px, transparent 1px 60px); }
.side-readout { position: absolute; right: 24px; top: 50%; transform: translateY(-50%) rotate(90deg); transform-origin: right center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; color: rgba(234,242,248,0.45); white-space: nowrap; }

.hero-body { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 28px; padding-top: 40px; padding-bottom: 72px; }
.signal { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.bracketed { position: relative; align-self: flex-start; padding: 20px 28px 20px 0; }
.bracketed::before, .bracketed::after { content: ""; position: absolute; right: 0; width: 22px; height: 22px; border: 0 solid var(--accent); }
.bracketed::before { top: 0; border-top-width: 1px; border-right-width: 1px; }
.bracketed::after { bottom: 0; border-bottom-width: 1px; border-right-width: 1px; }
.hero-title { font-size: clamp(64px, 11vw, 168px); line-height: 0.86; max-width: 1000px; }
.cursor { display: inline-block; width: 0.32em; height: 0.08em; margin-left: 0.08em; background: var(--accent); }
.hero-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 32px; }
.telemetry { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-top: 18px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: rgba(234,242,248,0.5); }
.telemetry .push { margin-left: auto; }

/* ---------- sections ---------- */
.section { padding-block: 96px; }
.section-tight { padding-top: 0; }
.page-top { padding-top: 72px; padding-bottom: 48px; }
.section-pad { height: 64px; }
.title-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }

/* games */
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 56px; align-items: center; }
.target-panel { position: relative; display: flex; justify-content: center; padding: 56px 48px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(circle at 30% 20%, rgba(92,200,242,0.14), transparent 60%), var(--panel); }
.target-ring { position: absolute; left: 50%; top: 50%; width: 360px; height: 360px; transform: translate(-50%, -50%); color: var(--accent); opacity: 0.18; }
.cover { position: relative; display: block; width: 100%; max-width: 440px; filter: drop-shadow(0 24px 48px rgba(0,0,0,0.6)); }
.tag { position: absolute; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.tag-tl { top: 18px; left: 40px; }
.tag-br { bottom: 18px; right: 40px; }
.tag.amber { color: var(--amber); }
.game-logo { display: block; width: 100%; max-width: 460px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.03); }
.stat-idx { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.stat-num { font-family: var(--display); font-size: 44px; line-height: 1; }
.stat-label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--muted); }
.meter { display: grid; grid-template-columns: repeat(var(--segs), minmax(0, 1fr)); gap: 3px; }
.meter span { height: 4px; background: rgba(234,242,248,0.15); }
.meter span.on { background: var(--accent); }

/* studio */
.studio-panel { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 48px; padding: clamp(28px, 5vw, 56px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.studio-panel > * { position: relative; }
.studio-panel > .dotgrid { position: absolute; inset: 0; background-image: radial-gradient(rgba(234,242,248,0.08) 1px, transparent 1px); background-size: 20px 20px; }
.studio-panel > .topbar { position: absolute; top: 0; left: clamp(28px, 5vw, 56px); width: 120px; height: 2px; background: var(--accent); }
.quote { margin: 8px 0 0; font-size: 18px; line-height: 1.5; font-style: italic; color: var(--text); }
.quote cite { display: block; margin-top: 8px; font-style: normal; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.principles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.principles li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 22px 24px; border-radius: 8px; border: 1px solid rgba(234,242,248,0.1); background: var(--panel-glass); }
.principles .mono { font-size: 12px; padding-top: 4px; }
.principles strong { font-size: 18px; font-weight: 600; }
.principles p { margin: 6px 0 0; font-size: 16px; line-height: 1.55; color: var(--text-3); }

/* archive cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.card { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 260px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; transition: border-color .2s; }
.card:hover { border-color: var(--accent); color: var(--text); }
.card-img { justify-content: flex-end; gap: 8px; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.35; filter: grayscale(1); transition: opacity .3s; }
.card-img:hover img { opacity: 0.5; }
.card-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,18,29,0) 30%, rgba(11,18,29,0.92) 100%); }
.card-img > span { z-index: 1; }
.card-tx { position: absolute; top: 20px; right: 20px; font-family: var(--mono); font-size: 10px; color: rgba(234,242,248,0.5); }
.card-meta { position: relative; font-family: var(--mono); font-size: 12px; color: var(--amber); }
.card-title { position: relative; font-size: 22px; font-weight: 600; line-height: 1.25; }

/* contact */
.contact { border-top: 1px solid var(--line); }
.contact-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 40px; padding-block: 80px; }
.kicker { font-size: 12px; letter-spacing: 0.16em; }
.channels { display: flex; flex-wrap: wrap; gap: 28px 40px; margin: 0; font-size: 17px; }
.channels dt { font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--muted); }
.channels dd { margin: 8px 0 0; }
.channels .links { display: flex; gap: 16px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-deep); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-block: 18px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- archive index ---------- */
.page-top .lede { margin-top: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.chip span { color: var(--muted); }
.chip:hover { border-color: var(--accent); }
.section-list { padding-block: 24px; }
.list-head { margin: 0 0 8px; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.tx-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tx-row { display: grid; grid-template-columns: 88px 1fr auto; gap: 8px 24px; align-items: baseline; padding: 18px 4px; border-bottom: 1px solid var(--line); transition: background .15s; }
.tx-row:hover { background: rgba(92,200,242,0.05); color: var(--text); }
.tx-row:hover .tx-title { color: var(--accent); }
.tx-id, .tx-date { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
.tx-title { font-size: 19px; font-weight: 500; line-height: 1.35; }

/* ---------- post ---------- */
.post { max-width: 880px; }
.post .sec-head { margin-bottom: 40px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
.post-title { font-size: clamp(48px, 6.5vw, 88px); }
.post-image { position: relative; margin: 40px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.post-image img { display: block; width: 100%; border-radius: 4px; }
.post-image .corner { top: -1px; left: -1px; }
.post-image .corner.br { top: auto; left: auto; bottom: -1px; right: -1px; }

.prose { margin-top: 48px; font-size: 18px; line-height: 1.75; color: var(--text-2); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose p + p { margin-top: 1.1em; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.8em 0 0.4em; font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1; color: var(--text); }
.prose h1 { font-size: 44px; } .prose h2 { font-size: 38px; } .prose h3 { font-size: 30px; } .prose h4 { font-size: 24px; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { color: var(--text); }
.prose img { display: block; max-width: 100%; height: auto; margin: 2em auto; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 24px; border-left: 2px solid var(--accent); color: var(--text); font-style: italic; }
.prose hr { border: 0; height: 1px; background: var(--line-strong); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.prose code { font-family: var(--mono); font-size: 0.9em; }
.eot { margin: 56px 0 0; font-size: 12px; letter-spacing: 0.14em; color: var(--muted); }
.post-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; margin: 32px 0 96px; }
.post-nav-link { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: 18px; font-weight: 500; line-height: 1.35; }
.post-nav-link .mono { font-size: 12px; letter-spacing: 0.08em; }
.post-nav-link.next { text-align: right; }
.post-nav-link:hover { border-color: var(--accent); color: var(--text); }

.lost { min-height: 60vh; display: flex; flex-direction: column; gap: 24px; justify-content: center; }
.lost .sec-head { margin-bottom: 8px; }

/* ---------- motion ---------- */
@keyframes sweep { from { transform: translateY(-10%); } to { transform: translateY(1100%); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
.blink { animation: blink 1.1s steps(1) infinite; }
.spin { animation: spin 40s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sweep, .pulse, .blink, .spin { animation: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .reticle { width: 340px; height: 340px; right: -140px; top: 160px; }
  .ruler-v, .side-readout { display: none; }
  .telemetry .push { margin-left: 0; }
  .sec-head { gap: 10px; margin-bottom: 32px; }
  .section { padding-block: 64px; }
  .section-tight { padding-top: 0; }
  .target-panel { padding: 48px 24px; }
  .tag-tl { left: 24px; } .tag-br { right: 24px; }
  .tx-row { grid-template-columns: 1fr auto; }
  .tx-row .tx-title { grid-column: 1 / -1; grid-row: 2; }
  .contact-row { padding-block: 56px; }
}
