/* ==========================================================================
   Andrés Rendón — Portfolio · styles.css
   Font: Geist (Regular 400 / Medium 500 / Bold 700)
   Spacing rule: every padding, margin, gap, radius and line-height is a
   multiple of 4px (see --space-* tokens). Font sizes live in --fs-*.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/Geist-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/Geist-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/Geist-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Palette (9 colors) */
  --c-ink: #121212;      /* text, dark surfaces */
  --c-line: #EAEAE6;     /* borders, dividers */
  --c-muted: #666662;    /* secondary text */
  --c-accent: #8737ED;   /* purple accent */
  --c-white: #FFFFFF;    /* page background */
  --c-gray: #8B8B8B;     /* tertiary text */
  --c-card: #FFFEFC;     /* card surface */
  --c-surface: #F9F9F6;  /* footer / soft surface */
  --c-warm: #FFFBF9;     /* warm surface (reserved) */
  --c-on-media: #FFFFFF; /* text/controls over video: the same in both themes */

  /* Font family + weights */
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;

  /* Font sizes */
  --fs-12: 12px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;
  --fs-40: 40px;
  --fs-48: 48px;
  --fs-56: 56px;
  --fs-64: 64px;
  --fs-84: 84px;

  /* Line heights (2px grid; see "Typographic rhythm" at the end of this file) */
  --lh-16: 16px;
  --lh-18: 18px;
  --lh-20: 20px;
  --lh-22: 22px;
  --lh-24: 24px;
  --lh-26: 26px;
  --lh-28: 28px;
  --lh-32: 32px;
  --lh-38: 38px;
  --lh-40: 40px;
  --lh-46: 46px;
  --lh-48: 48px;
  --lh-52: 52px;
  --lh-56: 56px;
  --lh-60: 60px;
  --lh-64: 64px;
  --lh-80: 80px;

  /* Spacing scale (4px grid) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-13: 52px;
  --space-14: 56px;
  --space-16: 64px;
  --space-18: 72px;
  --space-20: 80px;
  --space-24: 96px;
  --space-28: 112px;
  --space-30: 120px;
  --space-32: 128px;

  /* Radius */
  --radius-sm: 8px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Elevation: ink (#121212) at low alpha, no extra palette colour */
  --shadow-float: 0 8px 24px rgba(18, 18, 18, 0.08);

  /* Layout */
  --container: 1208px;
  --header-w: 1240px;   /* floating header max width */
  --gutter: 24px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 104px; }
body {
  margin: 0;
  background: var(--c-white);
  color: var(--c-ink);
  font-family: var(--font);
  font-size: var(--fs-16);
  line-height: var(--lh-24);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, figure, blockquote { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 4px; }

.container { width: min(100% - (var(--gutter) * 2), var(--container)); margin-inline: auto; }
.accent { color: var(--c-accent); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  background: var(--c-ink);
  color: var(--c-white);
  font-size: var(--fs-16);
  line-height: var(--lh-24);
  font-weight: var(--fw-medium);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
main:focus { outline: none; }

/* ---------- Shared type ---------- */
.eyebrow {
  margin: 0;
  color: var(--c-accent);
  font-size: var(--fs-16);
  line-height: var(--lh-24);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow--sm { font-size: var(--fs-16); letter-spacing: 0.1em; }

.h2 {
  font-size: var(--fs-40);
  line-height: var(--lh-48);
  font-weight: var(--fw-medium);
}
.h2--regular { font-weight: var(--fw-regular); }
.h2--xl { font-size: var(--fs-48); line-height: var(--lh-56); font-weight: var(--fw-regular); }
.h2__muted { color: var(--c-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-size: var(--fs-16);
  line-height: var(--lh-20);
  font-weight: var(--fw-medium);
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn svg { flex: none; }
.btn--pill {
  height: 36px;
  padding-inline: var(--space-5);
  border: 1px solid var(--c-ink);
  border-radius: var(--radius-pill);
}
.btn--solid { background: var(--c-ink); color: var(--c-white); }
.btn--solid:hover { background: var(--c-accent); border-color: var(--c-accent); }
.btn--outline { background: transparent; color: var(--c-ink); }
.btn--outline:hover { background: var(--c-ink); color: var(--c-white); }
.btn--block {
  height: 36px;
  padding-inline: var(--space-8);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--c-ink);
  color: var(--c-white);
  font-size: var(--fs-16);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.btn--block:hover { background: var(--c-accent); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding-inline: var(--space-4);
  background: var(--c-ink);
  color: var(--c-white);
}
.topbar__text {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-12);
  line-height: var(--lh-16);
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.topbar__dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); }
/* "Live" signal: a ring that expands and fades out, on repeat */
.topbar__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c-accent);
  animation: dot-pulse 1.8s ease-out infinite;
}
@keyframes dot-pulse {
  0%   { transform: scale(1);   opacity: .7; }
  70%  { transform: scale(3.2); opacity: 0; }
  100% { transform: scale(3.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .topbar__dot::after { animation: none; opacity: 0; } }

/* ---------- Header ----------
   Top of the page: the original full-width header.
   After scrolling past it (JS adds .is-floating) it becomes a floating, sticky
   pill (max --header-w) - see "Floating header" near the end of this file.      */
.site-header {
  position: relative;
  min-height: var(--header-h, 0px); /* JS keeps the space when the bar goes fixed */
  border-bottom: 1px solid var(--c-line);
  background: var(--c-white);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding-block: var(--space-8);
}
.header__brand { flex: none; width: 320px; max-width: 100%; }
.header__name {
  display: block;
  font-size: var(--fs-32);
  line-height: var(--lh-40);
  font-weight: var(--fw-bold);
}
.header__name span { color: var(--c-accent); }
.header__role {
  font-size: var(--fs-16);
  line-height: var(--lh-24);
  color: var(--c-muted);
}
.header__loc { display: block; }
.header__panel { display: flex; flex: 1; align-items: center; gap: var(--space-6); }
.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav__link {
  padding-block: var(--space-3); /* 48px target height, no visual change */
  white-space: nowrap;
  font-size: var(--fs-16);
  line-height: var(--lh-24);
  font-weight: var(--fw-medium);
  color: var(--c-muted);
  transition: color .15s ease;
}
.nav__link:hover, .nav__link[aria-current] { color: var(--c-ink); }
.header__actions { display: flex; align-items: center; gap: var(--space-6); margin-left: auto; }

/* Language switch (EN | ES): real links, the current language is filled. Lives in the floating mascot menu. */
.lang {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  background: var(--c-white);
}
.lang__link {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 30px;
  padding-inline: var(--space-2);
  border-radius: var(--radius-pill);
  color: var(--c-muted);
  font-size: var(--fs-12);
  line-height: var(--lh-16);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}
.lang__link:hover { color: var(--c-ink); }
.lang__link[aria-current] { background: var(--c-ink); color: var(--c-white); }

/* Header tools: language + theme switch (the mascot menu keeps its own copy) */
.header__tools { display: flex; align-items: center; gap: var(--space-2); }
.header__tools .theme-toggle { width: 36px; height: 36px; border: 1px solid var(--c-line); background: var(--c-white); }
.header__tools .theme-toggle:hover { border-color: var(--c-ink); }
.header__tools .lang__link { height: 30px; }

/* Menu button: hidden unless the nav is collapsed */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--c-ink);
  cursor: pointer;
  transition: background-color .15s ease;
}
.menu-toggle:hover { background: var(--c-surface); }
.menu-toggle__icon { width: 24px; height: 24px; }
.menu-toggle__close { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle__close { display: inline; }

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-20) 76px; }
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 592px;
  gap: var(--space-6);
  align-items: start;
}
.hero__title {
  font-size: var(--fs-64);
  line-height: var(--lh-60);
  font-weight: var(--fw-medium);
  letter-spacing: -0.0375em;
}
.hero__copy p {
  font-size: var(--fs-20);
  line-height: var(--lh-28);
  color: var(--c-muted);
}
.hero__title + p { margin-top: var(--space-12); }
.hero__copy p + p { margin-top: var(--space-6); }
.hero__title + .hero__keywords { margin-top: var(--space-6); }
.hero__copy .hero__keywords { color: var(--c-ink); font-weight: var(--fw-medium); }
.hero__copy .hero__keywords + .hero__text { margin-top: var(--space-12); }
.hero__photo img { display: block; width: 100%; height: auto; aspect-ratio: 592 / 596; object-fit: cover; border-radius: var(--radius-sm); }

/* ---------- By the numbers ---------- */
.numbers { padding-block: var(--space-18); border-bottom: 1px solid var(--c-line); }
.numbers .h2 { margin-top: var(--space-3); }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-13);
}
.stat__value {
  font-size: var(--fs-64);
  line-height: var(--lh-64);
  font-weight: var(--fw-bold);
  color: var(--c-accent);
}
.stat__label {
  margin-top: var(--space-3);
  font-size: var(--fs-20);
  line-height: var(--lh-28);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stat__text {
  margin-top: var(--space-1);
  font-size: var(--fs-16);
  line-height: var(--lh-24);
  color: var(--c-muted);
}

/* ---------- Process ---------- */
.process { padding-bottom: var(--space-18); border-bottom: 1px solid var(--c-line); }
.process__copy .h2, .education .h2 { margin-top: var(--space-3); }
.process__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6) var(--space-14);
  margin-top: var(--space-12);
}
.process__list p {
  font-size: var(--fs-20);
  line-height: var(--lh-28);
  color: var(--c-muted);
}
.process__list strong { color: var(--c-ink); font-weight: var(--fw-medium); }

/* ---------- Education ---------- */
.education {
  padding: var(--space-14);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-white);
}
.education__label {
  margin-top: var(--space-12);
  color: var(--c-accent);
  font-size: var(--fs-16);
  line-height: var(--lh-24);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.education__label + .education__item,
.education__label + .education__list { margin-top: var(--space-1); }
.education__label ~ .education__label { margin-top: var(--space-7); }
.education__item .education__title + .education__title { margin-top: var(--space-1); }
.education__title { font-size: var(--fs-20); line-height: var(--lh-28); }
.education__year { font-size: var(--fs-16); line-height: var(--lh-24); color: var(--c-muted); }
.education__item--degree .education__year { margin-top: var(--space-1); }
.education__list li + li { margin-top: var(--space-2); }

/* ---------- Experience ---------- */
.experience { padding-top: var(--space-24); }
.job { margin-top: var(--space-5); }
.experience .h2 + .job { margin-top: var(--space-13); }
.job__role { font-size: var(--fs-16); line-height: var(--lh-20); color: var(--c-accent); }
.job__company {
  font-size: var(--fs-24);
  line-height: var(--lh-32);
  font-weight: var(--fw-bold);
  letter-spacing: -0.0125em;
}
.job__date { margin-top: var(--space-4); font-size: var(--fs-16); line-height: var(--lh-24); color: var(--c-muted); }
.job__list { margin-top: var(--space-4); max-width: 1160px; }
.job:nth-of-type(n+3) .job__list { max-width: 616px; }
.job__list li {
  position: relative;
  padding-left: var(--space-5);
  font-size: var(--fs-16);
  line-height: var(--lh-24);
  color: var(--c-muted);
}
.job__list li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-muted);
}

/* ---------- Education + skills ---------- */
.skills { padding-block: var(--space-24) var(--space-20); }
.skills__grid {
  display: grid;
  grid-template-columns: 536px 1fr;
  gap: var(--space-14);
  align-items: start;
}
.skills__copy { padding-top: var(--space-14); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-2); margin-top: var(--space-2); }
.eyebrow--tools { margin-top: var(--space-8); }
.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding-inline: var(--space-3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  background: var(--c-white);
  font-size: var(--fs-16);
  line-height: var(--lh-24);
  font-weight: var(--fw-medium);
}
.chip--dark { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-white); }

/* ---------- Portfolio ---------- */
.portfolio {
  padding-block: 84px var(--space-20);
  border-block: 1px solid var(--c-line);
}
.portfolio__grid { display: flex; flex-wrap: wrap; gap: var(--space-12) var(--space-6); margin-top: var(--space-12); }
.card--wide { flex: 1 1 680px; max-width: 680px; }
.card--narrow { flex: 1 1 504px; max-width: 504px; }
.card__media {
  display: block;
  height: 320px;
  overflow: hidden;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-line);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.card__body { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-6); padding-top: var(--space-4); }
.card__text { flex: 1; min-width: 0; }
.card__legal { margin-top: var(--space-1); margin-bottom: var(--space-1); font-size: var(--fs-12); line-height: var(--lh-16); }
.card__title { font-size: var(--fs-24); line-height: var(--lh-32); font-weight: var(--fw-bold); }
.card__desc { font-size: var(--fs-16); line-height: var(--lh-24); color: var(--c-muted); }
.card__client { font-size: var(--fs-20); line-height: var(--lh-28); color: var(--c-accent); }
.card { position: relative; }
.card__link { color: inherit; }
/* One link per card: the title's pseudo-element stretches over the whole card */
.card__link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-sm); }
.card__link:focus-visible { outline: none; }
.card__link:focus-visible::after { outline: 2px solid var(--c-accent); outline-offset: 4px; }
.card__media img { transition: transform .3s ease; }
.card:hover .card__media img { transform: scale(1.02); }
.card:hover .card__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.card__arrow {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: var(--space-8);
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: var(--c-white);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.card__text:has(.card__legal) + .card__arrow { margin-top: 0; }
.card:hover .card__arrow, .card:focus-within .card__arrow { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-white); }
.portfolio__cta { display: flex; justify-content: center; margin-top: var(--space-12); }

/* ---------- Work page (listing) ---------- */
.crumbs { border-bottom: 1px solid var(--c-line); }
.crumbs__list { margin: 0; padding-inline: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; min-height: 54px; padding-block: var(--space-3); font-size: var(--fs-16); line-height: var(--lh-24); }
.crumbs__list li { display: flex; align-items: center; }
.crumbs__list li + li::before { content: "/"; margin-inline: var(--space-2); color: var(--c-muted); }
.crumbs__list a { padding-block: var(--space-1); color: var(--c-muted); }
.crumbs__list a:hover { color: var(--c-ink); }
.crumbs__list a[aria-current] { color: var(--c-ink); }

.page-hero { padding-block: var(--space-20); }
.page-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: var(--space-8) var(--space-10); align-items: end; }
.page-hero__title {
  font-size: var(--fs-84);
  line-height: var(--lh-80);
  font-weight: var(--fw-medium);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.page-hero__lead { font-size: var(--fs-20); line-height: var(--lh-28); color: var(--c-muted); }

.work { padding-bottom: var(--space-20); }
.work__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12) var(--space-6); align-items: start; }
.work .card__media { height: auto; aspect-ratio: 37 / 30; }

/* ---------- Testimonials ---------- */
.testimonials { padding-block: var(--space-10) var(--space-16); }
.testimonials__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  align-items: start;
  margin-top: var(--space-12);
}
.quote {
  padding: var(--space-8);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-surface);   /* same tone as the footer */
}
.quote__title { font-size: var(--fs-20); line-height: var(--lh-28); font-weight: var(--fw-bold); letter-spacing: -0.0125em; }
.quote__body { margin-top: var(--space-2); }
.quote__body p { font-size: var(--fs-16); line-height: var(--lh-24); color: var(--c-muted); }
.quote__body p + p { margin-top: var(--space-5); }
.quote__author { display: flex; flex-direction: column; margin-top: var(--space-3); }
.quote__author strong { color: var(--c-accent); font-size: var(--fs-16); line-height: var(--lh-24); font-weight: var(--fw-bold); }
.quote__author span { font-size: var(--fs-12); line-height: var(--lh-16); }

/* ---------- Contact ---------- */
.contact { padding-block: var(--space-10); border-top: 1px solid var(--c-line); }
.contact__grid { display: grid; grid-template-columns: 1fr 551px; gap: var(--space-10); align-items: start; }
.contact__title {
  font-size: var(--fs-64);
  line-height: var(--lh-64);
  font-weight: var(--fw-medium);
  letter-spacing: -0.0375em;
}
.contact__lead { max-width: 480px; margin-top: var(--space-6); font-size: var(--fs-20); line-height: var(--lh-28); color: var(--c-muted); }
.contact__list { margin-top: var(--space-4); }
.contact__list li { font-size: var(--fs-20); line-height: var(--lh-28); }
.contact__list li + li { margin-top: var(--space-1); }
.contact__list a {
  display: inline-block;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
.contact__list a:hover { color: var(--c-accent); }

/* Contact: email is plain text with a Copy button */
.copy-email { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); overflow-wrap: anywhere; }
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  padding: 0;
  border: 1px solid var(--c-ink);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--c-ink);
  cursor: pointer;
  transition: opacity .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.copy-btn:hover { background: var(--c-ink); color: var(--c-white); }
.copy-btn.is-copied { border-color: var(--c-accent); color: var(--c-accent); }
.copy-btn.is-copied:hover { background: transparent; }
.copy-btn svg { display: block; }
.copy-btn .i-check { display: none; }
.copy-btn.is-copied .i-copy { display: none; }
.copy-btn.is-copied .i-check { display: block; }
/* With a mouse the button shows on hover (or keyboard focus); on touch it stays visible */
@media (hover: hover) {
  .copy-btn { opacity: 0; }
  .copy-email:hover .copy-btn,
  .copy-email:focus-within .copy-btn,
  .copy-btn.is-copied { opacity: 1; }
}
.contact__cta {
  color: var(--c-accent);
  font-size: var(--fs-64);
  line-height: var(--lh-64);
  font-weight: var(--fw-medium);
  letter-spacing: -0.0375em;
}
.form__note { margin-top: var(--space-5); font-size: var(--fs-16); line-height: var(--lh-24); color: var(--c-muted); }
.contact form { display: flex; flex-direction: column; gap: var(--space-5); margin-top: var(--space-4); }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field label {
  font-size: var(--fs-12);
  line-height: var(--lh-16);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.field input, .field textarea {
  display: block;
  width: 100%;
  padding: var(--space-4);
  border: 1px solid var(--c-muted);
  border-radius: var(--radius-sm);
  background: var(--c-white);
  font-size: var(--fs-16);
  line-height: var(--lh-16);
  outline: none;
}
.field input { height: 48px; }
.field textarea { height: 184px; resize: none; }
.field input:focus, .field textarea:focus { border-color: var(--c-accent); box-shadow: 0 0 0 1px var(--c-accent); }
.field [aria-invalid="true"] { border-color: var(--c-ink); box-shadow: 0 0 0 1px var(--c-ink); }
.field [aria-invalid="true"]:focus { border-color: var(--c-accent); box-shadow: 0 0 0 1px var(--c-accent); }
.field__error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--fs-16);
  line-height: var(--lh-24);
  font-weight: var(--fw-medium);
  color: var(--c-ink);
}
.field__error[hidden] { display: none; }
.field__error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-ink);
  color: var(--c-white);
  font-size: var(--fs-12);
  line-height: 1;
  font-weight: var(--fw-bold);
}
.btn--submit { align-self: flex-start; min-width: 220px; margin-top: var(--space-2); border: 0; }
.btn--submit[aria-disabled="true"] { opacity: .6; cursor: progress; }
.form__status { font-size: var(--fs-16); line-height: var(--lh-24); font-weight: var(--fw-medium); }
.form__status:empty { display: none; }
.form__status:focus { outline: none; }
.form__status.is-error { color: var(--c-ink); }
.form__status.is-success {
  padding: var(--space-6);
  border: 1px solid var(--c-accent);
  border-radius: var(--radius-sm);
  background: var(--c-card);
  font-size: var(--fs-20);
  line-height: var(--lh-28);
}
.contact__form.is-sent .form__note,
.contact__form.is-sent .field,
.contact__form.is-sent .btn--submit { display: none; }

/* ---------- Footer ---------- */
.footer { background: var(--c-surface); }
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 96px;
  padding-inline: var(--space-20);
  font-size: var(--fs-12);
  line-height: var(--lh-20);
}
.footer__inner a { padding-block: var(--space-3); font-weight: var(--fw-bold); }
.footer__inner a:hover { color: var(--c-accent); }

/* ---------- Responsive ----------
   Desktop   >= 1200px   (design: 1440)
   Tablet    640-1199px  (design: 820)   [header top state: 2 rows up to 1279px]
   Mobile    <= 639px    (design: 375)
   -------------------------------------------------------------------------- */

/* ----- Header, top of page (below 1280px): brand on row 1, nav + actions on row 2 ----- */
@media (max-width: 1279px) {
  .header__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand brand"
      "nav   actions";
    align-items: center;
    gap: var(--space-1) var(--space-8);
    padding-block: var(--space-6) var(--space-4);
  }
  .header__panel { display: contents; }
  .header__brand { grid-area: brand; width: auto; }
  .nav { grid-area: nav; justify-self: start; gap: var(--space-6); }
  :lang(es) .nav { gap: var(--space-4); }
  .header__actions { grid-area: actions; justify-self: end; }
}
@media (min-width: 640px) and (max-width: 979px) {   /* nav + actions + tools no longer fit on one row */
  .header__inner { grid-template-areas: "brand brand" "nav nav" "actions actions"; }
  .header__actions { justify-self: start; margin: var(--space-2) 0 0; }
}
@media (min-width: 760px) and (max-width: 799px) {
  :lang(es) .header__inner { grid-template-areas: "brand brand" "nav nav" "actions actions"; }
  :lang(es) .header__actions { justify-self: start; margin: var(--space-2) 0 0; }
}

/* ----- Tablet (and small laptops) ----- */
@media (max-width: 1199px) {
  :root { --gutter: 32px; }

  /* Hero: title and keywords, then copy beside the photo */
  .hero { padding-block: var(--space-16); }
  .hero__grid {
    grid-template-columns: 1fr 320px;
    grid-template-areas:
      "title title"
      "keys  keys"
      "text  photo";
    column-gap: var(--space-8);
    row-gap: 0;
  }
  .hero__copy { display: contents; }
  .hero__title { grid-area: title; font-size: var(--fs-56); line-height: var(--lh-56); }
  .hero__keywords { grid-area: keys; }
  .hero__text { grid-area: text; }
  .hero__photo { grid-area: photo; }
  .hero__copy .hero__keywords + .hero__text { margin-top: var(--space-8); }
  .hero__photo { margin-top: var(--space-8); }

  .numbers { padding-block: var(--space-16); }
  .stats { grid-template-columns: repeat(2, 1fr); gap: var(--space-10) var(--space-8); }

  .contact__grid { grid-template-columns: 1fr; }
  .skills__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
  .skills__copy { padding-top: var(--space-10); }
  .education { padding: var(--space-10); }
  .process__list { grid-template-columns: 1fr; }

  .process { padding-bottom: var(--space-16); }
  .experience { padding-top: var(--space-16); }
  .skills { padding-block: var(--space-16); }

  .portfolio { padding-block: var(--space-16); }
  .card--wide, .card--narrow { flex-basis: 100%; max-width: none; }

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

  .contact__grid { gap: var(--space-12); }
  .contact__title { font-size: var(--fs-48); line-height: var(--lh-48); }
  .contact__lead { max-width: 560px; }

  .footer__inner { padding-inline: var(--gutter); }
}

/* ----- Mobile ----- */
/* Education + skills stack once two columns no longer fit */
@media (max-width: 979px) {
  .skills__grid { grid-template-columns: 1fr; gap: var(--space-12); }
  .skills__copy { padding-top: 0; }
}

@media (max-width: 639px) {
  :root { --gutter: 16px; }

  .topbar { height: auto; min-height: 40px; padding-block: var(--space-2); }
  .topbar__text { align-items: flex-start; text-align: left; }
  .topbar__dot { margin-top: var(--space-1); }

  /* Header: name + menu button, role, collapsible nav, actions */
  .header__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name  toggle"
      "role  role"
      "panel panel";
    align-items: center;
    gap: 0 var(--space-4);
    padding-block: var(--space-4) var(--space-6);
  }
  .header__brand { display: contents; }
  .header__name { grid-area: name; font-size: var(--fs-24); line-height: var(--lh-32); }
  .header__role { grid-area: role; margin-top: var(--space-1); font-size: var(--fs-16); line-height: var(--lh-24); }
  .menu-toggle { display: inline-flex; grid-area: toggle; }
  .header__panel { display: flex; grid-area: panel; flex-direction: column; align-items: stretch; gap: 0; }
  .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: var(--space-4) 0 0;
    border-top: 1px solid var(--c-line);
  }
  .js .header__panel:not(.is-open) .nav { display: none; }
  .nav__link {
    border-bottom: 1px solid var(--c-line);
    color: var(--c-ink);
  }
  .nav__link[aria-current] { color: var(--c-accent); }
  .header__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    margin: var(--space-4) 0 0;
  }
  .header__tools { grid-column: 1 / -1; justify-content: flex-start; margin: var(--space-4) 0 0; }   /* theme sits next to the language switch, set apart from the buttons */
  .btn--pill { height: 44px; padding-inline: var(--space-3); font-size: var(--fs-16); }

  /* Type */
  .h2 { font-size: var(--fs-32); line-height: var(--lh-40); }
  .h2--xl { font-size: var(--fs-40); line-height: var(--lh-48); }
  .eyebrow { font-size: var(--fs-16); line-height: var(--lh-24); }

  /* Hero: title, keywords, photo, copy */
  .hero { padding-block: var(--space-10) var(--space-12); }
  .hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "keys" "photo" "text"; }
  .hero__title { font-size: var(--fs-40); line-height: var(--lh-48); }
  .hero__copy p { font-size: var(--fs-16); line-height: var(--lh-24); }
  .hero__photo { margin-top: var(--space-8); }
  .hero__copy .hero__keywords + .hero__text { margin-top: var(--space-8); }

  /* Numbers */
  .numbers { padding-block: var(--space-12); }
  .stats { grid-template-columns: 1fr; gap: 0; margin-top: var(--space-8); }
  .stat { padding-block: var(--space-6); border-top: 1px solid var(--c-line); }
  .stat:last-child { padding-bottom: 0; }
  .stat__value { font-size: var(--fs-48); line-height: var(--lh-48); }

  /* Process + education */
  .process { padding-bottom: var(--space-12); }
  .skills__grid { gap: var(--space-10); }
  .process__list { margin-top: var(--space-8); }
  .process__list p { font-size: var(--fs-16); line-height: var(--lh-24); }
  .education { padding: var(--space-6); }
  .education__label { margin-top: var(--space-8); }

  /* Experience */
  .experience { padding-top: var(--space-12); }
  .experience .h2 + .job { margin-top: var(--space-8); }
  .job { margin-top: var(--space-8); }
  .job__company { font-size: var(--fs-20); }

  /* Skills */
  .skills { padding-block: var(--space-12); }

  /* Portfolio */
  .portfolio { padding-block: var(--space-12); }
  .portfolio__grid { gap: var(--space-10); margin-top: var(--space-8); }
  .card__media { height: 220px; }
  .card__title { font-size: var(--fs-20); line-height: var(--lh-28); }
  .card__client { font-size: var(--fs-16); line-height: var(--lh-24); }
  .card__arrow, .card__text:has(.card__legal) + .card__arrow { margin-top: 0; }
  .btn--block { height: auto; min-height: 44px; padding: var(--space-3) var(--space-2); letter-spacing: 0.02em; white-space: normal; text-align: center; }
  .portfolio__cta .btn--block { width: 100%; }

  /* Testimonials */
  .testimonials { padding-block: var(--space-10) var(--space-12); }
  .testimonials__grid { margin-top: var(--space-8); }
  .quote { padding: var(--space-6); }

  /* Contact */
  .contact { padding-block: var(--space-12); }
  .contact__grid { gap: var(--space-10); }
  .contact__title { font-size: var(--fs-40); line-height: var(--lh-48); }
  .contact__lead, .contact__list li { font-size: var(--fs-16); line-height: var(--lh-24); }
  .contact__cta { font-size: var(--fs-40); line-height: var(--lh-48); }
  .btn--submit { width: 100%; }
  .form__status.is-success { padding: var(--space-5); }

  /* Footer */
  .footer__inner { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; height: auto; padding-block: var(--space-4); }
}

/* ----- Small phones (320-359px) ----- */
@media (max-width: 359px) {
  .btn--pill { padding-inline: var(--space-2); }
  .hero__title, .contact__title, .contact__cta { font-size: var(--fs-32); line-height: var(--lh-40); }
}

/* ---------- Floating header ----------
   Added by main.js once the page has scrolled past the header.
   The <header> keeps its height (--header-h) so nothing jumps; only the inner
   bar leaves the flow and docks to the top as a pill.                          */
.site-header.is-floating .header__inner {
  position: fixed;
  top: var(--space-4);
  right: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-8);
  width: min(100% - (var(--gutter) * 2), var(--header-w));
  margin-inline: auto;
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-white);
  box-shadow: var(--shadow-float);
  animation: header-float-in .3s ease both;
}
@keyframes header-float-in {
  from { opacity: 0; transform: translateY(calc(var(--space-6) * -1)); }
  to   { opacity: 1; transform: none; }
}
.is-floating .header__brand { display: block; flex: none; width: auto; min-width: 0; }
.is-floating .header__name { font-size: var(--fs-24); line-height: var(--lh-32); }
.is-floating .header__role { margin-top: 0; font-size: var(--fs-12); line-height: var(--lh-16); }
.is-floating .header__panel { display: flex; flex: 1; flex-direction: row; align-items: center; gap: var(--space-6); }
.is-floating .nav { flex-direction: row; align-items: center; gap: var(--space-6); margin: 0 auto; border-top: 0; }
.is-floating .nav__link { border-bottom: 0; color: var(--c-muted); }
.is-floating .nav__link:hover, .is-floating .nav__link[aria-current] { color: var(--c-ink); }
.is-floating .header__actions { display: flex; gap: var(--space-2); margin: 0; }
.is-floating .menu-toggle { display: none; }

/* Floating + collapsed (below 1200px): hamburger + dropdown card */
@media (max-width: 1199px) {
  .site-header.is-floating .header__inner { justify-content: space-between; gap: var(--space-2); padding: var(--space-3) var(--space-6); }
  .is-floating .menu-toggle { display: inline-flex; }
  .is-floating .header__panel {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: min(100%, 400px);
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    padding: var(--space-4) var(--space-6) var(--space-6);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-sm);
    background: var(--c-white);
    box-shadow: var(--shadow-float);
  }
  .js .is-floating .header__panel:not(.is-open) { display: none; }
  .is-floating .nav { flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
  .is-floating .nav__link { border-bottom: 1px solid var(--c-line); color: var(--c-ink); }
  .is-floating .nav__link[aria-current] { color: var(--c-accent); }
  .is-floating .header__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-4); }
  .is-floating .header__tools { grid-column: 1 / -1; justify-content: flex-start; margin: var(--space-4) 0 0; }
  .is-floating .btn--pill { height: 44px; }
}
@media (max-width: 639px) {
  .is-floating .header__panel { left: 0; width: auto; }
}
@media (max-width: 359px) {
  .is-floating .header__name { font-size: var(--fs-20); line-height: var(--lh-28); }
  .is-floating .header__actions { grid-template-columns: 1fr; }
  .is-floating .header__brand { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .site-header.is-floating .header__inner { animation: none; }
}

.nowrap { white-space: nowrap; }

/* ---------- Case study page (PDP) ---------- */
.btn--link { text-decoration: underline; text-underline-offset: 4px; }
.pdp-hero { padding-block: var(--space-20) var(--space-20); }
.pdp-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: var(--space-8) var(--space-10); align-items: end; }
.pdp-hero__legal { font-size: var(--fs-16); line-height: var(--lh-24); }
.pdp-hero__title {
  margin-top: var(--space-2);
  font-size: var(--fs-84);
  line-height: var(--lh-80);
  font-weight: var(--fw-medium);
  letter-spacing: -0.03em;
}
.pdp-hero__side { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-6); padding-bottom: var(--space-2); }
.pdp-hero__lead { font-size: var(--fs-20); line-height: var(--lh-28); color: var(--c-muted); }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); margin-top: var(--space-12); font-size: var(--fs-12); line-height: var(--lh-16); color: var(--c-muted); }
.tags li { display: flex; align-items: center; gap: var(--space-4); }
.tags li + li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c-gray); }

.pdp-media { padding-bottom: var(--space-10); }
.player { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--c-ink); }
.player__video { display: block; width: 100%; height: auto; background: var(--c-ink); }
.player__bar {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  width: min(100% - var(--space-8), 780px);
  padding: var(--space-1) var(--space-3);
  transform: translateX(-50%);
  border-radius: var(--radius-sm);
  background: rgba(18, 18, 18, 0.88);
  color: var(--c-on-media);
  font-size: var(--fs-12);
  line-height: var(--lh-16);
}
.player__bar[hidden] { display: none; }
.player__btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.player__btn:hover, .player__btn[aria-pressed="true"], .player__btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.16); }
.player__btn:focus-visible, .player__seek:focus-visible, .player__menu button:focus-visible { outline: 2px solid var(--c-on-media); outline-offset: 0; }
.player__time { flex: none; min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.player__seek {
  --p: 0%;
  flex: 1;
  min-width: 0;
  height: 32px;
  margin: 0 var(--space-1);
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.player__seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--c-accent) var(--p), rgba(255, 255, 255, 0.32) var(--p)); }
.player__seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.32); }
.player__seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--c-accent); }
.player__seek::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%; background: var(--c-on-media); }
.player__seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--c-on-media); }
.player .i-pause, .player .i-muted { display: none; }
.player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: block; }
.player.is-muted .i-sound { display: none; }
.player.is-muted .i-muted { display: block; }
.player__more { position: relative; flex: none; }
.player__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--space-3));
  min-width: 220px;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  background: var(--c-ink);
  box-shadow: var(--shadow-float);
}
.player__menu[hidden] { display: none; }
.player__menu button { display: block; width: 100%; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--c-on-media); font-size: var(--fs-16); line-height: var(--lh-24); text-align: left; cursor: pointer; }
.player__menu button:hover { background: rgba(255, 255, 255, 0.16); }
.player:fullscreen { display: grid; place-items: center; border-radius: 0; }
.player:fullscreen .player__video { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }

.decisions { padding-block: var(--space-20) var(--space-24); background: var(--c-surface); }
.decisions .h2, .pdp-section .h2 { margin-top: var(--space-3); }
.steps { margin-bottom: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-10); margin-top: var(--space-12); }
.step { padding-top: var(--space-6); border-top: 1px solid var(--c-muted); }
.step__num { font-size: var(--fs-20); line-height: var(--lh-28); font-weight: var(--fw-bold); color: var(--c-accent); }
.step__title { margin-top: var(--space-6); font-size: var(--fs-24); line-height: var(--lh-32); font-weight: var(--fw-bold); }
.step__text { margin-top: var(--space-6); font-size: var(--fs-20); line-height: var(--lh-28); color: var(--c-muted); }

.pdp-section { padding-top: var(--space-20); }
.pdp-section--last { padding-bottom: var(--space-20); }
.split-head { display: grid; grid-template-columns: minmax(0, 504px) minmax(0, 1fr); align-items: end; }
.split-head .h2, .solution .h2 { max-width: 400px; line-height: var(--lh-52); }
.solution .h2 { max-width: none; }
.split-head__text, .solution__text { font-size: var(--fs-20); line-height: var(--lh-28); color: var(--c-muted); }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12) var(--space-6); align-items: start; margin-top: var(--space-12); }
.theme-grid__item, .ds-tile, .solution__media { overflow: hidden; border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-line); }
.theme-grid__item img, .solution__media img { width: 100%; height: auto; }
.ds-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8) var(--space-6); margin-top: var(--space-10); }
.ds-tile { aspect-ratio: 592 / 520; background: var(--c-white); }
.ds-tile img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.solution { display: grid; grid-template-columns: 520px minmax(0, 1fr); gap: var(--space-16); align-items: center; }
.solution__copy { max-width: 624px; }
.solution__text { margin-top: var(--space-6); }

.steps--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-10) var(--space-6); }
.player__still { display: block; width: 100%; height: auto; }
.wide-stack { display: grid; gap: var(--space-6); margin-top: var(--space-12); }
.wide-stack__item { overflow: hidden; border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-white); }
.wide-stack__item--dark { background: var(--c-ink); border-color: var(--c-ink); }
.wide-stack__item img { width: 100%; height: auto; }
.pdp-video { margin-top: var(--space-8); }

/* ---------- Work page: responsive ---------- */
@media (max-width: 1199px) {
  .page-hero { padding-block: var(--space-16); }
  .page-hero__grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .page-hero__title { font-size: var(--fs-56); line-height: var(--lh-56); }
  .page-hero__lead { max-width: 560px; }
  .work { padding-bottom: var(--space-16); }
  .work .card__title { font-size: var(--fs-20); line-height: var(--lh-28); }
  .work .card__client { font-size: var(--fs-16); line-height: var(--lh-24); }
  .work .card__body { gap: var(--space-4); }
}
@media (max-width: 639px) {
  .crumbs__list { min-height: 48px; }
  .page-hero { padding-block: var(--space-10) var(--space-12); }
  .page-hero__title { font-size: var(--fs-40); line-height: var(--lh-48); }
  .page-hero__lead { font-size: var(--fs-16); line-height: var(--lh-24); }
  .work { padding-bottom: var(--space-12); }
  .work__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-10); }
}
@media (max-width: 359px) {
  .page-hero__title { font-size: var(--fs-32); line-height: var(--lh-40); }
}

/* ---------- Case study page: responsive ---------- */
@media (max-width: 1199px) {
  .pdp-hero { padding-block: var(--space-16); }
  .pdp-hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
  .pdp-hero__title { font-size: var(--fs-56); line-height: var(--lh-56); }
  .pdp-hero__side { max-width: 560px; padding-bottom: 0; }
  .tags { margin-top: var(--space-10); }
  .decisions { padding-block: var(--space-16); }
  .steps, .steps--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-10) var(--space-6); }
  .pdp-section { padding-top: var(--space-16); }
  .pdp-section--last { padding-bottom: var(--space-16); }
  .split-head { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .split-head .h2 { max-width: 480px; }
  .split-head__text { max-width: 640px; }
  .solution { grid-template-columns: minmax(0, 1fr); gap: var(--space-10); }
  .solution__media { max-width: 520px; }
  .solution__copy { order: -1; }
}
@media (max-width: 639px) {
  .pdp-hero { padding-block: var(--space-10) var(--space-12); }
  .pdp-hero__title { font-size: var(--fs-40); line-height: var(--lh-48); }
  .pdp-hero__legal { font-size: var(--fs-12); line-height: var(--lh-16); }
  .pdp-hero__lead { font-size: var(--fs-16); line-height: var(--lh-24); }
  .pdp-media { padding-bottom: var(--space-8); }
  .player__bar { bottom: var(--space-2); width: calc(100% - var(--space-4)); padding-inline: var(--space-2); }
  .player__btn--skip, .player__btn--loop, [data-time="dur"] { display: none; }
  .decisions { padding-block: var(--space-12); }
  .steps, .steps--3 { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); margin-top: var(--space-8); }
  .wide-stack { margin-top: var(--space-8); }
  .pdp-video { margin-top: var(--space-6); }
  .step__text, .split-head__text, .solution__text { font-size: var(--fs-16); line-height: var(--lh-24); }
  .step__title { font-size: var(--fs-20); line-height: var(--lh-28); }
  .pdp-section { padding-top: var(--space-12); }
  .pdp-section--last { padding-bottom: var(--space-12); }
  .split-head .h2, .solution .h2 { line-height: var(--lh-40); }
  .theme-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); margin-top: var(--space-8); }
  .ds-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); margin-top: var(--space-8); }
}
@media (max-width: 359px) {
  .pdp-hero__title { font-size: var(--fs-32); line-height: var(--lh-40); }
}

/* Floating mascot: fixed bottom-left, talks about the skills and opens a small menu (theme switch) */
.fab {
  position: fixed;
  left: var(--gutter);
  bottom: var(--space-6);
  z-index: 40;
}
.fab__btn {
  display: block;
  width: 80px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: transform .2s ease;
}
.fab__btn img { display: block; width: 100%; height: auto; }
.fab__btn:hover { transform: translateY(-4px); }
/* Mascot speech bubble: always visible, announces the skills one word at a time (main.js module 8) */
.fab__tip {
  position: absolute;
  bottom: calc(100% + var(--space-3));
  left: var(--space-8);
  max-width: calc(100vw - (var(--gutter) * 2) - var(--space-8));
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm) 0;
  background: var(--c-white);
  color: var(--c-ink);
  font-size: var(--fs-16);
  line-height: var(--lh-20);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  overflow: visible;
  filter: drop-shadow(0 2px 6px rgba(18, 18, 18, 0.14));
  transform-origin: 0 100%;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.2, .7, .2, 1), visibility .3s ease, width .35s cubic-bezier(.2, .7, .2, 1);
}
.fab__word { display: block; transition: opacity .2s ease, transform .2s ease; }
.fab__word.is-out { opacity: 0; transform: translateY(-5px); }
.fab__words { display: none; }
/* pops in shortly after load (only when JS runs; a failsafe shows it anyway) */
html.js .fab__tip:not(.is-on) { opacity: 0; visibility: hidden; transform: scale(.8); animation: fab-tip-failsafe .01s 3.5s both; }
@keyframes fab-tip-failsafe { to { opacity: 1; visibility: visible; transform: none; } }
/* chat-bubble tail, bottom-left, pointing down at the mascot */
.fab__tip::before {
  content: "";
  position: absolute;
  bottom: calc(-1 * var(--space-2));
  left: 0;
  width: var(--space-3);
  height: var(--space-2);
  background: var(--c-white);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
/* click on the mascot silences / wakes the bubble (starts awake on every load) */
.fab.is-quiet .fab__tip { opacity: 0 !important; visibility: hidden !important; transform: scale(.8) !important; animation: none !important; }
.theme-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--c-muted);
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.theme-toggle:hover { color: var(--c-ink); background: var(--c-surface); }
.theme-toggle svg { display: block; }
@media (prefers-reduced-motion: reduce) { .fab__tip, .fab__word { transition: none; } html.js .fab__tip:not(.is-on) { transform: none; } }
@media (max-width: 639px) { .fab__tip { left: var(--space-6); font-size: var(--fs-12); line-height: var(--lh-16); padding: var(--space-2); } }
@media (max-width: 1199px) { .fab__btn { width: 64px; } }
@media (max-width: 639px) { .fab { bottom: var(--space-4); } .fab__btn { width: 48px; } }
@media (prefers-reduced-motion: reduce) { .fab__btn { transition: none; } .fab__btn:hover { transform: none; } }
/* Keep footer text clear of the floating mascot (icon width + gutter + 16px) */
@media (min-width: 1200px) and (max-width: 1299px) { .footer__inner { padding-left: 120px; } }
@media (max-width: 1199px) { .footer__inner { padding-left: calc(var(--gutter) + 64px + var(--space-4)); } }
@media (max-width: 639px) { .footer__inner { padding-left: calc(var(--gutter) + 48px + var(--space-4)); } }

/* Clutch Charger case study: live vs Figma comparison, screen tiles, ads panel */
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); margin-top: var(--space-12); align-items: start; }
.compare__label { font-size: var(--fs-24); line-height: var(--lh-32); font-weight: var(--fw-bold); }
.compare__shot { margin-top: var(--space-3); padding: var(--space-4); overflow: hidden; border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-white); }
.compare__shot img { display: block; width: 100%; height: auto; }
.pdp-hero__copy--narrow { max-width: 600px; }
@media (min-width: 1200px) { .pdp-hero__grid--wide-side { grid-template-columns: minmax(0, 1fr) 456px; } }
.ds-grid--screens .ds-tile { aspect-ratio: 592 / 518; }
.solution__media--dark { border: 0; background: var(--c-ink); }
@media (max-width: 639px) {
  .compare { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); margin-top: var(--space-8); }
  .compare__label { font-size: var(--fs-20); line-height: var(--lh-28); }
  .compare__shot { padding: var(--space-2); }
}

/* ---------- Typographic rhythm below 1200px (line-heights on a 2px grid) ----------
   Ratios: display/H1-H2 1.15-1.2, card/step titles 1.3, body 1.4-1.5, small 1.5.
   Desktop (>= 1200px) keeps the values from the Figma designs. */
@media (max-width: 1199px) {
  .split-head .h2, .solution .h2 { line-height: var(--lh-46); }
  .stat__label { line-height: var(--lh-26); }
  .job__role { line-height: var(--lh-22); }
  .footer__inner { line-height: var(--lh-18); }
}
@media (max-width: 639px) {
  .header__role { line-height: var(--lh-22); }
  .h2, .split-head .h2, .solution .h2 { line-height: var(--lh-38); }
  .h2--xl, .hero__title, .contact__title, .contact__cta, .page-hero__title, .pdp-hero__title { line-height: var(--lh-46); }
  .job__company, .card__title, .work .card__title, .step__title, .compare__label { line-height: var(--lh-26); }
}
@media (max-width: 359px) {
  .hero__title, .contact__title, .contact__cta, .page-hero__title, .pdp-hero__title { line-height: var(--lh-38); }
}

/* Adidas case study: prototype buttons, reversed solution row, four-up tiles */
.pdp-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.ds-grid--lead { margin-top: var(--space-12); }
.ds-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6); }
.ds-grid--four .ds-tile { aspect-ratio: 284 / 250; }
.solution--reverse { grid-template-columns: minmax(0, 1fr) 520px; }
@media (max-width: 1199px) {
  .ds-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .solution--reverse { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 639px) {
  .ds-grid--four { grid-template-columns: minmax(0, 1fr); }
  .ds-grid--lead { margin-top: var(--space-8); }
}

/* Stumptown case study: stacked wide tiles, tall tiles with column titles */
.ds-grid--stack { grid-template-columns: minmax(0, 1fr); gap: var(--space-12); }
.ds-tile--wide { aspect-ratio: 1208 / 383; }
.ds-tile--tall { aspect-ratio: 592 / 1189; }
.ds-col { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.ds-col__title { font-size: var(--fs-24); line-height: var(--lh-32); font-weight: 700; margin: 0; }
@media (max-width: 1199px) { .ds-grid--stack { gap: var(--space-8); } }
@media (max-width: 639px) { .ds-grid--stack { gap: var(--space-6); } .ds-col__title { font-size: var(--fs-20); line-height: var(--lh-28); } }

/* UI design components case study: no hero media, grouped tile grids */
.pdp-hero--no-media { padding-bottom: var(--space-10); }
.ds-groups { display: flex; flex-direction: column; gap: var(--space-12); margin-top: var(--space-12); }
.ds-group { display: flex; flex-direction: column; gap: var(--space-2); }
.ds-group .ds-grid { margin-top: 0; }
.ds-grid--roomy { row-gap: var(--space-12); }
.ds-grid--start { align-items: start; }
.ds-tile--banner { aspect-ratio: 592 / 380; }
.ds-tile--mail { aspect-ratio: 592 / 628; }
.ds-tile--wf { aspect-ratio: 592 / 738; }
@media (max-width: 1199px) { .ds-grid--roomy { row-gap: var(--space-8); } .ds-groups { gap: var(--space-10); margin-top: var(--space-10); } }
@media (max-width: 639px) { .ds-grid--roomy { row-gap: var(--space-6); } .ds-groups { gap: var(--space-8); margin-top: var(--space-8); } .pdp-hero--no-media { padding-bottom: var(--space-8); } }

/* ---------- Other projects carousel (end of every PDP) ---------- */
.other { padding-block: var(--space-20); border-top: 1px solid var(--c-line); }
.other__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); }
.other__head .h2 { margin-top: 0; }
.carousel__nav { display: flex; gap: var(--space-2); flex: none; }
.carousel__btn {
  display: grid; place-items: center; width: 48px; height: 48px;
  border: 1px solid var(--c-line); border-radius: 50%;
  background: var(--c-white); color: var(--c-ink); cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.carousel__btn:hover:not(:disabled) { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-white); }
.carousel__btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.carousel__btn:disabled { color: var(--c-gray); cursor: default; }
.carousel { margin-top: var(--space-8); }
.carousel__track {
  --gap: var(--space-6);
  display: flex; gap: var(--gap); margin: 0; list-style: none;
  /* inner padding keeps focus rings and the hover zoom from being clipped */
  padding: var(--space-2); margin: calc(-1 * var(--space-2));
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--space-2);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__item { flex: 0 0 calc((100% - 3 * var(--gap)) / 4); min-width: 0; scroll-snap-align: start; }
.card--mini .card__media { height: auto; aspect-ratio: 37 / 30; }
.card--mini .card__body { gap: var(--space-3); padding-top: var(--space-3); }
.card--mini .card__title { font-size: var(--fs-20); line-height: var(--lh-28); }
.card--mini .card__client { font-size: var(--fs-16); line-height: var(--lh-24); }
.card--mini .card__arrow { width: 32px; height: 32px; margin-top: var(--space-1); }
.card--mini .card__arrow svg { width: 12px; height: 12px; }
@media (max-width: 1199px) {
  .other { padding-block: var(--space-16); }
  .carousel__item { flex-basis: calc((100% - 2 * var(--gap)) / 3); }
}
@media (max-width: 639px) {
  .other { padding-block: var(--space-12); }
  .carousel { margin-top: var(--space-6); }
  .carousel__track { --gap: var(--space-4); }
  .carousel__item { flex-basis: 72%; }
  .carousel__btn { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .carousel__track { scroll-behavior: auto; } }

/* ---------- Work submenu (floating header only; first version on the homepage) ---------- */
.nav__item { display: flex; align-items: center; }
.nav__sub-toggle, .subnav { display: none; }
.is-floating .nav__item--sub { position: relative; }
.is-floating .nav__sub-toggle {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin-left: calc(var(--space-1) * -1);
  border: 0; border-radius: 50%; background: transparent; color: var(--c-muted); cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.is-floating .nav__sub-toggle svg { transition: transform .2s ease; }
.is-floating .nav__sub-toggle:hover { color: var(--c-ink); }
.is-floating .nav__sub-toggle:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.is-floating .nav__sub-toggle[aria-expanded="true"] { color: var(--c-ink); }
.is-floating .nav__sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.is-floating .subnav:not([hidden]) {
  display: block; position: absolute; top: calc(100% + 40px); left: calc(var(--space-3) * -1); z-index: 5;
  width: 360px; margin: 0; padding: var(--space-2); list-style: none;
  border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  background: var(--c-white); box-shadow: var(--shadow-float);
  animation: header-float-in .2s ease both;
}
/* invisible bridge so the pointer can travel from "Work" to the list */
.is-floating .subnav::before { content: ""; position: absolute; left: 0; right: 0; top: -40px; height: 40px; }
.subnav__link { display: flex; flex-direction: column; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); }
.subnav__link:hover, .subnav__link:focus-visible { background: var(--c-surface); }
.subnav__link:focus-visible { outline: 2px solid var(--c-accent); outline-offset: -2px; }
.subnav__title { font-size: var(--fs-16); line-height: var(--lh-24); font-weight: var(--fw-medium); color: var(--c-ink); }
.subnav__client { font-size: var(--fs-12); line-height: var(--lh-16); color: var(--c-accent); }
/* collapsed floating menu: the list opens inline under "Work" */
@media (max-width: 1199px) {
  .is-floating .nav__item--sub { flex-wrap: wrap; border-bottom: 1px solid var(--c-line); }
  .is-floating .nav__item--sub .nav__link { flex: 1; border-bottom: 0; }
  .is-floating .nav__sub-toggle { margin-left: 0; width: 44px; height: 44px; }
  .is-floating .subnav:not([hidden]) {
    position: static; flex-basis: 100%; width: auto; padding: 0 0 var(--space-3); border: 0; border-radius: 0; box-shadow: none; background: transparent; animation: none;
  }
  .is-floating .subnav::before { display: none; }
  .subnav__link { padding-inline: var(--space-2); }
}
@media (prefers-reduced-motion: reduce) { .is-floating .subnav:not([hidden]) { animation: none; } .is-floating .nav__sub-toggle svg { transition: none; } }
.subnav__link[aria-current="page"] { background: var(--c-surface); }

/* 404 page */
.err-header { padding-block: var(--space-6); }
.err-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.err { padding-block: var(--space-20) var(--space-24); }
.err__grid { display: grid; gap: var(--space-8); }
.err__num { margin: 0; color: var(--c-accent); font-size: var(--fs-84); line-height: var(--lh-80); font-weight: var(--fw-medium); letter-spacing: -0.03em; }
.err__copy { display: grid; gap: var(--space-6); justify-items: start; max-width: 640px; }
.err__title { margin: 0; font-size: var(--fs-56); line-height: var(--lh-56); font-weight: var(--fw-medium); letter-spacing: -0.0375em; text-wrap: balance; }
.err__text { margin: 0; color: var(--c-muted); font-size: var(--fs-20); line-height: var(--lh-28); }
.err__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.err__more { margin-top: var(--space-12); padding-top: var(--space-10); border-top: 1px solid var(--c-line); display: grid; gap: var(--space-5); }
.err__more .eyebrow { margin: 0; }
.err__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-8); }
.err__list a { display: flex; flex-direction: column; padding-block: var(--space-2); text-decoration: none; }
.err__link-title { font-size: var(--fs-20); line-height: var(--lh-28); font-weight: var(--fw-medium); }
.err__link-client { color: var(--c-muted); font-size: var(--fs-16); line-height: var(--lh-24); }
.err__list a:hover .err__link-title { color: var(--c-accent); }
@media (max-width: 1199px) { .err { padding-block: var(--space-16) var(--space-20); } .err__title { font-size: var(--fs-48); line-height: var(--lh-56); } }
@media (max-width: 639px) {
  .err__num { font-size: var(--fs-56); line-height: var(--lh-56); }
  .err__title { font-size: var(--fs-40); line-height: var(--lh-48); }
  .err__text { font-size: var(--fs-16); line-height: var(--lh-24); }
  .err__list { grid-template-columns: minmax(0, 1fr); }
  .err-header .btn { display: none; }
}
.footer--plain .footer__inner { width: min(100% - (var(--gutter) * 2), var(--container)); margin-inline: auto; padding-inline: 0; }

/* ==========================================================================
   Motion: content appears on load (above the fold) and while scrolling.
   Markers (data-anim / data-stagger) are written by build_motion.py; the engine is js/main.js (module 6).
   Hidden state only exists when JS is on (html.js); a failsafe reveals everything if the engine never starts.
   ========================================================================== */
html.js [data-anim] {
  opacity: 0;
  transition: opacity .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms), transform .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms);
}
html.js [data-anim="up"]   { transform: translateY(28px); }
html.js [data-anim="zoom"] { transform: translateY(20px) scale(.96); }
html.js [data-anim="chip"] { transform: translateY(12px) scale(.96); transition-duration: .5s; }
html.js [data-anim="fade"] { transform: none; }
html.js [data-anim="left"] { transform: translateX(-48px); }
/* PDP style: text comes into focus (blur to sharp, small rise); media settles in with a soft scale */
html.js [data-anim="blur"] {
  transform: translateY(14px); filter: blur(10px);
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms), transform .9s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms), filter .9s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms);
}
html.js [data-anim="pop"] { transform: scale(.94); transition-duration: 1s; }
/* wipe: the image opens from top to bottom over its grey placeholder and settles from a slight zoom.
   (The wipe is on the img, not on the observed element: IntersectionObserver ignores a clipped target.) */
html.js [data-anim="wipe"] { opacity: 1; transform: none; }
html.js [data-anim="wipe"] img {
  clip-path: inset(0 0 100% 0);
  transform: scale(1.14);
  transition: clip-path 1s cubic-bezier(.65, 0, .2, 1) var(--d, 0ms), transform 1.3s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms);
}
html.js [data-anim="wipe"].is-in img { clip-path: inset(0 0 0 0); transform: none; }
html.js [data-anim].is-in  { opacity: 1; transform: none; filter: none; }
html.js:not(.anim-on) [data-anim] { animation: anim-failsafe .01s 2.5s both; }
@keyframes anim-failsafe { to { opacity: 1; transform: none; filter: none; } }
html.js:not(.anim-on) [data-anim="wipe"] img { animation: anim-failsafe-img .01s 2.5s both; }
@keyframes anim-failsafe-img { to { transform: none; clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) {
  html.js [data-anim], html.js [data-anim] img { opacity: 1; transform: none; filter: none; clip-path: none; transition: none; animation: none; }
}


/* ==========================================================================
   Dark theme. Same nine palette tokens, redefined. Default is light; dark is chosen with the
   floating toolbox switch (sets data-theme="dark" on <html> and is remembered in localStorage).
   Pairs invert together (ink <-> white), so every "ink surface + white text" component keeps its contrast.
   ========================================================================== */
:root[data-theme="dark"] {
  --c-ink: #F3F3EF;
  --c-line: #2D2D31;
  --c-muted: #A9A9A5;
  --c-accent: #B085F5;
  --c-white: #0E0E10;
  --c-gray: #8F8F8F;
  --c-card: #151518;
  --c-surface: #1B1B1F;
  --c-warm: #17140F;
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
:root[data-theme="dark"] .fab__tip { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }
/* speech bubble: a lighter black than the page, so it stands out */
:root[data-theme="dark"] .fab__tip, :root[data-theme="dark"] .fab__tip::before { background: #26262B; }
/* toolbox switch: moon in light mode (go dark), sun in dark mode (go light) */
.theme-toggle .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-toggle__sun { display: block; }
/* soft cross-fade while switching (not for elements that are mid reveal) */
html.theme-anim *:not([data-anim]), html.theme-anim *:not([data-anim])::before, html.theme-anim *:not([data-anim])::after {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease, stroke .35s ease !important;
}
@media (prefers-reduced-motion: reduce) { html.theme-anim * { transition: none !important; } }
