:root {
  --page: #FFFFFF;
  --panel: #F6F3EF;
  --panel-2: #FAF8F5;
  --line: #E6DFD5;
  --bar: #EFEAE3;
  --chip: #ECE6DE;
  --ink: #2A2622;
  --ink-soft: #3F3934;
  --muted: #625A52;
  --orange: #FEBA4F;
  --orange-light: #FED8B1;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: calc(88 * var(--u));
  /* The size unit (Axus, Nov 2: what he sees at 67% zoom is the size he wants at 100%).
     0.67px on screens 1200px and wider, 1px on phones (600px and narrower), smoothly in between.
     Every size is written as calc(n * var(--u)), so this one line scales the site. */
  --u: clamp(0.67px, calc(1px - (100vw - 600px) * 0.00055), 1px);
}

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

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--mono);
  font-size: max(16px, calc(16 * var(--u)));
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; }
button { font: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: max(1140px, calc(1280 * var(--u))); margin: 0 auto; padding: 0 calc(32 * var(--u)); overflow-x: clip; } /* clip: button glows never widen the page */

/* Nav */
/* Logo in the middle; links on the right. */
.nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: calc(16 * var(--u)); height: var(--nav-h); }
.nav > * { grid-row: 1; }
.nav > .logo { grid-column: 2; }
.nav > :not(.logo) { grid-column: 3; justify-self: end; }
.nav > .nav-left { grid-column: 1; justify-self: start; }
.link { white-space: nowrap; }
.logo { display: flex; align-items: center; gap: calc(10 * var(--u)); text-decoration: none; color: var(--ink); }
.logo-mark { display: block; width: max(26px, calc(30 * var(--u))); height: max(26px, calc(30 * var(--u))); }
.logo-word { font-weight: 800; font-size: max(18px, calc(21 * var(--u))); letter-spacing: -0.04em; }

/* Text links and plain buttons */
.link {
  display: inline-flex; align-items: center; gap: calc(8 * var(--u));
  min-height: calc(44 * var(--u)); padding: 0 calc(4 * var(--u));
  border: 0; background: transparent; color: var(--ink);
  font-family: var(--mono); font-weight: 700; font-size: max(16px, calc(15 * var(--u)));
  text-decoration: none; cursor: pointer;
}
.link:hover, .logo:hover .logo-word { text-decoration: underline; text-underline-offset: calc(4 * var(--u)); }
.link.is-muted { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(10 * var(--u));
  min-height: calc(56 * var(--u)); padding: 0 calc(26 * var(--u)); border: 0;
  font-family: var(--mono); font-weight: 800; font-size: max(17px, calc(17 * var(--u)));
  color: var(--ink); text-decoration: none; cursor: pointer;
  transition: filter 140ms ease, transform 80ms ease;
}
.btn:hover { filter: brightness(0.96); }
.btn:active { transform: translateY(calc(1 * var(--u))); }
.btn-primary { background: var(--orange); border-radius: calc(20 * var(--u)); min-width: calc(220 * var(--u)); }
.btn-secondary { background: var(--panel); font-size: max(16px, calc(16 * var(--u))); padding: 0 calc(22 * var(--u)); }

:focus-visible { outline: calc(3 * var(--u)) solid var(--ink); outline-offset: calc(3 * var(--u)); }

.sr-only {
  position: absolute; width: calc(1 * var(--u)); height: calc(1 * var(--u)); padding: 0; margin: calc(-1 * var(--u));
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.dot { display: inline-block; width: calc(8 * var(--u)); height: calc(8 * var(--u)); background: var(--orange); flex: none; }

/* Footer */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: calc(6 * var(--u)) calc(24 * var(--u)); padding: calc(20 * var(--u)) 0 calc(28 * var(--u)); border-top: calc(1 * var(--u)) solid var(--line); font-size: max(16px, calc(13 * var(--u))); color: var(--muted); }
.foot a { color: var(--muted); font-weight: 700; text-decoration: none; min-height: calc(32 * var(--u)); display: inline-flex; align-items: center; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: calc(4 * var(--u)); }

/* Dark theme (Axus, Nov 1): the homepage and setup steps use <body class="theme-dark">.
   Orange stays orange; text on orange stays dark. */
.theme-dark {
  --page: #0E0C0B; --panel: #1A1714; --panel-2: #141110; --line: #2B2723; --bar: #2A2521; --chip: #2B2622;
  --ink: #F6F3EF; --ink-soft: #D9D2C8; --muted: #A69C91; --orange-light: #5A3A17;
  --serif: 'EB Garamond', Garamond, Georgia, serif;
  color-scheme: dark;
}
.theme-dark .btn-primary { color: #2A2622; }
.theme-dark .btn-secondary:hover { filter: brightness(1.15); }

@keyframes rise { from { opacity: 0; transform: translateY(calc(6 * var(--u))); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 calc(20 * var(--u)); }
}
