/* ==========================================================================
   Adrian Carballo — Portfolio
   Tokens, base, shared components, Home, Case studies
   ========================================================================== */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-variable.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f8f8f8;
  --ink: #040403;
  --ink-2: #363636;
  --muted: #666666;
  --muted-2: #616161;
  --line: #e0e0e0;
  --rule: #d6d6d6;
  --surface: #f0f0f0;
  --accent: #cb3d1d;
  --brand: #f24b29;
  --white: #ffffff;

  --display: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(20px, 4.2vw, 60px);
  --maxw: 1440px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
h1, h2, h3 { font-family: var(--display); }
ul, ol { padding: 0; list-style: none; }
dd { margin: 0; }
hr { border: 0; margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: rgba(203, 61, 29, 0.15); }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 14px 18px;
  background: var(--ink);
  color: var(--white);
  font: 600 0.875rem/1 var(--mono);
  letter-spacing: 0.4px;
  border-radius: 4px;
}
.skip-link:focus { top: 12px; }

.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;
}

.page {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --------------------------------------------------------------------------
   Shared type
   -------------------------------------------------------------------------- */
.mono { font-family: var(--mono); font-weight: 500; }

.label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.4;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
}

.arrow { font-family: var(--sans); }
.btn .arrow { margin-left: 0.5em; }

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  min-height: 73px;
  padding-block: 8px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
}
.nav__brand {
  letter-spacing: 0.5px;
  color: var(--ink);
  padding-block: 14px;
}
.nav__links {
  display: flex;
  gap: 0 clamp(20px, 3vw, 40px);
  letter-spacing: 0.3px;
  color: var(--ink-2);
}
.nav--case .nav__links { gap: 0 clamp(20px, 3.4vw, 48px); color: var(--muted); }
.nav--case .nav__links [data-current] { color: var(--ink); }

.nav__links a,
.nav__brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav__links a:hover::after,
.nav__links a[data-current]::after { transform: scaleX(1); }
.nav--case .nav__links a:hover { color: var(--ink); }

@media (max-width: 600px) {
  .nav { flex-wrap: wrap; padding-block: 4px 0; }
  .nav__brand { min-height: 44px; }
  .nav__links { width: 100%; justify-content: space-between; border-top: 1px solid var(--line); }
}

/* --------------------------------------------------------------------------
   Buttons / links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 15px 28px;
  border-radius: 28px;
  border: 1px solid transparent;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:active { transform: scale(0.985); }
.btn--primary { background: var(--accent); color: var(--white); }
.btn--primary:hover { background: #b73519; }
.btn--secondary { border-color: rgba(0, 0, 0, 0.2); color: var(--ink); }
.btn--secondary:hover { border-color: var(--ink); }
.btn--dark { background: var(--ink); color: var(--white); }
.btn--dark:hover { background: #26241f; }
.btn--sm { padding: 14px 24px; border-radius: 100px; }

.textlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink);
}
.textlink--soft { font-weight: 500; letter-spacing: 0.3px; color: var(--ink-2); }
.textlink .arrow { display: inline-block; margin-left: 0.5em; transition: transform 0.3s var(--ease); }
.textlink--accent { color: var(--accent); }

/* --------------------------------------------------------------------------
   Reveal on scroll (only when JS is on)
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-visible, .js [data-reveal]:focus-within { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   HOME
   ========================================================================== */
.home { display: flex; flex-direction: column; gap: 56px; padding-bottom: 40px; }
.home__main { display: flex; flex-direction: column; gap: 56px; }
section[id] { scroll-margin-top: 24px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 617.76px);
  align-items: start;
  gap: 32px;
}
.hero__copy { padding-top: 60px; display: flex; flex-direction: column; gap: 28px; }
.hero__statement {
  max-width: 17em;
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 3.125rem);
  line-height: 1.18;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.hero__prev { font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; color: var(--ink-2); }
.hero__prev .co { color: var(--accent); font-weight: 600; white-space: nowrap; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 16px; }

.hero-visual {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 617.76 / 653.84;
  justify-self: end;
}
.hero-visual__stage {
  position: absolute;
  inset: 0;
  --u: calc(100cqw / 617.76);
}
.hero-visual__stage > * { position: absolute; }
.hero-visual__backdrop {
  left: calc(80.96 * var(--u));
  top: 0;
  width: calc(421.52 * var(--u));
  height: calc(502.48 * var(--u));
}
.hero-visual__portrait {
  left: calc(13.2 * var(--u));
  top: calc(11.44 * var(--u));
  width: calc(591.36 * var(--u));
  height: calc(611.6 * var(--u));
  overflow: hidden;
}
.hero-visual__portrait img {
  position: absolute;
  left: -0.01%;
  top: -22.34%;
  width: 100.03%;
  height: 129.56%;
  max-width: none;
}
.hero-visual__fade {
  left: 0;
  top: calc(570.24 * var(--u));
  width: calc(617.76 * var(--u));
  height: calc(83.6 * var(--u));
  background: linear-gradient(180deg, rgba(248,248,248,0) 0%, rgba(248,248,248,0.8) 50%, #f8f8f8 62%, #f8f8f8 100%);
  pointer-events: none;
}
.hero-visual__tag {
  left: calc(430 * var(--u));
  top: calc(149.6 * var(--u));
}
.hero-visual__tag-box {
  margin-left: calc(19.36 * var(--u));
  padding: calc(10.56 * var(--u));
  background: var(--bg);
  font-family: var(--mono);
  font-weight: 500;
  font-size: max(0.875rem, calc(14 * var(--u)));
  line-height: 1.5;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  width: calc(150 * var(--u) + 21.12 * var(--u));
  box-shadow: 0 0 0 1px rgba(4, 4, 3, 0.05), 0 calc(8 * var(--u)) calc(20 * var(--u)) calc(-8 * var(--u)) rgba(4, 4, 3, 0.16);
}
.hero-visual__tag-box p + p { margin-top: calc(10.56 * var(--u)); }
.hero-visual__tag-line {
  position: absolute;
  left: 0;
  top: calc(19.36 * var(--u));
  width: calc(12.32 * var(--u));
  height: 2px;
  background: var(--ink);
}

@media (max-width: 600px) {
  .hero-visual__tag { left: 0; right: 0; top: auto; bottom: 0; }
  .hero-visual__tag-box {
    display: flex; flex-wrap: wrap; gap: 2px 18px;
    width: auto; margin: 0; padding: 10px 14px;
    font-size: 0.875rem; background: var(--bg);
  }
  .hero-visual__tag-box p + p { margin-top: 0; }
  .hero-visual__tag-box br { display: none; }
  .hero-visual__tag-line { display: none; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hero__copy { padding-top: 24px; gap: 32px; }
  .hero-visual { justify-self: center; max-width: 560px; }
}

/* Selected work */
.work__head { display: flex; flex-direction: column; gap: 16px; }
.work__title {
  font-weight: 800;
  font-size: clamp(1.875rem, 3vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: -0.024em;
}
.work__intro { max-width: 420px; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }
.work__grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px 32px;
}
@media (max-width: 620px) {
  .work__grid { grid-template-columns: minmax(0, 1fr); }
}

.project { position: relative; display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Project cover with scaled "window" mockups */
.cover {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 644 / 402.5;
  border-radius: 14px;
  overflow: hidden;
  background: var(--cover-bg, #d6e0f0);
}
.cover__stage {
  position: absolute;
  inset: 0;
  --u: calc(100cqw / 644);
}
.mock {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  border-radius: calc(8 * var(--u));
  background: #fff;
  box-shadow: 0 0 0 calc(0.75 * var(--u)) rgba(4, 4, 3, 0.1), 0 calc(2 * var(--u)) calc(4 * var(--u)) rgba(4, 4, 3, 0.07), 0 calc(14 * var(--u)) calc(26 * var(--u)) calc(-8 * var(--u)) rgba(4, 4, 3, 0.4);
  overflow: hidden;
  transition: transform 0.6s var(--ease);
}
/* macOS-style title bar: traffic lights drawn in CSS, title centered. */
.mock__chrome {
  position: relative;
  display: flex;
  align-items: center;
  width: calc(var(--w) * var(--u));
  height: calc(22 * var(--u));
  padding-inline: calc(8 * var(--u));
  background: #f1f1f0;
  border-bottom: calc(0.75 * var(--u)) solid rgba(4, 4, 3, 0.09);
  font-family: var(--mono);
  font-weight: 500;
  font-size: calc(9 * var(--u));
  line-height: 1;
  white-space: nowrap;
  color: #4a4a48;
  overflow: hidden;
}
.mock__chrome::before {
  content: "";
  flex: none;
  width: calc(30 * var(--u));
  height: calc(8 * var(--u));
  background:
    radial-gradient(circle at calc(4 * var(--u)) 50%, #ff5f57 calc(3.5 * var(--u)), transparent calc(3.8 * var(--u))),
    radial-gradient(circle at calc(15 * var(--u)) 50%, #febc2e calc(3.5 * var(--u)), transparent calc(3.8 * var(--u))),
    radial-gradient(circle at calc(26 * var(--u)) 50%, #28c840 calc(3.5 * var(--u)), transparent calc(3.8 * var(--u)));
}
.mock__chrome span { position: absolute; left: 50%; transform: translateX(-50%); max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.mock__body {
  position: relative;
  overflow: hidden;
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
}
.mock__body--white { background: #fff; }
.mock__body img {
  position: absolute;
  left: calc(var(--ix, 0) * var(--u));
  top: calc(var(--iy, 0) * var(--u));
  width: calc(var(--iw, var(--w)) * var(--u));
  height: calc(var(--ih, var(--h)) * var(--u));
  max-width: none;
  object-fit: contain;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .project:hover .mock:not(.mock--light) { transform: translate(calc(-3 * var(--u)), calc(-3 * var(--u))); }
  .project:hover .mock--light { transform: translate(calc(3 * var(--u)), calc(3 * var(--u))); }
}

.project__caption { display: flex; flex-direction: column; gap: 10px; }
.project__top { display: flex; align-items: center; gap: 10px; }
.project__name { font-weight: 800; font-size: clamp(1.375rem, 1.9vw, 1.625rem); letter-spacing: -0.016em; line-height: 1.2; }
.project__tag { font-weight: 500; font-size: 0.875rem; letter-spacing: 0.2px; color: var(--muted); }
.project__desc { font-size: 1rem; line-height: 1.5; color: var(--muted); }
.project__cta { margin-top: 0; }
.project__cta--soon { color: var(--muted); font-weight: 500; }
.project__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
@supports selector(:has(a)) {
  .project:has(.project__link:focus-visible) .cover { outline: 2px solid var(--accent); outline-offset: 4px; }
  .project__link:focus-visible { outline: none; }
}

/* Contact panel (home) */
.contact-panel {
  display: flex;
  align-items: center;
  gap: 64px;
  padding: clamp(28px, 4vw, 56px);
  background: var(--brand);
  color: var(--ink);
}
.contact-panel__copy { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.contact-panel__title {
  max-width: 850px;
  font-weight: 800;
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.016em;
}
.contact-panel__email {
  font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.25s;
}
.contact-panel__email:hover { text-decoration-color: currentColor; }
.contact-panel__email,
.case-contact__email { display: inline-flex; align-items: center; min-height: 44px; }
.contact-panel__arrow { width: clamp(72px, 11vw, 160px); height: auto; flex: none; transition: transform 0.5s var(--ease); }
@media (max-width: 760px) {
  .contact-panel { gap: 24px; align-items: flex-start; }
  .contact-panel__arrow { display: none; }
}

/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 28px;
  min-height: 100px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.footer__links { display: flex; gap: 28px; font-size: 0.875rem; letter-spacing: 0.3px; color: var(--ink-2); }
.footer__links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer__links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

/* ==========================================================================
   CASE STUDIES
   ========================================================================== */
.case { padding-bottom: 0; }

.case-hero { display: flex; flex-direction: column; gap: 36px; padding-block: 72px 56px; }
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.kicker::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.case-hero__title {
  max-width: 1180px;
  font-weight: 800;
  font-size: clamp(2.75rem, 7.2vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.038em;
  text-wrap: balance;
}
.case-hero__sub {
  max-width: 1000px;
  font-weight: 500;
  font-size: clamp(1.1875rem, 1.8vw, 1.625rem);
  line-height: 1.38;
  color: var(--muted);
}
.meta { display: flex; flex-wrap: wrap; gap: 24px 64px; padding-top: 12px; }
.meta__item { display: flex; flex-direction: column; gap: 8px; }
.meta__label { font-family: var(--mono); font-weight: 500; font-size: 0.875rem; letter-spacing: 0.5px; color: var(--muted-2); text-transform: uppercase; }
.meta__value { font-weight: 500; font-size: 1rem; color: var(--ink); }

.shot {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--white);
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot--hero { aspect-ratio: 1320 / 760; }
.shot--wide { aspect-ratio: 650 / 406; }
.shot--ref { aspect-ratio: 430 / 300; }
.shot--decision { aspect-ratio: 840 / 525; border-width: 1.292px; border-radius: 20.677px; }
.shot--inline { aspect-ratio: 2 / 1; border-radius: 10px; }

.case-hero-image { padding-bottom: 96px; }

.glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; padding-bottom: 96px; }
.glance__item { display: flex; flex-direction: column; gap: 14px; padding-top: 24px; border-top: 1px solid var(--ink); }
.glance__label { font-family: var(--mono); font-weight: 500; font-size: 0.875rem; letter-spacing: 0.5px; color: var(--muted); text-transform: uppercase; }
.glance__text { font-weight: 800; font-size: clamp(1.1875rem, 1.6vw, 1.375rem); line-height: 1.36; letter-spacing: -0.022em; }

.section { padding-bottom: 112px; }
.section--tight { padding-bottom: 48px; }
.section__stack { display: flex; flex-direction: column; gap: 48px; }

.split { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 80px; align-items: start; }
.split__left { display: flex; flex-direction: column; gap: 20px; }
.split__right { display: flex; flex-direction: column; gap: 24px; }
.h2 {
  font-weight: 800;
  font-size: clamp(1.875rem, 3vw, 2.625rem);
  line-height: 1.095;
  letter-spacing: -0.024em;
  text-wrap: balance;
}
.lead, .ed__text p, .card p, .cap__text { text-wrap: pretty; }
.lead { font-size: clamp(1rem, 1.25vw, 1.125rem); line-height: 1.56; color: var(--muted); }
.lead--ink { color: var(--ink); font-size: 1.0625rem; line-height: 1.53; }

.sub-label { font-family: var(--mono); font-weight: 500; font-size: 0.875rem; letter-spacing: 0.5px; color: var(--ink); text-transform: uppercase; }
.sub-label--muted { color: var(--muted); }
.sub-label--accent { color: var(--accent); }

.contrib { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.contrib ul { display: flex; flex-direction: column; gap: 12px; }
.contrib li { display: flex; gap: 14px; font-size: 1.0625rem; line-height: 26px; color: var(--ink); }
.contrib li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 10px; border-radius: 50%; background: var(--accent); }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.triple { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.quad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

.figure { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.figure--tight { gap: 14px; }
.cap { display: flex; flex-direction: column; gap: 6px; }
.cap__title { font-weight: 800; font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.02em; }
.cap__title--md { font-size: 1.375rem; line-height: 1.27; }
.cap__title--accent { color: var(--accent); font-size: 1.125rem; letter-spacing: -0.017em; }
.cap__title--accent a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: transparent; transition: text-decoration-color 0.2s; }
.cap__title--accent a:hover { text-decoration-color: currentColor; }
.cap__text { font-size: 1rem; line-height: 1.5; color: var(--muted); }

.card { display: flex; flex-direction: column; gap: 18px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.card--loop { gap: 12px; padding: 24px; }
.card--change { gap: 14px; padding: 24px; }
.card__head { display: flex; align-items: center; gap: 10px; }
.card__head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.card--before .card__head::before { background: var(--muted); }
.card p { font-size: 1.0625rem; line-height: 1.5; color: var(--muted); }
.card__num { font-family: var(--mono); font-weight: 500; font-size: 0.875rem; color: var(--muted); }
.card__title { font-weight: 800; font-size: 1.375rem; line-height: 1.1; letter-spacing: -0.02em; }
.card--change .card__title { font-size: 1.625rem; line-height: 1.23; }
.card--loop p, .card--change p { font-size: 1rem; line-height: 1.5; }

.quote { display: flex; flex-direction: column; gap: 24px; padding: clamp(24px, 3vw, 40px); background: var(--surface); }
.quote__title {
  max-width: 1200px;
  font-weight: 800;
  font-size: clamp(2.125rem, 4.5vw, 4rem);
  line-height: 1.09;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.quote__text { max-width: 1100px; font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.5; color: var(--muted); }

.statement { max-width: 1100px; font-weight: 500; font-size: clamp(1.25rem, 1.7vw, 1.5rem); line-height: 1.42; }
.footnote { font-family: var(--mono); font-weight: 500; font-size: 0.875rem; line-height: 1.5; letter-spacing: 0.3px; color: var(--muted-2); }


.decision { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 840px); gap: 80px; align-items: center; justify-content: space-between; }
.decision--flip { grid-template-columns: minmax(0, 840px) minmax(0, 400px); }
.decision__text { display: flex; flex-direction: column; gap: 18px; }
.decision__title { font-weight: 800; font-size: clamp(1.5rem, 2.2vw, 1.875rem); line-height: 1.2; letter-spacing: -0.013em; }

.reflect { display: flex; flex-direction: column; gap: 10px; }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.next { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding-block: 28px; }
.next .label { letter-spacing: 0.5px; }

.case-contact { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; padding-block: clamp(56px, 7vw, 96px); }
.case-contact__title { max-width: 900px; font-weight: 800; font-size: clamp(2.25rem, 4.5vw, 4rem); line-height: 1.1; letter-spacing: -0.016em; }
.case-contact__email { font-weight: 500; font-size: clamp(1.1875rem, 1.8vw, 1.5rem); color: var(--muted); overflow-wrap: anywhere; }
.case-contact__email:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.case .footer { min-height: 0; padding-block: 0 40px; }

/* Sorbot editorial layout */
.fig-full { display: flex; flex-direction: column; gap: 16px; }
.fig-full img { width: 100%; height: auto; aspect-ratio: 1320 / 825; object-fit: contain; }
.fig-caption { font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
.ed { display: flex; flex-direction: column; gap: 32px; padding-block: 80px; }
.rule { height: 1px; background: var(--rule); }
.ed__text { display: flex; flex-direction: column; gap: 20px; }
.ed__text p { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.5; color: var(--muted); }
.ed__text p.small { font-size: clamp(1rem, 1.25vw, 1.125rem); line-height: 1.56; }
.ed .h2--ed { font-size: clamp(1.875rem, 3.1vw, 2.75rem); line-height: 1.11; letter-spacing: -0.03em; }
.refs { display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 800; font-size: 1.625rem; line-height: 1.23; letter-spacing: -0.05em; color: var(--ink); }
.refs li { min-width: 120px; flex: 1 1 120px; max-width: 264px; }
.note { display: flex; flex-direction: column; gap: 12px; padding: 24px 32px; background: var(--surface); color: var(--muted); }
.note p:not(.label) { font-size: 1.125rem; line-height: 1.56; }
.note--tall { padding: 28px; gap: 16px; }
.note--tall .big { font-size: clamp(1.1875rem, 1.7vw, 1.5rem); line-height: 1.42; }
.model { display: flex; flex-direction: column; align-items: center; gap: 20px; padding-block: 40px; padding-inline: 20px; background: var(--surface); }
.model img { width: min(592px, 100%); height: auto; aspect-ratio: 592 / 484; object-fit: contain; }
.model p { width: min(720px, 100%); font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
.fig-white { background: var(--white); }

/* ==========================================================================
   Responsive — case studies
   ========================================================================== */
@media (max-width: 960px) {
  .split, .decision, .decision--flip { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .decision--flip .shot { order: 2; }
  .glance { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-bottom: 64px; }
  .pair, .triple { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section { padding-bottom: 72px; }
  .case-hero { padding-block: 40px 40px; gap: 28px; }
  .case-hero-image { padding-bottom: 56px; }
  .ed { padding-block: 56px; }
  .case-hero__title { letter-spacing: -0.03em; }
}
@media (max-width: 520px) {
  .quad { grid-template-columns: minmax(0, 1fr); }
  .meta { gap: 20px 40px; }
}

/* --------------------------------------------------------------------------
   Refinement pass (impeccable): browser surfaces, hierarchy, hero entrance
   -------------------------------------------------------------------------- */
::selection { background: var(--brand); color: var(--ink); }
:root { accent-color: var(--accent); caret-color: var(--accent); scrollbar-color: var(--ink-2) var(--bg); }
h1, h2, h3 { text-wrap: balance; }
.project__desc { text-wrap: pretty; }
.work__title { font-size: clamp(2.125rem, 4.2vw, 3.75rem); letter-spacing: -0.03em; }
.work__intro { font-size: 1rem; max-width: 460px; }
.project__name { transition: color 0.25s var(--ease); }
.project:hover .project__name { color: var(--accent); }

/* One authored moment: the statement rises, the rest follows. */
@media (prefers-reduced-motion: no-preference) {
  .hero__statement { animation: hero-fade 0.9s var(--ease) both; }
  .hero__prev { animation: hero-fade 0.8s var(--ease) 0.15s both; }
  .hero__cta { animation: hero-fade 0.8s var(--ease) 0.25s both; }
  .hero-visual { animation: hero-fade 1.1s var(--ease) 0.2s both; }
}
@keyframes hero-fade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Case studies: per-case color, next-case card, section progress, lightbox
   -------------------------------------------------------------------------- */
.case .case-hero-image {
  margin-bottom: 96px;
  padding: clamp(16px, 3.5vw, 56px) clamp(16px, 3.5vw, 56px) 0;
  padding-bottom: clamp(16px, 3.5vw, 56px);
  background: var(--case-bg);
  border-radius: 24px;
}
.case .glance__item { border-top: 3px solid var(--case-bg); }
.case .quote { background: var(--case-bg); }
.case .model { background: var(--case-bg); }

.next-case { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; padding-block: 48px 24px; }
.next-case__card {
  position: relative;
  display: grid;
  gap: 10px;
  width: 100%;
  padding: clamp(28px, 4vw, 56px);
  border-radius: 24px;
  background: var(--case-bg);
  color: var(--ink);
  transition: transform 0.4s var(--ease);
}
.next-case__title { font-family: var(--display); font-weight: 700; font-size: clamp(2.5rem, 6vw, 5.5rem); line-height: 1; letter-spacing: -0.035em; }
.next-case__tag { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--ink-2); }
.next-case__arrow { position: absolute; right: clamp(24px, 4vw, 56px); bottom: clamp(24px, 4vw, 48px); font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1; transition: transform 0.4s var(--ease); }
.next-case__card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Section progress (wide screens only) */
.progress { display: none; }
@media (min-width: 1360px) {
  .progress { position: fixed; z-index: 20; top: 50%; right: 18px; display: flex; flex-direction: column; gap: 4px; transform: translateY(-50%); }
  .progress a { position: relative; display: block; width: 24px; height: 24px; }
  .progress a::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--rule); transition: background 0.25s var(--ease), transform 0.25s var(--ease); }
  .progress a[aria-current="true"]::before { background: var(--accent); transform: scale(1.5); }
  .progress a span {
    position: absolute; right: 30px; top: 50%; transform: translate(6px, -50%);
    padding: 4px 10px; border-radius: 999px; background: var(--ink); color: var(--bg);
    font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0.4px; text-transform: uppercase; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .progress a:hover span, .progress a:focus-visible span, .progress a[aria-current="true"] span { opacity: 1; transform: translate(0, -50%); }
  .progress a:hover span, .progress a:focus-visible span { pointer-events: auto; }
  .progress.is-dismissed a span { opacity: 0 !important; }
  .progress a[aria-current="true"] span { opacity: 0; }
  .progress a[aria-current="true"]:hover span, .progress a[aria-current="true"]:focus-visible span { opacity: 1; }
}

/* Image viewer trigger */
.shot[data-zoom], img[data-zoom] { cursor: zoom-in; }
.case-hero-image img { border-radius: 12px; }
.shot[data-zoom]:focus-visible, img[data-zoom]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.case .quote .label, .case .quote .quote__text, .case .model p, .case .next-case__card .label { color: var(--ink-2); }

/* Iteration loop: filled step cards with a corner icon */
.case .card--loop {
  position: relative;
  min-height: 220px;
  justify-content: flex-end;
  border-color: transparent;
  background: var(--case-bg);
  transition: transform 0.35s var(--ease);
}
.case .card--loop .card__num { position: absolute; top: 24px; left: 24px; color: var(--ink-2); }
.card__icon {
  position: absolute; top: 16px; right: 16px;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink); color: var(--bg);
  transition: transform 0.35s var(--ease), background 0.25s var(--ease);
}
.case .card--loop p { color: var(--ink-2); }

/* Case-study reading path and editorial schematics. All text stays live. */
.case [id] { scroll-margin-top: 24px; }
.case .meta { margin: 0; }
.case .glance { padding-bottom: 0; }
.case .glance__item { gap: 10px; }
.case .case-hero-image { margin-bottom: 72px; }
.case .case-hero-image .fig-caption { color: var(--ink-2); }
/* Show the complete product UI, including controls at the edges, on phones. */
.case .shot--hero, .case .shot--decision { aspect-ratio: 8 / 5; }
.case .shot img { object-fit: contain; }
.case .next-case__tag { padding-right: 48px; }
.case .progress { right: 8px; }
.case .progress a { width: 44px; height: 44px; }
.case .progress a::before { inset: 19px; background: var(--muted); }
.case .progress a[aria-current="true"]::before { background: var(--accent); }
.case .progress a span { right: 44px; }


.case-options { margin: 12px 0 0; }
.case-options > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px 32px; padding-block: 24px; border-top: 1px solid var(--rule); }
.case-options dt { font-weight: 600; font-size: 1.25rem; line-height: 1.3; }
.case-options dt span { display: block; margin-top: 6px; color: var(--muted); font: 500 0.875rem/1.5 var(--mono); }
.case-options dd { max-width: 70ch; color: var(--muted); font-size: 1.0625rem; line-height: 1.55; }
.case-validation { counter-reset: validation; }
.case-validation li { counter-increment: validation; display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 2fr); gap: 12px 24px; border-top: 1px solid var(--rule); padding-block: 24px; }
.case-validation li::before { content: counter(validation, decimal-leading-zero); font: 500 0.875rem/1.5 var(--mono); color: var(--accent); }
.case-validation h4 { font-size: 1.25rem; line-height: 1.3; font-weight: 600; }
.case-validation p { max-width: 70ch; color: var(--muted); font-size: 1.0625rem; line-height: 1.55; }
.placeholder { display: flex; flex-direction: column; gap: 10px; padding: 24px; border: 1px dashed var(--muted); border-radius: 12px; background: var(--case-bg); }
.placeholder strong { color: var(--ink); font-size: 1.0625rem; line-height: 1.4; font-weight: 600; }
.placeholder p, .card .placeholder p { color: var(--ink-2); font-size: 1rem; line-height: 1.5; }

@media (max-width: 960px) {
  .case .case-hero-image { margin-bottom: 56px; }
  .case .glance { gap: 20px; }
  .case .glance__item { padding-top: 16px; }
  .case .glance__text { font-size: 1.1875rem; font-weight: 600; }
  .case-options > div { grid-template-columns: minmax(0, 1fr); }
  .case-validation li { grid-template-columns: 28px minmax(0, 1fr); gap: 10px 16px; }
  .case-validation p { grid-column: 2; }
}
@media (max-width: 520px) {
  .case .meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .case .meta__value { overflow-wrap: anywhere; }
  .case .glance__text { font-size: 1.125rem; }
}



/* Reference screenshots fill their frame edge to edge (no white letterbox). */
.case .shot--ref img { object-fit: cover; }
.case .shot--inline { aspect-ratio: 16 / 10; }

/* Iteration cards: full width, text on top, a pair of screens below. */
.iter-list { display: grid; gap: 24px; }
.iter { gap: 24px; }
.iter__head { display: flex; flex-direction: column; gap: 8px; }
.iter__text { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 48px; }
.iter__shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.iter__shot { display: flex; flex-direction: column; gap: 10px; margin: 0; }
@media (max-width: 760px) {
  .iter__text, .iter__shots { grid-template-columns: minmax(0, 1fr); }
}

/* FigJam-style flow (Vision problem section): shapes, connectors, sticky notes on a dot grid. */
.fj { display: grid; gap: 20px; margin: 0; }
.fj-board {
  position: relative; display: grid; gap: 28px; padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--line); border-radius: 20px; background-color: var(--white);
  background-image: radial-gradient(circle, var(--rule) 1.2px, transparent 1.4px); background-size: 20px 20px;
}
.fj-board--after { background-color: color-mix(in srgb, var(--case-bg, var(--surface)) 55%, var(--white)); }
.fj-title { font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ink-2); }
.fj-flow { display: flex; align-items: center; gap: 34px; }
.fj-node {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-width: 0; padding: 14px 18px; text-align: center;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--white);
  font-weight: 700; font-size: 1rem; line-height: 1.25;
}
.fj-flow > .fj-node + .fj-node::before {
  content: ""; position: absolute; right: 100%; top: 50%; width: 34px; height: 2px; background: var(--ink);
}
.fj-flow > .fj-node + .fj-node::after {
  content: ""; position: absolute; right: calc(100% - 1px); top: calc(50% - 5px);
  border-left: 8px solid var(--ink); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  border-left-color: var(--ink);
}
.fj-node--pill { border-radius: 999px; padding-inline: 22px; background: var(--ink); color: var(--bg); }
.fj-node--group { align-items: stretch; }
.fj-node--key { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fj-sub { display: flex; flex-direction: column; gap: 6px; }
.fj-sub li {
  padding: 5px 10px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--white); color: var(--ink);
  font-weight: 500; font-size: 0.875rem; line-height: 1.2; text-align: left;
}
.fj-mini { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.fj-mini i { font-style: normal; padding: 4px 8px; border-radius: 6px; background: var(--white); color: var(--ink); font-weight: 600; font-size: 0.875rem; }
.fj-mini b { font-size: 0.875rem; }
.fj-notes { display: flex; flex-wrap: wrap; gap: 18px 24px; }
.fj-note {
  max-width: 280px; padding: 14px 16px; border-radius: 4px; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: #040403;
  box-shadow: 0 1px 1px rgba(4,4,3,0.12), 0 6px 14px -6px rgba(4,4,3,0.25);
  transform: rotate(-1.2deg);
}
.fj-note:nth-child(2) { transform: rotate(1deg); }
.fj-note--yellow { background: #ffe27a; }
.fj-note--pink { background: #ffc2d4; }
.fj-note--green { background: #bff0c9; }
.fj-note--blue { background: #bcd9ff; }
@media (max-width: 1080px) {
  .fj-flow { flex-direction: column; align-items: stretch; gap: 34px; }
  .fj-flow > .fj-node + .fj-node::before { right: auto; left: 50%; top: auto; bottom: 100%; width: 2px; height: 34px; margin-left: -1px; }
  .fj-flow > .fj-node + .fj-node::after {
    right: auto; left: calc(50% - 6px); top: auto; bottom: calc(100% - 1px);
    border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--ink); border-bottom: 0;
  }
  .fj-sub { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .fj-note { transform: none; } }
/* Small UI exports (like a menu) stay at their natural size on the case tint instead of being stretched. */
.case .shot--natural { display: grid; place-items: center; background: var(--case-bg); }
.case .shot--natural img { width: auto; height: auto; max-width: 88%; max-height: 88%; object-fit: contain; border-radius: 10px; box-shadow: 0 8px 24px -8px rgba(4,4,3,0.25); }

/* --------------------------------------------------------------------------
   About and resume page
   -------------------------------------------------------------------------- */
.about-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding-block: clamp(32px, 5vw, 72px) clamp(56px, 7vw, 104px); }
.about-hero__copy { display: flex; flex-direction: column; gap: 28px; }
.about-hero .case-hero__title { font-size: clamp(2.5rem, 5.4vw, 5rem); }
.about-hero__cta { display: flex; flex-wrap: wrap; gap: 16px; }
.about-hero__photo { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 20px; background: var(--surface); }
.about-hero .meta { margin: 0; padding-top: 4px; }

.tl { display: flex; flex-direction: column; }
.tl__item { display: grid; grid-template-columns: minmax(120px, 170px) minmax(0, 1fr); gap: 8px 32px; padding-block: 32px; border-top: 1px solid var(--rule); }
.tl__item:first-child { border-top: 0; padding-top: 0; }
.tl__date { font-family: var(--mono); font-size: 0.875rem; line-height: 1.5; letter-spacing: 0.4px; color: var(--ink-2); padding-top: 6px; }
.tl__body { display: flex; flex-direction: column; gap: 6px; }
.tl__org { font-weight: 700; font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.15; letter-spacing: -0.02em; }
.tl__role { font-weight: 500; font-size: 1.0625rem; color: var(--accent); }
.tl__list { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.tl__list li { display: flex; gap: 14px; font-size: 1.0625rem; line-height: 1.55; color: var(--ink-2); }
.tl__list li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 11px; border-radius: 50%; background: var(--accent); }

.how { display: flex; flex-direction: column; }
.how li { display: flex; flex-direction: column; gap: 6px; padding-block: 20px; border-top: 1px solid var(--rule); }
.how li:first-child { border-top: 0; padding-top: 0; }
.how h3 { font-weight: 700; font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.015em; }
.how p { font-size: 1.0625rem; line-height: 1.55; color: var(--ink-2); }

@media (max-width: 900px) {
  .about-hero { grid-template-columns: minmax(0, 1fr); }
  .about-hero__photo { max-width: 360px; aspect-ratio: 1 / 1; object-position: center 20%; }
  .tl__item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tl__date { padding-top: 0; }
}

@media print {
  .viewer[open] { display: none !important; }
  .nav, .footer, .skip-link, .about-hero__cta, .case-contact, .placeholder, .progress { display: none !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body { background: #fff; }
  .about-hero { grid-template-columns: 1fr; padding-block: 0 24px; }
  .about-hero__photo { display: none; }
  .section, .about-hero { break-inside: avoid-page; }
  .tl__item { break-inside: avoid; }
  a { text-decoration: none; }
}
.lead a:not([class]) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.lead a:not([class]):hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   Motion refinements: About entrance and guarded hover movement.
   Everything is off under prefers-reduced-motion and content stays visible without JS.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .about-hero .case-hero__title { animation: hero-fade 0.8s var(--ease) both; }
  .about-hero .case-hero__sub { animation: hero-fade 0.8s var(--ease) 0.12s both; }
  .about-hero__cta, .about-hero .meta { animation: hero-fade 0.8s var(--ease) 0.26s both; }
  .about-hero__photo { animation: hero-fade 0.7s var(--ease) 0.08s both; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .case .card--loop:hover { transform: translateY(-4px); }
  .case .card--loop:hover .card__icon { transform: rotate(-8deg) scale(1.06); background: var(--accent); }
  .btn:hover { transform: translateY(-2px); }
  .textlink:hover .arrow { transform: translateX(4px); }
  .textlink--up:hover .arrow { transform: translate(2px, -2px); }
  .contact-panel:hover .contact-panel__arrow { transform: translate(6px, -6px); }
  .next-case__card:hover .next-case__arrow { transform: translateX(8px); }
}
/* Focus ring with enough contrast on the orange contact panel. */
.contact-panel a:focus-visible, .contact-panel :focus-visible { outline-color: var(--ink); }

/* --------------------------------------------------------------------------
   Case study opening: text on the left, the main screen on the right (stacked on small screens).
   -------------------------------------------------------------------------- */
.case-opening {
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  grid-template-areas: "hero image" "glance glance";
  column-gap: clamp(32px, 4vw, 64px); align-items: center;
}
.case-opening > .case-hero { grid-area: hero; }
.case-opening > .glance { grid-area: glance; margin-top: clamp(40px, 5vw, 72px); }
.case-opening > .case-hero-image { grid-area: image; margin: 0; padding: clamp(14px, 2vw, 24px); border-radius: 20px; }
.case-opening .case-hero__title { font-size: clamp(2.5rem, 4.6vw, 4.5rem); }
.case-opening .case-hero-image .fig-caption { font-size: 0.875rem; }
.case-opening .case-hero-image img { border-radius: 10px; }
@media (max-width: 1100px) {
  .case-opening { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "image" "glance"; }
  .case-opening > .case-hero-image { margin-top: 8px; padding: clamp(14px, 3.5vw, 40px); }
  .case-opening .case-hero__title { font-size: clamp(2.5rem, 9vw, 4.5rem); }
}


/* --------------------------------------------------------------------------
   Browser mockup stage for the case study opening: a macOS-style window with a second one behind.
   -------------------------------------------------------------------------- */
.case-opening > .hero-fig { background: none; padding: 0; margin: 0; border-radius: 0; display: grid; gap: 16px; }
.hero-stage { position: relative; aspect-ratio: 5 / 4; border-radius: 24px; background: var(--case-bg); overflow: hidden; }
.browser {
  position: absolute; overflow: hidden; border-radius: 12px; background: var(--white);
  box-shadow: 0 0 0 1px rgba(4, 4, 3, 0.08), 0 2px 4px rgba(4, 4, 3, 0.06), 0 28px 48px -18px rgba(4, 4, 3, 0.38);
}
.browser__bar { position: relative; display: flex; align-items: center; height: 30px; padding-inline: 12px; background: #f1f1f0; border-bottom: 1px solid rgba(4, 4, 3, 0.08); }
.browser__dots { display: flex; gap: 6px; }
.browser__dots i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.browser__dots i:nth-child(2) { background: #febc2e; }
.browser__dots i:nth-child(3) { background: #28c840; }
.browser__title { position: absolute; left: 50%; transform: translateX(-50%); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.3px; color: var(--ink-2); }
.browser img { display: block; width: 100%; height: auto; border-radius: 0; }
.hero-stage__front { left: 5%; bottom: 7%; width: 80%; }
.hero-stage__back { top: 7%; right: -9%; width: 66%; opacity: 0.96; }
.hero-stage .browser__body { line-height: 0; }
@media (prefers-reduced-motion: no-preference) {
  .hero-stage__front { animation: hero-fade 0.8s var(--ease) 0.1s both; }
  .hero-stage__back { animation: hero-fade 0.9s var(--ease) 0.3s both; }
}
@media (max-width: 1000px) {
  .hero-stage { aspect-ratio: 4 / 3; }
}
@media (max-width: 560px) { .hero-stage__back .browser__title { display: none; } }

.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.strip__item { aspect-ratio: 4 / 5; justify-content: flex-end; }
@media (max-width: 600px) { .hero-visual { max-width: 300px; } }

/* --------------------------------------------------------------------------
   Final review fixes
   -------------------------------------------------------------------------- */
/* Home hero: equal columns between 961 and 1200px so the title never meets the portrait. */
@media (min-width: 961px) and (max-width: 1200px) {
  .hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Focus ring for the zoomable hero screenshot stays inside the clipped window. */
/* Iteration cards: keep the "Changed" label orange. */
.card--change p.sub-label--accent { color: var(--accent); }
/* Printing: name and contact line, no dialog. */
.print-only { display: none; }
@media print {
  .print-only { display: block; font-family: var(--mono); font-size: 11pt; color: #000; padding-bottom: 8pt; }
}
/* Case opening on small screens: the product screen right after the title block. */
@media (max-width: 1100px) {
  .case-opening { grid-template-areas: "hero" "image" "glance"; }
}
.tl__note { padding-top: 6px; font-size: 0.9375rem; line-height: 1.5; color: var(--muted); }

/* --------------------------------------------------------------------------
   Type scale: one size per role on every page.
   lead 18 · body 17 · small 16 · caption 14 · label 13 (mono) · titles 22 / 30 / 42
   -------------------------------------------------------------------------- */
:root {
  --fs-lead: clamp(1rem, 1.25vw, 1.125rem);
  --fs-body: clamp(1rem, 1.18vw, 1.0625rem);
  --fs-sm: 1rem;
  --fs-cap: 0.875rem;
  --fs-label: 0.875rem;
}
/* Mono labels: some paragraph rules were out-specifying them (16, 17 and 20px). */
.label, p.label, .sub-label, p.sub-label, .card p.sub-label, .card p.card__num, .card p.card__head, .ed__text p.label, .card__num, .card__head, .meta__label, .glance__label {
  font-size: var(--fs-label); line-height: 1.4; letter-spacing: 0.5px;
}
/* Lead paragraphs (section intros) */
.lead, .ed__text p, .quote__text, .next-case__tag { font-size: var(--fs-lead); line-height: 1.56; }
/* Body copy in lists, cards and decisions */
.ed__text p.small, .lead--ink, .card p, .card--loop p, .card--change p, .how p, .tl__list li, .tl__role,
.contrib li, .case-options dd, .case-validation p { font-size: var(--fs-body); line-height: 1.55; }
/* Small supporting copy */
.cap__text, .project__desc, .meta__value, .work__intro, .placeholder p, .card .placeholder p { font-size: var(--fs-sm); line-height: 1.5; }
/* Captions */
.fig-caption, .tl__note { font-size: var(--fs-cap); line-height: 1.5; }
/* Titles */
.cap__title, .cap__title--md, .card__title, .card--change .card__title { font-size: 1.375rem; line-height: 1.25; }
.tl__org { font-size: clamp(1.5rem, 2.1vw, 1.875rem); }
.h2, .ed .h2--ed { font-size: clamp(1.625rem, 2.9vw, 2.625rem); line-height: 1.11; letter-spacing: -0.03em; }

/* Hierarchy: the page title (hero) is always larger than section headings; section headings share one size. */
.work__title, .contact-panel__title, .case-contact__title, .quote__title { font-size: clamp(1.625rem, 2.9vw, 2.625rem); line-height: 1.12; letter-spacing: -0.03em; }
.contact-panel__email, .case-contact__email { font-size: clamp(1.1875rem, 1.7vw, 1.5rem); }
.next-case__title { font-size: clamp(2.25rem, 4vw, 3.5rem); }

/* --------------------------------------------------------------------------
   System preferences: more contrast and forced colors (Windows high contrast).
   -------------------------------------------------------------------------- */
@media (prefers-contrast: more) {
  :root { --muted: #3a3a3a; --muted-2: #333333; --ink-2: #1f1f1f; --line: #6b6b6b; --rule: #6b6b6b; }
  .btn--secondary { border-color: var(--ink); }
}
@media (forced-colors: active) {
  .btn, .btn--primary, .btn--secondary { border: 1px solid ButtonText; }
  .hero-stage, .browser, .mock, .fj-board, .fj-node, .placeholder, .card, .next-case__card, .contact-panel, .hero-visual__tag-box { border: 1px solid CanvasText; }
  .fj-note { border: 1px solid CanvasText; }
  :focus-visible { outline: 2px solid Highlight; }
  .progress a::before { border: 1px solid CanvasText; }
  .progress a[aria-current="true"]::before { background: Highlight; border-color: Highlight; }
}

/* --------------------------------------------------------------------------
   Case study vertical rhythm: one space between sections on both pages.
   -------------------------------------------------------------------------- */
:root { --space-section: clamp(72px, 8vw, 112px); }
.case .section, .case .ed { padding-block: calc(var(--space-section) / 2); }
.case .section--tight { padding-block: calc(var(--space-section) / 2) 0; }
.case .case-opening { margin-bottom: calc(var(--space-section) / 2); }

/* About: interests */
.interests { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }

/* About: skills and tools */
.skills, .tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 28px; }
.skills li, .tools li { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border: 1px solid var(--rule); border-radius: 999px; font-size: 1rem; line-height: 1.3; color: var(--ink); }
.tool__logo { width: 20px; height: 20px; flex: none; background-color: var(--muted); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; transition: background-color 0.2s var(--ease); }
.skills li, .tools li { transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease); }
@media (hover: hover) {
  .skills li:hover, .tools li:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
  .tools li:hover .tool__logo { background-color: var(--brand-color, var(--bg)); }
}
@media (forced-colors: active) { .tool__logo { background-color: CanvasText; } }

/* About: colleague recommendations */
.said { display: grid; gap: 20px; }
.said__item { margin: 0; padding: 28px; border: 1px solid var(--rule); border-radius: 20px; background: var(--surface, transparent); }
.said__item blockquote { margin: 0 0 20px; }
.said__item blockquote p { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.5; color: var(--ink); }
.said__item figcaption { display: flex; flex-direction: column; gap: 4px; font-size: 1rem; line-height: 1.4; color: var(--ink-2); }
.said__item figcaption strong { color: var(--ink); }
.said__item figcaption span { font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.said__item figcaption .said__role { font-style: normal; }
.said__item blockquote p + p { margin-top: 1em; }
.said__item figcaption { display: grid; grid-template-columns: 56px 1fr; column-gap: 16px; align-items: center; }
.said__item figcaption img { grid-row: 1 / span 3; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }


/* Vision: early exploration sketches */
.sketches { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.sketches__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sketches__grid img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; border: 1px solid var(--rule); }
.sketches figcaption { font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); max-width: 720px; }
@media (max-width: 860px) { .sketches__grid { grid-template-columns: 1fr; } }

/* Image viewer */
.viewer { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(24, 26, 32, 0.94); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--white); display: none; }
.viewer[open] { display: block; }
.viewer::backdrop { background: transparent; }
.viewer__stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 72px 24px 96px; overflow: hidden; }
.viewer__stage img { max-width: min(86vw, 1100px); max-height: calc(100dvh - 176px); width: auto; height: auto; object-fit: contain; border-radius: 8px; background: var(--white); cursor: zoom-in; }
.viewer.is-zoomed .viewer__stage { overflow: auto; place-items: start center; }
.viewer.is-zoomed .viewer__stage img { max-width: none; max-height: none; cursor: zoom-out; }
.viewer__btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: var(--white); cursor: pointer; transition: background 0.2s var(--ease); }
.viewer__btn:hover { background: rgba(255, 255, 255, 0.22); }
.viewer__btn:focus-visible, .viewer__zoom:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.viewer__close { position: fixed; top: 12px; right: 12px; z-index: 2; }
.viewer__count { position: fixed; top: 20px; left: 24px; z-index: 2; font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0.4px; color: rgba(255, 255, 255, 0.85); }
.viewer__bar { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 2; display: flex; justify-content: center; align-items: center; gap: 12px; }
.viewer__zoom { min-height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.9); font: inherit; font-size: 0.875rem; cursor: pointer; }
.viewer__zoom:hover { background: rgba(255, 255, 255, 0.22); }
@media (max-width: 700px) { .viewer__stage { padding: 64px 12px 88px; } .viewer__stage img { max-width: 100%; max-height: calc(100dvh - 160px); } }
@media (prefers-reduced-motion: no-preference) { .viewer[open] .viewer__stage img { animation: hero-fade 0.25s var(--ease) both; } }
@media (forced-colors: active) { .viewer__btn, .viewer__zoom { border: 1px solid ButtonText; } }

/* Vision: smaller sketch row */
.sketches__grid { max-width: 720px; gap: 12px; }

/* Case pages: tall screenshots keep their natural height */
.case .shot--auto { aspect-ratio: auto; }
.case .shot--auto img { width: 100%; height: auto; object-fit: contain; }

.viewer__stage:focus-visible { outline: 2px solid var(--white); outline-offset: -6px; }

/* Image viewer: the page behind does not scroll while it is open. */
html.viewer-open { overflow: hidden; padding-right: var(--sbw, 0); }
.viewer, .viewer__stage { overscroll-behavior: contain; }

/* Tonal bands: full-bleed fields that group exhibit sections (screens, diagrams) and set them off from reading sections.
   The tint comes from the case colour at low strength; text stays on the quiet neutral/ink scale. */
:root { --band-bg: #ececec; --band-bg: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.case { --band-bg: #e6ece9; --band-bg: color-mix(in srgb, var(--case-bg, var(--surface)) 42%, var(--bg)); }
.band { --accent: #b23318; box-shadow: 0 0 0 100vmax var(--band-bg); clip-path: inset(0 -100vmax); background: var(--band-bg); }
hr.rule:has(+ .band), .band + hr.rule { display: none; }
@media (forced-colors: active) { .band { box-shadow: none; clip-path: none; background: transparent; } }
@media print { .band { box-shadow: none; clip-path: none; background: transparent; } }

.about-page .case { --band-bg: #f5ede8; --band-bg: color-mix(in srgb, var(--case-bg) 30%, var(--bg)); }

/* Inside a tonal band, containers sit on white; the case tint is not stacked on itself. */
.band .card, .band .iter, .band .card--change, .band .card--loop, .band .quote, .band .model, .band .placeholder { background: var(--white); }
.band .card, .band .iter, .band .card--change, .band .card--loop { border: 1px solid var(--line); }
.band .fj-board, .band .fj-board--after { background-color: var(--white); }
/* Pair rows: equal columns; a text cell pairs with an image (Z reading order), centred on the image. */
.pair--text { align-items: center; }
.pair__text { display: flex; flex-direction: column; gap: 16px; padding-inline: clamp(0px, 2vw, 24px); min-width: 0; }
.pair__text p { font-size: var(--fs-body, 1.0625rem); line-height: 1.55; color: var(--ink-2); }
.pair__text .small { font-size: 1rem; color: var(--muted); }
@media (max-width: 860px) { .pair--text { align-items: start; } .pair__text { padding-inline: 0; } }

.pair + .pair { margin-top: 28px; }
.band .note, .band .said__item { background: var(--white); }
