:root {
  color-scheme: light dark;
  --bg: #f6f4ef;
  --fg: #1c1b18;
  --muted: #5c5a54;
  --rule: #d8d4cb;
  --focus: #1c1b18;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --fg: #eeebe4;
    --muted: #b0aca3;
    --rule: #3a3934;
    --focus: #eeebe4;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--bg);
  color: var(--fg);
  font-family:
    "Iowan Old Style",
    "Palatino Linotype",
    Palatino,
    Georgia,
    "Times New Roman",
    serif;
  line-height: 1.5;
}

main {
  width: min(32rem, 100%);
  text-align: center;
}

header {
  margin: 0;
}

.name {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 {
  margin: 0.85rem 0 0;
  font-family:
    "Avenir Next",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: clamp(1.05rem, 2.6vw, 1.2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--fg);
}

.lede {
  margin: 0.55rem 0 0;
  font-family:
    "Avenir Next",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
}

.lede-alt {
  margin-top: 0.2rem;
  font-size: 0.88rem;
}

nav {
  margin-top: 2rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--rule);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  display: inline-block;
  padding: 0.45rem 0.1rem;
  font-family:
    "Avenir Next",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--fg) 30%, transparent);
  text-underline-offset: 0.22em;
}

nav a:hover {
  text-decoration-color: var(--fg);
}

nav a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 2px;
}

@media (max-width: 420px) {
  nav ul {
    gap: 0.45rem 1.1rem;
  }
}

/* Intro overlay — restored from the pre-redesign boot sequence */

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes slideUp {
  0% {
    transform: translate3d(0, 1em, 0);
    opacity: 0;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

html.boot .name,
html.boot h1,
html.boot .lede,
html.boot nav li {
  opacity: 0;
}

html.boot .name.is-revealing,
html.boot h1.is-revealing {
  opacity: 1;
}

html.boot:not(.intro-done) nav {
  opacity: 0;
}

#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  overflow: hidden;
}

#intro-terminal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  color: #00ff88;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  transition: opacity 200ms ease;
  z-index: 1;
  text-align: left;
  white-space: pre-wrap;
}

#intro-terminal .cursor {
  animation: blink 0.7s step-end infinite;
}

.typed-cursor {
  font-weight: 400;
  animation: blink 0.7s step-end infinite;
}

.intro-door {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  background: #000;
  transition: transform 1200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.intro-door-left {
  left: 0;
}

.intro-door-right {
  right: 0;
}

.intro-door-left.open {
  transform: translateX(-100%);
}

.intro-door-right.open {
  transform: translateX(100%);
}

html.intro-done .lede {
  animation: fadeIn 0.45s ease forwards;
}

html.intro-done nav li {
  animation: slideUp 0.5s ease-in-out forwards;
}

html.intro-done nav li:nth-child(1) {
  animation-delay: 0s;
}

html.intro-done nav li:nth-child(2) {
  animation-delay: 0.25s;
}

html.intro-done nav li:nth-child(3) {
  animation-delay: 0.5s;
}

html.intro-done nav li:nth-child(4) {
  animation-delay: 0.75s;
}

html.intro-done nav li:nth-child(5) {
  animation-delay: 1s;
}

html.intro-done nav li:nth-child(6) {
  animation-delay: 1.25s;
}

@media (prefers-reduced-motion: reduce) {
  html.boot .name,
  html.boot h1,
  html.boot .lede,
  html.boot nav,
  html.intro-done .lede,
  html.intro-done nav li {
    opacity: 1;
    animation: none;
    transform: none;
  }

  #intro-overlay {
    display: none;
  }
}
