/* Tokens, fonts and the few rules both documents share. Every value traces to DESIGN.md. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("/assets/fonts/fragment-mono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Fallbacks with Inter's metrics, so the swap from a system face does not move the page. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 107.12%;
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
}
/* Advance widths measured in Chrome: Fragment Mono 0.618em, Consolas 0.550em; Menlo, DejaVu Sans Mono and
   Courier New are all 0.600–0.602em. The fallbacks are scaled to Fragment Mono's width. */
@font-face {
  font-family: "Mono Fallback Consolas";
  src: local("Consolas");
  size-adjust: 112.4%;
}
@font-face {
  font-family: "Mono Fallback";
  src: local("Menlo"), local("DejaVu Sans Mono"), local("Courier New");
  size-adjust: 103%;
}

:root {
  --paper: #F5F1E8;
  --ink: #1D1B1A;
  --ink-2: #4A4641;
  --ink-3: #6B655D;
  --rule-strong: #8A847B;
  --hairline: #C9C2B4;
  --seal: #C43A2B;
  --on-ink: #F5F1E8;

  --sans: "Inter", "Inter Fallback", system-ui, sans-serif;
  --mono: "Fragment Mono", "Mono Fallback Consolas", "Mono Fallback", ui-monospace, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px; --s10: 160px;

  --micro: 120ms;
  --state: 240ms;
  --structure: 480ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.6, 0, 0.2, 1);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { min-height: 100svh; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; } /* a component's own display (e.g. .btn's flex) must not override hidden */

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--ink); color: var(--paper); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Buttons: things you press sit on the page as separate pieces of paper (2px radius, 1px edge). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 44px; padding: 0 var(--s4);
  border: 1px solid var(--rule-strong); border-radius: 2px;
  background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 500; line-height: 1; letter-spacing: -0.006em;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: border-color var(--micro) var(--ease-out), background-color var(--micro) var(--ease-out);
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }

/* Home ⇄ résumé: one document becoming the other. The name is the shared element. */
@view-transition { navigation: auto; }
.vt-name { view-transition-name: name; }
::view-transition-group(root) { animation-duration: var(--structure); animation-timing-function: var(--ease-in-out); }
::view-transition-group(name) { animation-duration: var(--structure); animation-timing-function: var(--ease-in-out); }
::view-transition-old(name), ::view-transition-new(name) { height: 100%; width: auto; object-fit: contain; object-position: left center; }

/* Reduced motion: no movement. Opacity changes (the bars dissolving) stay, they do not move anything. */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
