/* =========================================================
   ADAN FLORES — portfolio
   One design system. Console-flavoured, but the chrome serves
   the content instead of competing with it.
   ========================================================= */

:root {
  /* Surfaces */
  --bg: #06070a;
  --bg-2: #0a0c11;
  --bg-3: #11141b;

  /* Text */
  --hud: #f4f7fb;
  --hud-dim: #ced4e0;
  --hud-mute: #aab1c0;

  /* Rules. --line and --line-strong are decorative structure (dividers,
     container edges) and are deliberately quiet. --line-ui is for the
     boundary of actual controls, where WCAG 1.4.11 requires >= 3:1
     (it clears 3.2:1 on every surface used here). */
  --line: #232833;
  --line-strong: #39404e;
  --line-ui: #5f6878;

  /* Accent. Reserved for: awards, primary CTAs, focus, the caret. */
  --accent: #7dffb8;
  --accent-dim: #2d8a5e;
  --accent-ink: #06070a;

  /* Type */
  --display: "Anybody", "Arial Black", system-ui, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Spacing ladder — distance encodes relatedness. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 72px;
  --s9: 112px;

  --maxw: 1280px;
  --gutter: clamp(20px, 5vw, 40px);
  --topbar-h: 56px;

  color-scheme: dark;
}

/* ---------- Reset & base ---------- */
* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(125, 255, 184, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 255, 184, 0.022) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  background-attachment: fixed;
  color: var(--hud);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0;
}

h1,
h2,
h3,
h4,
figure {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
}

b,
strong {
  color: var(--hud);
  font-weight: 700;
}

/* Every interactive element gets a visible focus ring (WCAG 2.4.7). */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 400;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transform: translateY(-250%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Shared type roles ---------- */
.marker,
.sub,
.when,
.role,
.feature-eyebrow,
.c-cat,
.c-stack,
.tags li,
.about-facts dt,
.stack-groups dt,
.pm-label,
.pm-eyebrow,
.hero-kicker,
.hero-role,
.hero-awards,
.colophon {
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-name,
.section-head .title,
.feature-title,
.exp-row .where h3,
.compact-head,
.stack-title,
.pm-title,
.mailto-huge {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hud);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  min-height: var(--topbar-h);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(6, 7, 10, 0.92);
  backdrop-filter: blur(10px);
}

.topbar .mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--hud);
  white-space: nowrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: var(--s2);
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar {
  display: none;
}

.topnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s3);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--hud-mute);
  white-space: nowrap;
  transition: color 160ms ease;
}

.topnav a:hover,
.topnav a.is-active {
  color: var(--hud);
}

.topnav a.is-active::after {
  content: "";
  position: absolute;
  left: var(--s3);
  right: var(--s3);
  bottom: 8px;
  height: 2px;
  background: var(--accent);
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.cv-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--s3);
  border: 1px solid var(--line-ui);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--hud);
  transition: border-color 160ms ease, color 160ms ease;
}

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

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-ui);
  background: var(--bg-3);
}

.lang-switch button {
  min-width: 44px;
  min-height: 36px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--hud-mute);
  transition: background 140ms ease, color 140ms ease;
}

.lang-switch button + button {
  border-left: 1px solid var(--line-ui);
}

.lang-switch button:hover {
  color: var(--hud);
}

.lang-switch button.is-on {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

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

.section {
  padding: var(--s9) 0;
  border-top: 1px solid var(--line-strong);
}

.section:first-of-type {
  border-top: 0;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--s5);
  margin-bottom: var(--s7);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--line-strong);
}

.section-head .marker,
.section-head .sub {
  font-size: 11px;
  color: var(--hud-mute);
}

.section-head .marker .symbol {
  margin-right: var(--s2);
  color: var(--hud-mute);
  font-weight: 700;
}

.section-head .title {
  margin-top: var(--s2);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.05;
}

.section-head .sub {
  text-align: right;
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--s8) 0 var(--s9);
  border-top: 0;
}

.hero-kicker {
  font-size: 11px;
  color: var(--hud-mute);
}

.hero-name {
  margin: var(--s4) 0 0;
  font-size: clamp(2.8rem, 6.6vw, 5.4rem);
  font-weight: 900;
  font-stretch: 150%;
  line-height: 0.88;
}

.hero-name em {
  font-style: normal;
}

.hero-name em::after {
  content: "_";
  margin-left: 0.06em;
  color: var(--accent);
  animation: blink 1.1s steps(2) infinite;
}

/* Portrait sits beside the whole intro block so it reads as vertically
   centred against the hero, not pinned under the name. */
.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: var(--s7);
  align-items: center;
}

.hero-portrait {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-lede {
  max-width: 26ch;
  margin: var(--s5) 0 0;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--hud-dim);
  text-wrap: balance;
}

.hero-role {
  margin: var(--s5) 0 0;
  font-size: 12px;
  color: var(--hud-mute);
}

.hero-awards {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  margin: var(--s4) 0 0;
  font-size: 11px;
  color: var(--accent);
}

.hero-awards li {
  position: relative;
  padding-left: var(--s3);
}

.hero-awards li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  background: var(--accent);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s7);
}

/* ---------- Buttons & tags (shared) ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s5);
}

.action {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0 var(--s4);
  border: 1px solid var(--line-ui);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hud);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.action::after {
  content: ">";
  color: var(--hud-mute);
  transition: color 160ms ease;
}

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

.action:hover::after {
  color: var(--accent);
}

.action.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.action.primary::after,
.action.primary:hover::after {
  color: var(--accent-ink);
}

.action.primary:hover {
  background: #9dffca;
  border-color: #9dffca;
  color: var(--accent-ink);
}

.more-btn::after {
  content: "+";
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s4);
}

/* Tags sit inside an already-bordered block: background only, no border. */
.tags li {
  padding: 5px var(--s2);
  background: var(--bg-3);
  font-size: 10px;
  color: var(--hud-dim);
}

/* ---------- Experience ---------- */
.exp-list {
  display: grid;
  gap: var(--s6);
}

.exp-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: var(--s5);
  padding: var(--s6);
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.exp-row .when {
  font-size: 11px;
  color: var(--hud-dim);
}

.exp-row .when span {
  display: block;
  margin-top: var(--s2);
  color: var(--hud-mute);
  text-transform: none;
  letter-spacing: 0.04em;
}

.exp-row .where h3 {
  font-size: 1.5rem;
  line-height: 1.1;
}

.exp-row .where h3 em {
  font-style: normal;
  color: var(--hud-mute);
}

.exp-row .role {
  margin-top: var(--s2);
  font-size: 11px;
  color: var(--hud-mute);
}

.exp-row .what p {
  color: var(--hud-dim);
  font-size: 16px;
}

/* Numbers first — the result, then the detail. */
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s6);
  margin-bottom: var(--s5);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
}

.metrics li {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.metrics b {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--hud);
}

.metrics span {
  max-width: 18ch;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hud-mute);
}

.exp-more {
  margin-top: var(--s4);
}

.exp-more summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hud-mute);
  cursor: pointer;
  list-style: none;
  transition: color 160ms ease;
}

.exp-more summary::-webkit-details-marker {
  display: none;
}

.exp-more summary::before {
  content: "+";
  color: var(--accent);
}

.exp-more[open] summary::before {
  content: "–";
}

.exp-more summary:hover {
  color: var(--hud);
}

.exp-more p {
  margin-top: var(--s3);
}

/* ---------- Featured projects ---------- */
.features {
  display: grid;
  gap: var(--s9);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--s7);
  align-items: center;
}

.feature:nth-child(even) .feature-media {
  order: 2;
}

.feature-media {
  aspect-ratio: 16 / 11;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
}

.feature-media img,
.feature-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg);
}

.feature-eyebrow {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  font-size: 11px;
  color: var(--hud-mute);
}

.feature-eyebrow .n {
  font-weight: 700;
  color: var(--hud-mute);
}

.feature-title {
  margin-top: var(--s3);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 900;
  line-height: 1;
}

.feature-sub {
  margin-top: var(--s2);
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--hud-mute);
}

.feature-copy .lede {
  margin-top: var(--s4);
  max-width: 46ch;
  font-size: 16px;
  line-height: 1.6;
  color: var(--hud-dim);
}

.feature-award {
  display: inline-block;
  margin-top: var(--s4);
  padding: 6px var(--s3);
  border: 1px solid var(--accent-dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Compact projects ---------- */
.compact-head {
  margin: var(--s9) 0 var(--s5);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line-strong);
  font-size: 1.3rem;
}

.compacts {
  display: grid;
}

.compact {
  display: grid;
  grid-template-columns: 40px minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1fr) 24px;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  min-height: 64px;
  padding: var(--s4) var(--s3);
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: background 160ms ease, padding-left 200ms ease;
}

.compacts li:first-child .compact {
  border-top: 1px solid var(--line);
}

.compact:hover {
  background: var(--bg-2);
  padding-left: var(--s5);
}

.c-n {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--hud-mute);
}

.c-title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--hud);
}

.c-cat,
.c-stack {
  font-size: 10px;
  color: var(--hud-mute);
}

.c-arrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--hud-mute);
  text-align: right;
  transition: transform 200ms ease, color 160ms ease;
}

.compact:hover .c-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: var(--s7);
  align-items: start;
}

.about-aside {
  display: grid;
  gap: var(--s5);
  padding: var(--s5);
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.about-facts {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: var(--s3) var(--s4);
  margin: 0;
}

.about-facts dt {
  font-size: 10px;
  color: var(--hud-mute);
  padding-top: 3px;
}

.about-facts dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--hud);
}

.about-facts dd .now {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}

.about-facts dd .now::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 3.2s ease-in-out infinite;
}

.about-links {
  display: grid;
  gap: var(--s1);
}

.about-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--hud-dim);
  transition: color 160ms ease, padding-left 200ms ease;
}

.about-links li:last-child a {
  border-bottom: 0;
}

.about-links a::after {
  content: ">";
  margin-left: auto;
  color: var(--hud-mute);
}

.about-links a:hover {
  color: var(--accent);
  padding-left: var(--s2);
}

.about-body p {
  max-width: 62ch;
  margin: 0 0 1em;
  font-size: 17px;
  color: var(--hud-dim);
}

/* Stack lives here now: what I am good at, not everything I have touched. */
.stack-block {
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--line-strong);
}

.stack-title {
  font-size: 1.2rem;
}

.stack-groups {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: var(--s3) var(--s5);
  margin: var(--s4) 0 0;
}

.stack-groups dt {
  font-size: 10px;
  color: var(--hud-mute);
  padding-top: 4px;
}

.stack-groups dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--hud-dim);
}

/* ---------- Contact ---------- */
.contact-block {
  display: grid;
  gap: var(--s5);
}

.contact-lede {
  max-width: 46ch;
  font-size: 17px;
  color: var(--hud-dim);
}

.mailto-huge {
  display: block;
  font-size: clamp(1.4rem, 4.6vw, 3.4rem);
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: anywhere;
  transition: color 200ms ease;
}

.mailto-huge em {
  font-style: normal;
  color: var(--accent);
}

.mailto-huge:hover {
  color: var(--accent);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* ---------- Footer ---------- */
.colophon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s4);
  padding: var(--s6) 0 var(--s8);
  border-top: 1px solid var(--line-strong);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--hud-mute);
}

.colophon .right {
  text-align: right;
}

/* ---------- Project modal ---------- */
body.pmodal-open {
  overflow: hidden;
}

.pmodal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 32px);
  background: rgba(2, 4, 7, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: pmodal-in 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pmodal[hidden] {
  display: none;
}

.pmodal-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 920px);
  max-height: min(88vh, 840px);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}

.pmodal-head,
.pmodal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  background: var(--bg-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pmodal-head {
  min-height: 56px;
  padding: var(--s2) var(--s2) var(--s2) var(--s5);
  border-bottom: 1px solid var(--line-strong);
}

.pmodal-kicker {
  color: var(--hud-mute);
}

.pmodal-kicker::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--s3);
  border-radius: 50%;
  background: var(--hud-mute);
}

.pmodal-x {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 40px;
  padding: 0 var(--s2) 0 var(--s3);
  border: 1px solid var(--line-ui);
  color: var(--hud);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.pmodal-x span[aria-hidden="true"] {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  font-size: 14px;
  line-height: 1;
}

.pmodal-x:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.pmodal-content {
  overflow-y: auto;
  min-height: 0;
  padding: var(--s7) var(--gutter) var(--s8);
}

.pmodal-foot {
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--line-strong);
  color: var(--hud-mute);
  font-size: 10px;
}

.pm-inner {
  width: min(100%, 820px);
  margin: 0 auto;
}

.pm-eyebrow {
  font-size: 11px;
  color: var(--hud-mute);
}

.pm-eyebrow b {
  color: var(--hud-dim);
  font-weight: 700;
}

.pm-title {
  margin: var(--s3) 0 0;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1;
}

.pm-meta {
  margin-top: var(--s3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hud-dim);
}

.pm-badge {
  display: inline-block;
  margin-top: var(--s4);
  padding: 7px var(--s3);
  border: 1px solid var(--accent-dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.pm-section {
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--line-strong);
}

.pm-label {
  margin-bottom: var(--s4);
  font-size: 11px;
  color: var(--hud-mute);
}

.pm-summary {
  font-size: 17px;
  line-height: 1.6;
  color: var(--hud-dim);
}

.pm-highlights {
  counter-reset: pmh;
}

.pm-highlights li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.6;
  color: var(--hud-dim);
}

.pm-highlights li:first-child {
  border-top: 1px solid var(--line);
}

.pm-highlights li::before {
  content: counter(pmh, decimal-leading-zero);
  counter-increment: pmh;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--hud-mute);
  padding-top: 4px;
}

.pm-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.pm-stack li {
  padding: 6px var(--s3);
  background: var(--bg-3);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--hud-dim);
}

.pm-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* Modal gallery — the images that used to sit in the card carousels. */
.pm-gallery {
  display: flex;
  gap: var(--s3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--s3);
}

.pm-gallery figure {
  flex: 0 0 min(78%, 320px);
  scroll-snap-align: start;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.pm-gallery img,
.pm-gallery video {
  width: 100%;
  /* height:auto is required — the HTML height attribute would otherwise make
     both dimensions definite and aspect-ratio would be ignored. */
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--bg);
}

.pm-gallery figcaption {
  padding: var(--s2) var(--s3);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hud-mute);
}

/* ---------- Motion ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms ease, transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

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

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .exp-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s4);
  }

  .feature,
  .feature:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s5);
  }

  .feature:nth-child(even) .feature-media {
    order: 0;
  }

  .about-grid,
  .hero-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .compact {
    grid-template-columns: 32px minmax(0, 1fr) 24px;
    row-gap: var(--s1);
  }

  .c-cat,
  .c-stack {
    grid-column: 2;
  }
}

@media (max-width: 720px) {
  :root {
    --s9: 72px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: var(--s2) var(--s4);
    padding-top: var(--s2);
    padding-bottom: var(--s2);
  }

  .topnav {
    order: 3;
    width: 100%;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
  }

  /* Full 44px touch targets where it actually matters (WCAG 2.5.8). */
  .cv-link,
  .lang-switch button {
    min-height: 44px;
  }

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

  .section-head .sub {
    text-align: left;
  }

  .metrics {
    gap: var(--s5);
  }

  .metrics b {
    font-size: 1.6rem;
  }

  .stack-groups {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s1) 0;
  }

  .stack-groups dd {
    margin-bottom: var(--s3);
  }

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

  .colophon .right {
    text-align: left;
  }

  .pmodal {
    align-items: end;
    padding: 8px;
  }

  .pmodal-window {
    max-height: 92vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
