/* Colors and fonts live here; everything else reads them. */
:root {
  --bg: #fbfaf6;
  --text: #1c1b18;
  --muted: #6f6c64;
  --line: #e3e0d7;
  --soft: #f1efe8;
  --accent: #1f5fbf;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
}
html[data-theme="dark"] {
  --bg: #151513;
  --text: #ebe8e0;
  --muted: #9a968c;
  --line: #2e2d29;
  --soft: #1f1e1b;
  --accent: #82abf0;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #151513;
    --text: #ebe8e0;
    --muted: #9a968c;
    --line: #2e2d29;
    --soft: #1f1e1b;
    --accent: #82abf0;
  }
}

* { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { margin: 0; background: var(--bg); min-height: 100vh; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* Small print: dates, labels, numbering, the clock */
.mono { font-family: var(--mono); }

/* One column, centered */
.page { max-width: 700px; margin: 0 auto; padding: 24px 24px 96px; }
.noscript { color: var(--muted); }

/* Top bar: name, section links, theme */
.topbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: baseline; gap: 22px;
  padding: 18px 0 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 15px; font-weight: 700; margin-right: auto; white-space: nowrap; letter-spacing: -0.01em; }
.tabs { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { font-size: 14px; color: var(--muted); white-space: nowrap; padding-bottom: 2px; border-bottom: 1.5px solid transparent; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.mode-button { font: 12px var(--mono); color: var(--muted); }
.mode-button:hover { color: var(--text); }

/* Section labels look like "— ABOUT" */
.label {
  margin: 44px 0 14px;
  font: 600 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.label::before { content: "— "; font-weight: 400; }

/* Intro */
.greeting { margin-top: 4px; font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.punchline { margin: 6px 0 20px; font: 12px var(--mono); color: var(--muted); }
.bio { font-size: 16px; line-height: 1.65; max-width: 60ch; }
.where { margin-top: 12px; font: 12px var(--mono); color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 16px; font-size: 14px; }
.facts { counter-reset: fact; max-width: 60ch; }
.facts li { position: relative; padding-left: 34px; margin-top: 8px; counter-increment: fact; }
.facts li::before {
  content: counter(fact, decimal-leading-zero);
  position: absolute; left: 0; top: 3px;
  font: 12px var(--mono); color: var(--muted);
}

/* Sections */
.panel-note { margin: -6px 0 14px; font: 12px var(--mono); color: var(--muted); }

.entry {
  display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 2px 22px;
  padding: 18px 0;
  scroll-margin-top: 64px; /* keep the sticky bar off an entry we jump to */
}
.entry + .entry { border-top: 1px solid var(--line); }
.entry-when { padding-top: 4px; font: 12px/1.6 var(--mono); color: var(--muted); }
.entry-title { font-size: 16px; font-weight: 600; line-height: 1.35; }
.entry-subtitle { margin-top: 1px; font-size: 14px; color: var(--muted); }
.entry-text { margin-top: 8px; }
.entry-bullets { margin-top: 8px; }
.entry-bullets li, .group-lines li { position: relative; padding-left: 16px; }
.entry-bullets li::before, .group-lines li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
.entry-bullets li { margin-top: 6px; }
.entry-group { margin-top: 14px; }
.group-heading { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.group-lines { margin-top: 4px; font-size: 14px; }
.group-lines li { margin-top: 3px; }
.entry-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; font-size: 13px; }
.arrow { display: inline-block; transition: transform .2s ease; }
.entry-link:hover .arrow { transform: translateX(2px); }
.placeholder { color: var(--muted); background: var(--soft); border-radius: 3px; padding: 0 4px; }

/* Photos */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.photo { aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px; background: var(--soft); }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.photo:hover img { transform: scale(1.03); }

.lightbox {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(21, 21, 19, .95); color: #ebe8e0;
}
.lightbox[hidden] { display: none; }
.lb-figure { max-width: min(92vw, 1200px); text-align: center; }
.lb-figure img { max-width: 100%; max-height: 84vh; width: auto; height: auto; margin: 0 auto; border-radius: 4px; }
.lb-figure figcaption { margin-top: 12px; font: 12px var(--mono); color: #9a968c; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; width: 44px; height: 44px;
  font-size: 22px; line-height: 44px; text-align: center;
  color: #ebe8e0; opacity: .7; border-radius: 50%;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox :focus-visible { outline-color: #ebe8e0; }

/* Videos */
.video { position: relative; aspect-ratio: 16 / 9; margin-top: 8px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.video iframe, .video-play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play img { width: 100%; height: 100%; object-fit: cover; }
.video-icon {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 28px; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}

/* Phones */
@media (max-width: 600px) {
  .page { padding: 12px 18px 72px; }
  .topbar { flex-wrap: wrap; gap: 6px 16px; padding: 12px 0 10px; }
  .brand { flex: 1; }            /* name and the theme button share the first row */
  .tabs { flex: 1 1 100%; order: 1; flex-wrap: wrap; gap: 2px 16px; }  /* section links get the second row, wrapping if needed */
  .greeting { font-size: 30px; }
  .entry { grid-template-columns: 1fr; gap: 0; padding: 14px 0; scroll-margin-top: 104px; }
  .entry-when { padding-top: 0; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .photo img, .arrow { transition: none; }
}
