:root {
  --bg: #ffffff;
  --text: #080808;
  --muted: #6e6e6e;
  --line: #d1d1d1;
  --accent: #0033b3;
  --accent-ink: #ffffff;
  --gap: 40px;
  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2b2b2b;
    --text: #a9b7c6;
    --muted: #939393;
    --line: #444849;
    --accent: #cc7832;
    --accent-ink: #2b2b2b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #2b2b2b;
  --text: #a9b7c6;
  --muted: #939393;
  --line: #444849;
  --accent: #cc7832;
  --accent-ink: #2b2b2b;
  color-scheme: dark;
}

html { scroll-padding-top: env(safe-area-inset-top, 0px); }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* Header */
header.site {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}
.brand { font-weight: 700; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.bar-right { display: flex; align-items: center; gap: 20px; min-width: 0; }
nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
nav a:hover { color: var(--text); }
nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

.theme-toggle {
  appearance: none;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  cursor: pointer;
  flex: none;
  transition: border-color .15s;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
.theme-toggle[data-mode="dark"] .i-sun { display: block; }
.theme-toggle[data-mode="dark"] .i-moon { display: none; }

/* Views */
main.wrap { min-height: calc(100vh - 160px); padding-top: var(--gap); }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 20px; }
h2:not(:first-child) { margin-top: var(--gap); }
p { margin: 0 0 16px; max-width: 66ch; }

.intro {
  display: grid;
  grid-template-columns: 1.4em 1fr;
  font-size: clamp(17px, 3.2vw, 20px);
  line-height: 1.6;
  margin-bottom: var(--gap);
}
.intro .prompt { color: var(--accent); font-weight: 700; }
.intro p { margin: 0 0 14px; max-width: 52ch; }
.intro p:last-child { margin-bottom: 0; }
.caret {
  display: inline-block;
  width: 0.5em; height: 0.95em;
  margin-left: 4px;
  background: var(--accent);
  vertical-align: -0.1em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.row .when { color: var(--muted); }
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.row p { margin: 0 0 8px; color: var(--muted); }
.row p:last-child { margin-bottom: 0; }
.row .stack { color: var(--accent); font-size: 13px; }
.row .stack a { text-decoration-color: var(--line); text-underline-offset: 3px; }
.row .stack a:hover { text-decoration-color: var(--accent); }

.row.wide { grid-template-columns: 170px 1fr; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { border: 1px solid var(--line); border-radius: 6px; padding: 6px 14px; line-height: 1.5; }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.contact-list a { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.contact-list a:hover .val { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.contact-list svg { width: 20px; height: 20px; flex: none; }
.empty { color: var(--muted); }

footer { margin-top: 72px; padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  .bar { height: auto; flex-wrap: wrap; padding: 10px 0 0; }
  .bar-right { display: contents; }
  .theme-toggle { order: 2; }
  .brand { order: 1; flex: 1; }
  nav { order: 3; width: 100%; overflow-x: auto; margin: 0 -24px; padding: 0 24px 10px; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav ul { gap: 22px; width: max-content; }
  :root { --gap: 28px; }
  .row { grid-template-columns: 1fr; }
  .row.wide { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  * { transition: none !important; }
}
