:root {
  --bg: #0E1111;
  --surface: #161A1A;
  --ph: #1A1F1F;
  --line: #2A3030;
  --line-2: #3A4242;
  --text: #E8E6E1;
  --text-2: #C9CCC8;
  --text-3: #B8BCB8;
  --muted: #9AA09C;
  --accent: #7FD68A;
  --warn: #E0B15C;
  --danger: #F08A7E;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; display: block; }
h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 16px; }
h2 { font-size: clamp(26px, 3.5vw, 34px); font-weight: 600; margin: 0 0 20px; line-height: 1.15; }
h3 { font-size: 21px; font-weight: 600; margin: 0; line-height: 1.25; }
p { margin: 0 0 12px; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--surface); padding: 1px 6px; }

.wrap { max-width: 1280px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
@media (max-width: 640px) { .wrap { padding-left: 16px; padding-right: 16px; } }
.section { padding-top: 96px; }
.section-top { padding-top: 64px; padding-bottom: 96px; }
.narrow { max-width: 720px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-xl { display: flex; flex-direction: column; gap: 80px; }
.mt { margin-top: 24px; }
.grow { flex-grow: 1; }

.mono { font-family: var(--mono); }
.small { font-size: 13px; }
.small-text { font-size: 15px; }
.dim { color: var(--muted); }
.dim-2 { color: var(--text-3); }
.accent { color: var(--accent); }
.warn { color: var(--warn); }
.error, .error-text { color: var(--danger); }
.error { border: 1px solid var(--danger); padding: 10px 14px; }
.notice { border: 1px solid var(--line-2); background: var(--surface); padding: 12px 16px; }
.prompt { font-family: var(--mono); font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.lede { font-size: 19px; color: var(--text-2); max-width: 720px; }
.lede.big { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.35; max-width: 780px; }
.display { font-size: clamp(48px, 9vw, 76px); line-height: 1.02; }
.ico { display: inline-block; vertical-align: -2px; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--line); }
.nav { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { font-family: var(--mono); font-size: 15px; font-weight: 500; padding: 12px 0; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0 26px; font-size: 15px; align-items: center; }
.nav-links a { padding: 12px 0; border-bottom: 2px solid transparent; }
.nav-links a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); margin-top: 32px; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; align-items: center; padding-top: 16px; padding-bottom: 16px; font-size: 13px; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot-links a { padding: 12px 0; }

/* buttons */
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; text-align: center; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); color: var(--bg); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.linkish { background: none; border: 0; padding: 10px 4px; color: var(--muted); font: inherit; cursor: pointer; }
.linkish:hover { color: var(--accent); }
.push-right { margin-left: auto; }
.inline-form { display: inline; margin: 0; }

/* placeholders and imagery */
.ph { background: var(--ph); border: 1px dashed var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--mono); font-size: 12px; text-align: center; padding: 12px; }
.hero { padding-top: 72px; padding-bottom: 40px; }
.hero-fig { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hero-img { width: 100%; height: clamp(300px, 52vw, 640px); object-fit: cover; }
.cap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 20px; }
.sec-head h1, .sec-head h2 { margin: 0; }
.sec-head > a { padding: 12px 0; font-size: 15px; }

.cards-3 { display: flex; flex-wrap: wrap; gap: 24px; }
.cards-3 > * { flex: 1 1 300px; }
.cards-2 { display: flex; flex-wrap: wrap; gap: 24px; }
.cards-2 > * { flex: 1 1 360px; }
.thread { display: flex; flex-direction: column; gap: 12px; }
.thread-img { width: 100%; height: 240px; object-fit: cover; }
.thread .small { margin: 4px 0 0; }
.term { height: 240px; background: var(--surface); border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; line-height: 1.9; padding: 22px; color: var(--text-2); overflow: hidden; }

.panel { padding: 32px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.panel .btn { margin-top: 8px; }
.panel-title { font-size: 21px; font-weight: 500; margin: 0; }
.row-panel { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 28px; background: var(--surface); margin-top: 48px; }
.row-panel p { margin: 0; }
.box { border: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.box.stack { gap: 12px; }

/* rows (journal, timeline) */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows > li { border-bottom: 1px solid var(--line); }
.row { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 22px 0; align-items: baseline; }
.row-date { width: 120px; font-size: 13px; }
.row-date.wide { width: 150px; }
.row-tag { width: 110px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.row-main { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.row-title { font-size: 19px; font-weight: 500; }
.row-ex { font-size: 15px; color: var(--text-3); }

/* tabs / chips */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin: 24px 0 16px; }
.tabs.flat { border: 0; padding: 0; margin: 0; }
.tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.tab.mono { font-family: var(--mono); font-size: 13px; }
.tab.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--mono); font-size: 13px; padding: 10px 14px; border: 1px solid var(--line); color: var(--text-2); background: transparent; }
button.chip { cursor: pointer; min-height: 44px; }
.chip.on { border-color: var(--accent); color: var(--accent); }

/* work grid */
.masonry { columns: 3 340px; column-gap: 20px; }
.m-item { margin: 0 0 20px; break-inside: avoid; display: flex; flex-direction: column; gap: 8px; }
.m-item img { width: 100%; height: auto; background: var(--ph); }
.m-item figcaption { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }

/* systems */
.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.split-main { flex: 999 1 560px; min-width: 0; }
.split-side { flex: 1 1 300px; }
.split-side.box span { font-size: 15px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid-auto.wide { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; }
.repo { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--surface); min-height: 150px; }
.talk { display: flex; flex-direction: column; gap: 6px; padding: 22px; border: 1px solid var(--line); }
.talk-title { font-size: 19px; font-weight: 500; }

/* forms */
.form { display: flex; flex-direction: column; gap: 10px; }
label { font-size: 14px; color: var(--text-2); }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line-2); color: var(--text); font: inherit; font-size: 16px; border-radius: 0; }
textarea { min-height: 120px; resize: vertical; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
input[type="file"] { padding: 10px; }
.check { display: inline-flex; gap: 10px; align-items: center; min-height: 44px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.unlock { max-width: 480px; }
.unlock .btn, .form .btn { align-self: flex-start; }
.input-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.input-row input { flex: 1 1 200px; width: auto; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.fields-2, .fields-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.fields-2 > div, .fields-3 > div { display: flex; flex-direction: column; gap: 8px; }
fieldset.box { margin: 12px 0 0; }
legend { padding: 0 6px; }
.mono-area { font-family: var(--mono); font-size: 14px; line-height: 1.6; }
.file-btn { position: relative; }

/* post */
.post { max-width: 760px; margin: 0 auto; }
.post-head { margin-bottom: 32px; }
.post-cover { margin: 0 0 40px; }
.post-cover img { width: 100%; }
.prose { font-size: 18px; line-height: 1.7; color: var(--text-2); }
.prose h2, .prose h3, .prose h4, .prose h5 { color: var(--text); margin: 40px 0 14px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose figure { margin: 0 0 22px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose img { margin: 28px 0; width: 100%; }
.prose figure img { margin: 0 0 8px; }
.prose figcaption { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.prose blockquote { border-left: 2px solid var(--accent); padding-left: 18px; color: var(--text); }
.prose pre { background: var(--surface); padding: 18px; overflow-x: auto; font-size: 14px; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.post-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; gap: 20px; }

/* gallery */
.g-cover { position: relative; height: clamp(280px, 40vw, 440px); background: var(--ph); overflow: hidden; }
.g-cover-img { width: 100%; height: 100%; object-fit: cover; }
.g-cover-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px; background: linear-gradient(to top, rgba(14,17,17,0.92), rgba(14,17,17,0)); }
.g-cover-text h1 { font-size: clamp(30px, 5vw, 48px); margin: 0 0 6px; }
.g-cover-text p { margin: 0; color: var(--text-2); }
.g-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); margin: 16px 0 20px; }
.g-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.g-item { margin: 0; position: relative; }
.g-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--ph); }
.g-item.hidden { display: none; }
.g-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: rgba(14,17,17,0.85); border: 0; color: var(--text); cursor: pointer; }
.icon-btn.fav svg { fill: none; }
.icon-btn.fav[aria-pressed="true"] { color: var(--accent); }
.icon-btn.fav[aria-pressed="true"] svg { fill: currentColor; }

/* store */
.preview-bar { background: var(--warn); color: var(--bg); font-family: var(--mono); font-size: 13px; text-align: center; padding: 10px 16px; }
.preview-bar a { color: var(--bg); text-decoration: underline; }
.product { display: flex; flex-direction: column; gap: 12px; }
.product-img { width: 100%; height: 260px; object-fit: cover; }
.product-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.product .btn { align-self: stretch; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(8,10,10,0.96); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 56px 16px 24px; z-index: 50; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; }
.lightbox p { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 0; }
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next { position: absolute; min-width: 48px; min-height: 48px; background: transparent; border: 1px solid var(--line-2); color: var(--text); font: 500 15px var(--mono); cursor: pointer; }
.lightbox .lb-close { top: 12px; right: 12px; }
.lightbox .lb-prev { left: 12px; top: 50%; }
.lightbox .lb-next { right: 12px; top: 50%; }

/* admin */
.admin-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 24px; }
.admin-top-r { display: flex; gap: 16px; align-items: center; }
.admin-wrap { display: flex; flex-wrap: wrap; }
.admin-nav { flex: 1 1 220px; max-width: 100%; padding: 20px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { min-height: 44px; display: flex; align-items: center; padding: 0 14px; }
.admin-nav a[aria-current="page"] { background: #1F2626; color: var(--accent); }
.admin-main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 800px) { .admin-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); } .admin-main { padding: 20px 16px; } }
.admin h1 { font-size: 32px; margin: 0; }
.admin h2 { font-size: 22px; margin: 16px 0 0; }
.admin-form { max-width: 960px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.stat-n { font-size: 30px; font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 600px; }
.table th { text-align: left; font: 500 12px var(--mono); color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); text-transform: uppercase; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.admin-grid.small { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.admin-card { background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.admin-card img, .admin-card .ph { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.admin-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.admin-card input, .admin-card select { min-height: 40px; padding: 6px 10px; font-size: 14px; }
.admin-card.is-cover { outline: 2px solid var(--accent); }
.link-card { color: var(--text); }
.sort { display: flex !important; flex-direction: row !important; align-items: center; gap: 6px !important; }
.sort input { width: 70px; }
.admin-thumb { max-width: 320px; }
.danger-zone { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .bar { height: 6px; background: var(--line); position: relative; }
.progress .bar::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--accent); }
.msg.unread { border-color: var(--accent); }
.pre { white-space: pre-wrap; color: var(--text-2); margin: 0; }

/* error pages: digital rain behind */
#rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0; transition: opacity 1.2s; pointer-events: none; }
#rain.on { opacity: 0.55; }
.rain-page { background: #000; }
.rain-page .site-header, .rain-page main { position: relative; z-index: 1; }
.rain-page .site-header { background: rgba(14,17,17,0.85); }
.err-box { margin-top: 12vh; margin-bottom: 12vh; padding: 40px; background: rgba(10,13,13,0.88); border: 1px solid var(--line); backdrop-filter: blur(3px); }
.err-box h1 { font-size: clamp(64px, 12vw, 120px); margin: 8px 0; color: var(--accent); }
.err-out { color: var(--danger); font-size: 14px; margin: 0; }
@media (max-width: 640px) { .err-box { padding: 24px 16px; margin-top: 6vh; } }
@media (prefers-reduced-motion: reduce) { #rain { transition: none; } }

/* turnstile */
.cf-turnstile { min-height: 65px; margin: 6px 0; }

.btn.pill-blue { border-color: #6FA8FF; color: #CFE0FF; }
.btn.pill-blue:hover { background: #6FA8FF; color: #0E1111; }
.btn.pill-red { border-color: #F08A7E; color: #FFD6D0; }
.btn.pill-red:hover { background: #F08A7E; color: #0E1111; }

/* bulk actions */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bulk-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); }
.bulk-bar select { width: auto; min-height: 44px; padding: 6px 10px; font-size: 14px; }
.bulk-pick { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; }
.col-pick { width: 44px; }
.pick-corner { display: flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 32px; cursor: pointer; }
.pick-inline { display: inline-flex; vertical-align: middle; margin-right: 6px; }
.admin-card.picked, .msg.picked { outline: 2px solid var(--accent); outline-offset: -2px; }
tr.picked td { background: rgba(127, 214, 138, 0.09); }
.sec-head > a.btn { padding: 0 22px; flex: none; }
.danger-text { color: var(--danger); }
input.num { width: 80px; }
details > summary { cursor: pointer; padding: 6px 0; }
