/* What the three directions share: the portfolio dashboard's dark tokens, type, header, buttons and footer. */
:root {
  color-scheme: dark;
  --surface-0: #100e0c;
  --surface-1: #181513;
  --surface-2: #211d1a;
  --rule: #393431;
  --rule-strong: #d5d0ca;
  --ink: #f2f0ec;
  --text-secondary: #c7c3be;
  --text-muted: #9f9b96;
  --primary: #fba541;
  --primary-ink: #fcae52;
  --on-primary: #100e0c;
  --bone: #d5d0ca;
  --wire: #8a8580;
  --fig-bg: var(--surface-0);
  --font-display: Archivo, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Chivo Mono", ui-monospace, Menlo, monospace;
  --r-sm: 2px;
  --r-md: 4px;
  --s-xs: 4px; --s-sm: 8px; --s-md: 16px; --s-lg: 24px; --s-xl: 40px; --s-2xl: 56px; --s-3xl: 88px;
  --gutter: clamp(16px, 3vw, 32px);
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --head: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head) + 20px); scrollbar-color: var(--rule) var(--surface-0); }
body {
  margin: 0; background: var(--surface-0); color: var(--ink);
  font-family: var(--font-display); font-size: 16px; font-weight: 400; line-height: 1.55;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; overflow-x: clip;
}
a { color: var(--primary-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--primary); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--primary); color: var(--on-primary); }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { list-style: none; margin: 0; padding: 0; }
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 40; padding: 8px 12px; background: var(--ink); color: var(--surface-0); }
.skip:focus { left: 8px; }
.arrow { flex: none; }
.label { font-family: var(--font-mono); font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }

/* masthead */
.masthead { position: sticky; top: 0; z-index: 30; background: var(--surface-0); border-bottom: 1px solid var(--rule); }
.masthead-inner { display: flex; align-items: center; gap: var(--s-md); min-height: var(--head); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; font-stretch: 122%; font-weight: 700; font-size: 15px; letter-spacing: 0.005em; }
.wordmark svg { width: 20px; height: 20px; color: var(--primary); flex: none; }
.masthead nav { display: flex; flex-wrap: wrap; gap: 0 2px; margin-left: auto; }
.masthead nav a { padding: 6px 10px; font-size: 14px; color: var(--text-secondary); text-decoration: none; border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s; }
.masthead nav a:hover { color: var(--ink); border-bottom-color: var(--primary); }

/* type */
h1 { font-weight: 640; font-stretch: 112%; font-size: clamp(2.1rem, 1rem + 3.2vw, 3.6rem); line-height: 1; letter-spacing: -0.024em; }
h2 { font-weight: 620; font-stretch: 110%; font-size: clamp(1.3rem, 1.05rem + 0.9vw, 1.75rem); line-height: 1.1; letter-spacing: -0.015em; }
h3 { font-size: 17px; font-weight: 600; font-stretch: 104%; line-height: 1.3; }
.lede { font-size: clamp(16px, 0.95rem + 0.25vw, 19px); color: var(--text-secondary); max-width: 56ch; }
.prose { max-width: 66ch; font-size: 17px; color: var(--text-secondary); }
.prose p + p { margin-top: var(--s-md); }
.prose p:first-child { color: var(--ink); }

/* buttons and links */
.actions { display: flex; flex-wrap: wrap; gap: var(--s-sm); }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: var(--r-md); background: var(--surface-0); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; transition: box-shadow 0.2s var(--ease); white-space: nowrap; }
.btn:hover { box-shadow: inset 0 -3px 0 var(--primary); }
.btn.primary { background: var(--ink); color: var(--surface-0); }
.btn .arrow, .link .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow, .link:hover .arrow { transform: translateX(3px); }
.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* figures: decoration for the text they sit with. They take no pointer events and carry no text. */
.fig { position: absolute; margin: 0; pointer-events: none; user-select: none; overflow: hidden; }
.fig canvas, .fig .still, .fig .still img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fig .still img { object-fit: contain; }
.fig canvas { opacity: 0; transition: opacity 0.9s var(--ease); }
.fig.is-live canvas { opacity: 1; }
.fig.is-static canvas { display: none; }

/* further pages */
.pages a { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr) auto; align-items: baseline; gap: var(--s-md) var(--s-2xl); padding: 14px 8px; border-bottom: 1px solid var(--rule); color: var(--text-secondary); text-decoration: none; transition: background-color 0.15s; }
.pages a:hover { background: var(--surface-1); }
.pages-title { color: var(--ink); font-weight: 600; font-size: 17px; font-stretch: 104%; }
.pages .arrow { color: var(--primary); transition: transform 0.2s var(--ease); }
.pages a:hover .arrow { transform: translateX(4px); }

/* footer */
.foot { position: relative; margin-top: var(--s-3xl); border-top: 1px solid var(--rule); background: var(--surface-0); }
.foot-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-sm) var(--s-lg); padding-top: var(--s-lg); padding-bottom: var(--s-xl); }
.foot-name { font-stretch: 116%; font-weight: 650; font-size: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot nav a { font-size: 14px; color: var(--text-secondary); text-decoration: none; padding: 4px 0; }
.foot nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--primary); }

@media (max-width: 860px) {
  .masthead { position: static; }
  .masthead-inner { flex-wrap: wrap; padding-top: 10px; gap: 6px; }
  .masthead nav { margin: 0 calc(var(--gutter) * -1); width: calc(100% + var(--gutter) * 2); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
  .masthead nav a { padding: 9px 8px 9px var(--gutter); border-bottom: 0; border-right: 1px solid var(--rule); font-size: 13px; }
  .masthead nav a:nth-child(3n) { border-right: 0; }
  .masthead nav a:nth-child(-n+3) { border-bottom: 1px solid var(--rule); }
  .wordmark { font-size: 14px; font-stretch: 112%; flex: 0 1 auto; min-width: 0; }
  .pages a { grid-template-columns: 1fr auto; row-gap: 2px; }
  .pages-note { grid-column: 1; grid-row: 2; }
  .pages .arrow { grid-row: 1 / span 2; align-self: center; }
}
@media (max-width: 640px) {
  .btn { white-space: normal; padding: 8px 16px; }
  .wordmark { line-height: 1.2; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
