@font-face { font-family: "Libre Franklin"; font-weight: 400 700; font-style: normal; font-display: swap; src: url(fonts/LibreFranklin.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400 600; font-style: normal; font-display: swap; src: url(fonts/SourceSerif4-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/SourceSerif4-italic.woff2) format("woff2"); }

:root {
  --bg: #dddbda;
  --surface: #d4d1ce;
  --surface-2: #cac6c1;
  --ink: #2f2e2d;
  --muted: #55514d;
  --accent: #c22f2a;
  --accent-press: #a92621;
  --accent-ink: #ffffff;
  --focus: var(--accent);
  --word-bg: var(--ink);
  --word-ink: var(--bg);
  --shimmer: rgba(255, 255, 255, 0.4);

  --display: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-hero: clamp(3rem, 1.2rem + 6vw, 7rem);

  --margin: clamp(20px, 2.6vw, 40px);
  --section: clamp(96px, 10vw, 160px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Dark: the same warm greys, turned down. Text 11:1 or more, grey text 5.5:1 or more;
   the red is a step lighter so buttons keep white text at 4.5:1 and the focus ring shows. */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1b1a;
  --surface: #252321;
  --surface-2: #2f2c29;
  --ink: #ebe8e4;
  --muted: #a8a29b;
  --accent: #d23a34;
  --accent-press: #b8302b;
  --focus: #e0443e;
  --word-bg: var(--surface-2);
  --word-ink: var(--ink);
  --shimmer: rgba(255, 255, 255, 0.06);
}
/* GitHub's preview cards are white; one notch down so they do not glare on the dark ground */
[data-theme="dark"] .row .pic img { filter: brightness(0.9); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-body)/1.55 var(--text); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Navigation */
.nav { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 28px var(--margin) 0; font: 700 0.9375rem/1 var(--display); }
.nav .mark { font-size: 1.25rem; text-decoration: none; letter-spacing: -0.02em; }
.nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav ul a { text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color 160ms ease; }

/* The light/dark switch: set like the links beside it - same face, same underline on hover -
   with a small drawn icon. It names what it switches to. 44px tall to tap, without moving the line. */
.theme { display: none; align-items: center; gap: 0.4em; min-height: 44px; margin: -14px 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.18em; transition: text-decoration-color 160ms ease; }
.can-theme .theme { display: inline-flex; }
.theme .ico { position: relative; width: 1.05em; height: 1.05em; flex: none; }
.theme svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity 200ms var(--ease-out), transform 300ms var(--ease-out); }
.theme .moon path { fill: currentColor; stroke: none; }
.theme .sun, [data-theme="dark"] .theme .moon { opacity: 0; transform: rotate(-60deg) scale(0.6); }
[data-theme="dark"] .theme .sun { opacity: 1; transform: none; }
.theme .to-light, [data-theme="dark"] .theme .to-dark { display: none; }
[data-theme="dark"] .theme .to-light { display: inline; }
.theme:active .ico { transform: scale(0.9); transition: transform 120ms var(--ease-out); }

/* Colours cross-fade only while the switch is pressed (theme.js sets .theming for 320 ms) */
.theming, .theming * { transition: background-color 280ms ease, color 280ms ease, border-color 280ms ease, fill 280ms ease !important; }

/* Hero: the name, set as large as the page allows */
.hero { padding: clamp(64px, 9vw, 140px) var(--margin) 0; }
.who { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 40px); }
.avatar { width: clamp(52px, 5.5vw, 88px); height: auto; aspect-ratio: 1; border-radius: 24%; background: var(--surface-2); flex: none; }
.hero h1 { font-size: var(--step-hero); line-height: 0.82; letter-spacing: -0.05em; text-transform: uppercase; white-space: nowrap; }
.hero .lead { margin-top: clamp(28px, 3vw, 48px); max-width: 36ch; font-size: var(--step-lead); line-height: 1.4; }
.hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 32px; }
.hero .meta { color: var(--muted); }

/* Projects */
.projects { padding: var(--section) var(--margin) 0; }
.projects-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; margin-bottom: 48px; }
.projects h2 { font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.03em; }
.count { color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); background: var(--surface); transition: background-color 200ms ease; }
.row .pic { display: block; aspect-ratio: 2 / 1; background: var(--surface-2); overflow: hidden; overflow: clip; }
.row .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease-out); }
.row .txt { padding: clamp(24px, 3vw, 44px); display: flex; flex-direction: column; gap: 14px; }
.row h3 { font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.row h3 a { text-decoration: none; }
.row .desc { font-size: var(--step-lead); line-height: 1.35; max-width: 34ch; }
.row .facts { max-width: 60ch; }
.row .topics { max-width: 60ch; }
.row .links { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-top: auto; padding-top: 12px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; background: var(--accent); color: var(--accent-ink); font: 700 1rem/1 var(--display); text-decoration: none; transition: transform 160ms var(--ease-out), background-color 160ms ease; }
.btn:active { transform: scale(0.97); background: var(--accent-press); }
.textlink { font: 700 1rem/1 var(--display); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); transition: text-decoration-color 160ms ease; }
.fallback { margin-top: 24px; }

/* Skeleton while the list loads */
.skeleton .pic, .skeleton .bar { position: relative; overflow: hidden; }
.skeleton .bar { display: block; height: 18px; background: var(--surface-2); }
.skeleton .bar.w40 { width: 40%; height: 40px; } .skeleton .bar.w90 { width: 90%; } .skeleton .bar.w70 { width: 70%; } .skeleton .bar.w30 { width: 30%; }
.skeleton .pic::after, .skeleton .bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--shimmer), transparent); transform: translateX(-100%); animation: shimmer 1.4s ease-in-out infinite; } /* taste-skill-ignore: skeleton shimmer while loading */
@keyframes shimmer { to { transform: translateX(100%); } }

/* Footer */
.foot { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; padding: 8px; margin-top: var(--section); }
.word { display: flex; align-items: center; justify-content: center; min-height: 300px; background: var(--word-bg); color: var(--word-ink); font: 700 clamp(3rem, 1rem + 8vw, 9rem)/0.9 var(--display); letter-spacing: -0.04em; }
.go { display: flex; flex-direction: column; justify-content: space-between; min-height: 300px; padding: 24px; background: var(--accent); color: var(--accent-ink); text-decoration: none; transition: background-color 200ms ease; }
.go span { font: 700 var(--step-lead)/1.1 var(--display); }
.go svg { align-self: end; width: 56px; height: 56px; transition: transform 260ms var(--ease-out); }

/* Hover only where there is a pointer */
@media (hover: hover) and (pointer: fine) {
  .nav ul a:hover, .theme:hover { text-decoration-color: currentColor; }
  .row:hover { background: var(--surface-2); }
  .row:hover .pic img { transform: scale(1.03); }
  .btn:hover { background: var(--accent-press); }
  .textlink:hover { text-decoration-color: currentColor; }
  .go:hover { background: var(--accent-press); }
  .go:hover svg { transform: translate(4px, 4px); }
}

/* Entrances */
.avatar, .hero h1, .hero .lead, .hero .actions > * { animation: rise 800ms var(--ease-out) both; }
.hero h1 { animation-delay: 60ms; } .hero .lead { animation-delay: 120ms; }
.hero .actions > :first-child { animation-delay: 180ms; } .hero .actions > :last-child { animation-delay: 240ms; }
.js [data-rise] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.js [data-rise].in { opacity: 1; transform: none; }
[data-delay="1"] { --i: 1; }
.row.enter { animation: rise 700ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .avatar, .hero h1, .hero .lead, .hero .actions > *, .row.enter { animation: fade 300ms ease both; }
  .js [data-rise] { transform: none; transition: opacity 300ms ease; }
  .skeleton .pic::after, .skeleton .bar::after { animation: none; }
  .row .pic img, .go svg, .theme svg { transition: none; }
  .theme .sun, [data-theme="dark"] .theme .moon { transform: none; }
  .theming, .theming * { transition: none !important; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}

@media (max-width: 820px) {
  .nav ul { gap: 20px; }
  .hero h1 { font-size: 13vw; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .foot { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 6px; }
  .word, .go { min-height: 160px; }
}
