:root {
  --bg: #f4f1e8;
  --bg-panel: #fbfaf5;
  --ink: #1f1b16;
  --muted: #6b6353;
  --link: #1a4fc4;
  --link-visited: #6f3fb0;
  --rule: #c9c0aa;
  --accent: #2e7d32;
  --mono: "SFMono-Regular", "SF Mono", "Menlo", "Consolas",
    "Liberation Mono", monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", "Palatino", "Georgia",
    "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130f;
    --bg-panel: #1c1a14;
    --ink: #e8e2d2;
    --muted: #9a917d;
    --link: #79a6ff;
    --link-visited: #c39bf0;
    --rule: #3a352a;
    --accent: #7bd17f;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(0, 0, 0, 0.012) 0,
      rgba(0, 0, 0, 0.012) 1px,
      transparent 1px,
      transparent 6px
    );
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  padding: 2rem 1rem 3rem;
}

/* Subtle CRT scanline overlay */
.crt {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.03) 0,
    rgba(0, 0, 0, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

@media (prefers-color-scheme: dark) {
  .crt {
    mix-blend-mode: screen;
    opacity: 0.25;
  }
}

.page {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 2rem 2rem 1.5rem;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.08);
}

.masthead {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  object-fit: cover;
  flex: 0 0 auto;
}

.masthead-text {
  flex: 1 1 240px;
  min-width: 0;
}

.sitename {
  font-family: var(--mono);
  font-size: 2rem;
  margin: 0;
  letter-spacing: -0.5px;
}

.tagline {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

h2 {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

p {
  margin: 0 0 1rem;
}

section p:last-child {
  margin-bottom: 0;
}

.rule {
  border: 0;
  border-top: 1px dashed var(--rule);
  margin: 1.5rem 0;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  background: var(--link);
  color: var(--bg-panel);
  text-decoration: none;
}

.links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
}

.links li {
  margin: 0.35rem 0;
}

.links li::before {
  content: "→ ";
  color: var(--muted);
}

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

.colophon {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.colophon p {
  margin: 0.25rem 0;
}

.copyright {
  letter-spacing: 0.3px;
}

.blink {
  color: var(--accent);
  animation: blink 1.1s step-start infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blink {
    animation: none;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1rem 0.5rem 2rem;
    font-size: 17px;
  }

  .page {
    padding: 1.5rem 1.25rem;
  }

  .masthead {
    flex-direction: column;
    text-align: center;
  }

  .sitename {
    font-size: 1.7rem;
  }
}
