*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #000;
  --panel:     #000;
  --hover:     rgba(231, 233, 234, 0.08);
  --line:      #2f3336;
  --text:      #e7e9ea;
  --dim:       #71767b;
  --accent:    #8ab4ff;
  --accent-bg: #8ab4ff;
  --accent-fg: #06101f;
  --card:      #16181c;
  --radius:    16px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --bar-h: 53px;
  --console-h: 72px;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

html { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.dim { color: var(--dim); }

/* starfield behind everything */
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ── control-panel bar (full width) ── */
.console {
  position: sticky; top: 0; z-index: 50; width: 100%;
  background: linear-gradient(180deg, #283149 0%, #182033 46%, #0d111b 100%);
  border-bottom: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 1px 0 rgba(138, 180, 255, .2), 0 10px 28px rgba(0, 0, 0, .7);
}
.console-inner {
  height: var(--console-h); padding: 0 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
}

/* engraved label plates with rivets in the corners */
.plate {
  --rivet: #5b6683;
  position: relative; display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 20px;
  border: 1px solid #04060b; border-radius: 6px;
  background:
    radial-gradient(circle at 7px 7px, var(--rivet) 0 1.5px, transparent 2.2px) no-repeat,
    radial-gradient(circle at calc(100% - 7px) 7px, var(--rivet) 0 1.5px, transparent 2.2px) no-repeat,
    radial-gradient(circle at 7px calc(100% - 7px), var(--rivet) 0 1.5px, transparent 2.2px) no-repeat,
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), var(--rivet) 0 1.5px, transparent 2.2px) no-repeat,
    linear-gradient(180deg, #090c14, #0f131e);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .85), 0 1px 0 rgba(255, 255, 255, .08);
  font: 600 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #8fa0c4; white-space: nowrap;
}
.plate.brand { justify-self: start; }
.plate.brand:hover { color: #dfe8ff; }

/* recessed housing the buttons sit in */
.keys {
  display: flex; gap: 12px; padding: 7px 10px 7px;
  border: 1px solid #000; border-radius: 10px;
  background: linear-gradient(180deg, #05070c, #0a0d15);
  box-shadow: inset 0 3px 9px rgba(0, 0, 0, .95), 0 1px 0 rgba(255, 255, 255, .09);
}

/* the buttons: chunky keycaps with a lamp; the current section is latched down and lit */
.key {
  position: relative; display: flex; align-items: center; gap: 11px;
  min-width: 112px; height: 44px; margin-bottom: 4px; padding: 0 18px 0 14px;
  border: 1px solid #06080e; border-radius: 7px;
  background: linear-gradient(180deg, #465069 0%, #2c3449 46%, #1f2637 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -2px 0 rgba(0, 0, 0, .35), 0 4px 0 #080b12, 0 7px 10px rgba(0, 0, 0, .55);
  font: 700 12px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #aeb9d4;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .6);
  transition: transform .06s ease-out, box-shadow .06s ease-out, color .15s, filter .15s;
}
.key:hover { color: #fff; filter: brightness(1.14); }
.key:active, .key.active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, .6), 0 1px 0 #080b12, 0 2px 4px rgba(0, 0, 0, .5);
}
.key.active { color: #eaf3ff; background: linear-gradient(180deg, #25314f, #1b2543 60%, #16203a); }
.key:focus-visible { outline-offset: 3px; border-radius: 7px; }

.led {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: #171d2c; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .85), 0 1px 0 rgba(255, 255, 255, .12);
}
.key.active .led {
  background: radial-gradient(circle at 35% 30%, #e0ecff, #8ab4ff 55%, #4b7fd8);
  box-shadow: 0 0 6px 2px rgba(138, 180, 255, .75), 0 0 16px 4px rgba(138, 180, 255, .35);
}
.led.on {
  background: radial-gradient(circle at 35% 30%, #d3ffe4, #47e690 55%, #1fa860);
  box-shadow: 0 0 6px 1px rgba(71, 230, 144, .75), 0 0 14px 3px rgba(71, 230, 144, .3);
}

/* ── layout ── */
.layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 820px) minmax(250px, 310px);
  justify-content: center;
  min-height: calc(100vh - var(--console-h));
}

.side { position: sticky; top: var(--console-h); height: calc(100vh - var(--console-h)); overflow-y: auto; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.side-inner { display: flex; flex-direction: column; gap: 14px; padding: 8px 12px 16px; min-height: 100%; }
.side-left  .side-inner { padding-right: 20px; }
.side-right .side-inner { padding-left: 24px; padding-top: 12px; }

.feed {
  background: var(--panel);
  border-inline: 1px solid var(--line);
  min-height: calc(100vh - var(--console-h));
}

/* ── spaceship panel buttons (side panels) ──
   Same family as the top bar: raised keycaps with a lamp. Each kind of button is a variation. */
:root {
  --rivets:
    radial-gradient(circle at 7px 7px, #5b6683 0 1.5px, transparent 2.2px) no-repeat,
    radial-gradient(circle at calc(100% - 7px) 7px, #5b6683 0 1.5px, transparent 2.2px) no-repeat,
    radial-gradient(circle at 7px calc(100% - 7px), #5b6683 0 1.5px, transparent 2.2px) no-repeat,
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), #5b6683 0 1.5px, transparent 2.2px) no-repeat;
  --cap-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 -2px 0 rgba(0, 0, 0, .35), 0 4px 0 #080b12, 0 7px 10px rgba(0, 0, 0, .5);
  --cap-pressed: inset 0 2px 7px rgba(0, 0, 0, .6), 0 1px 0 #080b12, 0 2px 4px rgba(0, 0, 0, .5);
}
.tool, .latest, a.post-card {
  --cap-top: #3d4761; --cap-mid: #283047; --cap-bot: #1c2334;
  position: relative; border: 1px solid #06080e; color: var(--text);
  background: linear-gradient(180deg, var(--cap-top) 0%, var(--cap-mid) 48%, var(--cap-bot) 100%);
  box-shadow: var(--cap-shadow);
  transition: transform .06s ease-out, box-shadow .06s ease-out, filter .15s;
}
.tool:hover, .latest:hover, a.post-card:hover { filter: brightness(1.14); }
.tool:active, .latest:active, a.post-card:active { transform: translateY(3px); box-shadow: var(--cap-pressed); }
.tool:focus-visible, .latest:focus-visible, a.post-card:focus-visible { outline-offset: 3px; border-radius: 9px; }

/* engraved section label */
.side-title {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px 2px;
  font: 700 11px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: #8fa0c4;
}
.side-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #2b3550, transparent); }

/* tools: wide keys, blue lamp top-right */
.tool-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
.tool { display: flex; align-items: flex-start; gap: 14px; padding: 13px 34px 14px 14px; border-radius: 9px; }
.tool::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0ecff, #8ab4ff 55%, #4b7fd8);
  box-shadow: 0 0 6px 2px rgba(138, 180, 255, .7), 0 0 14px 3px rgba(138, 180, 255, .3);
}
.tool svg { width: 24px; height: 24px; flex: none; margin-top: 1px; color: #9fb4e6; }
.tool-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font: 700 12px/1.35 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.tool-name svg { width: 12px; height: 12px; margin: 0; color: #7f8fb2; }
.tool-desc { display: block; margin-top: 5px; font-size: 12.5px; line-height: 1.4; color: #93a1c4; }
.tool-badge {
  display: inline-block; margin-top: 5px; padding: 1px 7px; border: 1px solid rgba(255, 196, 107, .55); border-radius: 3px;
  background: rgba(255, 196, 107, .08); font: 700 10px/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #ffc46b;
}
.wip-tool::after {
  background: radial-gradient(circle at 35% 30%, #fff0d0, #ffc46b 55%, #d98a14);
  box-shadow: 0 0 6px 2px rgba(255, 196, 107, .7), 0 0 14px 3px rgba(255, 196, 107, .3);
}

/* latest story: a lit display key, green lamp */
.latest {
  --cap-top: #1f3d4c; --cap-mid: #143040; --cap-bot: #0f2230;
  display: flex; flex-direction: column; gap: 4px; margin: 2px 0 10px; padding: 13px 34px 14px 16px; border-radius: 9px;
}
.latest::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d3ffe4, #47e690 55%, #1fa860);
  box-shadow: 0 0 6px 2px rgba(71, 230, 144, .7), 0 0 14px 3px rgba(71, 230, 144, .3);
}
.latest.active { box-shadow: var(--cap-shadow), 0 0 18px rgba(71, 230, 144, .3); }
.latest-label { font: 700 10.5px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #7fe3b0; }
.latest-title { font-family: var(--reading-font); font-size: 19px; font-weight: 700; line-height: 1.3; }
.latest-meta { font-size: 12.5px; line-height: 1.4; color: #93a9b8; }
.latest-meta:empty { display: none; }

/* ── middle: the site (editorial, book-like) ── */
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page { padding: 44px 32px 72px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.page-title { font-family: Georgia, "Times New Roman", serif; }
.entry h2, .story h1, .ch-main strong, .doc-sub, .featured-title { font-family: var(--reading-font); }
.page-title { font-size: 34px; line-height: 1.15; font-weight: 700; }
.page-sub { margin: 6px 0 28px; color: var(--dim); }
.more { color: var(--accent); font-size: 14px; }
.text-link { color: var(--accent); }
.text-link:hover { text-decoration: underline; }
.empty-note { padding: 32px 0; color: var(--dim); }
.not-found { padding: 48px 32px; color: var(--dim); }

.back-link { display: inline-block; font-size: 14px; color: var(--dim); }
.back-link:hover { color: var(--text); }
.page > .back-link { margin-bottom: 20px; }
.reader-bar { padding: 22px 32px 0; }

/* category filters + tags */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.chip {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; color: #c5c9cc;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: #536471; }
.chip.active { border-color: var(--accent); color: var(--accent); background: rgba(138, 180, 255, .08); }
.chip small { margin-left: 4px; color: var(--dim); font-size: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { padding: 2px 9px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; color: var(--dim); }
a.tag:hover { border-color: var(--accent); color: var(--accent); }

/* lists of articles / stories */
.section-h { margin: 34px 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.section-h:first-child { margin-top: 0; }
.entry { display: flex; flex-direction: column; gap: 4px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.section-h + .entry, #article-list .entry:first-child { border-top: 1px solid var(--line); }
.entry h2 { font-size: 27px; font-weight: 700; line-height: 1.25; transition: color .15s; }
.entry:hover h2 { color: var(--accent); }
.entry-kicker { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.entry-sub { font-family: var(--reading-font); font-size: 17px; font-style: italic; color: #b7bcc0; }
.entry-meta { font-size: 13px; color: var(--dim); }
.entry p { margin-top: 4px; color: #c5c9cc; max-width: 36em; }
.entry .more { margin-top: 6px; }

/* series page + chapter lists */
.series-eyebrow { margin-bottom: 6px; }
.chapters { list-style: none; margin-top: 22px; border-top: 1px solid var(--line); }
.chapters li { border-bottom: 1px solid var(--line); }
.chapters a { display: flex; align-items: baseline; gap: 16px; padding: 14px 6px; transition: background .15s; }
.chapters a:hover { background: rgba(255, 255, 255, .03); }
.ch-num { flex: none; width: 1.5em; font-family: Georgia, serif; font-size: 22px; color: var(--dim); text-align: center; }
.ch-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-main strong { font-size: 18px; font-weight: 700; line-height: 1.3; }
.ch-main span { font-size: 13px; color: var(--dim); }
.chapters.compact { margin-top: 18px; }
.chapters.compact .ch-num { font-size: 16px; }
.chapters.compact .ch-main strong { font-size: 16px; }
.chapters li.current { background: rgba(138, 180, 255, .08); }
.chapters li.current .ch-num, .chapters li.current strong { color: var(--accent); }

/* keycap-style buttons (same family as the top bar) */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager-btn {
  display: flex; flex-direction: column; gap: 5px; padding: 12px 16px 13px; margin-bottom: 4px;
  border: 1px solid #06080e; border-radius: 7px; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text);
  background: linear-gradient(180deg, #3d4760, #262e42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 0 #080b12, 0 6px 9px rgba(0, 0, 0, .5);
  transition: transform .06s ease-out, box-shadow .06s ease-out, filter .15s;
}
.pager-btn small { font: 700 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #93a1c4; }
.pager-btn.next { text-align: right; align-items: flex-end; }
a.pager-btn:hover { filter: brightness(1.16); }
a.pager-btn:active { transform: translateY(3px); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5), 0 1px 0 #080b12; }
.pager-btn.off { opacity: .45; box-shadow: none; transform: translateY(3px); }
.pager-btn.start { display: inline-flex; margin-top: 4px; }

/* the block at the bottom of a chapter */
.series-nav { margin-top: 56px; padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 8px; background: rgba(22, 24, 28, .6); }
.series-progress { margin: 4px 0 18px; font-size: 14px; color: var(--dim); }
.series-nav .back-link { margin-top: 16px; }

/* reader */
.story { padding: 12px 32px 72px; }
.story h1 { font-size: 40px; line-height: 1.15; font-weight: 700; }
.story .story-meta { margin: 8px 0 20px; font-size: 14px; color: var(--dim); }
.doc-kicker { display: block; margin-bottom: 10px; }
.doc-kicker:hover { text-decoration: underline; }
.doc-sub { margin-top: 6px; font-size: 22px; font-style: italic; color: #b7bcc0; }
.doc-tags { margin: 0 0 28px; }
.doc-source { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.doc-source + .doc-source { margin-top: 8px; padding-top: 0; border-top: 0; }
.link-button { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.link-button:disabled { opacity: .6; cursor: progress; }

/* the Articles page's pointer to accordingtoknowledge.com */
.atk-callout {
  display: grid; gap: 4px; margin: -10px 0 24px; padding: 14px 18px; border: 1px solid var(--line); border-left: 3px solid #e0bf65;
  border-radius: 12px; background: linear-gradient(90deg, rgba(224, 191, 101, .1), transparent 70%); transition: background .15s;
}
.atk-callout:hover { background: linear-gradient(90deg, rgba(224, 191, 101, .18), transparent 80%); }
.atk-callout strong { color: #e9cb77; font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.atk-callout span { color: var(--dim); font-size: 14px; }

/* contact */
/* a label column wide enough for a long label to wrap onto a couple of comfortable lines,
   then the link; on phones the label sits above its link */
.contact-list { list-style: none; border-top: 1px solid var(--line); }
.contact-list li {
  display: grid; grid-template-columns: minmax(9.5rem, 36%) minmax(0, 1fr); column-gap: 28px; align-items: center;
  padding: 20px 6px; border-bottom: 1px solid var(--line); font-size: 17px; line-height: 1.4;
}
.contact-label { font: 700 11px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); text-wrap: balance; }
.contact-list .text-link { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .contact-list li { grid-template-columns: 1fr; row-gap: 6px; padding: 16px 4px; }
}

/* ── right: article highlights (spaceship panel) ── */
.search {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px;
  border: 1px solid #000; border-radius: 8px;
  background: linear-gradient(180deg, #05070c, #0a0d15);
  box-shadow: inset 0 3px 9px rgba(0, 0, 0, .95), 0 1px 0 rgba(255, 255, 255, .09);
}
.search:focus-within { box-shadow: inset 0 3px 9px rgba(0, 0, 0, .95), 0 0 0 1px var(--accent), 0 0 14px rgba(138, 180, 255, .25); }
.search svg { width: 17px; height: 17px; color: #6f7fa3; flex: none; }
.search:focus-within svg { color: var(--accent); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 13px var(--mono); letter-spacing: .04em; }
.search input::placeholder { color: #55617f; }

/* engraved plate that holds a group of keys */
.card {
  border: 1px solid #04060b; border-radius: 9px; padding-bottom: 12px;
  background: var(--rivets), linear-gradient(180deg, #090c14, #0f131e);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .85), 0 1px 0 rgba(255, 255, 255, .08);
}
.card h2 { padding: 16px 20px 12px; font: 700 11px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: #8fa0c4; }

/* article highlights: slab keys with a lit bar on the left edge */
#post-list { display: flex; flex-direction: column; gap: 12px; padding: 2px 14px 6px; }
a.post-card { display: block; padding: 11px 14px 12px 24px; border-radius: 8px; }
a.post-card::before {
  content: ""; position: absolute; left: 9px; top: 11px; bottom: 11px; width: 4px; border-radius: 2px;
  background: #8ab4ff; box-shadow: 0 0 8px rgba(138, 180, 255, .8);
}
.post-card .kicker { display: flex; flex-wrap: wrap; gap: 4px 8px; font: 600 10.5px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #93a1c4; }
.post-card .kicker b { color: #a9c6ff; font-weight: 700; }
.post-card .title { margin-top: 4px; font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.empty { padding: 4px 20px 8px; color: var(--dim); }

/* work-in-progress notice: a hazard plate */
.wip { padding: 18px 20px 20px; border-style: dashed; border-color: rgba(255, 196, 107, .5); }
.wip-badge {
  display: inline-block; padding: 2px 8px; border: 1px solid rgba(255, 196, 107, .5); border-radius: 4px;
  font: 700 11px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #ffc46b;
}
.wip h2 { padding: 10px 0 6px; font: 700 19px/1.25 var(--font); letter-spacing: 0; text-transform: none; color: var(--text); }
.wip p:not(.wip-badge) { font-size: 14px; color: #c5c9cc; }
.wip-bar {
  height: 8px; margin-top: 14px; border-radius: 2px; opacity: .7;
  background: repeating-linear-gradient(-45deg, rgba(255, 196, 107, .6) 0 8px, transparent 8px 16px);
}

.side-foot { padding: 4px 16px; color: var(--dim); font-size: 13px; }

@media (prefers-reduced-motion: no-preference) {
  .wip-tool::after { animation: lamp 2.4s ease-in-out infinite; }
  @keyframes lamp { 50% { opacity: .45; } }
}

/* ── gallery ── */
.tag-filters { margin-top: -12px; }
.tag-filters .chip { font-size: 12px; color: var(--dim); }
.tag-filters .chip.active { color: var(--accent); }
.gallery-grid { column-count: 3; column-gap: 12px; margin-top: 4px; }
.tile { position: relative; display: block; break-inside: avoid; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #0b0d10; }
.tile img { display: block; width: 100%; height: auto; transition: transform .3s ease, filter .2s; }
.tile:hover img { transform: scale(1.03); filter: brightness(1.1); }
.tile-cap {
  position: absolute; inset: auto 0 0 0; padding: 26px 10px 8px; font-size: 13px; font-weight: 600; line-height: 1.3;
  background: linear-gradient(transparent, rgba(0, 0, 0, .88)); opacity: 0; transition: opacity .2s;
}
.tile:hover .tile-cap, .tile:focus-visible .tile-cap { opacity: 1; }
@media (hover: none) { .tile-cap { opacity: 1; } }
@media (max-width: 560px) { .gallery-grid { column-count: 2; } }

.photo { padding: 12px 32px 72px; }
.photo-frame { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #0b0d10; }
.photo-frame img { display: block; width: 100%; height: auto; }
.photo h1 { margin-top: 22px; font-family: Georgia, "Times New Roman", serif; font-size: 30px; line-height: 1.2; font-weight: 700; }
.photo-caption { margin-top: 10px; max-width: 36em; font-size: 17px; line-height: 1.6; color: #c5c9cc; }
.photo-meta { margin: 20px 0 0; border-top: 1px solid var(--line); }
.photo-meta div { display: flex; gap: 16px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.photo-meta dt { flex: none; width: 5.5em; font: 700 11px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.photo-meta dd { margin: 0; }
.photo .doc-tags { margin: 18px 0 0; }
.photo .pager { margin-top: 32px; }
.ch-main em { font-family: var(--reading-font); font-size: 15px; color: #b7bcc0; }
@media (max-width: 480px) { .photo { padding: 12px 20px 64px; } }

/* ── reading a story/article: two panels ── */
body.reading .layout { grid-template-columns: minmax(0, 940px) minmax(250px, 310px); }
body.reading.hide-right .layout { grid-template-columns: minmax(220px, 260px) minmax(0, 940px); }
body.reading .story { padding-left: 56px; padding-right: 56px; }
body.reading .reader-bar { padding-left: 56px; }
@media (min-width: 901px) {
  body.reading.hide-left .side-left, body.reading.hide-right .side-right { display: none; }
}

/* ── home ── */
.home-about { max-width: 40em; }
.about-text { margin-top: 8px; font-family: var(--reading-font); font-size: 26px; line-height: 1.35; font-weight: 400; color: var(--text); }
.home-block { margin-top: 36px; }
.home-block > .eyebrow { display: block; margin-bottom: 12px; }
.featured {
  display: flex; flex-direction: column; gap: 6px; padding: 22px 24px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px;
  background: rgba(22, 24, 28, .6); transition: background .15s;
}
.featured:hover { background: rgba(138, 180, 255, .07); }
.featured-title { font-size: 30px; font-weight: 700; line-height: 1.2; }
/* article thumbnails (1200 x 630 pictures from the editor) */
.featured-thumb { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.entry.has-thumb { display: grid; grid-template-columns: minmax(0, 1fr) 190px; column-gap: 20px; align-items: start; }
.entry.has-thumb > * { grid-column: 1; }
.entry.has-thumb > .entry-thumb { grid-column: 2; grid-row: 1 / span 8; width: 190px; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 8px; margin-top: 6px; }
@media (max-width: 560px) {
  .entry.has-thumb { display: flex; }
  .entry.has-thumb > .entry-thumb { width: 100%; order: -1; margin: 0 0 8px; }
}
.featured-summary { color: #c5c9cc; }
.featured .entry-sub:empty, .featured .tags:empty, .featured-summary:empty { display: none; }

.gallery-key {
  display: flex; align-items: center; gap: 18px; margin-top: 36px; padding: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(22, 24, 28, .6);
  transition: background .15s, border-color .15s;
}
.gallery-key:hover { border-color: #536471; background: rgba(138, 180, 255, .06); }
.gallery-key:not(.has-image) { padding: 22px 24px; }
.gallery-key img { flex: none; width: 132px; height: 132px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #0b0d10; }
.gallery-key-label { display: flex; flex-direction: column; gap: 4px; padding-right: 12px; }
.gallery-key-label strong { font-family: Georgia, "Times New Roman", serif; font-size: 26px; line-height: 1.15; }
.gallery-key-label small { font-size: 14px; color: var(--dim); }
.gallery-key-label::after { content: "Browse the gallery \2192"; margin-top: 6px; font-size: 14px; color: var(--accent); }

/* the ghost under the bottom-right corner of the home page: hidden until you hover the empty space,
   then the top of its head pokes up at a tilt (a link to #ghost, the "missing page") */
.ghost-peek { position: relative; display: block; width: 180px; height: 96px; margin: 24px 0 0 auto; overflow: hidden; outline: none; }
.ghost-peek img {
  position: absolute; left: 20px; top: 100%; width: 160px; height: auto;
  transform-origin: 40% 30%; transform: translateY(8px) rotate(0deg); opacity: 0;
  transition: transform .45s cubic-bezier(.3, 1.5, .5, 1), opacity .2s ease;
  pointer-events: none;
}
.ghost-peek:hover img, .ghost-peek:focus-visible img { transform: translateY(-58px) rotate(20deg); opacity: 1; }
@media (hover: none) { .ghost-peek { height: 64px; } }
@media (prefers-reduced-motion: reduce) { .ghost-peek img { transition: opacity .2s ease; } }
@media (max-width: 480px) {
  .gallery-key img { width: 96px; height: 96px; }
}

/* mobile bottom bar */
.bottom-bar { display: none; }

/* ── responsive ── */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(210px, 240px) minmax(0, 720px) minmax(240px, 280px); }
  body.reading .layout { grid-template-columns: minmax(0, 820px) minmax(260px, 300px); }
  body.reading.hide-right .layout { grid-template-columns: minmax(230px, 260px) minmax(0, 820px); }
  .side-right .side-inner { padding-left: 16px; }
}

@media (max-width: 1080px) {
  .plate.brand { display: none; }
  .console-inner { display: flex; justify-content: center; }
}

/* below this: one panel at a time, switched from the bottom bar */
@media (max-width: 900px) {
  :root { --console-h: 64px; }
  .layout { display: block; max-width: 640px; margin: 0 auto; padding-bottom: 84px; }
  .side { position: static; height: auto; overflow: visible; }
  .side-inner { padding: 12px 16px 24px; min-height: 0; background: rgba(0,0,0,.85); }
  .side-right .side-inner { padding-left: 16px; }
  .feed { border-inline: 1px solid var(--line); min-height: 0; }
  .side, .feed { display: none; }
  body[data-panel="left"]  .side-left,
  body[data-panel="right"] .side-right { display: block; }
  body[data-panel="mid"]   .feed { display: block; }
  .me-chip { display: none; }

  .console-inner { display: flex; justify-content: center; padding: 0 10px; gap: 0; }
  .plate { display: none; }
  .keys { flex: 1; gap: 8px; padding: 6px 8px; }
  .key { flex: 1; min-width: 0; height: 40px; gap: 8px; padding: 0 8px 0 12px; font-size: 11px; letter-spacing: .1em; }

  .bottom-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: 72px; gap: 10px; padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    display: flex; background: linear-gradient(180deg, #182033, #0d111b); border-top: 1px solid #000;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 -8px 24px rgba(0, 0, 0, .6);
  }
  .bottom-bar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; margin-bottom: 4px;
    border: 1px solid #06080e; border-radius: 8px; color: #93a1c4;
    background: linear-gradient(180deg, #3d4761 0%, #283047 48%, #1c2334 100%);
    box-shadow: var(--cap-shadow);
    font: 700 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
    transition: transform .06s ease-out, box-shadow .06s ease-out;
  }
  .bottom-bar button:active { transform: translateY(3px); box-shadow: var(--cap-pressed); }
  .bottom-bar svg { width: 20px; height: 20px; }
  body[data-panel="left"]  .bottom-bar [data-show="left"],
  body[data-panel="mid"]   .bottom-bar [data-show="mid"],
  body[data-panel="right"] .bottom-bar [data-show="right"] {
    color: #eaf3ff; transform: translateY(3px); box-shadow: var(--cap-pressed);
    background: linear-gradient(180deg, #25314f, #1b2543 60%, #16203a);
  }
}

@media (max-width: 480px) {
  .page { padding: 32px 20px 64px; }
  .reader-bar { padding: 16px 20px 0; }
  .story { padding: 12px 20px 64px; }
  .story h1 { font-size: 30px; }
  .not-found { padding: 40px 20px; }
  .pager { grid-template-columns: 1fr; }
  .pager-btn.next { text-align: left; align-items: flex-start; }
  .key .led { display: none; }
  .key { justify-content: center; padding: 0 2px; font-size: 9.5px; letter-spacing: .03em; }
  .keys { gap: 6px; padding: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  * { transition: none !important; }
}

.featured .entry-kicker:empty { display: none; }

/* gallery: groups inside groups */
.sub-filters { margin-top: -14px; align-items: center; }
.sub-filters .sub-label { margin-right: 4px; font: 700 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.sub-filters .chip { font-size: 12px; }
.chip.path { border-color: rgba(138, 180, 255, .45); color: var(--accent); }

/* "Why am I not…" (no tab until SITE.whyNotTab) */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wn-pick { display: block; margin: 0 0 8px; }
.wn-pick select {
  width: 100%; max-width: 30em; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: #0b0d10; color: var(--text); font: inherit; font-size: 16px;
}
.wn-pick select option, .wn-pick select optgroup { background: #0b0d10; color: var(--text); }
.wn-pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wn-detail { margin-top: 30px; }
.wn-name { font-family: var(--reading-font); font-size: 32px; line-height: 1.2; font-weight: 700; }
.wn-detail .tags { margin: 8px 0 18px; }
.wn-from { margin: 28px 0 8px; font: 700 11px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.wn-text { max-width: 36em; font-family: var(--reading-font); font-size: 19px; line-height: 1.7; }
.wn-text p + p { margin-top: 1em; }
.wn-text a { color: var(--accent); text-decoration: underline; }

/* home: a real 73-frame walk cycle (assets/goat.png, 480×165 per frame) prances across
   "About me" when you hover, then goes again. He's drawn facing left, so he enters from
   offscreen right, crosses, and exits offscreen left (.goat-lane clips him once he's past
   the edge) before resetting. Two layers: .goat-walk glides right→left (a couple of smooth,
   eased stops, both `left` and `opacity` transitioned so leaving the panel mid-walk eases
   away instead of popping back into view); the inner .goat steps through the frame strip
   with `steps()` so the legs actually cycle, plus a small continuous hop for a skipping
   feel — both only matter while he's on-screen walking; frames hold on 0 while offscreen,
   rather than fighting the glide for one jerky keyframe list. */
.home-about { position: relative; }
.goat-lane {
  --goat-w: 130px; --goat-h: 44px; --goat-frames: 73; --goat-hop: 8px; --goat-fade: 22px;
  position: relative; height: calc(var(--goat-h) + var(--goat-hop)); margin-top: -15px; opacity: 0;
  overflow: hidden; pointer-events: none; transition: opacity .2s ease;
  /* fade at the edges instead of a hard clip, so he doesn't look chopped off as he enters/exits */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--goat-fade), #000 calc(100% - var(--goat-fade)), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 var(--goat-fade), #000 calc(100% - var(--goat-fade)), transparent 100%);
}
.home-about:hover .goat-lane, .home-about:focus-within .goat-lane { opacity: 1; }
.goat-walk {
  position: absolute; left: 0; bottom: 0; width: var(--goat-w); height: var(--goat-h);
  transition: left .2s ease, opacity .2s ease;   /* eases back to rest if you stop hovering mid-walk */
}
.home-about:hover .goat-walk, .home-about:focus-within .goat-walk { animation: goat-walk 11s ease-in-out infinite; }
@keyframes goat-walk {
  0%    { left: 100%;                     opacity: 1; }   /* enters from offscreen right */
  45%   { left: calc(-1 * var(--goat-w)); opacity: 1; }   /* exits fully offscreen left */
  45.3% { left: calc(-1 * var(--goat-w)); opacity: 0; }   /* stay hidden while he's "gone" */
  92%   { left: calc(-1 * var(--goat-w)); opacity: 0; }
  92.3% { left: 100%;                     opacity: 0; }   /* reset instantly while invisible */
  93%   { left: 100%;                     opacity: 1; }   /* ready to enter again */
  100%  { left: 100%;                     opacity: 1; }
}
.goat {
  position: absolute; left: 0; bottom: 0; width: var(--goat-w); height: var(--goat-h);
  background: url("assets/goat.png") repeat-x left bottom;
  background-size: calc(var(--goat-w) * var(--goat-frames)) var(--goat-h);
}
.home-about:hover .goat, .home-about:focus-within .goat { animation: goat-step 11s infinite, goat-hop .35s ease-in-out infinite; }
/* the legs cycle through the 73-frame walk 3 times per crossing (not once) — one pass looked
   like smooth sliding with moving legs; repeating the stride several times over the same
   distance/time reads as actual little jumps instead. background-repeat lets the strip
   wrap seamlessly frame 72 -> 0 each lap. */
@keyframes goat-step {
  0%    { background-position-x: 0;                                        animation-timing-function: steps(216); }   /* 72 steps/lap × 3 laps */
  45%   { background-position-x: calc(var(--goat-w) * (1 - var(--goat-frames)) * 3); }
  45.01%{ background-position-x: 0; }                                       /* rest on frame 0 while offscreen */
  100%  { background-position-x: 0; }
}
@keyframes goat-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(-1 * var(--goat-hop))); } }
@media (max-width: 560px) {
  .goat-lane { --goat-w: 88px; --goat-h: 30px; --goat-hop: 5px; --goat-fade: 14px; margin-top: -10px; }
}
@media (prefers-reduced-motion: reduce) {
  .goat-lane { opacity: 1; }
  .goat-walk, .goat { left: 0; background-position-x: 0; transform: none; }
  .home-about:hover .goat-walk, .home-about:focus-within .goat-walk,
  .home-about:hover .goat, .home-about:focus-within .goat { animation: none; }
}

/* a ghost with a guitar shows up wherever a page or item genuinely doesn't exist.
   On the full "page doesn't exist" screen it's big, and clicking it leads to #secret. */
.not-found { display: flex; align-items: center; gap: 28px; }
.err-ghost-link { flex: none; display: block; border-radius: 12px; transition: transform .15s ease, filter .15s ease; }
.err-ghost-link:hover, .err-ghost-link:focus-visible { transform: scale(1.04); filter: brightness(1.12); }
.err-ghost-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.err-ghost { display: block; width: 260px; max-width: 46vw; height: auto; image-rendering: auto; }
.empty-note.with-ghost { display: flex; align-items: center; gap: 16px; padding: 26px 0; }
.empty-note.with-ghost .err-ghost { width: 64px; max-width: none; }
.secret .page-sub { margin-bottom: 26px; }

/* secret page: activities (games etc.) */
.activity { margin-bottom: 36px; }
.activity-head { display: flex; align-items: center; gap: 12px; }
.activity-head h2 { font: 700 22px/1.2 var(--reading-font); }
.activity-sub { margin: 4px 0 14px; color: #c5c9cc; }
.game-frame {
  display: block; width: 100%; aspect-ratio: 16 / 10; max-height: 78vh; min-height: 300px;
  border: 1px solid var(--line); border-radius: 8px; background: #03050b;
}
.activity-note { margin-top: 8px; font-size: 13px; color: var(--dim); }
@media (max-width: 700px) { .game-frame { aspect-ratio: 3 / 4; max-height: 72vh; } }
/* the page puts the game in full screen (so it can lock the Esc key for it) */
.game-frame:fullscreen { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; border: 0; border-radius: 0; }
@media (max-width: 560px) {
  .not-found { flex-direction: column; text-align: center; gap: 10px; }
  .err-ghost { width: 200px; max-width: 70vw; }
  .empty-note.with-ghost { flex-direction: column; text-align: center; }
}
