/*
 * fzentowski.pw — one stylesheet, no framework.
 * Deep forest green with a faint blueprint grid and thin section lines, system font,
 * translucent header, instant press feedback. Light theme via [data-theme="light"].
 */

/* ---------- Tokens ---------- */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  /* deep forest ground, warm off-white ink, moss accent for text and lines */
  --bg: #0e1b14;
  --bg-raised: #122219;
  --surface: #15271d;
  --surface-hover: #1a2f23;
  --glass: rgb(14 27 20 / 0.74);
  --sheet: rgb(18 34 25 / 0.97);
  --line: rgb(185 215 190 / 0.12);
  --line-strong: rgb(185 215 190 / 0.24);
  --grid: rgb(185 215 190 / 0.045);
  --ink: #e9eee6;
  --ink-soft: #a9bbad;
  --accent: #8fc49c;
  --accent-strong: #a9d3b3;
  --accent-wash: rgb(143 196 156 / 0.1);
  /* solid fills (primary buttons, active filter, selection): forest with light text */
  --fill: #3a7350;
  --fill-hover: #2f6343;
  --fill-ink: #f4f7f2;
  --good: #8fc49c;
  --warn: #dcb662;
  --bad: #dd8f96;
  --shadow: 0 24px 60px -30px rgb(0 0 0 / 0.7);
}

[data-theme="light"] {
  color-scheme: light;
  /* warm paper ground, forest ink and accent */
  --bg: #f3f5f0;
  --bg-raised: #e9eee6;
  --surface: #ffffff;
  --surface-hover: #f7f9f5;
  --glass: rgb(243 245 240 / 0.8);
  --sheet: rgb(255 255 255 / 0.97);
  --line: rgb(30 70 45 / 0.14);
  --line-strong: rgb(30 70 45 / 0.28);
  --grid: rgb(30 70 45 / 0.045);
  --ink: #13251a;
  --ink-soft: #4b5f51;
  --accent: #2f6a45;
  --accent-strong: #24543a;
  --accent-wash: rgb(47 106 69 / 0.08);
  --fill: #2f6a45;
  --fill-hover: #24543a;
  --fill-ink: #ffffff;
  --good: #2f6a45;
  --warn: #8a6100;
  --bad: #a3343f;
  --shadow: 0 24px 60px -34px rgb(20 45 30 / 0.3);
}

:root {
  --font: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  --font-display: system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* type scale: tracking tightens as size grows, leading loosens as it shrinks */
  --t-small: 0.875rem;
  --t-body: 1.0625rem;
  --t-lead: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --t-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
  --t-h2: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
  --t-h1: clamp(2.5rem, 1.6rem + 3.6vw, 4.75rem);

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-small: 9px;
  --header-h: 4rem;

  /* critically damped, no overshoot (Apple: damping 1.0) */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --press: 100ms;
  --move: 380ms;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-body) / 1.6 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 300ms ease, color 300ms ease;
}

main {
  flex: 1;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-h1);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h2 {
  font-size: var(--t-h2);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

h3 {
  font-size: var(--t-h3);
  line-height: 1.25;
  letter-spacing: -0.012em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--fill);
  color: var(--fill-ink);
  border-radius: var(--radius-small);
}

.skip-link:focus {
  top: 1rem;
}

.icon {
  /* Font Awesome icons: filled shapes of varying width, sized by height */
  width: auto;
  height: 1em;
  flex: none;
  fill: currentColor;
}

/* Blueprint grid behind everything, fading out below the first screen */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 70% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 70% 0%, #000 30%, transparent 75%);
}

/* ---------- Header: a translucent layer content scrolls under ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

/* scroll-edge effect: the line only appears once content is underneath */
.site-header[data-scrolled] {
  border-bottom-color: var(--line);
}

.site-header__inner {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand__mark {
  width: 34px;
  height: 34px;
  flex: none;
  overflow: visible;
}

.brand__trace {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand__in {
  fill: var(--bg);
  stroke: var(--ink);
  stroke-width: 6;
}

.brand__out {
  fill: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

/* the signal runs through the trace on hover */
@media (prefers-reduced-motion: no-preference) {
  .brand:hover .brand__trace {
    stroke-dasharray: 18 10;
    animation: brand-signal 0.8s linear 1 forwards;
  }
}

@keyframes brand-signal {
  to {
    stroke-dashoffset: -28;
  }
}

.nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.nav a {
  position: relative;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-small);
  color: var(--ink-soft);
  font-size: 1rem;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, transform var(--press) ease-out;
}

.nav a:hover {
  color: var(--ink);
  background: var(--accent-wash);
}

.nav a:active {
  transform: scale(0.96);
}

.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.2rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.site-header__tools {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, transform var(--press) ease-out;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--accent-wash);
}

.icon-button:active {
  transform: scale(0.92);
}

.icon-button > span {
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

[data-theme="dark"] .icon--moon,
[data-theme="light"] .icon--sun,
.nav-toggle[aria-expanded="true"] .nav-toggle__open,
.nav-toggle[aria-expanded="false"] .nav-toggle__close {
  display: none;
}

.nav-toggle {
  display: none;
}

/* ---------- Buttons, chips, links ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.875rem;
  padding: 0 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 600 1rem / 1 var(--font);
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform var(--press) ease-out;
}

.button:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-wash);
}

/* feedback on press, not on release */
.button:active,
.chip:active,
.filter:active {
  transform: scale(0.97);
}

.button .icon {
  width: auto;
  height: 1.1rem;
  flex: none;
}

.button--primary {
  border-color: var(--fill);
  background: var(--fill);
  color: var(--fill-ink);
}

.button--primary:hover {
  border-color: var(--fill-hover);
  background: var(--fill-hover);
  color: var(--fill-ink);
}

.chip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 550;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform var(--press) ease-out;
}

.chip .icon {
  width: auto;
  height: 1rem;
}

.chip:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-wash);
}

.chip--accent {
  border-color: transparent;
  background: var(--accent-wash);
  color: var(--accent);
}

.text-link {
  color: var(--ink-soft);
  font-size: 1rem;
  text-decoration: none;
}

.text-link::after {
  content: " →";
  display: inline-block;
  transition: transform 200ms var(--ease);
}

.text-link:hover::after {
  transform: translateX(3px);
}

/* ---------- Schematic lines ---------- */

/* Section heading with a process line running to the right edge, ending in a node */
.rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: var(--t-h2);
}

.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  min-width: 2rem;
  background: linear-gradient(90deg, var(--line-strong), var(--line) 70%, transparent);
}

.section__head {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section__head .rule {
  flex: 1;
}

/* Frame with corner ticks, like a viewport on a drawing */
.frame {
  position: relative;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--bg-raised);
}

.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
}

.frame::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
  border-top-left-radius: calc(var(--radius) + 6px);
}

.frame::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 2px 2px 0;
  border-bottom-right-radius: calc(var(--radius) + 6px);
}

.frame img {
  width: 100%;
  border-radius: var(--radius);
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(1.5rem, 4vw, 3rem);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.hero__path {
  margin-bottom: 1.25rem;
  color: var(--accent);
  font: 500 var(--t-small) / 1.4 var(--mono);
  letter-spacing: 0.02em;
}

.hero__title {
  max-width: 11ch;
  font-size: clamp(2.75rem, 1.5rem + 5vw, 6.5rem);
}

.hero__lead {
  max-width: 40ch;
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-size: var(--t-lead);
  line-height: 1.5;
}

.hero__figure {
  width: 100%;
  margin: 0;
}

.frame--portrait {
  position: relative;
}

.frame--portrait img {
  aspect-ratio: 352 / 405;
  object-fit: cover;
  object-position: 40% 20%;
  filter: saturate(0.85) contrast(1.03);
  transition: opacity 700ms ease;
}

/* data points that settle into the photo once on load; canvas sits exactly over the image */
.dots {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-radius: var(--radius);
  pointer-events: none;
  transition: opacity 700ms ease;
}

.frame--portrait[data-dots="playing"] img {
  opacity: 0;
}

.frame--portrait[data-dots="done"] .dots {
  opacity: 0;
}

.hero__caption {
  margin-top: 0.85rem;
  color: var(--ink-soft);
  font: 500 var(--t-small) / 1.4 var(--mono);
  text-align: right;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 200ms ease, background-color 200ms ease, transform var(--move) var(--ease), box-shadow var(--move) var(--ease);
}

.card:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

/* the whole card is the link; actions sit above it */
.card:active {
  transform: translateY(-1px) scale(0.99);
  transition-duration: var(--press);
}

.card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
}

/* light screenshots sit inset on the dark ground so they don't glare between dark ones */
.card__media--light {
  padding: 0.75rem 0.75rem 0;
}

.card__media--light img {
  border-radius: calc(var(--radius) / 2) calc(var(--radius) / 2) 0 0;
}

.card__media picture {
  display: block;
  height: 100%;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 600ms var(--ease);
}

.card:hover .card__media img {
  transform: scale(1.03);
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem 1.35rem 1.35rem;
}

.card__meta {
  color: var(--ink-soft);
  font: 500 var(--t-small) / 1.4 var(--mono);
  letter-spacing: 0.01em;
}

.card__title {
  font-size: var(--t-h3);
}

.card__link {
  text-decoration: none;
}

.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card__text {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.card__more {
  order: 2;
  flex-basis: 100%;
  margin-top: 0.35rem;
  color: var(--accent);
  font-size: var(--t-small);
  font-weight: 600;
}

.card__more::after {
  content: " →";
  display: inline-block;
  transition: transform 200ms var(--ease);
}

.card:hover .card__more::after {
  transform: translateX(3px);
}

/* ---------- Filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter {
  min-height: 2.25rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: 500 var(--t-small) / 1 var(--font);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform var(--press) ease-out;
}

.filter:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.filter[aria-pressed="true"] {
  border-color: var(--fill);
  background: var(--fill);
  color: var(--fill-ink);
}

.card[hidden] {
  display: none;
}

.filters__empty {
  color: var(--ink-soft);
}

/* ---------- Pages ---------- */

.page {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem);
}

.page-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

.page-head__path {
  margin-bottom: 1rem;
  color: var(--accent);
  font: 500 var(--t-small) var(--mono);
}

.page-head__lead {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: var(--t-lead);
  line-height: 1.5;
}

.page-head .actions {
  margin-top: 1.75rem;
}

/* Long-form text */
.prose {
  max-width: 42rem;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: var(--t-h3);
  letter-spacing: -0.015em;
}

.prose h3 {
  margin-top: 2.25rem;
  font-size: var(--t-h3);
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 0.6em;
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose li::marker {
  color: var(--accent);
}

.prose strong {
  font-weight: 650;
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--accent-wash);
  font: 0.9em var(--mono);
}

.prose iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---------- Project page ---------- */

.project-head {
  padding: clamp(2rem, 5vw, 3.5rem) 0 2rem;
  max-width: var(--wrap);
}

.project-head h1 {
  max-width: 18ch;
}

.project-head__lead {
  max-width: 40rem;
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: var(--t-lead);
  line-height: 1.5;
}

.crumbs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
  font: 500 var(--t-small) var(--mono);
}

.crumbs a {
  color: var(--accent);
  text-decoration: none;
}

.facts {
  display: grid;
  gap: 1.25rem;
  margin: 0;
}

.facts dt {
  color: var(--ink-soft);
  font: 500 var(--t-small) var(--mono);
}

.facts dd {
  margin: 0.35rem 0 0;
}

.facts__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.facts__tags span {
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--t-small);
}

.facts__links {
  display: grid;
  gap: 0.35rem;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.project-head .actions {
  margin-top: 1.75rem;
}

.project-shot {
  margin-block: 0 clamp(2.5rem, 6vw, 4rem);
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  align-items: start;
  gap: clamp(2rem, 5vw, 4rem);
}

.project-aside {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.project-aside__panel {
  padding: 1.25rem 1.35rem;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--line);
  margin-top: 4rem;
}

.project-nav__link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 48%;
  font-weight: 600;
  text-decoration: none;
}

.project-nav__link span {
  color: var(--ink-soft);
  font: 500 var(--t-small) var(--mono);
}

.project-nav__link--next {
  margin-left: auto;
  text-align: right;
}

/* ---------- Timeline (CV and homepage) ---------- */

.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline {
  --when: 10.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: calc(var(--when) + 1rem);
  width: 1px;
  background: var(--line-strong);
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: var(--when) minmax(0, 1fr);
  gap: 2rem;
  padding: 0 0 2.25rem;
}

.timeline__item::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  left: calc(var(--when) + 1rem - 4px);
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.timeline__item:first-child::before {
  background: var(--accent);
}

.timeline__when {
  padding-top: 0.15rem;
  white-space: nowrap;
  color: var(--ink-soft);
  font: 500 var(--t-small) / 1.6 var(--mono);
  text-align: right;
}

.timeline__what h3 {
  font-size: var(--t-h3);
}

.timeline__where {
  margin-top: 0.15rem;
  color: var(--ink-soft);
}

.timeline__what ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink);
}

.timeline__what li + li {
  margin-top: 0.35rem;
}

.timeline__what li::marker {
  color: var(--accent);
}

.timeline--compact .timeline__item {
  padding-bottom: 1.5rem;
}

/* Homepage: work and education side by side, each its own line */
.career-split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
}

.career-col {
  padding: 1.5rem 1.5rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.career-col--edu {
  border-style: dashed;
  background: transparent;
}

.career-col__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  font-size: var(--t-body);
  letter-spacing: 0;
}

.career-col__head .icon {
  width: auto;
  height: 1.35rem;
}

.steps {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.5rem;
  list-style: none;
}

.steps::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  bottom: 1.5rem;
  left: 4px;
  width: 1px;
  background: var(--line-strong);
}

.steps__item {
  position: relative;
  padding-bottom: 1.5rem;
}

.steps__item::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  left: calc(-1.5rem);
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.steps__item:first-child::before {
  background: var(--accent);
}

/* education nodes are squares and the line is dashed */
.career-col--edu .steps::before {
  width: 0;
  border-left: 1px dashed var(--line-strong);
  background: none;
}

.career-col--edu .steps__item::before {
  border-radius: 2px;
  background: var(--bg);
}

.steps__when {
  color: var(--ink-soft);
  font: 500 var(--t-small) / 1.6 var(--mono);
}

.steps__item h4 {
  margin: 0.15rem 0 0;
  font: 650 var(--t-body) / 1.3 var(--font-display);
  letter-spacing: -0.01em;
}

.steps__where {
  margin-top: 0.1rem;
}

.steps__note {
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.cv-section + .cv-section {
  margin-top: 3.5rem;
}

.cv-section .rule {
  margin-bottom: 2rem;
}

.rule__label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.rule__label .icon {
  width: auto;
  height: 0.8em;
  color: var(--accent);
}

.timeline__item--edu::before {
  border-radius: 2px;
}

.cv-head__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* ---------- Yield teaser ---------- */

.yield {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.yield__intro p {
  margin-top: 0.6rem;
  color: var(--ink-soft);
}

.yield__controls {
  display: grid;
  gap: 1.25rem;
}

.field__label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.field__label output {
  color: var(--ink);
  font: 600 1rem var(--mono);
}

input[type="range"] {
  width: 100%;
  height: 1.75rem;
  margin: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}

.yield__figure {
  color: var(--accent);
  font: 650 clamp(3rem, 2rem + 4vw, 4.5rem) / 1 var(--font-display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.yield__figure small {
  margin-left: 0.15em;
  font-size: 0.45em;
  letter-spacing: 0;
}

.yield__verdict {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* ---------- Contact ---------- */

.contact__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: end;
  gap: 2rem clamp(2rem, 6vw, 5rem);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-top: 1px solid var(--line);
}

.contact__inner::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.contact__title {
  max-width: 20ch;
}

.contact__text {
  max-width: 36rem;
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: var(--t-lead);
}

.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  color: var(--accent);
  font: 650 clamp(1.375rem, 1rem + 1.4vw, 2rem) / 1.2 var(--font-display);
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
  transition: color var(--move) var(--ease), transform 100ms ease;
}

.contact__mail:hover {
  color: var(--ink);
}

.contact__mail:active {
  transform: scale(0.97);
}

/* ---------- Calculator ---------- */

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  align-items: start;
  gap: 1.5rem;
  padding-bottom: 4rem;
}

.calc__inputs {
  display: grid;
  gap: 1.25rem;
}

.calc__group {
  margin: 0;
  padding: 1.25rem 1.35rem 1.4rem;
  min-width: 0;
}

.calc__group legend {
  float: left;
  width: 100%;
  margin-bottom: 1rem;
  font: 650 var(--t-body) var(--font-display);
}

.calc__fields {
  display: grid;
  gap: 1rem;
  clear: both;
}

.calc__fields + .calc__fields {
  margin-top: 1rem;
}

.calc__fields--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.calc__fields--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calc__fields--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calc__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.calc__pair .calc__group {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.input {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  clear: both;
}

.input__label {
  font-size: 1rem;
  font-weight: 550;
}

.input__hint {
  color: var(--ink-soft);
  font-size: var(--t-small);
  line-height: 1.35;
}

.input input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--bg);
  color: var(--ink);
  font: 500 1rem var(--mono);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input input:hover {
  border-color: var(--accent);
}

.input input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.input input[readonly] {
  border-style: dashed;
  background: transparent;
  color: var(--ink-soft);
}

.calc__results {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  padding: 1.35rem;
  border-color: var(--line-strong);
}

.calc__results-title {
  margin-bottom: 1rem;
  font-size: var(--t-body);
}

.calc__metrics {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.metric {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-small);
  background: var(--bg);
}

.metric dt {
  color: var(--ink-soft);
  font-size: var(--t-small);
}

.metric dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.25rem 0 0;
  font: 650 1.25rem var(--mono);
  font-variant-numeric: tabular-nums;
}

/* the one number that answers "does it pay for itself?" */
.metric--main {
  padding: 1rem 1.1rem 1.15rem;
  background: var(--bg-raised);
}

.metric--main dd {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: clamp(2rem, 1.6rem + 1.2vw, 2.5rem);
  letter-spacing: -0.02em;
}

.metric--main .status {
  letter-spacing: 0;
}

/* everything else: label left, value right, one quiet row each */
.metric:not(.metric--main) {
  padding: 0.6rem 0.25rem;
  background: none;
}

.metric:not(.metric--main) + .metric:not(.metric--main) {
  border-top: 1px solid var(--line);
}

.metric:not(.metric--main) dd {
  font-size: var(--t-body);
}

.calc__bar {
  display: none;
}

@media (max-width: 62rem) {
  /* room for the bar under the last field */
  .calc {
    padding-bottom: 6rem;
  }

  .calc__bar:not([hidden]) {
    position: fixed;
    right: var(--gutter);
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    left: var(--gutter);
    z-index: 40;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--sheet);
    box-shadow: var(--shadow);
    color: var(--ink-soft);
    font-size: var(--t-small);
    text-decoration: none;
    transform: none;
    opacity: 1;
    transition: transform var(--move) var(--ease), opacity 200ms ease;
  }

  /* leaves the way it came: down past the bottom edge */
  .calc__bar[data-away] {
    transform: translateY(calc(100% + 1rem));
    opacity: 0;
    pointer-events: none;
  }

  .calc__bar strong {
    color: var(--ink);
    font: 650 1.25rem var(--mono);
    font-variant-numeric: tabular-nums;
  }

  .calc__bar:active {
    transform: scale(0.97);
    transition-duration: 100ms;
  }
}

.status {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font: 600 var(--t-small) var(--font);
}

.status:empty {
  display: none;
}

.status[data-state="good"] {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: var(--good);
}

.status[data-state="warn"] {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn);
}

.status[data-state="bad"] {
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}

.calc__note {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: var(--t-small);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  padding: 2rem 0 2.5rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.site-footer__name {
  color: var(--ink);
  font-weight: 600;
}

.site-footer__name span {
  color: var(--ink-soft);
  font-weight: 400;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.site-footer__links .icon,
.facts__links .icon {
  width: auto;
  height: 1.05rem;
  flex: none;
}

.facts__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.site-footer__meta {
  margin-left: auto;
  font-size: var(--t-small);
}

/* ---------- Scroll reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 600ms ease, transform 700ms var(--ease);
  }

  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 62rem) {
  .yield {
    grid-template-columns: 1fr 1fr;
  }

  .yield__intro {
    grid-column: 1 / -1;
  }

  .calc {
    grid-template-columns: 1fr;
  }

  .calc__results {
    position: static;
    order: -1;
  }

  .project-body {
    grid-template-columns: 1fr;
  }

  .project-aside {
    position: static;
    order: -1;
  }

  .calc__fields--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 48rem) {
  :root {
    --header-h: 3.5rem;
  }

  .nav-toggle {
    display: grid;
  }

  /* menu sheet: grows down from the header, leaves the way it came */
  .nav {
    position: absolute;
    top: calc(var(--header-h) + 0.5rem);
    right: var(--gutter);
    left: var(--gutter);
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    /* nested inside the blurred header, so a blur here can't see the page: use a near-solid sheet */
    background: var(--sheet);
    box-shadow: var(--shadow);
    transform-origin: top right;
    transform: scale(0.96) translateY(-6px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--move) var(--ease), opacity 200ms ease, visibility 0s linear 200ms;
  }

  .nav[data-open] {
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: transform var(--move) var(--ease), opacity 200ms ease, visibility 0s;
  }

  .nav a {
    padding: 0.85rem 1rem;
    font-size: var(--t-body);
  }

  .nav a[aria-current="page"]::after {
    left: 0.4rem;
    right: auto;
    top: 0.85rem;
    bottom: 0.85rem;
    width: 2px;
    height: auto;
  }

  .site-header__tools {
    margin-left: auto;
  }

  .hero__inner {
    grid-template-columns: 1fr;
  }

  /* phones: name and role first, the photo follows */
  .hero__figure {
    max-width: 20rem;
  }

  /* tablets: two cards side by side; phones stack them (see 30rem) */
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card:hover {
    transform: none;
    box-shadow: none;
  }

  .yield {
    grid-template-columns: 1fr;
  }

  .career-split,
  .contact__inner {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    left: 4px;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding-left: 1.75rem;
  }

  .timeline__item::before {
    left: 0;
  }

  .timeline__when {
    text-align: left;
  }

  .calc__fields--3,
  .calc__fields--2,
  .calc__pair {
    grid-template-columns: 1fr;
  }

  .site-footer__meta {
    margin-left: 0;
  }

  .section__head {
    gap: 1rem;
  }
}

@media (max-width: 30rem) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .calc__fields--4 {
    grid-template-columns: 1fr;
  }

  .brand span {
    display: none;
  }
}

/* ---------- Accessibility preferences ---------- */

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

  .card:hover,
  .card:hover .card__media img {
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .nav {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root,
  [data-theme="dark"] {
    --line: rgb(185 215 190 / 0.4);
    --line-strong: rgb(185 215 190 / 0.7);
    --ink-soft: #d3ddd4;
  }

  [data-theme="light"] {
    --line: rgb(30 70 45 / 0.45);
    --line-strong: rgb(30 70 45 / 0.75);
    --ink-soft: #24382b;
  }
}
