:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f1e8;
  --ink: #1c1915;
  --muted: #6d645a;
  --fact: #3a342c;
  --line: #e4d9c8;
  --link: #9a4312;
  --hover: rgba(28, 25, 21, 0.045);
  --pane: rgba(154, 67, 18, 0.06);
  --pane-edge: rgba(28, 25, 21, 0.45);
  --mark: #c56a22;
  --glow: rgba(197, 106, 34, 0.45);
  --lamp: rgba(197, 106, 34, 0.34);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14110e;
  --ink: #f4efe6;
  --muted: #b3a89c;
  --fact: #ddd4c6;
  --line: #322c26;
  --link: #e7a15a;
  --hover: rgba(244, 239, 230, 0.05);
  --pane: rgba(231, 161, 90, 0.08);
  --pane-edge: rgba(244, 239, 230, 0.55);
  --mark: #e7a15a;
  --glow: rgba(231, 161, 90, 0.55);
  --lamp: rgba(231, 161, 90, 0.22);
}

html { background: var(--bg); }

body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font: 16px/1.45 "Segoe UI", system-ui, sans-serif;
}

a { color: var(--ink); }
a:hover { color: var(--link); }

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  background: var(--bg);
  color: var(--ink);
  padding: 6px 8px;
}

header.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: baseline;
  width: min(920px, calc(100% - 48px));
  margin: 22px auto 0;
}

.brand {
  color: var(--ink);
  font: 700 15px/1.2 "Segoe UI", system-ui, sans-serif;
  text-decoration: none;
}

nav.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: baseline;
  margin-left: auto;
  font: 15px/1.2 "Segoe UI", system-ui, sans-serif;
}

nav.nav a,
button.theme {
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  min-height: 32px;
}

nav.nav a:hover,
nav.nav a[aria-current="page"],
button.theme:hover {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wrap {
  width: min(920px, calc(100% - 48px));
  margin: 0 auto 56px;
}

.lamp {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(640px 520px at var(--x, 18%) var(--y, 42%), var(--lamp), transparent 68%);
}

.bar,
.wrap,
.colophon {
  position: relative;
  z-index: 1;
}

.about {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 28px 0 8px;
}

.night {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  margin: 36px 0 28px;
}

.night h1 {
  font: 700 22px/1.15 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
}

.quote {
  margin: 14px 0 0;
  max-width: 11em;
  color: var(--ink);
  font: 46px/1.12 Georgia, "Iowan Old Style", Palatino, serif;
}

.from {
  margin: 16px 0 0;
  font: 14px/1.3 "Segoe UI", system-ui, sans-serif;
}

.from a { color: var(--link); }

.doors { margin: 8px 0 0; }

.door {
  display: block;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.doors .door:last-child { border-bottom: 1px solid var(--line); }

.door-name {
  display: block;
  font: 700 34px/1.1 "Segoe UI", system-ui, sans-serif;
}

.door-fact {
  display: block;
  margin-top: 6px;
  max-width: 36rem;
  color: var(--fact);
  font: 18px/1.4 Georgia, "Iowan Old Style", Palatino, serif;
}

img.portrait {
  width: 116px;
  height: 142px;
  object-fit: cover;
  object-position: center 16%;
  display: block;
}

h1 {
  margin: 0;
  font: 700 28px/1.15 "Segoe UI", system-ui, sans-serif;
}

.lede {
  margin: 10px 0 0;
  max-width: 36rem;
  font: 20px/1.45 Georgia, "Iowan Old Style", Palatino, serif;
}

.stack {
  margin: 8px 0 0;
  color: var(--muted);
  font: 13px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.about .copy p { margin: 0 0 12px; max-width: 40rem; }

.night .portrait {
  width: 100%;
  height: min(78vh, 640px);
  object-position: center 12%;
}

.piece {
  max-width: 38rem;
  margin: 26px 0 0;
}

.piece h3 {
  margin: 0;
  font: 700 22px/1.2 "Segoe UI", system-ui, sans-serif;
}

.piece h3 a { text-decoration: none; }
.piece h3 a:hover { color: var(--link); }

.piece p {
  margin: 8px 0 0;
  font: 18px/1.5 Georgia, "Iowan Old Style", Palatino, serif;
}

.where {
  margin: 8px 0 0;
  font: 14px/1.3 "Segoe UI", system-ui, sans-serif;
}

.where a { color: var(--link); }

ol.notes {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.note {
  max-width: 38rem;
  margin: 0 0 22px;
}

.note p {
  margin: 6px 0 0;
  font: 18px/1.5 Georgia, "Iowan Old Style", Palatino, serif;
}

section.group h2 {
  margin: 28px 0 0;
  color: var(--muted);
  font: 13px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 400;
}

ul.index {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

ul.index li {
  position: relative;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) auto;
  gap: 6px 20px;
  align-items: baseline;
  padding: 13px 0 13px 12px;
  border-bottom: 1px solid var(--line);
}

ul.index li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--link);
  transform: scaleY(0);
  transform-origin: top;
  opacity: 0;
}

ul.index .name {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
}

ul.index li:hover {
  background: var(--hover);
}

ul.index li:hover .name { text-decoration: underline; text-underline-offset: 3px; }

ul.index .fact { color: var(--fact); }

ul.index .meta {
  color: var(--link);
  font: 13px/1.35 ui-monospace, "Cascadia Mono", Consolas, monospace;
  text-align: right;
  text-decoration: none;
}

ul.index .meta:hover { text-decoration: underline; text-underline-offset: 3px; }

ol.log {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

ol.log a {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 11px 0 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

ol.log a:hover { background: var(--hover); }

ol.log time {
  color: var(--muted);
  font: 13px/1.35 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

ol.log a:hover span { text-decoration: underline; text-underline-offset: 3px; }

ol.posts {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

li.post { margin: 0 0 22px; }

.when {
  margin: 0 0 2px;
  font: 13px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.when a {
  color: var(--muted);
  text-decoration: none;
}

.when a:hover { color: var(--link); text-decoration: underline; }

.body { margin: 0; }

.more {
  margin: 6px 0 0;
  font: 14px/1.4 "Segoe UI", system-ui, sans-serif;
}

.more a { color: var(--link); }

.dot { color: var(--muted); }

a.back {
  display: inline-block;
  margin: 22px 0 8px;
  color: var(--link);
  font-size: 14px;
}

p.dek { margin: 8px 0 0; max-width: 40rem; }

footer.colophon {
  margin-top: 28px;
  color: var(--muted);
  font-size: 14px;
}

footer.colophon p { margin: 0 0 4px; }

footer.colophon a { color: var(--link); }

@media (prefers-reduced-motion: no-preference) {
  .lamp { animation: breathe 8s ease-in-out infinite alternate; }

  .night .portrait,
  .door-name {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
  }

  .door:hover .door-name {
    color: var(--link);
    transform: translateX(6px);
  }

  section.group {
    animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  section.group:nth-of-type(1) { animation-delay: 0.05s; }
  section.group:nth-of-type(2) { animation-delay: 0.1s; }
  section.group:nth-of-type(3) { animation-delay: 0.15s; }
  section.group:nth-of-type(4) { animation-delay: 0.2s; }
  section.group:nth-of-type(5) { animation-delay: 0.25s; }

  ul.index li,
  ol.log li {
    animation: rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  ul.index li:nth-child(1),
  ol.log li:nth-child(1) { animation-delay: 0.04s; }
  ul.index li:nth-child(2),
  ol.log li:nth-child(2) { animation-delay: 0.08s; }
  ul.index li:nth-child(3),
  ol.log li:nth-child(3) { animation-delay: 0.12s; }
  ul.index li:nth-child(4),
  ol.log li:nth-child(4) { animation-delay: 0.16s; }
  ul.index li:nth-child(n + 5),
  ol.log li:nth-child(n + 5) { animation-delay: 0.2s; }

  ul.index li::before,
  ul.index .name {
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  }

  ul.index li:hover::before {
    transform: scaleY(1);
    opacity: 1;
  }

  ul.index li:hover .name { transform: translateX(3px); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes breathe {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@media (max-width: 720px) {
  header.bar { width: auto; margin: 16px 16px 0; }
  .wrap { width: auto; margin: 0 16px 40px; }
  nav.nav { margin-left: 0; }
  nav.nav a,
  button.theme {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .night {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 18px;
  }
  .night .portrait {
    width: 100%;
    height: 420px;
  }
  .quote { font-size: 34px; }
  .door-name { font-size: 28px; }
  ul.index li,
  ol.log a {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 14px 0 14px 12px;
  }
  ul.index .meta { text-align: left; }
}
