@font-face {
  font-family: 'Fraunces';
  src: url(/fonts/fraunces-normal.woff2) format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  size-adjust: 103%;
}

@font-face {
  font-family: 'Fantasque Sans Mono';
  src: url(/fonts/fantasque-sans-mono.woff2) format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html {
  min-height: 100%;
  background: #0a0a0c;
  color-scheme: dark;
}

body, h1, p {
  margin: 0;
}

:root {
  --bg: #0a0a0c;
  --fg: #e6efe0;
  --muted: rgba(230, 239, 224, 0.78);
  --accent: #a8c5a0;
  --serif: 'Fraunces', Georgia, serif;
  --mono: 'Fantasque Sans Mono', monospace;
}

body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: none;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  /* Dragging on the canvas must never select page text. */
  -webkit-user-select: none;
  user-select: none;
  /* Let touch-drag reach the canvas as pointermove instead of scrolling. */
  touch-action: none;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 72% 62% at 50% 50%,
    rgba(10, 10, 12, 0.72) 0%,
    rgba(10, 10, 12, 0.9) 60%,
    rgba(10, 10, 12, 0.985) 100%
  );
}

@media (min-width: 600px) and (orientation: landscape) {
  .vignette {
    background:
      linear-gradient(
        to right,
        rgba(10, 10, 12, 0.97) 0%,
        rgba(10, 10, 12, 0.93) 22%,
        rgba(10, 10, 12, 0.8) 40%,
        rgba(10, 10, 12, 0.55) 65%,
        rgba(10, 10, 12, 0.30) 100%
      ),
      linear-gradient(
        to bottom,
        rgba(10, 10, 12, 0.45) 0%,
        rgba(10, 10, 12, 0.00) 20%,
        rgba(10, 10, 12, 0.00) 80%,
        rgba(10, 10, 12, 0.45) 100%
      );
  }
}

.page {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem, 8vw, 5.5rem) clamp(1.5rem, 7vw, 5rem);
  max-width: 52rem;
}

/* Content stays hidden until the fonts are ready (see js/fonts.js),
   so the swap from fallback to web font is never visible. */
.js .content {
  opacity: 0;
  filter: blur(6px);
}

.js.ready .content {
  animation: soft-arrive 0.5s 0.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes soft-arrive {
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js.ready .content {
    animation: none;
    opacity: 1;
    filter: none;
  }
}

.name {
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
  font-variation-settings: "SOFT" 50, "WONK" 0;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.prose p {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.65;
  color: #e6efe0;
  max-width: 36rem;
  margin-bottom: 2.25rem;
  font-variation-settings: "SOFT" 25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.links a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(230, 239, 224, 0.4);
  transition: color 0.1s ease, border-color 0.1s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.links a:hover,
.links a:focus-visible {
  color: var(--accent);
  border-bottom-color: currentColor;
}

.links .sep {
  margin: 0 0.7em;
  color: var(--muted);
  user-select: none;
}

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    justify-content: flex-start;
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
  }

  .name {
    font-size: clamp(2rem, 8vh, 3rem);
    margin-bottom: 0.9rem;
  }
}
/* Without JavaScript there is no background and the content is shown at once. */
html:not(.js) #bg,
html:not(.js) .vignette {
  display: none;
}

.name--page {
  font-size: clamp(2rem, 6vw, 3.25rem);
}

.prose h2 {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 2.25rem 0 0.75rem;
  font-variation-settings: "SOFT" 50, "WONK" 0;
}

.prose ul,
.prose ol {
  max-width: 36rem;
  margin: 0 0 2.25rem;
  padding-left: 1.25rem;
  line-height: 1.6;
  color: rgba(221, 230, 214, 0.82);
}

.prose a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(221, 230, 214, 0.25);
  transition: color 0.1s ease, border-color 0.1s ease;
}

.prose a:hover,
.prose a:focus-visible {
  color: var(--accent);
  border-bottom-color: currentColor;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
}

.prose pre {
  max-width: 100%;
  margin: 0 0 2.25rem;
  padding: 1rem;
  overflow-x: auto;
  background: rgba(221, 230, 214, 0.06);
}

/* Mobile readability: larger type, looser line-height, comfortable tap targets. */
@media (max-width: 599px) {
  body {
    font-size: 1.0625rem;
  }

  /* Mobile: no vignette — the darkened frosted card is enough, so keep the
     whole screen showing the automaton at full brightness. */
  .vignette {
    display: none;
  }

  /* Frost the text onto its own softly-blurred slab so the moving
     automaton can't fight the letters. Falls back gracefully (no blur)
     on browsers without backdrop-filter support. */
  .content {
    padding: clamp(1rem, 4vw, 1.6rem) clamp(0.9rem, 4vw, 1.4rem);
    border-radius: 14px;
    margin-left: -1.1rem;
    margin-right: -1.1rem;
  }
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .content {
      -webkit-backdrop-filter: blur(14px);
      backdrop-filter: blur(14px);
      background: rgba(10, 10, 12, 0.5);
      -webkit-box-decoration-break: clone;
      box-decoration-break: clone;
    }
  }
  @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .content {
      background: radial-gradient(
        closest-corner,
        rgba(10, 10, 12, 0.78) 0%,
        rgba(10, 10, 12, 0.42) 60%,
        rgba(10, 10, 12, 0.2) 100%
      );
    }
  }

  .hero {
    padding: clamp(3rem, 12vh, 5rem) 1.5rem;
  }

  .name {
    font-size: 2.6rem;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
  }

  .prose p {
    font-size: 1.12rem;
    line-height: 1.75;
    margin-bottom: 1.6rem;
  }

  .links {
    font-size: 1rem;
    line-height: 2;
    row-gap: 0.15rem;
  }

  .links a {
    padding: 0.4rem 0;
  }

  .links .sep {
    margin: 0 0.55em;
  }

  .prose ul,
  .prose ol {
    font-size: 1.12rem;
    line-height: 1.75;
  }
}

@media (max-width: 599px) and (orientation: landscape) {
  .name {
    font-size: clamp(2rem, 10vw, 2.6rem);
  }
}
