@font-face { font-family: "Afacad Flux"; src: url(/fonts/afacad-flux.woff2) format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Spline Sans Mono"; src: url(/fonts/spline-sans-mono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  --ground: #f5f5f2;
  --ink: #1a1a1a;
  --supporting: #62615d;
  --seal: #cb361e;

  --side: clamp(28px, 5.6vw, 128px);
  --edge: clamp(28px, 9.5svh, 112px);
  --rail: clamp(190px, 24vw, 520px);
  --large: clamp(28px, 10px + 2.22vw, 64px);
  --small: clamp(17px, 14px + 0.22vw, 22px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0f1728;
    --ink: #edebe4;
    --supporting: #a3a098;
    --seal: #f0543c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0f1728;
  --ink: #edebe4;
  --supporting: #a3a098;
  --seal: #f0543c;
}

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

html { background: var(--ground); color: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* two columns: the name, pages and address share the first */

body {
  min-height: max(100svh, 380px);
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  padding: 0 var(--side);
  font: 400 var(--small)/1.5 "Afacad Flux", "Gill Sans", "Avenir Next", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--ink); color: var(--ground); }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

header, footer { grid-area: 1 / 1; position: sticky; padding: var(--edge) 0; line-height: 1.25; }
header { align-self: start; justify-self: start; top: 0; }
footer { align-self: end; justify-self: start; bottom: 0; }

.name { font-weight: 500; letter-spacing: 0.01em; text-decoration: none; }

nav { margin-top: 1.6em; }
nav ul { padding: 0; list-style: none; }
nav a { position: relative; display: inline-block; padding: 4px 0; color: var(--supporting); text-decoration: none; }
nav a:hover, nav a[aria-current] { color: var(--ink); }
nav a[aria-current] { font-weight: 500; }

/* the dot: the page you are on */

nav a[aria-current]::before, .lost main::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--seal); }
nav a[aria-current]::before { left: -18px; top: calc(50% - 4px); }

/* light or dark: a small half disc at the top right, on the line of the name */

.theme { grid-area: 1 / 2; align-self: start; justify-self: end; position: sticky; top: calc(var(--edge) + 0.625 * var(--small) - 22px); width: 44px; height: 44px; margin: calc(var(--edge) + 0.625 * var(--small) - 22px) -16px 0 0; padding: 0; border: 0; background: none; color: var(--supporting); cursor: pointer; }
.theme::before { content: ""; position: absolute; inset: 16px; border: 1.5px solid; border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.theme:hover { color: var(--ink); }
.theme:focus-visible { outline-offset: -10px; border-radius: 50%; }

footer a { display: inline-block; padding: 4px 0; margin: -4px 0; }

main { grid-area: 1 / 2; align-self: center; padding: var(--edge) 0 calc(var(--edge) + 4svh); }

/* one paragraph in two inks */

.say { max-width: 15.8em; font-size: var(--large); font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; }
.say h1 { display: inline; font: inherit; }
.say p { display: inline; color: var(--supporting); }
.say a { color: var(--ink); text-decoration-thickness: 0.04em; text-underline-offset: 0.3em; }
.say a:hover { text-decoration-thickness: 0.08em; }
.say span, time { white-space: nowrap; }

/* support, privacy */

.page main { align-self: start; padding-bottom: calc(var(--edge) * 1.6); }
.page .say { margin-top: -0.28em; }
.page .say h1, .page .say p { display: block; }
.page section { max-width: 34em; margin-top: 2.6em; color: var(--supporting); text-wrap: pretty; }
.page .say + section { margin-top: clamp(64px, 14svh, 160px); }
.page section h2 { margin-bottom: 0.2em; font: inherit; font-weight: 500; color: var(--ink); }
.page section a { color: var(--ink); }
.page section p + p, .page section ul + p { margin-top: 0.8em; }
.page section ul { padding: 0; list-style: none; }
.page section li + li { margin-top: 0.25em; }

/* 404: the dot has left the list */

.lost main::after { right: var(--side); bottom: calc(var(--edge) + 0.4em); }
.lost { position: relative; }
.lost .say p + p { display: block; margin-top: 0.6em; }

/* home: the balance. Set at twice its size and scaled down, so a browser's smallest type size can't stretch it */

.balance { --cell: 3.5px; grid-area: 1 / 2; align-self: end; justify-self: end; position: relative; width: calc(56 * 1.2 * var(--cell)); height: calc(34 * 2 * var(--cell)); margin-bottom: calc(var(--edge) - 2 * var(--cell)); }
.balance pre { position: absolute; left: 0; top: 0; font: 500 calc(4 * var(--cell))/1 "Spline Sans Mono", Menlo, Consolas, monospace; font-variant-ligatures: none; transform: scale(0.5); transform-origin: 0 0; user-select: none; -webkit-user-select: none; }
.balance button { position: absolute; inset: 0; border: 0; border-radius: 50%; padding: 0; background: none; cursor: pointer; }

@media (max-height: 600px) {
  .balance { display: none; }
}

@media (max-height: 420px) {
  header, footer { position: static; }
  .theme { position: relative; top: auto; }
}

@media (max-width: 719px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
  header, footer { position: static; }
  .theme { grid-area: 1 / 1; position: relative; top: auto; }
  header { grid-area: 1 / 1; padding-bottom: 0; }
  main, .page main { grid-area: 2 / 1; padding: clamp(48px, 10svh, 96px) 0; }
  main { align-self: center; }
  footer { grid-area: 3 / 1; padding-top: 0; }
  nav { margin-top: 1em; }
  nav a { padding: 9px 0; }
  footer a { padding: 10px 0; margin: -10px 0; }
  .page .say + section { margin-top: 2.6em; }
  .balance { --cell: 2.3px; grid-area: 3 / 1; }
  main:has(+ .balance) { padding: 28px 0; }
}
