:root {
  --bg: #07080a;
  --panel: rgba(14, 15, 19, 0.90);
  --panel-2: rgba(22, 18, 23, 0.80);
  --text: #d9cdd4;
  --muted: #897c84;
  --bright: #fff3f7;
  --line: #6f293b;
  --accent: #e65372;
  --accent-2: #8c2139;
  --shadow: rgba(230, 83, 114, 0.20);
  --font: "Sarasa Mono SC", "Noto Sans Mono CJK SC", "Microsoft YaHei UI", "Courier New", monospace;
}

:root[data-theme="teal"] {
  --bg: #050b0c;
  --panel: rgba(5, 20, 21, 0.90);
  --panel-2: rgba(10, 30, 29, 0.80);
  --text: #b7d6d2;
  --muted: #668d89;
  --bright: #e9fffb;
  --line: #286c68;
  --accent: #55c7bb;
  --accent-2: #174f4c;
  --shadow: rgba(85, 199, 187, 0.19);
}

:root[data-theme="amber"] {
  --bg: #0b0803;
  --panel: rgba(24, 14, 3, 0.90);
  --panel-2: rgba(37, 24, 7, 0.80);
  --text: #e4bd72;
  --muted: #9d6d2b;
  --bright: #ffe6ae;
  --line: #8d571e;
  --accent: #f0a83d;
  --accent-2: #6c3d11;
  --shadow: rgba(255, 178, 62, 0.19);
}

* { box-sizing: border-box; }
html {
  background: var(--bg);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-color: var(--accent-2) var(--bg);
  scrollbar-width: thin;
}
html::-webkit-scrollbar { width: 11px; height: 11px; background: var(--bg); }
html::-webkit-scrollbar-track { background: var(--bg); }
html::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg);
  background: var(--accent-2);
}
html::-webkit-scrollbar-thumb:hover { background: var(--accent); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 72% -12%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 30%),
    radial-gradient(circle at 14% 42%, rgba(37, 55, 62, .14), transparent 30%),
    linear-gradient(180deg, #0b0b0e 0%, var(--bg) 58%, #030304 100%);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0.025em;
  text-shadow: 0 0 7px var(--shadow);
  transition: background .28s ease, color .28s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 130px rgba(0,0,0,.86);
  z-index: 40;
}

a { color: inherit; }
button, input, textarea { font: inherit; }
button { color: inherit; }

.crt-overlay,
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.crt-overlay {
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(0,0,0,.16) 3px, rgba(0,0,0,.16) 4px);
  mix-blend-mode: multiply;
  opacity: .38;
}

.noise-overlay {
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 8vw;
  color: #f07a91;
  background: #030304;
  transition: opacity .35s ease, visibility .35s ease;
}
.boot-enabled .boot-screen { display: grid; }
.boot-screen.hidden { opacity: 0; visibility: hidden; }
.skip-boot .boot-screen { display: none; }
.boot-screen pre { width: min(760px, 100%); margin: 0; white-space: pre-wrap; line-height: 1.45; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: 78px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 7, .93);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  padding: 5px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  box-shadow: 0 0 18px var(--shadow), inset 0 0 16px var(--shadow);
  object-fit: contain;
  image-rendering: pixelated;
}
.brand strong { display: block; color: var(--bright); letter-spacing: .12em; }
.brand small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }

.nav { display: flex; gap: clamp(12px, 1.8vw, 25px); }
.nav a { position: relative; text-decoration: none; font-size: 11px; letter-spacing: .15em; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -7px; height: 1px; background: var(--accent); transition: right .2s ease; }
.nav a:hover::after, .nav a[aria-current="page"]::after { right: 0; }

.language-switch {
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(3, 38px);
  border: 1px solid var(--line);
  background: transparent;
}
.language-switch button {
  width: 38px;
  height: 34px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.language-switch button:last-child { border-right: 0; }
.language-switch button:hover { color: var(--bright); background: var(--panel-2); }
.language-switch button[aria-pressed="true"] {
  color: #16070b;
  background: var(--accent);
  text-shadow: none;
  box-shadow: 0 0 16px var(--shadow);
}

.ticker { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--accent); color: #12070a; text-shadow: none; white-space: nowrap; }
.ticker-track { display: flex; width: max-content; padding: 5px 0; animation: ticker var(--ticker-duration, 27s) linear infinite; font-size: 11px; font-weight: bold; will-change: transform; }
.ticker-track.is-measuring { animation: none; }
.ticker-group { display: flex; flex-shrink: 0; align-items: center; gap: 36px; padding-right: 36px; }
@keyframes ticker { to { transform: translate3d(var(--ticker-distance, -50%), 0, 0); } }

.layout,
.subpage-layout,
.logs-shell,
.log-detail-shell,
.vault-layout {
  width: min(1280px, calc(100% - 36px));
  margin: 34px auto 60px;
}

.layout {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 24px;
}
.subpage-layout .pixel-lab, .subpage-layout .archive { margin-top: 0; }

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--panel), var(--panel-2));
  box-shadow: 0 0 24px rgba(0,0,0,.28), inset 0 0 18px rgba(0,0,0,.18);
}

.sidebar { align-self: start; position: sticky; top: 112px; padding: 18px; }
.sidebar section + section { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--line); }
.panel-title { margin: 0 0 12px; color: var(--bright); font-size: 12px; letter-spacing: .16em; }
.panel-title::before { content: ":: "; color: var(--accent); }
.sys-stats { margin: 0; }
.sys-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.sys-stats div + div { margin-top: 5px; }
.sys-stats dt { min-width: 0; color: var(--muted); }
.sys-stats dd { flex-shrink: 0; margin: 0; color: var(--bright); text-align: right; white-space: nowrap; }
.tree { margin: 0; padding: 0; list-style: none; color: var(--muted); }
.tree li { margin: 4px 0; }
.tree .indent { padding-left: 18px; color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-filter { position: relative; cursor: pointer; }
.tag-filter input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tag-filter span { display: block; padding: 3px 7px; border: 1px solid var(--line); font-size: 11px; }
.tag-filter span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border: 1px solid var(--line); vertical-align: 1px; }
.tag-filter:hover span { color: var(--bright); background: var(--panel-2); }
.tag-filter input:focus-visible + span { outline: 1px solid var(--accent); outline-offset: 2px; }
.tag-filter input:checked + span { color: #15070b; background: var(--accent); text-shadow: none; box-shadow: 0 0 14px var(--shadow); }
.tag-filter input:checked + span::before { border-color: #15070b; background: #15070b; }
.tag-link { display: block; padding: 3px 7px; border: 1px solid var(--line); font-size: 11px; text-decoration: none; }
.tag-link:hover, .tag-link:focus-visible { color: var(--bright); border-color: var(--accent); outline: none; box-shadow: 0 0 12px var(--shadow); }
.decoration-section { min-width: 0; }
.decoration-monitor {
  position: relative;
  width: 100%;
  height: clamp(142px, 12vw, 164px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #030407;
  contain: paint;
}
.decoration-monitor::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, .16) 4px
  );
  opacity: .38;
  pointer-events: none;
}
.decoration-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: pointer;
  touch-action: manipulation;
}
.decoration-canvas:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -3px;
  box-shadow: inset 0 0 18px var(--shadow);
}
.button-link { display: block; width: 100%; margin-top: 8px; padding: 8px 10px; border: 0; background: transparent; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; }
.button-link:hover { color: var(--bright); background: rgba(255,255,255,.04); }

.quick-page-frame {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.quick-page-content { min-width: 0; }
.quick-rail {
  position: sticky;
  top: 112px;
  align-self: start;
  padding: 16px;
}
.quick-rail-section + .quick-rail-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.quick-nav-list { display: grid; gap: 2px; }
.quick-rail .button-link {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.quick-rail .button-link:focus-visible {
  color: var(--bright);
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  background: rgba(255,255,255,.04);
}
.quick-rail-link[aria-current="page"] {
  color: #16070b;
  background: var(--accent);
  text-shadow: none;
}
.quick-contact-open { color: var(--accent); }
.about-page > .quick-page-content { display: grid; gap: 24px; }

.content { min-width: 0; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.17fr .83fr;
  gap: 32px;
  align-items: center;
  height: 520px;
  min-height: 520px;
  padding: clamp(28px, 5vw, 62px);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -90px;
  width: 320px;
  height: 320px;
  border: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 50%;
  opacity: .25;
}
.hero-copy { position: relative; z-index: 2; display: flex; align-self: stretch; min-width: 0; flex-direction: column; justify-content: center; }
.hero-copy > .eyebrow { margin: 0 0 10px; }
.hero h1 {
  display: -webkit-box;
  width: min(100%, 6.2em);
  margin: 0 0 18px;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  color: var(--bright);
  font-size: 60px;
  line-height: 1.08;
  letter-spacing: 0;
}
.hero h1::first-line { color: var(--accent); }
.hero p { max-width: 680px; color: var(--muted); }
.hero-summary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.hero-actions a { padding: 7px 10px; border: 1px solid var(--line); color: var(--text); font-size: 11px; text-decoration: none; }
.hero-actions a:hover, .hero-actions a:focus-visible { color: var(--bright); border-color: var(--accent); outline: none; box-shadow: 0 0 12px var(--shadow); }
.eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.post-preview-wrap { position: relative; z-index: 2; justify-self: end; width: min(100%, 400px); border: 1px solid var(--line); background: #09090d; box-shadow: 14px 14px 0 rgba(0,0,0,.22), 0 0 26px var(--shadow); }
.post-preview-head { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 8px 5px 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.post-preview-status { display: flex; min-width: 54px; align-items: center; justify-content: flex-end; gap: 7px; }
.post-preview-status button { display: grid; width: 26px; height: 26px; padding: 0; place-items: center; border: 1px solid var(--line); color: var(--text); background: transparent; line-height: 1; cursor: pointer; }
.post-preview-status button:hover, .post-preview-status button:focus-visible { color: var(--bright); border-color: var(--accent); outline: none; box-shadow: 0 0 12px var(--shadow); }
.post-preview-status button[hidden] { display: none; }
.post-preview-stage {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  place-items: center;
  background-color: #090a0f;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(255,255,255,.018) 4px);
}
.post-preview-stage img { width: 100%; height: 100%; object-fit: contain; background: #090a0f; }
.post-preview-empty { margin: 0; padding: 24px; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-align: center; }

.home-latest-logs { margin-top: 38px; }
.home-log-list { display: grid; gap: 14px; }
.home-log-card { position: relative; display: block; min-width: 0; padding: clamp(20px, 3vw, 32px); color: var(--text); text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.home-log-card:hover, .home-log-card:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 24px var(--shadow), inset 0 0 18px rgba(0,0,0,.18); transform: translateY(-2px); }
.home-log-head { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.home-log-head > div { display: flex; min-width: 0; align-items: baseline; gap: 14px; }
.home-log-index { flex: 0 0 auto; color: var(--accent); }
.home-log-head h3 { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--bright); font-size: clamp(20px, 2.2vw, 29px); line-height: 1.25; }
.home-log-head time { flex: 0 0 auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.home-log-meta { margin: 13px 0 0; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.home-log-excerpt { display: -webkit-box; margin: 13px 0 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; color: var(--muted); }
.home-log-open { display: block; width: fit-content; margin-top: 17px; color: var(--accent); font-size: 10px; }

.home-about-strip { display: grid; grid-template-columns: minmax(150px, .42fr) minmax(0, 1.58fr); gap: 26px; margin-top: 38px; padding: clamp(22px, 3vw, 34px); }
.home-about-id { display: flex; min-width: 0; align-items: center; justify-content: center; flex-direction: column; border-right: 1px dashed var(--line); text-align: center; }
.home-about-id h2 { margin: 2px 0 7px; overflow-wrap: anywhere; color: var(--bright); font-size: clamp(34px, 4.5vw, 52px); line-height: 1; letter-spacing: 0; }
.home-about-id small { color: var(--muted); font-size: 9px; }
.home-about-copy { min-width: 0; padding: 18px 20px; border: 1px dashed var(--line); background: rgba(0,0,0,.12); }
.home-about-copy p { margin: 0; }
.home-about-copy p + p { margin-top: 8px; }
.home-about-focus { color: var(--muted); }
.home-about-copy a { display: inline-block; margin-top: 14px; color: var(--accent); font-size: 10px; text-decoration: none; }
.home-about-copy a:hover, .home-about-copy a:focus-visible { color: var(--bright); outline: 1px solid var(--accent); outline-offset: 4px; }

.posts-section { margin-top: 38px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading h2 { margin: 2px 0 0; color: var(--bright); font-size: 26px; letter-spacing: .08em; }
.section-heading > span { color: var(--muted); font-size: 10px; }
.section-heading.compact { margin-bottom: 18px; }
.post { position: relative; padding: clamp(20px, 3.5vw, 38px); scroll-margin-top: 112px; }
.post[hidden] { display: none; }
.post + .post { margin-top: 14px; }
.featured-post::before { content: "FEATURED"; position: absolute; top: -1px; right: 26px; padding: 4px 10px; color: #17080c; background: var(--accent); font-size: 9px; text-shadow: none; }
.post-head { display: flex; justify-content: space-between; gap: 24px; align-items: start; }
.post-head > div { display: flex; gap: 14px; align-items: baseline; }
.post-index { color: var(--accent); }
.post h3 { margin: 0; color: var(--bright); font-size: clamp(20px, 2.4vw, 31px); line-height: 1.25; }
.post time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.post-meta { color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.post details { margin-top: 18px; }
.post summary { width: fit-content; padding: 5px 9px; border: 1px solid var(--line); cursor: pointer; list-style: none; }
.post summary::-webkit-details-marker { display: none; }
.post summary::before { content: "> "; color: var(--accent); }
.post details[open] summary::before { content: "v "; }
.post-body { margin-top: 17px; padding: 17px; border-left: 2px solid var(--accent); background: rgba(0,0,0,.14); }
.post-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.post-pagination[hidden] { display: none; }
.post-pagination button { display: grid; width: 36px; height: 34px; padding: 0; place-items: center; border: 1px solid var(--line); color: var(--text); background: transparent; cursor: pointer; }
.post-pagination button:hover:not(:disabled), .post-pagination button:focus-visible { color: var(--bright); border-color: var(--accent); outline: none; box-shadow: 0 0 12px var(--shadow); }
.post-pagination button:disabled { opacity: .35; cursor: default; }
.post-pagination span { min-width: 72px; color: var(--muted); font-size: 11px; text-align: center; }
blockquote { margin: 18px 0 0; padding: 10px 14px; border: 1px dashed var(--line); color: var(--bright); }
.palette-strip { display: grid; grid-template-columns: 6fr 3fr 1.2fr 1fr 1fr; height: 16px; margin-top: 18px; border: 1px solid rgba(255,255,255,.08); }
.palette-strip span:nth-child(1) { background: #132a2d; }
.palette-strip span:nth-child(2) { background: #8e293f; }
.palette-strip span:nth-child(3) { background: #e7b96c; }
.palette-strip span:nth-child(4) { background: #69d4e6; }
.palette-strip span:nth-child(5) { background: #a882ff; }

.pixel-lab, .archive, .about { margin-top: 38px; padding: clamp(20px, 3vw, 34px); scroll-margin-top: 110px; }
.pixel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pixel-card { padding: 10px; border: 1px solid var(--line); color: var(--text); background: rgba(0,0,0,.13); text-align: left; cursor: pointer; }
.pixel-card:hover, .pixel-card.active { border-color: var(--accent); box-shadow: 0 0 18px var(--shadow); transform: translateY(-2px); }
.pixel-card strong { display: block; margin-top: 10px; color: var(--bright); font-size: 12px; }
.pixel-card small { color: var(--muted); font-size: 10px; }
.pixel-preview { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; image-rendering: pixelated; }
.pixel-preview::before, .pixel-preview::after, .pixel-preview i { content: ""; position: absolute; }
.preview-scarlet { background: linear-gradient(#15121d 0 62%, #24121d 62%); }
.preview-scarlet::before { right: 15%; top: 16%; width: 24px; height: 24px; border-radius: 50%; background: #e6d6c3; box-shadow: -5px 0 #15121d; }
.preview-scarlet::after { left: 0; right: 0; bottom: 0; height: 34%; background: #16161d; clip-path: polygon(0 40%, 25% 15%, 43% 52%, 65% 22%, 100% 42%, 100% 100%, 0 100%); }
.preview-scarlet i { left: 43%; bottom: 22%; width: 4px; height: 12px; background: #e65372; box-shadow: -5px 3px #e65372, 5px 3px #e65372, -10px -3px #f5d55a, 10px -3px #69d4e6, -12px 5px #a882ff, 12px 5px #f18bcb; }
.preview-teal { background: linear-gradient(#14272c 0 57%, #29443f 57%); }
.preview-teal::before { right: 8%; top: 34%; width: 52%; height: 29%; background: #737d7c; transform: rotate(-7deg); box-shadow: -7px 5px #4f5e60, 9px -5px #96a19f; clip-path: polygon(0 25%, 76% 0, 100% 35%, 83% 100%, 18% 80%); }
.preview-teal::after { left: 0; right: 0; bottom: 0; height: 38%; background: #375a48; clip-path: polygon(0 42%, 38% 13%, 100% 45%, 100% 100%, 0 100%); }
.preview-teal i { left: 20%; bottom: 20%; width: 3px; height: 9px; background: #b62f49; box-shadow: -4px 2px #b62f49, 4px 2px #b62f49; }
.preview-amber { background: #120d06; }
.preview-amber::before { left: 13%; right: 13%; top: 14%; bottom: 20%; border: 3px solid #b47825; background: #1b1207; box-shadow: inset 0 0 18px rgba(240,168,61,.22); }
.preview-amber::after { left: 23%; top: 29%; width: 45%; height: 3px; background: #e4a342; box-shadow: 0 8px #9b6b28, 0 16px #9b6b28, 0 24px #e4a342; }
.preview-amber i { left: 41%; bottom: 12%; width: 18%; height: 6%; background: #6c4415; }
.lab-note { margin-bottom: 0; color: var(--muted); font-size: 11px; }

.archive-table { border: 1px solid var(--line); }
.archive-row { display: grid; grid-template-columns: 130px 1fr 80px 70px; gap: 14px; padding: 10px 13px; border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent); text-decoration: none; }
.archive-row:last-child { border-bottom: 0; }
.archive-row.head { color: var(--muted); background: rgba(255,255,255,.03); font-size: 10px; }
a.archive-row:hover { background: rgba(255,255,255,.04); color: var(--bright); }
.about { display: grid; grid-template-columns: 210px 1fr; gap: 24px; }
.about-heading { display: flex; min-height: 100%; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.about h2 { margin: 3px 0 0; color: var(--bright); font-size: 30px; }
.terminal-block { padding: 18px; border: 1px dashed var(--line); background: rgba(0,0,0,.16); }
.terminal-block p { margin: 0 0 12px; }
.prompt { color: var(--accent); }

footer { display: flex; justify-content: space-between; gap: 18px; padding: 16px clamp(18px, 4vw, 56px); border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .1em; }

dialog { width: min(520px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow-y: auto; border: 1px solid var(--line); color: var(--text); background: var(--bg); box-shadow: 0 0 50px rgba(0,0,0,.7), 0 0 20px var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.dialog-card, .console-card { padding: 20px; }
.dialog-title { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dialog-title button { border: 0; background: transparent; cursor: pointer; font-size: 20px; }
.dialog-card label { display: block; margin-top: 16px; color: var(--muted); font-size: 11px; }
.dialog-card input, .dialog-card textarea { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid var(--line); outline: none; color: var(--bright); background: rgba(255,255,255,.03); }
.dialog-card input:focus, .dialog-card textarea:focus { box-shadow: 0 0 16px var(--shadow); }
.dialog-card textarea { min-height: 150px; resize: vertical; }
.dialog-card input[type="file"] { padding: 7px; color: var(--muted); }
.dialog-card input[type="file"]::file-selector-button { margin-right: 10px; padding: 6px 9px; border: 1px solid var(--line); color: var(--text); background: transparent; cursor: pointer; }
.dialog-actions { display: flex; justify-content: end; gap: 9px; margin-top: 16px; }
.dialog-actions button { padding: 8px 12px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.dialog-actions button:disabled { opacity: .5; cursor: wait; }
.dialog-actions .dialog-primary { color: #16070b; border-color: var(--accent); background: var(--accent); text-shadow: none; }
.dialog-note { min-height: 1.6em; margin-bottom: 0; color: var(--muted); font-size: 10px; }
.dialog-note.error { color: #ff9aaf; }
.dialog-note.success { color: var(--accent); }
.contact-dialog { width: min(640px, calc(100% - 28px)); }
.contact-destination { margin: 14px 0 0; color: var(--muted); font-size: 10px; }
.contact-destination code { color: var(--accent); }
.field-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.attachment-list { min-height: 18px; margin-top: 8px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.console-dialog { width: min(720px, calc(100% - 28px)); }
.console-output { height: min(330px, 55vh); overflow-y: auto; padding: 12px 0; color: var(--muted); font-size: 12px; }
.console-output p { margin: 0 0 8px; }
.console-output b, .console-output .cmd { color: var(--accent); font-weight: normal; }
.console-form { display: flex; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.console-form label { color: var(--accent); white-space: nowrap; }
.console-form input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--bright); background: transparent; }
@media (max-width: 1000px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav { order: 3; grid-column: 1 / -1; justify-content: center; padding-top: 8px; border-top: 1px dashed var(--line); }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .sidebar section + section { margin-top: 0; padding-top: 0; border-top: 0; }
  .sidebar-mail-block { grid-column: 1 / -1; padding-top: 18px !important; border-top: 1px dashed var(--line) !important; }
  .hero { grid-template-columns: 1fr 340px; }
  .hero h1 { font-size: 54px; }
}

@media (max-width: 1100px) {
  .quick-page-frame { grid-template-columns: minmax(0, 1fr); }
  .quick-rail {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, .32fr);
    gap: 18px;
  }
  .quick-rail-section + .quick-rail-section {
    margin-top: 0;
    padding-top: 0;
    padding-left: 18px;
    border-top: 0;
    border-left: 1px dashed var(--line);
  }
  .quick-nav-list {
    grid-template-columns: repeat(5, minmax(max-content, 1fr));
    gap: 4px;
    overflow-x: auto;
  }
  .quick-rail .button-link { margin-top: 0; }
  .quick-mail-section .button-link { margin-top: 4px; }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .hero-copy { align-self: auto; }
  .post-preview-wrap { justify-self: stretch; width: 100%; max-width: 520px; }
  .pixel-grid { grid-template-columns: 1fr; }
  .home-about-strip { grid-template-columns: 1fr; }
  .home-about-id { padding-bottom: 22px; border-right: 0; border-bottom: 1px dashed var(--line); }
  .quick-rail { grid-template-columns: minmax(0, 1fr); }
  .quick-rail-section + .quick-rail-section {
    margin-top: 14px;
    padding-top: 14px;
    padding-left: 0;
    border-top: 1px dashed var(--line);
    border-left: 0;
  }
  .quick-nav-list {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    justify-content: start;
  }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar { padding-inline: 14px; }
  .brand small { display: none; }
  .brand strong { font-size: 12px; }
  .language-switch { grid-template-columns: repeat(3, 34px); }
  .language-switch button { width: 34px; height: 32px; font-size: 9px; }
  .nav { justify-content: start; overflow-x: auto; }
  .layout,
  .subpage-layout,
  .logs-shell,
  .log-detail-shell,
  .vault-layout {
    width: min(100% - 20px, 1280px);
    margin-top: 18px;
  }
  .sidebar { grid-template-columns: 1fr; }
  .sidebar section + section { padding-top: 18px; border-top: 1px dashed var(--line); }
  .hero { min-height: auto; padding: 26px 20px; }
  .hero h1 { font-size: 40px; }
  .post-head { display: block; }
  .post-head > div { display: block; }
  .post time { display: inline-block; margin-top: 8px; }
  .home-log-head { display: block; }
  .home-log-head > div { align-items: start; }
  .home-log-head time { display: inline-block; margin-top: 9px; }
  .archive-row { grid-template-columns: 1fr 70px; }
  .archive-row span:nth-child(1), .archive-row span:nth-child(4) { display: none; }
  .about { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .boot-screen { display: none; }
}
