:root {
  color-scheme: light dark;
  --background: #fafaf8;
  --text: #191919;
  --secondary: #555653;
  --accent: #d6a500;
  --grid-dot: rgba(25, 25, 25, .085);
  --ambient: rgba(145, 157, 137, .055);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #101112;
    --text: #f4f4f0;
    --secondary: #b5b5b0;
    --accent: #ffd84d;
    --grid-dot: rgba(244, 244, 240, .10);
    --ambient: rgba(132, 147, 161, .065);
  }
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body {
  display: flow-root; /* Prevent main top margin collapsing outside body. */
  margin: 0;
  min-height: 100svh;
  background-color: var(--background);
  background-image:
    radial-gradient(circle, var(--grid-dot) .6px, transparent .85px),
    radial-gradient(ellipse at 75% 15%, var(--ambient), transparent 65%);
  background-size: 32px 32px, 100% 100%;
  background-position: 16px 16px, center;
  color: var(--text);
  font-family: 'Montserrat Alternates', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.content {
  width: min(600px, calc(100% - 96px));
  margin: 80px 0 0 48px;
}

h1, h2, p { letter-spacing: normal; line-height: 1.6; }
h1 { margin: 0 0 32px; font-size: 24px; font-weight: 600; }
h2 { margin: 0 0 24px; color: var(--secondary); font-size: 18px; font-weight: 600; }
p { margin: 0 0 32px; color: var(--secondary); font-size: 16px; font-weight: 500; }

nav { display: flex; flex-wrap: wrap; gap: 24px; }
nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 16px;
  border: 1px solid var(--text);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
nav a:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
nav a:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--background); }

/* Trim line-box leading where supported, matching Figma's vertical trim. */
@supports (text-box-trim: trim-both) and (text-box-edge: cap alphabetic) {
  h1, h2, p, nav a {
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
  }
}

/* Same 80px top margin at every viewport width. */
@media (max-width: 840px) {
  .content { width: calc(100% - 64px); margin-left: 32px; }
}
@media (max-width: 369px) {
  .content { width: calc(100% - 32px); margin-left: 16px; }
}

.cursor-disc { display: none; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body.cursor-enabled, body.cursor-enabled a { cursor: none; }
  .cursor-disc {
    display: grid;
    place-items: center;
    position: fixed;
    inset: 0 auto auto 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 9999;
    transform: translate3d(-100px, -100px, 0);
    will-change: transform, width, height;
    opacity: 0;
    transition: width 280ms cubic-bezier(.2,.8,.2,1), height 280ms cubic-bezier(.2,.8,.2,1), opacity 140ms ease;
  }
  .cursor-disc.is-visible { opacity: 1; }
  .cursor-disc.is-link { width: 120px; height: 120px; }
  .cursor-label {
    font: 600 11px/1.6 'Montserrat Alternates', Arial, sans-serif;
    letter-spacing: .08em;
    color: #000;
    opacity: 0;
    transform: scale(.8);
    transition: opacity 160ms ease, transform 200ms ease;
  }
  .cursor-disc.is-link .cursor-label { opacity: 1; transform: scale(1); }
}
