/* Poetterns site: shared look. Colors follow the system unless the switch picks light or dark. */
[hidden] { display: none !important; }
/* Fonts (self-hosted): Special Elite for the name and headings, Courier Prime for text */
@font-face { font-family:"Special Elite"; src:url(/assets/fonts/SpecialElite-Regular.woff2) format("woff2"); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:"Courier Prime"; src:url(/assets/fonts/CourierPrime-Regular.woff2) format("woff2"); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:"Courier Prime"; src:url(/assets/fonts/CourierPrime-Bold.woff2) format("woff2"); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:"Courier Prime"; src:url(/assets/fonts/CourierPrime-Italic.woff2) format("woff2"); font-weight:400; font-style:italic; font-display:swap; }
@font-face { font-family:"Courier Prime"; src:url(/assets/fonts/CourierPrime-BoldItalic.woff2) format("woff2"); font-weight:700; font-style:italic; font-display:swap; }
@font-face { font-family:"Walter Turncoat"; src:url(/assets/fonts/WalterTurncoat-Regular.woff2) format("woff2"); font-weight:400; font-style:normal; font-display:block; }
@font-face { font-family:"Edu SA Beginner"; src:url(/assets/fonts/EduSABeginner.woff2) format("woff2"); font-weight:400 700; font-style:normal; font-display:block; }
@font-face { font-family:"Chainprinter"; src:url(/assets/fonts/Chainprinter.woff2) format("woff2"); font-weight:400; font-style:normal; font-display:swap; }
:root {
  --bg:#faf8f4; --fg:#1d1b18; --muted:#6b655c; --card:#ffffff; --line:#e6e1d8; --accent:#8a5a2b; --bad:#b3261e; --chip:#f1ece3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#141311; --fg:#f1ede6; --muted:#a29a8e; --card:#1e1c19; --line:#34302a; --accent:#d9a066; --bad:#f2b8b5; --chip:#2a2723;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:#141311; --fg:#f1ede6; --muted:#a29a8e; --card:#1e1c19; --line:#34302a; --accent:#d9a066; --bad:#f2b8b5; --chip:#2a2723;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:16px/1.5 "Courier Prime", "Courier New", monospace; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display:flex; align-items:center; gap:8px; height:64px; }
.brand { font: 400 28px/1 "Special Elite", "Courier New", monospace; color: var(--fg); text-decoration: none; margin-right: auto; }
.btn { font: inherit; font-size: 14px; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }

/* Light / dark switch: drawn sun, filled moon; the one in use is in the accent color */
.theme { display:inline-flex; border:1px solid var(--line); border-radius:999px; padding:3px; }
.theme button { display:grid; place-items:center; width:44px; height:36px; border:0; border-radius:999px; background:transparent; color:var(--muted); opacity:.75; cursor:pointer; }
.theme button:hover { opacity:1; }
.theme button[aria-pressed="true"] { background: var(--chip); color: var(--accent); opacity:1; }
.icon-btn { display:inline-grid; place-items:center; width:44px; height:44px; border-radius:999px; border:0; background:transparent; color:var(--muted); cursor:pointer; }
.icon-btn:hover { background: var(--chip); color: var(--fg); }
.offscreen { position:fixed !important; left:-10000px; top:-10000px; width:1px; height:1px; overflow:hidden; }

/* Content */
h1 { font: 400 34px/1.2 "Special Elite", "Courier New", monospace; margin: 28px 0 4px; }
h2 { font: 400 21px/1.3 "Special Elite", "Courier New", monospace; margin: 0 0 10px; }
.grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 16px 0; }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px; min-width:0; }
.stat { font: 700 30px/1.1 "Courier Prime", "Courier New", monospace; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 14px; }
table { width:100%; border-collapse:collapse; }
td { padding:6px 0; border-bottom:1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { text-align:right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
details { border-top: 1px solid var(--line); padding: 8px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; display:flex; justify-content: space-between; gap: 12px; list-style: none; }
summary::-webkit-details-marker { display:none; }
summary::after { content: "›"; color: var(--muted); transition: transform .15s; }
details[open] summary::after { transform: rotate(90deg); }
summary .count { margin-left:auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; max-height: 260px; overflow:auto; }
.chip { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 14px; }
.section { margin: 28px 0; }
.center { min-height: 60vh; display:grid; place-items:center; text-align:center; }
#apple-sign-in-button, #apple-sign-out-button { display:inline-block; }

/* Typewriter logo (assets/typing.js) */
.tw { position: relative; display: inline-block; white-space: nowrap; }
.tw-ghost { color: var(--fg); opacity: .12; }
.tw-ink { position: absolute; left: 0; top: 0; white-space: nowrap; }
.tw-key { display: inline-block; opacity: var(--ink); transform: translateY(var(--y)) rotate(var(--r)); animation: tw-strike .14s ease-out; }
@keyframes tw-strike { from { opacity: 0; transform: translateY(calc(var(--y) - 2px)) rotate(var(--r)) scale(1.08); } }
.tw-caret { display: inline-block; width: .5em; height: .08em; background: var(--accent); vertical-align: -0.12em; margin-left: 1px; animation: tw-blink 1s steps(1) infinite; }
.tw-caret.tw-done { animation: tw-out 2.4s steps(1) forwards; }
@keyframes tw-out { 0%,25%,50% { opacity: 1; } 12.5%,37.5%,62.5%,100% { opacity: 0; } }
@keyframes tw-blink { 50% { opacity: 0; } }
