/* tokens.css */
/* ==========================================================================
   Design tokens — the ONE place to change colors, fonts and sizes.
   Values come from the Figma file's variables (names in comments).
   ========================================================================== */

:root {
  /* ---- Colors -------------------------------------------------------- */
  --color-bg: #313131;               /* Background */
  --color-surface: #4d4d4d;          /* Foreground — header, footer, page intro, CTA */
  --color-card: #565555;             /* Card Color — cards, code block, metric pane */
  --color-chip: #696969;             /* Chip Color — role chips, progress track */
  --color-line: #7b7d79;             /* Line Color — borders, separators, dashed dividers */

  --color-accent: #7bd565;           /* Header Text Color — headings, links, primary button */
  --color-text: #ffffff;             /* Normal Text Color */
  --color-text-secondary: #9f9c9c;   /* Secondary Text Color — labels */
  --color-text-muted: #94a3b8;       /* shader meta line, next/prev labels */
  --color-text-inverse: #000000;     /* Third Text Color — text on light buttons/chips */

  --color-button-light: #ffffff;     /* Button Color 2 */
  --color-button-light-hover: #ececec;
  --color-field: #ffffff;            /* input background */
  --color-logo-bg: #ffffff;          /* Photo circle behind experience/education logos */
  --color-media-bg: #1f1f1f;         /* behind media while it loads */
  --color-checker-light: #f9f9f9;    /* Media Placeholder checkerboard */
  --color-checker-dark: #ebebeb;
  --color-highlight: #d5d5d5;        /* progress bar hover */
  --color-gold: #e2b33c;             /* "important" feature tab text */
  --color-gold-shine: #fff5cc;       /* glint that wipes across it + the sparkle */
  --color-error: #ff4e4e;
  --color-available: #22c55e;        /* footer availability dot */

  --status-shipped: #9dfba3;         /* Shipped Status Color */
  --status-prototype: #82e8ff;       /* Prototype Status Color */
  --status-awaiting: #ffec7e;        /* Awaiting Publication Color */

  /* Code block syntax colors */
  --code-text: #ffffff;              /* General Code Color */
  --code-keyword: #569cd6;           /* Include & Attribute Color */
  --code-object: #4ec9b0;            /* Object Color */
  --code-string: #d69d85;            /* String Color */
  --code-number: #b5cea8;            /* Number Color */
  --code-struct: #c0d088;            /* Struct Color */
  --code-function: #dcdcaa;          /* Code Function Color */
  --code-comment: #57a64a;           /* Code Comment Color */

  /* ---- Fonts --------------------------------------------------------- */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Type scale — fluid between ~1280px and the 1920px design width */
  --fs-title: clamp(2rem, 1.2rem + 1.67vw, 3rem);          /* 48 — Title Text */
  --fs-cta: clamp(1.75rem, 1.1rem + 1.35vw, 2.5rem);       /* 40 — homepage CTA */
  --fs-heading: clamp(1.5rem, 1.07rem + 0.9vw, 2rem);      /* 32 — Heading Text */
  --fs-card-title: 1.25rem;                                /* 20 — Card Title / Nav Bar Text */
  --fs-body-lg: clamp(1rem, 0.9rem + 0.21vw, 1.125rem);    /* 18 — Normal Text Format */
  --fs-body: 0.9375rem;                                    /* 15 */
  --fs-small: 0.875rem;                                    /* 14 */
  --fs-meta: 0.8125rem;                                    /* 13 */
  --fs-label: 0.75rem;                                     /* 12 */
  --fs-tiny: 0.6875rem;                                    /* 11 */

  /* ---- Layout -------------------------------------------------------- */
  --content-max: 1760px;                        /* 1920 frame minus 80px gutters */
  --gutter: clamp(1.25rem, 4.17vw, 5rem);       /* 80px at 1920 */
  --header-height: 90px;
  --section-gap: 20px;

  /* ---- Shape & effects ---------------------------------------------- */
  --radius-button: 4px;
  --radius-card: 5px;
  --radius-media: 15px;
  --radius-pill: 15px;
  --shadow-card: 0 9px 4px rgba(0, 0, 0, 0.25);        /* Card Shadow */
  --shadow-header: 0 40px 30px rgba(0, 0, 0, 0.25);
  --shadow-footer: 0 -30px 15px rgba(0, 0, 0, 0.25);
  --media-blur: 2px;                                    /* Media Blur (Figma radius 4) */

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
}

/* base.css */
/* ==========================================================================
   Base / reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
p,
figure,
dl,
dd,
blockquote {
  margin: 0;
}

img,
video,
iframe,
canvas,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

ul[class],
ol[class] {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-accent);
  color: var(--color-text-inverse);
  font-family: var(--font-mono);
  font-weight: 700;
  text-decoration: none;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* layout.css */
/* ==========================================================================
   Layout — container, header, footer, page sections
   ========================================================================== */

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

/* Sections separated by a dashed rule (Figma: 2px dashed Line Color) */
.section {
  padding-block: 20px;
  border-bottom: 2px dashed var(--color-line);
}

.section--plain {
  border-bottom: 0;
}

.section__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 30px;
}

/* Homepage stacks its sections with a 20px gap (Figma Home Page frame). */
.page-home main {
  gap: var(--section-gap);
  padding-block: var(--section-gap);
}

/* --------------------------------------------------------------------------
   Header — Figma "Page Header" (53:509)
   -------------------------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 20;
  background: var(--color-surface);
  border-block: 2px solid var(--color-surface);
  box-shadow: var(--shadow-header);
}

.site-header__inner {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 655px) auto;
  justify-content: space-between;
  align-items: center;
  column-gap: 24px;
  height: var(--header-height);
}

.site-header__brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-decoration: none;
  min-width: 0;
}

.site-header__name {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 29px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--color-accent);
  white-space: nowrap;
}

.site-header__name-text {
  min-height: 26px;
}

/* Heavy Vertical Bar — terminal cursor */
.site-header__cursor {
  flex: none;
  width: 14px;
  height: 29px;
  background: var(--color-accent);
}

.site-header__cursor.is-blinking {
  animation: cursor-blink 1.06s steps(1, end) infinite;
}

@keyframes cursor-blink {
  50% {
    opacity: 0;
  }
}

/* Hide the name until the typewriter starts (set by the inline head script) */
.will-type .site-header__name-text {
  visibility: hidden;
}

.site-header__role {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--color-text);
  white-space: nowrap;
}

/* Motion graphic: the looping clip clipped to the Figma parallelogram, with a noise overlay */
.site-header__graphic {
  position: relative;
  width: 100%;
  height: var(--header-height);
  overflow: hidden;
  clip-path: polygon(0 0, 81.9% 0, 100% 100%, 18.1% 100%);
  background: var(--color-media-bg);
}

.site-header__video,
.site-header__noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.site-header__video {
  object-fit: cover;
}

.site-header__noise {
  mix-blend-mode: screen;
  opacity: 0.35;
  pointer-events: none;
  image-rendering: pixelated;
}

/* Nav — Figma "Nav Link" (Idle / Active) */
.site-nav ul {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 116px;
  height: 40px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-card-title);
  color: var(--color-accent);
  text-decoration: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 7.63%;
  right: 7.63%;
  bottom: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform var(--duration-base) var(--ease-out);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.site-header__menu {
  display: none;
}

@media (max-width: 1500px) {
  .nav-link {
    width: auto;
    padding-inline: 12px;
  }
}

@media (max-width: 1200px) {
  .site-header__inner {
    grid-template-columns: auto auto;
  }

  .site-header__graphic {
    display: none;
  }
}

/* Tablet / phone: hamburger menu */
@media (max-width: 900px) {
  .site-header__menu {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-button);
  }

  .site-header__menu span {
    display: block;
    height: 2px;
    background: var(--color-accent);
    transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-fast);
  }

  .site-header__menu[aria-expanded='true'] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header__menu[aria-expanded='true'] span:nth-child(2) {
    opacity: 0;
  }

  .site-header__menu[aria-expanded='true'] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--color-surface);
    border-top: 1px solid var(--color-line);
    box-shadow: var(--shadow-header);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 16px;
  }

  .nav-link {
    justify-content: flex-start;
    width: 100%;
    height: 52px;
    padding-inline: 0;
  }

  .nav-link::after {
    left: 0;
    right: auto;
    width: 96px;
    transform-origin: left;
  }

  /* Without JS the menu button can't work, so show the links inline instead. */
  html:not(.js) .site-header__menu {
    display: none;
  }

  html:not(.js) .site-nav {
    position: static;
    display: block;
    border: 0;
    box-shadow: none;
    background: none;
  }
}

@media (max-width: 480px) {
  .site-header__role {
    font-size: 0.625rem;
  }
}

/* --------------------------------------------------------------------------
   Footer — Figma "Footer" (60:1010)
   -------------------------------------------------------------------------- */

.site-footer {
  position: relative;
  background: var(--color-surface);
  box-shadow: var(--shadow-footer);
  padding-block: 64px 48px;
}

.site-footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
}

.site-footer__about {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 400px;
  max-width: 100%;
}

.site-footer__name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

.site-footer__blurb {
  font-size: var(--fs-small);
  line-height: 1.5;
}

.site-footer__contact,
.site-footer__availability {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-footer__contact {
  width: 300px;
}

.site-footer__availability {
  width: 250px;
}

.site-footer__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-label);
  color: var(--color-text-secondary);
}

.site-footer__email {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  text-decoration: none;
}

.site-footer__email:hover {
  color: var(--color-accent);
}

.site-footer__location {
  font-size: var(--fs-small);
}

.site-footer__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-meta);
}

.site-footer__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-available);
}

.site-footer__note {
  font-size: var(--fs-label);
}

.site-footer__bottom {
  display: flex;
  justify-content: flex-end;
  margin-top: 48px;
}

@media (max-width: 900px) {
  .site-footer__top {
    flex-direction: column;
    gap: 32px;
  }

  .site-footer__about,
  .site-footer__contact,
  .site-footer__availability {
    width: auto;
  }

  .site-footer__bottom {
    justify-content: flex-start;
  }
}

/* components.css */
/* ==========================================================================
   Components — Figma "Desktop Components"
   ========================================================================== */

/* ---- Button (Look=Colored → primary, Look=White → light) ---------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1px solid;
  border-radius: var(--radius-button);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-small);
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--duration-fast), filter var(--duration-fast), transform var(--duration-fast);
}

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

.button--primary:hover {
  filter: brightness(1.08);
}

.button--light {
  background: var(--color-button-light);
  border-color: var(--color-text-inverse);
  color: var(--color-text-inverse);
}

.button--light:hover {
  background: var(--color-button-light-hover);
}

.button:active {
  transform: translateY(1px);
}

.button[disabled],
.button[aria-disabled='true'] {
  opacity: 0.6;
  pointer-events: none;
}

.button .fa-solid,
.button .fa-brands {
  font-size: 0.875em;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* ---- Display Chip -------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 10px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Look=Without Outline — grey role chip */
.chip--tag {
  height: 23px;
  background: var(--color-chip);
  border-radius: var(--radius-card);
  font-size: var(--fs-tiny);
  color: var(--color-text);
}

/* Look=With Outline — white toolset chip */
.chip--tool {
  height: 33px;
  background: var(--color-text);
  border-radius: var(--radius-button);
  font-size: var(--fs-label);
  color: var(--color-text-inverse);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- Status Chip --------------------------------------------------------- */
.status-chip {
  --status-color: var(--status-awaiting);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px;
  background: var(--color-card);
  border: 1px solid var(--status-color);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  line-height: 1.35;
  color: var(--color-text);
  white-space: nowrap;
}

.status-chip--shipped {
  --status-color: var(--status-shipped);
}

.status-chip--prototype {
  --status-color: var(--status-prototype);
}

.status-chip--awaiting {
  --status-color: var(--status-awaiting);
}

.status-chip__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--status-color);
}

/* ---- Section Heading ----------------------------------------------------- */
.section-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.section-heading__text {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--fs-heading);
  line-height: 1.2;
  color: var(--color-accent);
}

.section-heading__line {
  width: 80px;
  height: 2px;
  background: var(--color-accent);
}

/* ---- Page Intro ---------------------------------------------------------- */
.page-intro {
  background: var(--color-surface);
  padding-block: 40px;
}

.page-intro__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  min-height: 109px;
}

.page-intro__title {
  font-weight: 800;
  font-size: var(--fs-title);
  line-height: 1.2;
  color: var(--color-accent);
}

.page-intro__text {
  width: 863px;
  max-width: 50%;
  font-size: var(--fs-body-lg);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .page-intro__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    min-height: 0;
  }

  .page-intro__text {
    max-width: none;
    width: auto;
  }
}

/* ---- Title bar (project / generic pages) --------------------------------- */
.title-bar {
  padding-block: 30px;
}

.title-bar__text {
  font-weight: 800;
  font-size: var(--fs-title);
  line-height: 1.2;
  color: var(--color-accent);
  overflow-wrap: anywhere;
}

/* ---- Media (image / video / embed / placeholder) ------------------------- */
.media {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: var(--media-ratio, 753 / 380);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-media);
  background: var(--color-media-bg);
}

.media__img,
.media__video,
.media iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

/* Figma "Media Placeholder" checkerboard */
.media--placeholder {
  background-color: var(--color-checker-light);
  background-image: repeating-conic-gradient(var(--color-checker-dark) 0 25%, transparent 0 50%);
  background-size: 64px 64px;
}

.media--embed {
  aspect-ratio: 16 / 9;
}

/* ---- Card ---------------------------------------------------------------- */
.card {
  --media-ratio: 370 / 240;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 450px;
  padding: 24px;
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base);
}

.card--large {
  --media-ratio: 512 / 240;
  min-height: 549px;
}

.card__showcase {
  position: relative;
}

.card__media {
  transition: filter var(--duration-base) var(--ease-out);
}

/* Small project cards use the tighter 5px corner from Figma */
.card--project.card--small .card__media {
  border-radius: var(--radius-card);
}

.card__showcase .status-chip {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
}

/* Centered with inset + auto margins (not transform), so the shared
   .button:active press effect can't knock it off-center. */
.card__learn-more {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: fit-content;
  height: fit-content;
  margin: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
}

/* Hover / keyboard focus — Figma "Card State=Hover" */
.card:hover .card__media,
.card:focus-within .card__media {
  filter: blur(var(--media-blur));
}

.card:hover .card__learn-more,
.card:focus-within .card__learn-more {
  opacity: 1;
  pointer-events: auto;
}

.card__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.card__title {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: var(--fs-card-title);
  line-height: 1.3;
  color: var(--color-accent);
  overflow-wrap: anywhere;
}

.card__title a {
  text-decoration: none;
}

/* Whole card is clickable through the title link */
.card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--radius-card);
}

.card__title a:focus-visible {
  outline: none;
}

.card__title a:focus-visible::after {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  column-gap: 40px;
  row-gap: 2px;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--color-text);
}

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

.card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card__text {
  font-size: var(--fs-small);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.card--large .card__text {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.card__separator {
  width: 100%;
  margin: auto 0 0;
  border: 0;
  border-top: 1px solid var(--color-line);
}

.card--blog .card__text {
  margin-top: auto;
}

.card__links {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.card__links-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-label);
}

.card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 28px;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.card__link:hover,
.card__link:focus-visible {
  color: var(--color-accent);
}

/* ---- Card grids ---------------------------------------------------------- */
.card-grid {
  --cols: 4;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--grid-gap, 25px);
  width: 100%;
}

.card-grid--3 {
  --cols: 3;
  --grid-gap: 40px;
}

.card-grid--blog {
  --grid-gap: 28px;
}

@media (max-width: 1599px) {
  .card-grid--4 {
    --cols: 3;
  }
}

@media (max-width: 1199px) {
  .card-grid--4,
  .card-grid--3 {
    --cols: 2;
    --grid-gap: 24px;
  }
}

@media (max-width: 699px) {
  .card-grid--4,
  .card-grid--3 {
    --cols: 1;
  }

  .card,
  .card--large {
    min-height: 0;
  }
}

/* ---- Metric Pane --------------------------------------------------------- */
.metric-pane {
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
  padding: 24px;
  background: var(--color-card);
}

.metric-pane__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-label);
  color: var(--color-text-secondary);
}

.metric-pane__list {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 12px;
}

.metric-pane__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-pane__group dt {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  color: var(--color-text-secondary);
}

.metric-pane__group dd {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-small);
}

.metric-pane__group a {
  text-decoration: underline;
}

.metric-pane__group a:hover {
  color: var(--color-accent);
}

/* ---- Code Block / Table Block -------------------------------------------- */
/* A Table Block is a Markdown table in the Code Block's frame: same card, label and caption. */
.code-block,
.table-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
  padding: 24px;
  background: var(--color-card);
}

.code-block {
  --code-line-height: 1.62;
}

.code-block__label,
.table-block__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-label);
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

/* Long code lines and wide tables scroll sideways inside the block */
.code-block pre,
.table-block__scroll {
  margin: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-line) transparent;
}

/* Longer than CODE_BLOCK_MAX_LINES (ui.js): cap the height, scroll the rest */
.code-block--scroll pre {
  max-height: calc(var(--code-max-lines) * var(--code-line-height) * var(--fs-meta));
  overflow-y: auto;
}

.code-block code {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: var(--code-line-height);
  color: var(--code-text);
  tab-size: 2;
}

.code-block__caption,
.table-block__caption {
  padding-top: 16px;
  border-top: 1px dashed var(--color-line);
  font-size: var(--fs-meta);
  color: var(--color-text-secondary);
}

/* Sideways only: a fractional table height would otherwise add a 1px vertical scrollbar */
.table-block__scroll {
  overflow-y: hidden;
}

.table-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  line-height: 1.5;
}

.table-block th,
.table-block td {
  min-width: 7rem; /* on narrow screens the table scrolls instead of squeezing text to a word per line */
  padding: 12px 16px;
  vertical-align: top;
}

/* Edge cells line up with the label */
.table-block th:first-child,
.table-block td:first-child {
  padding-left: 0;
}

.table-block th:last-child,
.table-block td:last-child {
  padding-right: 0;
}

.table-block th {
  padding-top: 0;
  border-bottom: 1px solid var(--color-line);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-meta);
  text-align: left;
}

.table-block tbody tr + tr td {
  border-top: 1px dashed var(--color-line);
}

.table-block tbody tr:last-child td {
  padding-bottom: 0;
}

/* Markdown column alignment (:---:, ---:) */
.table-block [align='center'] {
  text-align: center;
}

.table-block [align='right'] {
  text-align: right;
}

.table-block a {
  color: var(--color-accent);
}

.table-block strong {
  font-weight: 600;
}

.table-block code:not(.hljs) {
  padding: 2px 6px;
  background: var(--color-bg);
  border-radius: var(--radius-button);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* highlight.js tokens → Figma code colors */
.hljs-keyword,
.hljs-built_in,
.hljs-meta,
.hljs-meta .hljs-keyword,
.hljs-attr,
.hljs-attribute,
.hljs-selector-tag,
.hljs-literal {
  color: var(--code-keyword);
}

.hljs-title,
.hljs-title.class_,
.hljs-title.class_.inherited__,
.hljs-class .hljs-title {
  color: var(--code-object);
}

.hljs-type {
  color: var(--code-struct);
}

.hljs-string,
.hljs-meta .hljs-string,
.hljs-regexp,
.hljs-char.escape_ {
  color: var(--code-string);
}

.hljs-number {
  color: var(--code-number);
}

.hljs-title.function_,
.hljs-function .hljs-title {
  color: var(--code-function);
}

.hljs-comment,
.hljs-quote {
  color: var(--code-comment);
}

/* ---- Input Field --------------------------------------------------------- */
.input-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.input-field__label {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  color: var(--color-text-secondary);
}

.input-field__control {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  background: var(--color-field);
  border: 1px solid var(--color-surface);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-meta);
  color: var(--color-text-inverse);
}

.input-field__control::placeholder {
  color: var(--color-text-secondary);
  opacity: 1;
}

.input-field__control:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 0;
}

.input-field--multiline .input-field__control {
  height: auto;
  min-height: 200px;
  padding: 11px;
  resize: vertical;
  line-height: 1.5;
}

/* ---- Next / Prev bar ----------------------------------------------------- */
.next-prev {
  background: var(--color-card);
  padding-block: 64px;
}

.next-prev__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.next-prev__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.next-prev__item--next {
  align-items: flex-end;
  margin-left: auto;
}

.next-prev__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-label);
  color: var(--color-text-muted);
}

/* ---- Social links -------------------------------------------------------- */
.social-icons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.social-icons a {
  display: inline-flex;
  font-size: 44px;
  line-height: 1;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--duration-fast), transform var(--duration-fast);
}

.social-icons a:hover,
.social-icons a:focus-visible {
  color: var(--color-accent);
  transform: translateY(-2px);
}

.social-text {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.social-text a {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--color-text);
}

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

/* pages.css */
/* ==========================================================================
   Page sections
   ========================================================================== */

/* ---- Prose (Markdown bodies, long descriptions) -------------------------- */
.prose {
  font-size: var(--fs-body-lg);
  line-height: 1.6;
  min-width: 0;
}

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

.prose .paragraph-heading + * {
  margin-top: 20px;
}

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

.prose strong {
  font-weight: 600;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

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

.prose code:not(.hljs) {
  padding: 2px 6px;
  background: var(--color-card);
  border-radius: var(--radius-button);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.prose blockquote {
  padding-left: 20px;
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-secondary);
}

.prose img {
  border-radius: var(--radius-media);
  border: 1px solid var(--color-line);
}

.prose hr {
  border: 0;
  border-top: 2px dashed var(--color-line);
}

.paragraph-heading {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: var(--fs-card-title);
  line-height: 1.3;
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  padding-block: 80px;
  border-bottom: 2px dashed var(--color-line);
}

.hero__inner {
  display: flex;
  align-items: flex-start;
  gap: 64px;
}

.hero__intro {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}

.hero__title {
  font-weight: 800;
  font-size: var(--fs-title);
  line-height: 1.2;
  color: var(--color-accent);
}

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

.hero__text p + p {
  margin-top: 1.6em;
}

.hero__text strong {
  font-weight: 600;
}

.hero__carousel {
  flex: 0 0 43%;
  max-width: 753px;
  min-width: 0;
}

@media (max-width: 1200px) {
  .hero__inner {
    flex-direction: column;
    gap: 48px;
  }

  .hero__carousel {
    flex: none;
    width: 100%;
    max-width: 900px;
  }
}

@media (max-width: 700px) {
  .hero {
    padding-block: 48px;
  }

  .social-icons a {
    font-size: 36px;
  }
}

/* ---- Project Carousel ---------------------------------------------------- */
.carousel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.carousel__stage {
  --media-ratio: 753 / 380;
}

.carousel__stage.is-linked {
  cursor: pointer;
}

.carousel__stage .media__video {
  transition: opacity var(--duration-base);
}

.carousel__stage.is-loading .media__video {
  opacity: 0.6;
}

/* Project title docked top-left over the clip (Figma 2273:1207); js/carousel.js types and erases it */
.carousel__title {
  position: absolute;
  top: 19px; /* 20px from the outer edge, inside the stage's 1px border */
  left: 19px;
  right: 19px;
  color: var(--color-accent);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); /* keeps it readable over bright footage */
  pointer-events: none;
}

/* Heavy Vertical Bar — the same terminal cursor as the header name, sized to the title */
.carousel__cursor {
  display: inline-block;
  width: 0.7em;
  height: 1.2em;
  margin-left: 0.15em;
  vertical-align: -0.25em;
  background: var(--color-accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.carousel__title[data-state='holding'] .carousel__cursor {
  animation: cursor-blink 1.06s steps(1, end) infinite;
}

.carousel__title[data-state='done'] .carousel__cursor,
.carousel__title[data-state='static'] .carousel__cursor {
  visibility: hidden;
}

@media (max-width: 700px) {
  .carousel__title {
    top: 11px;
    left: 11px;
    right: 11px;
    font-size: var(--fs-body);
  }
}

.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.carousel__bar {
  position: relative;
  flex: 0 1 110px;
  height: 15px;
  padding: 0;
  background: none;
  border: 0;
}

.carousel__bar::before,
.carousel__fill {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
}

.carousel__bar::before {
  right: 0;
  background: var(--color-chip);
  transition: background-color var(--duration-fast);
}

.carousel__bar:hover::before,
.carousel__bar:focus-visible::before {
  background: var(--color-highlight);
}

.carousel__fill {
  width: 0;
  background: var(--color-accent);
}

.carousel__toggle {
  position: relative;
  flex: none;
  width: 23px;
  height: 25px;
  padding: 0;
  background: var(--color-card);
  border: 0;
  border-radius: 3px;
}

/* Playing → pause icon (two bars); paused → play triangle */
.carousel__toggle::before,
.carousel__toggle::after {
  content: '';
  position: absolute;
  top: 5px;
  width: 5px;
  height: 15px;
  background: var(--color-accent);
}

.carousel__toggle::before {
  left: 5px;
}

.carousel__toggle::after {
  left: 13px;
}

.carousel__toggle[aria-pressed='true']::before {
  left: 7.5px;
  top: 6.5px;
  width: 9px;
  height: 12px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.carousel__toggle[aria-pressed='true']::after {
  display: none;
}

/* ---- Experience / Education lists ---------------------------------------- */
.entry-list {
  width: 100%;
}

.entry {
  display: grid;
  grid-template-columns: 50px 250px 160px minmax(0, 1fr);
  align-items: start;
  column-gap: 48px;
  row-gap: 8px;
  padding-block: 24px;
  border-bottom: 1px solid var(--color-line);
}

.entry:last-child {
  border-bottom: 0;
}

.entry__logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--color-logo-bg);
  object-fit: contain;
  padding: 5px;
}

.entry__logo--placeholder {
  display: block;
}

.entry__heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.entry__name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

.entry__role {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--color-text-secondary);
}

.entry__dates {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  white-space: nowrap;
}

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

@media (max-width: 1100px) {
  .entry {
    grid-template-columns: 50px minmax(0, 1fr);
    column-gap: 24px;
  }

  .entry__dates,
  .entry__text {
    grid-column: 2;
  }
}

/* ---- Engineering Toolset ------------------------------------------------- */
.toolset {
  display: flex;
  gap: 64px;
  width: 100%;
}

.toolset__intro {
  display: flex;
  flex-direction: column;
  gap: 30px;
  flex: 0 0 569px;
  max-width: 34%;
}

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

.toolset__groups {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.toolset__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolset__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-meta);
  color: var(--color-text-secondary);
}

@media (max-width: 1000px) {
  .toolset {
    flex-direction: column;
    gap: 32px;
  }

  .toolset__intro {
    flex: none;
    max-width: none;
  }
}

/* ---- Homepage CTA -------------------------------------------------------- */
.cta {
  padding-block: 96px;
  background: var(--color-surface);
}

.cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  text-align: center;
}

.cta__title {
  max-width: 800px;
  font-weight: 800;
  font-size: var(--fs-cta);
  line-height: 1.2;
  color: var(--color-accent);
}

.cta .button-row {
  justify-content: center;
}

/* ---- List pages (Projects / Shaders / Blog) ------------------------------ */
.list-section {
  padding-block: 40px;
}

.list-section__empty {
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
}

/* ---- Contact ------------------------------------------------------------- */
.contact-section {
  padding-block: 77px;
}

.message-box {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1644px;
  margin-inline: auto;
  padding: 32px;
  background: var(--color-card);
}

.message-box__title {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.125rem;
}

.message-box__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-box__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.message-box__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.message-box__status {
  font-size: var(--fs-tiny);
  color: var(--color-error);
}

.message-box__status.is-success {
  color: var(--color-accent);
}

.message-box__response {
  font-size: var(--fs-tiny);
  color: var(--color-text-secondary);
}

/* Honeypot field for bots */
.message-box__trap {
  position: absolute;
  left: -9999px;
}

@media (max-width: 700px) {
  .contact-section {
    padding-block: 32px;
  }

  .message-box {
    padding: 20px;
  }

  .message-box__row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---- Project page -------------------------------------------------------- */
.overview {
  display: grid;
  grid-template-columns: minmax(0, 753fr) minmax(0, 879fr);
  align-items: center;
  gap: clamp(40px, 6.4vw, 123px);
  width: 100%;
}

.overview__showcase {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
}

/* Project page: text centred on the media alone, metrics 20px under the media
   (Figma "Media and Text" row hugs 753 + 92 + 879). */
.overview--split {
  grid-template-rows: auto 1fr; /* text crosses the 1fr row, so only the media sizes row 1 */
  align-items: start;
  gap: 20px clamp(40px, 4.8vw, 92px);
  max-width: 1724px;
}

.overview--split > .media {
  grid-area: 1 / 1;
}

.overview--split > .metric-pane {
  grid-area: 2 / 1;
  justify-self: start;
}

/* Never shorter than the media (same column ratio), so short text centres on it
   and long text starts level with it and runs down beside the metrics. */
.overview__text {
  grid-area: 1 / 2 / 3;
  justify-self: stretch; /* aspect-ratio items otherwise shrink-to-fit */
  display: flex;
  flex-direction: column;
  justify-content: center;
  aspect-ratio: 879 / 380;
  min-width: 0;
}

.overview--split:has(.media--embed) .overview__text {
  aspect-ratio: 14064 / 6777; /* 16:9 embed in the 753fr column: (879 × 16) / (753 × 9) */
}

/* Media/text/metrics, then related blogs across the full width */
.project-overview {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.project-overview .card-grid {
  row-gap: 20px;
}

/* Figma "Feature Tab Panel" — tabs wrap onto extra rows when they don't fit */
.feature-tabs {
  width: 100%;
  margin-top: 34px; /* Figma: 64px between the section heading and the tabs */
}

.feature-tabs__list {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
}

/* Card-colored strip behind a wrapped row of tabs (sized by js/tabs.js) */
.feature-tabs__fill {
  position: absolute;
  left: 0;
  z-index: -1;
  background: var(--color-card);
  pointer-events: none;
}

.feature-tabs__tab {
  min-height: 40px;
  max-width: 100%;
  padding: 7px 10px; /* 40px tall with the 26px line; long titles wrap on narrow screens */
  border: 0;
  border-radius: 5px 5px 0 0;
  background: var(--color-surface);
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: var(--fs-card-title);
  line-height: 26px; /* exactly 40px with the padding, so wrapped rows stack without seams */
  color: var(--color-text-secondary);
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--duration-base);
}

.feature-tabs__tab:hover {
  color: var(--color-text);
}

.feature-tabs__tab[aria-selected='true'] {
  background: var(--color-card);
  color: var(--color-accent);
  cursor: default;
}

.feature-tabs__tab:focus-visible {
  outline-offset: -2px;
}

/* significance: important — a gold glint wipes across the tab text, and every other wipe ends in a sparkle.
   With reduced motion both animations are cut short, leaving the resting style: plain gold text, no sparkle. */
.feature-tabs__tab--important {
  position: relative;
  --shine-cycle: 4s;
}

.feature-tabs__label {
  background: linear-gradient(105deg, var(--color-gold) 40%, var(--color-gold-shine) 50%, var(--color-gold) 60%) 100% 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: tab-shine var(--shine-cycle) ease-in-out infinite;
}

.feature-tabs__bling {
  position: absolute;
  top: 3px;
  right: 2px;
  width: 11px;
  height: 11px;
  background: var(--color-gold-shine);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 3px var(--color-gold));
  transform: scale(0);
  pointer-events: none;
  animation: tab-bling calc(var(--shine-cycle) * 2) ease-out infinite;
}

/* Hovered or selected, an important tab behaves like the others (white on hover, green when selected);
   the shine only plays while it sits unselected. */
.feature-tabs__tab--important:hover .feature-tabs__label,
.feature-tabs__tab--important[aria-selected='true'] .feature-tabs__label {
  background: none;
  color: inherit;
  animation: none;
}

.feature-tabs__tab--important:hover .feature-tabs__bling,
.feature-tabs__tab--important[aria-selected='true'] .feature-tabs__bling {
  animation: none;
}

/* The glint crosses in the first 40% of each cycle, then rests */
@keyframes tab-shine {
  0% {
    background-position: 100% 0;
  }
  40%,
  100% {
    background-position: 0 0;
  }
}

/* Twice as long as the shine: pops right as every other glint reaches the end of the text */
@keyframes tab-bling {
  0%,
  18% {
    transform: scale(0) rotate(0deg);
  }
  22% {
    transform: scale(1.15) rotate(45deg);
  }
  30%,
  100% {
    transform: scale(0) rotate(90deg);
  }
}

.feature-tabs__panel {
  display: flex;
  flex-direction: column;
  gap: 64px;
  padding: 30px 25px;
  background: var(--color-card);
  box-shadow: var(--shadow-card);
}

.feature-tabs__panel[hidden] {
  display: none;
}

/* The panel is card-colored, so code blocks and tables inside it use the page background to stand out */
.feature-tabs__panel .code-block,
.feature-tabs__panel .table-block {
  background: var(--color-bg);
}

.feature-tabs__panel .table-block code:not(.hljs) {
  background: var(--color-card);
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature__main {
  --feature-gap: clamp(32px, 5.7vw, 109px);
  display: grid;
  grid-template-columns: minmax(0, 854fr) minmax(0, 747fr);
  align-items: start;
  gap: var(--feature-gap);
}

/* The media is first in the markup (so it can float, below) but sits in the right column */
.feature__main > .feature__text {
  grid-area: 1 / 1;
}

.feature__main > .feature__media {
  grid-area: 1 / 2;
}

/* Text far taller than its media (js/features.js decides): the media floats right at its column width and the
   text wraps under it. A code block or table never wraps: one that starts beside the media stays docked in the
   left column for its whole length; one that starts below the media spans the full width. */
.feature__main--wrap {
  display: flow-root;
}

.feature__main--wrap > .feature__media {
  float: right;
  width: calc((100% - var(--feature-gap)) * 747 / 1601);
  margin: 0 0 24px var(--feature-gap);
}

.feature__main--wrap > .feature__text {
  display: block;
}

.feature__main--wrap > .feature__text > * + * {
  margin-top: 24px; /* the column's flex gap */
}

.feature--text .feature__main--wrap > .feature__text > * + * {
  margin-top: 16px;
}

/* Auto width lets a code block or table narrow beside the floated media instead of being pushed below it */
.feature__main--wrap .code-block,
.feature__main--wrap .table-block {
  width: auto;
}

.feature__main--full {
  grid-template-columns: minmax(0, 1fr);
}

.feature__text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* All of a feature's media, stacked in the right column */
.feature__media {
  --media-ratio: 747 / 380;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.feature__figure > a {
  display: block;
}

.feature__figure figcaption {
  margin-top: 10px;
  font-size: var(--fs-meta);
  color: var(--color-text-secondary);
}

.feature--text .feature__text {
  gap: 16px;
}

/* Sub features flow two per row under their big feature */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px clamp(32px, 5.7vw, 109px);
}

.feature--text {
  gap: 16px;
}

.feature--text .prose {
  font-size: var(--fs-body-lg);
}

.related {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.related__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-card-title);
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

.reflection {
  display: grid;
  grid-template-columns: minmax(0, 475fr) minmax(0, 1023fr);
  align-items: stretch;
  gap: clamp(40px, 6.4vw, 123px);
  width: 100%;
}

/* No image to dock beside the answers: they take the full width */
.reflection--text-only {
  grid-template-columns: minmax(0, 1fr);
}

.reflection__media {
  --media-ratio: auto;
  height: 100%;
  min-height: 420px;
}

.reflection__qa {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.reflection__item {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 1100px) {
  .overview,
  .feature__main,
  .reflection {
    grid-template-columns: 1fr;
  }

  /* Stacked: text, then its media */
  .feature__main > .feature__media {
    grid-area: 2 / 1;
  }

  /* Stacked: media, metrics, then text */
  .overview--split {
    grid-template-rows: none;
  }

  .overview--split > .media,
  .overview--split > .metric-pane,
  .overview__text {
    grid-area: auto;
  }

  .overview__text,
  .overview--split:has(.media--embed) .overview__text {
    aspect-ratio: auto;
    margin-top: 20px;
  }

  .feature-tabs__panel {
    gap: 48px;
    padding: 24px 20px;
  }

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

  .reflection__media {
    height: auto;
    min-height: 0;
    --media-ratio: 16 / 9;
  }
}

/* ---- Generic page (blogs / shaders) -------------------------------------- */
.generic-body {
  padding-block: 20px 64px;
}

.generic-body__content > * + * {
  margin-top: 24px;
}

.generic-body__content > .block,
.generic-body__content > .code-block,
.generic-body__content > .table-block,
.generic-body__content > .section-heading,
.generic-body__content > * + .block {
  margin-top: clamp(40px, 4vw, 72px);
}

.generic-body__content > .section-heading + * {
  margin-top: 30px;
}

.generic-body__content > :first-child {
  margin-top: 0;
}

.generic-body__content > p,
.generic-body__content > ul,
.generic-body__content > ol,
.generic-body__content > blockquote,
.generic-body__content > h3,
.generic-body__content > h4 {
  max-width: 1023px;
  font-size: var(--fs-body-lg);
  line-height: 1.6;
}

.block {
  width: 100%;
}

.block--media-text {
  display: grid;
  grid-template-columns: minmax(0, 605fr) minmax(0, 1023fr);
  align-items: center;
  gap: clamp(32px, 6.4vw, 123px);
}

.block--media-right {
  grid-template-columns: minmax(0, 1023fr) minmax(0, 605fr);
}

.block--media-right .block__media {
  order: 2;
}

.block__media {
  --media-ratio: 605 / 380;
  min-width: 0;
}

.block--text-code {
  display: grid;
  grid-template-columns: minmax(0, 840fr) minmax(0, 890fr);
  align-items: center;
  gap: 30px;
}

.block__code {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.block--media {
  --media-ratio: 16 / 9;
}

.block--media figcaption,
.block--gallery figcaption {
  margin-top: 10px;
  font-size: var(--fs-meta);
  color: var(--color-text-secondary);
}

.block--gallery {
  --media-ratio: 4 / 3;
  display: grid;
  grid-template-columns: repeat(var(--gallery-cols, 2), minmax(0, 1fr));
  gap: 24px;
}

.block--callout {
  padding: 24px 32px;
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
}

@media (max-width: 1100px) {
  .block--media-text,
  .block--media-right,
  .block--text-code {
    grid-template-columns: 1fr;
  }

  .block--media-right .block__media {
    order: 0;
  }
}

@media (max-width: 700px) {
  .block--gallery {
    grid-template-columns: 1fr;
  }
}

/* ---- 404 ------------------------------------------------------------------ */
.not-found {
  padding-block: 80px;
}

.not-found__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}

.not-found__code {
  font-family: var(--font-mono);
  font-size: var(--fs-body-lg);
  color: var(--color-text-secondary);
}

/* ---- Elements (style guide) ---------------------------------------------- */
.elements {
  padding-block: 40px 80px;
}

.elements__section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-block: 40px;
  border-bottom: 2px dashed var(--color-line);
}

.elements__item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.elements__name {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--color-text-secondary);
}

.elements__name code {
  color: var(--color-accent);
}

.elements__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
}

.elements__note {
  max-width: 900px;
  color: var(--color-text-secondary);
}
