:root {
  --bg: #0d0c0a; --surface: #15130f; --raised: #1c1914; --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.14);
  --ink: #e8e2d4; --muted: #9a927f; --faint: #6b645a;
  --accent: #8a9cf0; --accent-ink: #0e1020; --paper: #f1eadb; --paper-ink: #1a1712; --paper-muted: #5e574b;
  --up: #6fbf73; --down: #d06a55;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --body-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shell: 1320px; --gap: 20px; --r: 12px; --pill: 999px;
  --dur: .24s; --ease-out: cubic-bezier(.23, 1, .32, 1);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
b { font-weight: 600; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gap); }
h2, h3 { font-weight: 500; letter-spacing: .01em; margin: 0; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(13, 12, 10, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { height: 62px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.brand-mark { width: 14px; height: 14px; background: var(--accent); border-radius: 3px; box-shadow: 0 0 0 3px rgba(138, 156, 240, .18); }
.clock { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); margin-left: auto; margin-right: auto; }
.clock .sep { color: var(--faint); }
.speed { font-size: 11px; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: var(--pill); color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(138, 156, 240, .6); animation: pulse 2.2s infinite; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(138, 156, 240, .55); } 70% { box-shadow: 0 0 0 7px rgba(138, 156, 240, 0); } 100% { box-shadow: 0 0 0 0 rgba(138, 156, 240, 0); } }
.links { display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--muted); }
.links a:hover { color: var(--ink); }
.pill { font: 500 13px var(--sans); padding: 8px 14px; border-radius: var(--pill); border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); cursor: pointer; transition: transform .12s, background var(--dur); }
.pill:hover { background: #a2b1f5; }
.pill:active { transform: translateY(1px); }
.pill.ghost { background: transparent; color: var(--muted); border-color: var(--line-strong); }
.pill.ghost:hover { color: var(--ink); border-color: var(--ink); }
.pill.ca { background: var(--raised); color: var(--ink); border-color: var(--line-strong); padding: 6px 12px; font-size: 12px; }
.pill.ca:hover { border-color: var(--accent); background: var(--raised); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); padding: var(--gap) 0; }
.monitor { min-width: 0; }
.bezel { background: linear-gradient(180deg, #1f1b16, #14110d); border: 1px solid var(--line-strong); border-radius: 18px; padding: 14px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04); }
.screen { position: relative; background: #000; border-radius: 8px; overflow: hidden; display: flex; justify-content: center; align-items: center; box-shadow: inset 0 0 60px rgba(0, 0, 0, .6); }
.screen canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .35) 100%); }
.bubble { position: absolute; z-index: 3; transform: translate(-50%, -100%); background: var(--paper); color: var(--paper-ink); font: 500 13px/1.3 var(--sans); padding: 7px 10px; border-radius: 10px; max-width: 220px; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: var(--paper); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.tag { position: absolute; z-index: 2; transform: translate(-50%, -100%); font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); background: rgba(13, 12, 10, .78); border: 1px solid rgba(255, 255, 255, .16); padding: 4px 7px 3px; border-radius: var(--pill); pointer-events: none; white-space: nowrap; }
.tag::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 6px; height: 6px; background: rgba(13, 12, 10, .78); border-right: 1px solid rgba(255, 255, 255, .16); border-bottom: 1px solid rgba(255, 255, 255, .16); transform: translateX(-50%) rotate(45deg); }
.status { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; font-size: 14px; }
.status-right { margin-left: auto; font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.notes { margin: 8px 6px 0; }
.note { display: flex; gap: 14px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-family: var(--body-serif); font-size: 16px; line-height: 1.4; animation: unfold var(--dur) var(--ease-out) both; }
.note .mono { flex: none; width: 66px; font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.note:first-child { border-top: 0; }

/* rail */
.rail { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.card h3 { margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.kv:last-of-type { border-bottom: 0; }
.kv b { color: var(--ink); font-weight: 500; }
.meters { display: grid; gap: 8px; margin-top: 12px; }
.meter { display: grid; grid-template-columns: 82px 1fr 34px; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.meter > i { display: block; height: 4px; background: var(--raised); border-radius: 2px; overflow: hidden; }
.meter > i > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width .8s var(--ease-out); }
.meter b { text-align: right; font-weight: 500; color: var(--ink); }
.headlines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.headlines li { font-family: var(--body-serif); font-size: 15px; line-height: 1.35; padding-left: 12px; position: relative; }
.headlines li::before { content: ""; position: absolute; left: 0; top: 9px; width: 4px; height: 4px; background: var(--faint); border-radius: 50%; }
.headlines li.w3::before { background: var(--accent); }
.headlines li small { display: block; color: var(--muted); font-family: var(--sans); font-size: 12px; margin-top: 2px; }
.era { margin: 0; display: grid; grid-template-columns: 78px 1fr; gap: 5px 10px; font-size: 13px; }
.era dt { color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; padding-top: 3px; }
.era dd { margin: 0; color: var(--ink); }
.era dd.mono { color: var(--muted); font-size: 12px; }
.token .ca-full { width: 100%; text-align: left; background: var(--raised); border: 1px solid var(--line-strong); color: var(--ink); border-radius: 8px; padding: 10px 12px; font-size: 12px; word-break: break-all; cursor: pointer; }
.token .ca-full:hover { border-color: var(--accent); }
.about p { margin: 0; font-family: var(--body-serif); font-size: 15px; line-height: 1.5; color: var(--ink); }
.about b { color: var(--ink); font-weight: 500; }

/* columns */
.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); padding-bottom: 40px; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; max-height: 86vh; }
.col > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.col > header h2 { font-family: var(--serif); font-size: 28px; letter-spacing: -.01em; }
.col > .small { margin: 0 0 12px; }
.list { overflow: auto; flex: 1; min-height: 0; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--raised) transparent; }
.col .pill.ghost { margin-top: 12px; align-self: flex-start; }

.entry { padding: 14px 0; border-top: 1px solid var(--line); animation: unfold var(--dur) var(--ease-out) both; }
.entry:first-child { border-top: 0; padding-top: 4px; }
.entry .when { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.entry .when .tag { color: var(--faint); }
.entry p { font-family: var(--body-serif); font-size: 16px; line-height: 1.55; margin: 8px 0 0; white-space: pre-wrap; }
@keyframes unfold { from { opacity: 0; transform: perspective(900px) rotateX(4deg) translateY(10px); } to { opacity: 1; transform: none; } }

/* the paper */
.paper { background: var(--paper); color: var(--paper-ink); border-radius: 6px; padding: 18px 18px 14px; margin: 8px 0 12px; box-shadow: 0 1px 0 rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .06); overflow: auto; min-height: 0; }
.paper .masthead { font-family: var(--serif); font-size: 34px; line-height: 1; text-align: center; letter-spacing: -.01em; border-bottom: 2px solid var(--paper-ink); padding-bottom: 8px; }
.paper .motto { text-align: center; font-family: var(--body-serif); font-style: italic; font-size: 13px; color: var(--paper-muted); margin: 6px 0; }
.paper .edline { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-muted); border-top: 1px solid rgba(0, 0, 0, .25); border-bottom: 1px solid rgba(0, 0, 0, .25); padding: 5px 0; margin-bottom: 12px; }
.paper .head { font-family: var(--serif); font-size: 27px; line-height: 1.05; margin: 0; }
.paper .deck { font-family: var(--body-serif); font-style: italic; font-size: 15px; color: var(--paper-muted); margin: 6px 0 12px; }
.paper .sec { border-top: 1px solid rgba(0, 0, 0, .18); padding-top: 8px; margin-top: 8px; }
.paper .sec h4 { font-family: var(--sans); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 4px; color: var(--paper-ink); }
.paper .sec p { font-family: var(--body-serif); font-size: 14.5px; line-height: 1.5; margin: 0; }
.paper .weather { font-family: var(--mono); font-size: 11px; color: var(--paper-muted); margin-top: 12px; }
.paper .more { margin-top: 12px; display: flex; justify-content: flex-end; }
.paper .pill { background: var(--paper-ink); color: var(--paper); }
.paper .pill:hover { background: #333; }
.paper.full { max-height: none; }
.paper.full .body { column-count: 2; column-gap: 28px; column-rule: 1px solid rgba(0, 0, 0, .15); }
.paper.full .sec { break-inside: avoid; }
.paper .box { border: 1px solid var(--paper-ink); padding: 10px 12px; margin-top: 14px; }
.paper .box h4 { font-family: var(--sans); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 6px; }
.paper .box p, .paper .box li { font-family: var(--body-serif); font-size: 13.5px; margin: 0 0 6px; }
.paper .box ul { margin: 0; padding-left: 16px; }
.paper .mail q { font-style: italic; }
.editions { display: grid; gap: 6px; overflow: auto; min-height: 0; }
.editions a { display: flex; gap: 10px; font-size: 13px; color: var(--muted); padding: 4px 0; border-top: 1px solid var(--line); }
.editions a b { color: var(--ink); font-weight: 500; font-family: var(--body-serif); font-size: 14px; }
.editions a .mono { flex: none; font-size: 11px; padding-top: 2px; }

/* letters */
.letter-form { display: grid; gap: 8px; padding: 6px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.letter-form input, .letter-form textarea { width: 100%; background: var(--raised); border: 1px solid var(--line-strong); color: var(--ink); border-radius: 8px; padding: 10px 12px; font: 15px var(--body-serif); resize: vertical; }
.letter-form input { font-family: var(--sans); font-size: 14px; }
.letter-form input:focus, .letter-form textarea:focus { outline: none; border-color: var(--accent); }
.lf-row { display: flex; justify-content: space-between; align-items: center; }
#lf-note { margin: 0; color: var(--muted); min-height: 1em; }
#lf-note.err { color: var(--down); }
.letter { padding: 12px 0; border-top: 1px solid var(--line); animation: unfold var(--dur) var(--ease-out) both; }
.letter .who { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.letter .q { font-family: var(--body-serif); font-size: 14.5px; color: var(--muted); margin: 6px 0; }
.letter .a { font-family: var(--body-serif); font-size: 15.5px; line-height: 1.5; margin: 6px 0 0; padding-left: 12px; border-left: 2px solid var(--accent); white-space: pre-wrap; }
.letter.waiting .a { border-left-color: var(--faint); color: var(--muted); font-style: italic; }
#my-letters:not(:empty) { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--line-strong); }
#my-letters h4 { margin: 8px 0 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* footer / modal */
.foot { display: flex; justify-content: space-between; gap: 20px; padding-top: 16px; padding-bottom: 40px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .7); display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 40px 16px; }
.modal[hidden] { display: none; } /* author display:flex would otherwise beat the hidden attribute */
.modal-card { position: relative; width: min(980px, 100%); }
.modal .close { position: absolute; right: -8px; top: -34px; background: transparent; border: 0; color: var(--ink); font-size: 26px; cursor: pointer; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .columns { grid-template-columns: 1fr; }
  .col { max-height: none; }
  .list { overflow: visible; }
}
@media (max-width: 720px) {
  .top-in { gap: 12px; }
  .links a:not(#x-link) { display: none; }
  .clock #clock-date { display: none; }
  .paper.full .body { column-count: 1; }
  .foot { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .entry, .letter { animation: none; }
  .live-dot { animation: none; }
}
