/* css/fonts.css */
/* Self-hosted fonts (generated from Google Fonts; latin, latin-ext, cyrillic, cyrillic-ext subsets). */
/* Inter cyrillic-ext */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-cyrillic-ext.fccca918.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* Inter cyrillic */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-cyrillic.aebf2ab4.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* Inter latin-ext */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.a28eb6d3.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter latin */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.c9407645.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* JetBrains Mono cyrillic-ext */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-cyrillic-ext.142ebf7f.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* JetBrains Mono cyrillic */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-cyrillic.cfc54a0a.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* JetBrains Mono latin-ext */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext.9a1b37b1.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono latin */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.615a7673.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Outfit latin-ext */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/outfit-latin-ext.9e38b3f1.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Outfit latin */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/outfit-latin.92684e4a.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Metric-adjusted fallbacks: keep text size close to the web font so the swap causes no layout shift. */
@font-face {
  font-family: "Outfit Fallback";
  src: local("Arial");
  size-adjust: 98.59%;
  ascent-override: 101.44%;
  descent-override: 26.37%;
  line-gap-override: 0.00%;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.80%;
  ascent-override: 89.86%;
  descent-override: 22.38%;
  line-gap-override: 0.00%;
}
@font-face {
  font-family: "JetBrains Mono Fallback";
  src: local("Courier New");
  size-adjust: 99.98%;
  ascent-override: 102.02%;
  descent-override: 30.00%;
  line-gap-override: 0.00%;
}

/* css/tokens.css */
/* Design tokens — docs/DESIGN.md §3–§6.
   Colors: light on :root, dark on [data-theme="dark"] and, for the "system" choice, under prefers-color-scheme.
   Keep the two dark blocks identical (a unit test checks it, and checks text contrast). */

:root {
  /* Type */
  --font-display: "Outfit", "Outfit Fallback", system-ui, sans-serif;
  --font-body: "Inter", "Inter Fallback", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, monospace;

  --fs-display: clamp(3rem, 2rem + 6vw, 8rem);
  --fs-h1: clamp(2.5rem, 1.8rem + 3.5vw, 5rem);
  --fs-h2: clamp(2rem, 1.6rem + 2vw, 3.5rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --fs-body-l: 1.25rem;
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;
  --measure: 68ch;

  /* Layout */
  --container: 1360px;
  --gutter: clamp(16px, 4vw, 48px);
  --grid-gap: clamp(16px, 2vw, 24px);
  --section-space: clamp(96px, 12vw, 176px);
  --header-h: 64px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 160ms;
  --t-base: 320ms;
  --t-slow: 640ms;
  --t-xslow: 1000ms;
}

@media (min-width: 900px) {
  :root {
    --header-h: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --t-fast: 0ms;
    --t-base: 0ms;
    --t-slow: 0ms;
    --t-xslow: 0ms;
  }
}

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #FFFFFF;
  --bg-elev: #F5F5F7;
  --bg-invert: #17171C;
  --text: #17171C;
  --text-muted: #5B5B66;
  --line: #E6E6EA;
  --accent: #FF5A4E;
  --on-accent: #17171C;
  --accent-text: #CF3429;
  --focus: #2F6BFF;
  --success: #12805C;
  --danger: #C8322A;
  --header-bg: rgb(255 255 255 / 0.78);
  --selection: rgb(255 90 78 / 0.3);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F0F12;
  --bg-elev: #18181D;
  --bg-invert: #F2F2F5;
  --text: #F2F2F5;
  --text-muted: #A0A0AB;
  --line: #2A2A31;
  --accent: #FF5A4E;
  --on-accent: #17171C;
  --accent-text: #FF7A70;
  --focus: #7FA2FF;
  --success: #4FD1A1;
  --danger: #FF8A80;
  --header-bg: rgb(15 15 18 / 0.78);
  --selection: rgb(255 90 78 / 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F0F12;
    --bg-elev: #18181D;
    --bg-invert: #F2F2F5;
    --text: #F2F2F5;
    --text-muted: #A0A0AB;
    --line: #2A2A31;
    --accent: #FF5A4E;
    --on-accent: #17171C;
    --accent-text: #FF7A70;
    --focus: #7FA2FF;
    --success: #4FD1A1;
    --danger: #FF8A80;
    --header-bg: rgb(15 15 18 / 0.78);
    --selection: rgb(255 90 78 / 0.3);
  }
}

/* css/base.css */
/* Reset, type scale, links, focus, selection — docs/DESIGN.md §4. */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-block-start: calc(var(--header-h) + var(--space-4));
}

body {
  min-block-size: 100vh;
  min-block-size: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  display: block;
  max-inline-size: 100%;
}

img,
video {
  block-size: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

p,
li,
h1,
h2,
h3,
h4 {
  overflow-wrap: break-word;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

::selection {
  background: var(--selection);
  color: var(--text);
}

/* Headings */
h1,
h2,
h3,
h4,
.t-display,
.t-h1,
.t-h2,
.t-h3 {
  font-family: var(--font-display);
  line-height: 1.05;
  text-wrap: balance;
}

.t-display {
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

h1,
.t-h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2,
.t-h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h3,
.t-h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.t-body-l {
  font-size: var(--fs-body-l);
  line-height: 1.6;
}

.t-small {
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.5;
}

.t-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.t-muted {
  color: var(--text-muted);
}

.prose {
  max-inline-size: var(--measure);
}

.prose > * + * {
  margin-block-start: 1em;
}

/* Links */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.prose a {
  color: var(--accent-text);
}

/* Focus: 2 px ring + 2 px offset, keyboard only */
:focus {
  outline: none;
}

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

/* Utilities */
.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  inset-block-start: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* css/layout.css */
/* Container, grid, sections — docs/DESIGN.md §5. Breakpoints: 600, 900, 1200, 1600. */

.container {
  inline-size: 100%;
  max-inline-size: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

.section {
  padding-block: var(--section-space);
}

.section--tight {
  padding-block: calc(var(--section-space) / 2);
}

.section--invert {
  background: var(--bg-invert);
  color: var(--bg);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, var(--space-5));
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-3));
}

.site-main {
  display: block;
}

/* Top of inner pages: label + h1 (+ intro). */
.page-head {
  display: grid;
  gap: var(--space-3);
  padding-block: clamp(48px, 8vw, 112px) var(--space-6);
}

/* css/components/button.css */
/* Button: primary = coral with ink text, secondary = outline, ghost. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: 48px;
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transform: translate(var(--mx, 0px), var(--my, 0px));
  transition: transform var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}

.button:active {
  transform: translate(var(--mx, 0px), var(--my, 0px)) scale(0.97);
}

.button--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button--secondary {
  border-color: currentcolor;
  background: transparent;
  color: inherit;
}

.button--ghost {
  background: transparent;
  color: inherit;
  text-decoration-line: underline;
  text-underline-offset: 0.25em;
}

.button--small {
  min-block-size: 40px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-small);
}

.button__icon {
  inline-size: 1.1em;
  block-size: 1.1em;
  flex: none;
}

/* css/components/pill.css */
/* Pill / tag and filter pills. */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-block-size: 32px;
  padding: var(--space-1) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

a.pill {
  min-block-size: 40px;
}

a.pill:hover {
  border-color: var(--text);
}

.pill--active,
.pill[aria-current="page"],
.pill[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.pill--status::before {
  content: "";
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--success);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

/* css/components/card.css */
/* Card frame: media on top, title + meta below. Elevation by --bg-elev and a 1 px line, no heavy shadows. */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.card__media {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

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

.card__link {
  text-decoration: none;
}

/* Whole card is clickable through the title link. */
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}

.card__link:focus-visible {
  outline: none;
}

.card:has(.card__link:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: var(--radius-lg);
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  color: var(--text-muted);
}

.card--tile {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

/* css/components/project-card.css */
/* Project card: 16:10 cover (image or muted loop video), title, categories and year. The whole card is one link. */

.project-card__link {
  display: grid;
  gap: var(--space-4);
  color: inherit;
  text-decoration: none;
}

.project-card__media {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.project-card__media .media {
  border-radius: 0;
}

.project-card__media .media__img {
  transition: transform var(--t-slow) var(--ease-out);
}

.project-card__link:hover .project-card__media .media__img {
  transform: scale(1.04);
}

.project-card__body {
  display: grid;
  gap: var(--space-1);
}

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

.project-card__link:hover .project-card__title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
}

.project-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  color: var(--text-muted);
}

.project-card__link:focus-visible {
  outline-offset: 6px;
  border-radius: var(--radius-lg);
}

/* css/components/media.css */
/* Media frame: blur placeholder behind the real image; aspect ratio comes from width/height attributes (zero CLS).
   Focal point uses classes (no inline styles, so a strict CSP stays possible). */

.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

.media__img,
.media__blur {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.media__img {
  position: relative;
}

.media__blur {
  position: absolute;
  inset: 0;
  filter: blur(20px);
  transform: scale(1.1);
}

.media--cover {
  aspect-ratio: 16 / 10;
}

.media--cover .media__img {
  position: absolute;
  inset: 0;
}

.media--natural .media__img {
  block-size: auto;
}

/* Focal point, 10 % steps */
.fx-0 { object-position: 0% var(--fy, 50%); }
.fx-10 { object-position: 10% var(--fy, 50%); }
.fx-20 { object-position: 20% var(--fy, 50%); }
.fx-30 { object-position: 30% var(--fy, 50%); }
.fx-40 { object-position: 40% var(--fy, 50%); }
.fx-50 { object-position: 50% var(--fy, 50%); }
.fx-60 { object-position: 60% var(--fy, 50%); }
.fx-70 { object-position: 70% var(--fy, 50%); }
.fx-80 { object-position: 80% var(--fy, 50%); }
.fx-90 { object-position: 90% var(--fy, 50%); }
.fx-100 { object-position: 100% var(--fy, 50%); }
.fy-0 { --fy: 0%; }
.fy-10 { --fy: 10%; }
.fy-20 { --fy: 20%; }
.fy-30 { --fy: 30%; }
.fy-40 { --fy: 40%; }
.fy-50 { --fy: 50%; }
.fy-60 { --fy: 60%; }
.fy-70 { --fy: 70%; }
.fy-80 { --fy: 80%; }
.fy-90 { --fy: 90%; }
.fy-100 { --fy: 100%; }

.media--empty {
  background: var(--bg-elev);
}

.media--video video {
  inline-size: 100%;
  block-size: auto;
  background: var(--bg-elev);
}

.media--cover video.media__img {
  position: absolute;
  inset: 0;
  block-size: 100%;
  object-fit: cover;
}

/* css/components/section-heading.css */
/* Section heading: small mono label, big title, optional intro and action. */

.section-heading {
  display: grid;
  gap: var(--space-4);
  margin-block-end: clamp(var(--space-6), 5vw, var(--space-8));
}

.section-heading__label {
  color: var(--text-muted);
}

.section-heading__intro {
  max-inline-size: 52ch;
  color: var(--text-muted);
}

@media (min-width: 900px) {
  .section-heading--split {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .section-heading--split .section-heading__label {
    grid-column: 1 / -1;
  }
}

/* css/components/header.css */
/* Header, logo, theme toggle, mobile menu — docs/SPEC.md §4.1, DESIGN.md §6–§7.
   Without JS: on phones the nav is a plain wrapped list. With JS (html.js, set in <head>): full-screen menu. */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  transition: transform var(--t-base) var(--ease-out);
}

/* Translucent, blurred background after scrolling: a separate layer so only its opacity animates. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-block-end: 1px solid var(--line);
  background: var(--header-bg);
  opacity: 0;
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  transition: opacity var(--t-fast) linear;
}

.site-header.is-scrolled::before,
.site-header.is-menu-open::before {
  opacity: 1;
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.site-header__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  min-block-size: var(--header-h);
  padding-block: var(--space-2);
}

.site-header__bar-item {
  position: relative;
  z-index: 2;
}

.site-header__badge {
  display: none;
}

.site-header__cta {
  display: none;
}

/* Logo: Dot & Ring mark + wordmark "kindbit labs" */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-inline-end: auto;
  color: var(--text);
  text-decoration: none;
}

.logo__mark {
  inline-size: 32px;
  block-size: 32px;
}

.logo__word {
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.logo__word-kind {
  font-weight: 700;
}

.logo__word-labs {
  font-weight: 400;
  color: var(--text-muted);
}

/* Nav */
.site-nav {
  inline-size: 100%;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  font-weight: 500;
  text-decoration: none;
}

/* Hover / current underline: see .link-draw in motion.css. */

.site-nav__cta {
  margin-block-start: var(--space-3);
}

/* Icon buttons (theme toggle, menu) */
.icon-button {
  display: inline-grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text);
}

/* Author display rules beat the UA [hidden] style, so restate it (the theme toggle stays hidden without JS). */
.icon-button[hidden] {
  display: none;
}

.icon-button:hover {
  border-color: var(--text);
}

.icon-button svg {
  inline-size: 20px;
  block-size: 20px;
}

.theme-toggle__icon {
  display: none;
}

.theme-toggle[data-choice="light"] .theme-toggle__icon--light,
.theme-toggle[data-choice="dark"] .theme-toggle__icon--dark,
.theme-toggle[data-choice="system"] .theme-toggle__icon--system {
  display: block;
}

.menu-toggle {
  display: none;
}

.menu-toggle__close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__open {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__close {
  display: block;
}

/* Phones without JS: header scrolls away with the page. */
@media (max-width: 899.98px) {
  html:not(.js) .site-header {
    position: relative;
  }

  /* Phones with JS: nav becomes a full-screen panel behind the header bar. */
  .js .menu-toggle {
    display: inline-grid;
  }

  .js .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    padding: calc(var(--header-h) + var(--space-6)) var(--gutter) var(--space-7);
    overflow-y: auto;
    background: var(--bg);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-12px);
    transition:
      opacity var(--t-base) var(--ease-out),
      transform var(--t-base) var(--ease-out),
      visibility 0s linear var(--t-base);
  }

  .js .site-header.is-menu-open .site-nav {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition:
      opacity var(--t-base) var(--ease-out),
      transform var(--t-base) var(--ease-out),
      visibility 0s;
  }

  .js .site-nav__list {
    flex-direction: column;
    gap: var(--space-2);
  }

  .js .site-nav__link {
    font-family: var(--font-display);
    font-size: var(--fs-h2);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
  }

  .js .site-nav__cta {
    align-self: flex-start;
    margin-block-start: 0;
  }
}

@media (min-width: 600px) {
  .site-header__badge {
    display: inline-flex;
  }
}

@media (min-width: 900px) {
  .site-header__inner {
    flex-wrap: nowrap;
    gap: var(--space-5);
  }

  .logo {
    margin-inline-end: 0;
  }

  .site-nav {
    inline-size: auto;
    margin-inline-start: auto;
  }

  .site-nav__list {
    gap: var(--space-5);
  }

  .site-nav__cta {
    display: none;
  }

  .site-header__cta {
    display: inline-flex;
  }
}

/* Lock page scroll while the mobile menu is open. */
html.has-menu-open {
  overflow: hidden;
}

/* css/components/footer.css */
/* Footer: big inverted CTA, then contact, socials, small nav, copyright. */

.footer-cta {
  padding-block: clamp(80px, 10vw, 144px);
  background: var(--bg-invert);
  color: var(--bg);
}

.footer-cta__inner {
  display: grid;
  gap: var(--space-6);
}

.footer-cta__line {
  max-inline-size: 14ch;
}

.footer-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
}

.footer-cta__email {
  font-size: var(--fs-body-l);
  font-weight: 500;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  padding-block: var(--space-7);
  font-size: var(--fs-small);
}

.site-footer__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  padding: 0;
  list-style: none;
}

.site-footer__list a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  text-decoration: none;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  color: var(--text-muted);
}

/* css/motion.css */
/* Motion — docs/DESIGN.md §6. Only transform, opacity and clip-path are animated. Everything is off under
   prefers-reduced-motion (bottom of this file); duration tokens are 0 there as well. */

/* ---------- Hero: lines rise from a mask, then subline + buttons fade up ---------- */
.hero__line {
  overflow: clip;
  /* Room for descenders (g, y) inside the clip, without changing the line spacing. */
  padding-block-end: 0.12em;
  margin-block-end: -0.12em;
}

.hero__line-inner {
  display: block;
  animation: line-rise var(--t-xslow) var(--ease-out) both;
}

.hero__line:nth-child(2) .hero__line-inner {
  animation-delay: 80ms;
}

.hero__line:nth-child(3) .hero__line-inner {
  animation-delay: 160ms;
}

.hero__subline,
.hero__actions {
  animation: fade-up var(--t-slow) var(--ease-out) 360ms both;
}

.hero__actions {
  animation-delay: 440ms;
}

@keyframes line-rise {
  from {
    transform: translateY(105%);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ---------- Scroll reveal (reveal.js only hides elements that are still below the fold) ---------- */
.reveal-pending {
  opacity: 0;
  transform: translateY(24px);
}

.reveal-in {
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}

/* ---------- Marquee ---------- */
.marquee__inner {
  animation: marquee 48s linear infinite;
}

.marquee:hover .marquee__inner,
.marquee.is-paused .marquee__inner {
  animation-play-state: paused;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Links: underline draws from the left ---------- */
.site-nav__link,
.site-footer__list a,
.link-draw {
  position: relative;
  text-decoration: none;
}

.site-nav__link::after,
.site-footer__list a::after,
.link-draw::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 8px;
  block-size: 2px;
  background: currentcolor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-base) var(--ease-out);
}

.site-nav__link:hover::after,
.site-nav__link[aria-current="page"]::after,
.site-footer__list a:hover::after,
.link-draw:hover::after {
  transform: scaleX(1);
}

/* ---------- Mobile menu: links stagger in ---------- */
@media (max-width: 899.98px) {
  .js .site-nav__list > li,
  .js .site-nav__cta {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
  }

  .js .site-header.is-menu-open .site-nav__list > li,
  .js .site-header.is-menu-open .site-nav__cta {
    opacity: 1;
    transform: none;
  }

  .js .site-header.is-menu-open .site-nav__list > li:nth-child(2) { transition-delay: 40ms; }
  .js .site-header.is-menu-open .site-nav__list > li:nth-child(3) { transition-delay: 80ms; }
  .js .site-header.is-menu-open .site-nav__list > li:nth-child(4) { transition-delay: 120ms; }
  .js .site-header.is-menu-open .site-nav__list > li:nth-child(5) { transition-delay: 160ms; }
  .js .site-header.is-menu-open .site-nav__cta { transition-delay: 200ms; }
}

/* ---------- Project cards: "View →" label follows the pointer (cursor-label.js, pointer: fine only) ---------- */
.cursor-label {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 60;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-small);
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast) linear;
}

.cursor-label.is-visible {
  opacity: 1;
}

/* ---------- Before / after slider (before-after.js turns the side-by-side pair into this) ---------- */
.before-after.is-slider {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  container-type: inline-size;
}

.before-after.is-slider .before-after__item + .before-after__item {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 calc(var(--pos, 50) * 1%));
}

.before-after.is-slider .before-after__item + .before-after__item .media,
.before-after.is-slider .before-after__item + .before-after__item .media__img {
  block-size: 100%;
}

.before-after.is-slider .before-after__item + .before-after__item .media__img {
  object-fit: cover;
}

.before-after.is-slider .media {
  border-radius: 0;
}

.before-after.is-slider .before-after__item + .before-after__item .before-after__label {
  inset-inline-start: auto;
  inset-inline-end: var(--space-3);
}

.before-after__handle {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 2px;
  margin-inline-start: -1px;
  background: var(--bg);
  transform: translateX(calc(var(--pos, 50) * 1cqi));
  pointer-events: none;
}

.before-after__handle::after {
  content: "↔";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.before-after__range {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.before-after.is-slider:has(.before-after__range:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

/* ---------- Page transitions (cross-document View Transitions; ignored where unsupported) ---------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vt-out var(--t-base) var(--ease-in-out) both;
}

::view-transition-new(root) {
  animation: vt-in var(--t-base) var(--ease-out) both;
}

@keyframes vt-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* The header stays put while the page changes. */
.site-header {
  view-transition-name: site-header;
}

/* Project cover: shared element from the clicked card (page-transition.js names it) to the case study. */
.project__cover .media {
  view-transition-name: project-cover;
}

::view-transition-group(project-cover) {
  animation-duration: var(--t-slow);
  animation-timing-function: var(--ease-out);
}

/* Theme switch: a circle grows from the toggle (theme-toggle.js); the default crossfade is turned off for it. */
html.theme-switching::view-transition-old(root),
html.theme-switching::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------- Reduced motion: everything instant ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  .hero__line-inner,
  .hero__subline,
  .hero__actions,
  .marquee__inner {
    animation: none;
  }

  .marquee__track[aria-hidden="true"] {
    display: none;
  }

  .marquee__inner {
    flex-wrap: wrap;
    inline-size: auto;
    padding-inline: var(--gutter);
  }

  .reveal-pending {
    opacity: 1;
    transform: none;
  }

  .project-card__link:hover .project-card__media .media__img {
    transform: none;
  }
}

