/* ==========================================================================
   Ryan Walsh — Portfolio
   Light pages with a navy/violet gradient hero, after aphex.co. Violet is the
   interface accent; the pink "pen" marks the hand-drawn annotations. The
   lime/teal come from Ryan's own TapSOS work and only appear inside project
   imagery. --paper is the text colour and --ground the background: .on-dark
   swaps them for navy sections.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Contrast ratios are against white (light) and navy (.on-dark). */
  --navy: #0d173f;
  --violet: #5d51ff; /* 5.1:1 on white, fine for text */
  --tint: #f4f5f8;

  --ground: #ffffff;
  --ground-raised: var(--tint);
  --surface: var(--tint);
  --paper: var(--navy); /* 17.3:1 */
  --paper-soft: #475472; /* 7.6:1 */
  --paper-faint: #5a6785; /* 5.7:1, still AA on --tint */
  --line: rgba(13, 23, 63, 0.12);
  --line-strong: rgba(13, 23, 63, 0.28);

  --accent: var(--violet);
  --pen: #ff2fad; /* 3.4:1: strokes and focus rings only, never small text */
  --focus: var(--pen);
  --button-hover: var(--violet);
  --button-hover-text: #ffffff;

  --tapsos-lime: #d7fa89;
  --tapsos-teal: #16758a; /* swap for the exact token from your TapSOS file */
  --tapsos-ink: #162029;
  --night: #1d2440;
  --night-light: #f2b35b;

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-md: clamp(1.1875rem, 1.05rem + 0.45vw, 1.4375rem);
  --text-lg: clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem);
  --text-xl: clamp(2.125rem, 1.5rem + 2.6vw, 3.875rem);
  --text-2xl: clamp(2.625rem, 1.4rem + 4.4vw, 5.5rem);
  --text-display: clamp(3rem, 1.2rem + 6.4vw, 7.25rem);

  --gutter: clamp(20px, 4.2vw, 64px);
  --col-gap: clamp(16px, 2vw, 32px);
  --max: 1440px;
  --header-h: 72px;
  --radius-media: 16px;
  --radius-control: 10px;
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
}

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--paper);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }

::selection { background: var(--pen); color: var(--navy); }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--ground);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.nowrap { white-space: nowrap; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.flow > * + * { margin-top: var(--flow, 1em); }

/* ---------- Controls ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0 1.25em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.button:hover { border-color: var(--paper); }
.button--solid {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ground);
}
.button--solid:hover { background: var(--button-hover); border-color: var(--button-hover); color: var(--button-hover-text); }

.text-link {
  color: var(--paper);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.3em;
  transition: text-decoration-color 0.2s;
}
.text-link:hover { text-decoration-color: var(--accent); }

/* ---------- Dark sections ----------
   Navy sections re-point the tokens, so everything inside just works.
   Lighter text values were checked against the brightest gradient stop.
   Navy media panels (.media--surface) get the same light text. */
.on-dark,
.media--surface {
  --ground: var(--navy);
  --paper: #ffffff;
  --paper-soft: #dcdff0; /* 5.0:1 on the violet wash, 13:1 on navy */
  --paper-faint: #dcdff0;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.36);
  --accent: var(--pen); /* 5.2:1 on navy */
  --focus: #ffffff;
  --button-hover: var(--pen);
  --button-hover-text: var(--navy);
  color-scheme: dark;
  background-color: var(--navy);
  color: var(--paper);
}

/* Same layers as the aphex.co hero, with Ryan's pink in the corner. */
.hero-band {
  margin-top: calc(-1 * var(--header-h));
  padding-top: var(--header-h);
  background:
    linear-gradient(117deg, rgba(13, 23, 63, 0) 64%, rgba(255, 47, 173, 0.6)),
    linear-gradient(100deg, rgba(93, 81, 255, 0.8), rgba(13, 23, 63, 0.8) 88%),
    var(--navy);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: transparent; /* the ::before layer paints it */
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
/* The blur lives on a layer behind the header, not the header itself:
   backdrop-filter would trap the fixed mobile menu inside the header's box. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(13, 23, 63, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: opacity 0.3s;
}
/* Sit clear on the gradient until the page scrolls. */
.js:not(.nav-open) .site-header:not(.is-scrolled)::before { opacity: 0; }
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
/* The mark is "RW" in braille: R (dots 1 2 3 5) and W (dots 2 4 5 6), with the
   empty positions drawn faintly so each cell still reads as a cell. */
.wordmark__mark { flex: none; width: auto; height: 22px; overflow: visible; }
.wordmark__blank { opacity: 0.3; }
/* Dots follow the text colour (white on the gradient and on navy). Pink
   #ff2fad is only 2:1 on the violet gradient, so the last dot starts as a
   lighter pink (3.6:1) and switches once the navy header appears (5.2:1). */
.wordmark__pen { fill: #ffa3d8; transition: fill 0.3s; }
.site-header.is-scrolled .wordmark__pen,
html:not(.js) .wordmark__pen,
.nav-open .wordmark__pen { fill: var(--pen); }

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 34px);
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  color: var(--paper-soft);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.nav__link:hover,
.nav__link[aria-current] { color: var(--paper); }
.nav__link[aria-current]::after { transform: scaleX(1); background: var(--accent); }


.nav-toggle {
  display: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--paper);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
}
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: inline; }

@media (max-width: 859px) {
  /* Without JavaScript the nav simply wraps under the name. */
  html:not(.js) .site-header__inner { flex-wrap: wrap; padding-block: 12px; }
  html:not(.js) .nav__list { flex-wrap: wrap; gap: 8px 18px; }

  .js .nav-toggle { display: inline-flex; align-items: center; }
  .js .nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    display: none;
    padding: 28px var(--gutter) 48px;
    background: var(--ground);
    overflow-y: auto;
  }
  .js.nav-open .nav { display: block; }
  .js.nav-open body { overflow: hidden; }
  .js .nav__list { flex-direction: column; align-items: flex-start; gap: 4px; }
  .js .nav__link {
    color: var(--paper);
    font-size: var(--text-xl);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.25;
  }
  .js .nav__link::after { display: none; }
}

/* ---------- Pen marks (hand-drawn annotations) ---------- */
.pen {
  position: absolute;
  max-width: none;
  overflow: visible;
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.pen path { stroke-dasharray: 1; stroke-dashoffset: 0; }

.js .pen[data-draw] path { stroke-dashoffset: 1; }
.js .pen[data-draw].is-drawn path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.05s var(--ease-out) var(--delay, 0s);
}
.js .pen[data-draw].is-drawn path + path {
  transition-delay: calc(var(--delay, 0s) + 0.75s);
  transition-duration: 0.35s;
}

.circled {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.circled .pen--loop {
  left: -9%;
  top: 50%;
  width: 118%;
  height: auto;
  transform: translateY(-44%) rotate(-2.5deg);
}

/* ---------- Media (placeholder art with image slots) ---------- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-media);
  container-type: inline-size;
  isolation: isolate;
}
.media--lime { background: var(--tapsos-lime); }
/* Soft violet-to-pink wash from the site palette, for real mockup images. */
.media--brand { background: linear-gradient(135deg, #e6e4ff 0%, #f1ecff 48%, #ffe1f2 100%); }
.media--night { background: var(--night); }
.media--paper { background: var(--tint); }
.media--tint { background: var(--tint); }
/* Label shown in an image slot until the real image is added. */
.media__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--paper-faint);
  font-size: var(--text-sm);
  font-weight: 500;
}

.media__art { position: absolute; inset: 0; }
.media__art--flow { position: relative; inset: auto; }

/* Drop a real image into /images with the right name and it covers the art. */
.media__img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media__img--contain { object-fit: contain; }
.media__img--inset { padding: 6% 5%; }
/* Landscape screens in a portrait card: fill the height and run off the right edge. */
.media__img--peek { object-fit: cover; object-position: 0% 50%; padding: 14% 0 14% 9%; }
/* Mockups ease up in size on hover (the card link on home, the figure on the
   case study); the background stays put because only the img scales. */
.media--zoom .media__img {
  transition: transform 0.7s var(--ease-out);
}
.project__link:hover .media--zoom .media__img,
.project__link:focus-visible .media--zoom .media__img,
.cs-hero-media .media--zoom:hover .media__img { transform: scale(1.06); }
/* A real image replaces the HTML placeholder art and the "coming soon" label
   (both return if the image fails to load, via the img's onerror). */
.media:has(> .media__img) > .media__art { visibility: hidden; }
.media:has(> .media__img) > .media__ph { display: none; }

.caption {
  margin-top: 14px;
  color: var(--paper-faint);
  font-size: var(--text-sm);
  line-height: 1.5;
  max-width: 60ch;
}

/* ---------- Phone mockups (built in HTML, sized with container units) ---------- */
.phone {
  --w: 240px;
  position: relative;
  flex: none;
  width: var(--w);
  aspect-ratio: 9 / 19.2;
  padding: calc(var(--w) * 0.032);
  border-radius: calc(var(--w) * 0.165);
  background: #0b0b0b;
  box-shadow:
    0 40px 70px -36px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1.5px #343434;
  container-type: inline-size;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 6cqw;
  border-radius: 13.5cqw;
  background: #ffffff;
  color: var(--tapsos-ink);
  font-family: var(--font);
  font-size: 4.2cqw;
  line-height: 1.3;
  overflow: hidden;
}
.app::before {
  content: "";
  position: absolute;
  top: 3cqw;
  left: 50%;
  z-index: 4;
  width: 30cqw;
  height: 8.5cqw;
  border-radius: 99px;
  background: #0b0b0b;
  transform: translateX(-50%);
}

.app__status {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 14cqw;
  padding: 0 3cqw;
  font-size: 4.3cqw;
  font-weight: 700;
}
.app__status::after {
  content: "";
  width: 6.5cqw;
  height: 3.2cqw;
  border-radius: 1cqw;
  background: currentColor;
  opacity: 0.85;
}

.app__bar {
  display: flex;
  flex: none;
  align-items: center;
  height: 10cqw;
  font-weight: 600;
}
.app__bar--end { justify-content: flex-end; }
.app__back::before { content: "\2039"; margin-right: 1.6cqw; font-size: 6cqw; line-height: 0; }
.app__close {
  position: relative;
  width: 5.5cqw;
  height: 5.5cqw;
}
.app__close::before,
.app__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 0.8cqw;
  border-radius: 1cqw;
  background: currentColor;
  transform: rotate(45deg);
}
.app__close::after { transform: rotate(-45deg); }

.app__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3cqw;
  margin-bottom: 5cqw;
  color: #98a3ad;
  font-size: 3.8cqw;
  font-weight: 700;
}
.app__tabs span { padding-bottom: 2cqw; border-bottom: 1.1cqw solid #e3e7ea; }
.app__tabs .is-active { color: var(--tapsos-teal); border-color: var(--tapsos-teal); }

.app__title { margin-bottom: 4cqw; font-size: 5.4cqw; font-weight: 700; letter-spacing: -0.01em; }
.app__text { margin-bottom: 5cqw; color: #46525c; font-size: 3.9cqw; }

.app__options { display: grid; gap: 2.6cqw; }
.app__options li,
.app__rows li {
  border-radius: 2.6cqw;
  background: #ffffff;
  box-shadow: 0 0.5cqw 2.6cqw rgba(22, 32, 41, 0.13);
}
.app__options li {
  display: flex;
  align-items: center;
  gap: 3cqw;
  padding: 3cqw 3.4cqw;
  font-size: 3.9cqw;
  font-weight: 600;
}

.app__ico {
  flex: none;
  width: 6.4cqw;
  height: 6.4cqw;
  color: var(--tapsos-teal);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app__rows { display: grid; gap: 3cqw; }
.app__rows li { display: grid; gap: 0.6cqw; padding: 3.4cqw 4cqw; }
.app__rows b { font-size: 4cqw; }
.app__rows span { color: #5b6670; font-size: 3.4cqw; }

.app__shield {
  position: relative;
  display: grid;
  place-items: center;
  width: 19cqw;
  height: 19cqw;
  margin: 3cqw 0 4cqw;
  border-radius: 4cqw;
  background: #2657d6;
  color: #ffffff;
}
.app__shield > svg { width: 11cqw; height: 11cqw; fill: none; stroke: currentColor; stroke-width: 2; }
.app__lock {
  position: absolute;
  right: -3cqw;
  bottom: -3cqw;
  display: grid;
  place-items: center;
  width: 9cqw;
  height: 9cqw;
  border: 1cqw solid #ffffff;
  border-radius: 50%;
  background: #128a4a;
}
.app__lock svg { width: 4.4cqw; height: 4.4cqw; fill: none; stroke: #ffffff; stroke-width: 2.6; }

/* Map screen */
.app--map { padding: 0; }
.app__map { position: absolute; inset: 0; width: 100%; height: 100%; }
.app--map .app__status { position: relative; z-index: 2; padding: 0 9cqw; }
.app__banner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  margin: 1cqw 4cqw 0;
  padding: 3cqw 4cqw;
  border-radius: 3cqw;
  background: rgba(78, 84, 90, 0.94);
  color: #ffffff;
}
.app__banner-kicker { font-size: 3.2cqw; opacity: 0.85; }
.app__banner-title { font-size: 4.8cqw; font-weight: 700; }
.app__here {
  position: absolute;
  top: 45%;
  left: 52%;
  z-index: 1;
  width: 6cqw;
  height: 6cqw;
  border: 1cqw solid #ffffff;
  border-radius: 50%;
  background: #1aa0c8;
  box-shadow: 0 0 0 5cqw rgba(26, 160, 200, 0.22);
  transform: translate(-50%, -50%);
}
.app__sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: grid;
  gap: 4cqw;
  padding: 5cqw 5cqw 8cqw;
  border-radius: 5cqw 5cqw 0 0;
  background: #ffffff;
  box-shadow: 0 -2cqw 6cqw rgba(0, 0, 0, 0.08);
}
.app__address { display: flex; align-items: flex-start; gap: 2.6cqw; font-size: 3.6cqw; }
.app__address b { display: block; font-size: 4.2cqw; }
.app__address span { color: #5b6670; }
.app__address .app__ico { color: var(--tapsos-ink); }
.app__edit {
  align-self: center;
  margin-left: auto;
  padding: 0.8cqw 3cqw;
  border: 0.5cqw solid var(--tapsos-ink);
  border-radius: 99px;
  color: var(--tapsos-ink);
  font-weight: 700;
}
.app__cta {
  display: block;
  padding: 3.4cqw;
  border-radius: 2.4cqw;
  background: var(--tapsos-teal);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
}

/* ---------- Home: hero ----------
   Type sizes, weights and spacing match the uxfol.io reference like for like:
   32px / 40px / 56px heading at its 768px and 1024px breakpoints, a light
   18px intro line, and a flat #f3f3f2 ground. */
/* The grey eases into the white page below, alongside the grid's own fade. */
.hero-band--light { position: relative; isolation: isolate; background: linear-gradient(to bottom, #f3f3f2 65%, var(--ground)); }
/* Fill the first screen so the case studies start below the fold. */
.hero-band--light { min-height: 100vh; min-height: 100svh; }
.hero-band--light + .section { border-top: 0; padding-top: clamp(40px, 4.5vw, 64px); }
/* The reference's 40px graph-paper grid, easing out toward the bottom edge. */
.hero-band--light::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent);
  mask-image: linear-gradient(to bottom, #000 65%, transparent);
  pointer-events: none;
}
.site-header--light::before { background: rgba(243, 243, 242, 0.96); } /* near-solid so dark sections can't wash out the links */
.site-header--light .wordmark__pen { fill: var(--pen); }

.hero {
  padding-top: clamp(70px, 29px + 10.9vw, 186px);
  padding-bottom: clamp(64px, 40px + 6.9vw, 139px);
}
.hero__hello {
  margin-bottom: 30px;
  color: var(--paper-faint); /* the reference's #929294 is only 2.9:1 here */
  font-size: 16.8px;
  font-weight: 300;
  line-height: 1.45;
}
.hero__title {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: normal;
  text-wrap: balance;
}
@media (min-width: 769px) {
  .hero__hello { font-size: 17.2px; line-height: 1.5; }
  .hero__title { max-width: min(776px, 66%); font-size: 40px; line-height: 1.17; }
}
@media (min-width: 1025px) {
  .hero__hello { font-size: 18px; line-height: 1.44; }
  .hero__title { font-size: 56px; line-height: 1.07; }
}
.hero__aside { margin-top: clamp(40px, 4vw, 56px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Availability sits beside the intro line in the same type, marked by a live dot. */
.hero__hello { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
.status { display: inline-flex; align-items: center; gap: 10px; }
.status__dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
}
.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #16a34a;
  animation: ping 2s var(--ease-out) infinite;
}
@keyframes ping {
  from { opacity: 0.6; transform: scale(1); }
  70%, to { opacity: 0; transform: scale(2.6); }
}
@media (prefers-reduced-motion: reduce) {
  .status__dot::after { animation: none; }
}

.js .hero__hello,
.js .hero__title,
.js .hero__aside { animation: rise 0.9s var(--ease-out) both; }
.js .hero__title { animation-delay: 0.08s; }
.js .hero__aside { animation-delay: 0.38s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(88px, 11vw, 168px);
  border-top: 1px solid var(--line);
}
/* Section markers: big enough to stop the eye while scrolling. */
.section__label {
  margin-bottom: 1.25rem;
  color: var(--accent);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.section__intro {
  max-width: 30ch;
  font-size: var(--text-lg);
  font-weight: 200;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ---------- Home: work ---------- */
/* The work section reads as a tight image grid: names sit on the images, and
   the full card text stays in the page (visually hidden) for screen readers. */
#work > .grid { column-gap: 16px; }
.project { margin-top: 16px; }
.project--feature { margin-top: clamp(28px, 3.5vw, 48px); }
.project__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(13, 23, 63, 0.14);
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(13, 23, 63, 0.16);
  color: var(--navy);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}
/* Hover / keyboard focus: the image blurs under a navy tint (dark enough for
   white text at AA on the lightest card) and the project details appear. */
.project__overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  background: rgba(13, 23, 63, 0.6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #ffffff;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.project__overlay-title { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
.project__overlay-desc { max-width: 56ch; color: rgba(255, 255, 255, 0.88); font-size: var(--text-base); line-height: 1.5; }
.project__overlay-cta {
  margin-top: 10px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 0.9375rem;
  font-weight: 600;
}
.project__link:hover .project__overlay,
.project__link:focus-visible .project__overlay { opacity: 1; }
.project__link:hover .project__badge,
.project__link:focus-visible .project__badge { opacity: 0; }
.project__badge { transition: opacity 0.2s; }

/* No hover on phones and touch tablets, so the one line and link sit under
   each image there instead. */
.project__caption { display: none; }
@media (max-width: 899px), (hover: none) {
  .project__caption { display: block; margin-top: 14px; }
  .project__caption-desc { color: var(--paper-soft); }
  .project__caption .project__cta { margin-top: 8px; }
  .project + .project { margin-top: 36px; }
}
.project__link { display: block; text-decoration: none; }
.project__media { aspect-ratio: 16 / 11; }

.project__text { margin-top: 22px; }
.project__title {
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.project__desc { margin-top: 10px; color: var(--paper-soft); } /* runs the full width of its image */
.project__meta { margin-top: 10px; color: var(--paper-faint); font-size: var(--text-sm); }
.project__cta {
  display: inline-block;
  margin-top: 18px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: border-color 0.2s;
}
.project__arrow {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.4em;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease-out);
}
.project__link:hover .project__cta { border-color: var(--accent); }
.project__link:hover .project__arrow,
.project__link:focus-visible .project__arrow { transform: translateX(4px); }
.project__cta--pending { border-bottom-style: dashed; color: var(--paper-faint); }

.art-cover {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8cqw;
}
.art-cover .phone { --w: 33cqw; }
.art-cover .phone:first-child { transform: translateY(9cqw) rotate(-4deg); }
.art-cover .phone:last-child { margin-left: -5cqw; transform: rotate(3deg); }

.art-night svg { width: 100%; height: 100%; }

/* ---------- Home: about ---------- */
.about__statement {
  max-width: 17ch;
  font-size: var(--text-xl);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.about__body { margin-top: clamp(36px, 5vw, 64px); color: var(--paper-soft); max-width: 58ch; }
.about__principles { margin-top: clamp(40px, 5vw, 64px); }
.about__principles-title { margin-bottom: 12px; font-size: 1.125rem; font-weight: 600; }
.beliefs li { display: flex; align-items: flex-start; gap: 14px; padding-block: 16px; border-top: 1px solid var(--line); }
.beliefs li:last-child { border-bottom: 1px solid var(--line); }
.beliefs .pen--dot { position: static; flex: none; width: 16px; height: 16px; margin-top: 0.3em; }

/* Pink bullet: the dot pops in, then a single ripple fades out. */
.pen--dot .pen__dot { fill: var(--pen); stroke: none; transform-box: fill-box; transform-origin: center; }
.pen--dot .pen__ring { fill: none; stroke: var(--pen); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.js .pen--dot[data-draw] .pen__dot { transform: scale(0); }
.js .pen--dot[data-draw].is-drawn .pen__dot {
  transform: scale(1);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) var(--delay, 0s);
}
.js .pen--dot[data-draw].is-drawn .pen__ring { animation: dot-ripple 0.9s var(--ease-out) calc(var(--delay, 0s) + 0.2s) both; }
@keyframes dot-ripple {
  from { opacity: 0.7; transform: scale(0.5); }
  to { opacity: 0; transform: scale(1.7); }
}
.beliefs p { color: var(--paper-soft); font-size: 0.9375rem; line-height: 1.5; }
.beliefs strong { display: block; margin-bottom: 2px; color: var(--paper); font-size: var(--text-base); font-weight: 600; }

.about__block {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--col-gap);
  row-gap: 20px;
  margin-top: clamp(72px, 9vw, 128px);
}
.about__subhead { color: var(--paper); font-size: 1.25rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }

/* Skills as soft grey cards, the same ground as the home hero. */
.skills { display: grid; gap: 12px; }
.skills > div { padding: 24px; border-radius: var(--radius-media); background: #f3f3f2; }
.skills dt { margin-bottom: 6px; font-weight: 600; }
.skills dd { max-width: 40ch; color: var(--paper-soft); font-size: 0.9375rem; line-height: 1.55; }
.skills__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border-radius: var(--radius-control);
  background: #ffffff;
  color: var(--violet);
}
.skills__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.tools { margin-top: 36px; }
.tools__label { margin-bottom: 14px; font-weight: 600; }
.tools__list { display: flex; flex-wrap: wrap; gap: 10px; }
.tools__list li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  font-size: 0.9375rem;
  font-weight: 500;
}
.tools__list svg { flex: none; width: 18px; height: 18px; fill: currentColor; }

.history__item {
  display: grid;
  gap: 4px var(--col-gap);
  padding-block: 20px;
  border-top: 1px solid var(--line);
}
.history__when { color: var(--paper-faint); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.history__role { font-weight: 600; }
.history__detail { max-width: 62ch; color: var(--paper-soft); }
.history + .about__subhead { margin-top: 36px; }
.about__cv { margin-top: 8px; }

/* ---------- Home: recommendations ---------- */
.rec blockquote p {
  font-weight: 300;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}
.rec--lead blockquote p {
  font-size: var(--text-lg);
  line-height: 1.3;
  text-indent: -0.42em;
}
/* Two quotes as white cards on the tinted section, equal height side by side,
   each opening with a large violet quote mark and ending with who said it. */
.rec--a,
.rec--b {
  display: flex;
  flex-direction: column;
  margin-top: clamp(28px, 3.5vw, 48px);
  padding: clamp(28px, 3vw, 44px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(13, 23, 63, 0.04), 0 18px 40px -18px rgba(13, 23, 63, 0.18);
}
.rec--a::before,
.rec--b::before {
  content: "\201C";
  display: block;
  height: 0.5em;
  margin-bottom: 20px;
  color: var(--violet);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
}
.rec--a blockquote p,
.rec--b blockquote p { color: var(--paper); font-size: 1.125rem; font-weight: 400; line-height: 1.6; letter-spacing: 0; }
.rec blockquote p + p { margin-top: 0.85em; }
.rec figcaption {
  display: flex;
  flex-direction: column;
  margin-top: 22px;
  font-size: var(--text-sm);
}
.rec--lead figcaption::before {
  content: "";
  width: 28px;
  height: 1px;
  margin-bottom: 14px;
  background: var(--line-strong);
}
.rec--a figcaption,
.rec--b figcaption {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 28px;
}
.rec__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #eceafe;
  color: var(--violet);
  font-size: 0.9375rem;
  font-weight: 700;
}
.rec__who { display: flex; flex-direction: column; }
.rec__name { color: var(--paper); font-size: var(--text-base); font-weight: 600; }
.rec__role { color: var(--paper-faint); }
#recommendations { background: linear-gradient(var(--tint) 20%, var(--ground)); }

/* ---------- Contact ---------- */
.section--contact {
  padding-bottom: clamp(104px, 13vw, 184px);
  background:
    radial-gradient(circle at 24% 0, rgba(93, 81, 255, 0.7), rgba(93, 81, 255, 0) 42%),
    radial-gradient(circle at 85% 0, rgba(255, 47, 173, 0.6), rgba(255, 47, 173, 0) 28%),
    var(--navy);
}
/* Same type as the home hero heading: 32 / 40 / 56px, regular weight. */
.contact__title {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: normal;
  text-wrap: balance;
}
@media (min-width: 769px) {
  .contact__title { max-width: min(776px, 66%); font-size: 40px; line-height: 1.17; }
}
@media (min-width: 1025px) {
  .contact__title { font-size: 56px; line-height: 1.07; }
}
.contact__body { margin-top: clamp(44px, 6vw, 88px); }
.contact__lead { color: var(--paper-soft); }
.contact__email-row { position: relative; margin-top: 6px; }
.contact__email {
  font-size: min(var(--text-lg), 5.5vw);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: break-word;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s;
}
.contact__email:hover { border-color: var(--accent); }
.pen--arrow { display: none; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 28px;
  border-top: 1px solid var(--line);
  color: var(--paper-faint);
  font-size: var(--text-sm);
}
.site-footer__inner { text-align: center; }

/* ==========================================================================
   Case study
   ========================================================================== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 100%;
  height: 2px;
  background: var(--pen);
  transform: scaleX(0);
  transform-origin: left;
}

.cs-hero { padding-top: clamp(40px, 7vw, 96px); padding-bottom: clamp(40px, 5vw, 72px); }
.crumbs { display: flex; gap: 0.5em; color: var(--paper-faint); font-size: var(--text-sm); }
.crumbs a { color: var(--paper-soft); }
.cs-hero__heading { margin-top: clamp(28px, 4vw, 48px); }
.cs-hero__name {
  display: block;
  margin-bottom: 0.5em;
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cs-hero__title {
  display: block;
  max-width: 19ch;
  font-size: var(--text-2xl);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.cs-hero__lead {
  max-width: 44ch;
  margin-top: clamp(28px, 4vw, 48px);
  color: var(--paper-soft);
  font-size: var(--text-md);
  line-height: 1.5;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px var(--col-gap);
  margin-top: clamp(32px, 4vw, 48px);
}
.facts > div { padding-top: 12px; border-top: 1px solid var(--line); }
.facts dt { color: var(--paper-faint); font-size: var(--text-sm); }
.facts dd { font-weight: 500; }

.cs-hero-media { margin-top: clamp(32px, 5vw, 72px); }
.cs-hero-media .media { aspect-ratio: 4 / 5; }
.art-trio {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 9cqw;
}
.art-trio .phone { --w: 38cqw; }
.art-trio .phone:nth-child(1),
.art-trio .phone:nth-child(3) { display: none; }

.agenda {
  display: grid;
  gap: 12px;
  margin-top: clamp(56px, 7vw, 96px);
}
.agenda__item {
  display: block;
  padding: 22px 0 6px;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.agenda__title { font-size: var(--text-md); font-weight: 500; letter-spacing: -0.015em; }
.agenda__desc { margin-top: 4px; color: var(--paper-soft); font-size: 0.9375rem; }
.agenda__item:hover .agenda__title { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }

.cs-layout { display: block; }
.cs-index { display: none; }

.cs-section {
  padding-block: clamp(72px, 9vw, 136px);
  border-top: 1px solid var(--line);
}
.cs-story > .cs-section:first-child { border-top: 0; }
.cs-section__tag {
  display: flex;
  gap: 14px;
  margin-bottom: clamp(20px, 2.5vw, 32px);
  color: var(--paper);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.cs-section__tag span { color: var(--accent); font-variant-numeric: tabular-nums; }
.cs-h2 {
  max-width: 21ch;
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.cs-sub { margin-top: 14px; color: var(--paper-soft); font-size: var(--text-md); }
.cs-h3 { margin-bottom: 12px; color: var(--paper); font-size: 1.125rem; font-weight: 600; }

.prose { max-width: 62ch; color: var(--paper-soft); }
.prose > * + * { margin-top: 1em; }
.prose strong { color: var(--paper); font-weight: 600; }

.split {
  display: grid;
  gap: clamp(40px, 6vw, 88px);
  margin-top: clamp(32px, 4vw, 56px);
}

.brief {
  margin-top: 36px;
  padding-left: 20px;
  border-left: 2px solid var(--line-strong);
}
.brief__label { color: var(--paper-faint); font-size: var(--text-sm); }
.brief__text { margin-top: 4px; font-size: var(--text-md); line-height: 1.45; }

.criteria__lead { margin-bottom: 4px; color: var(--paper-soft); }
.criteria li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-block: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--text-md);
  line-height: 1.35;
}
.criteria li:last-child { border-bottom: 1px solid var(--line); }
.criteria .pen--tick { position: static; flex: none; width: 26px; height: 22px; margin-top: 0.1em; }

.stats {
  display: grid;
  gap: 48px var(--col-gap);
  margin-top: clamp(40px, 5vw, 72px);
}
.stat__num {
  color: var(--accent);
  font-size: clamp(3.25rem, 1.6rem + 5.2vw, 6.75rem);
  font-weight: 200;
  line-height: 0.9;
  letter-spacing: -0.055em;
}
.stat__text { max-width: 26ch; margin-top: 14px; color: var(--paper-soft); }
.stat__text sup { color: var(--paper-faint); font-size: 0.7em; }
.statement {
  max-width: 30ch;
  margin-top: clamp(56px, 7vw, 104px);
  font-size: var(--text-lg);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.sources { margin-top: 28px; color: var(--paper-faint); font-size: var(--text-sm); }

.activities { display: grid; gap: 28px var(--col-gap); margin-top: clamp(40px, 5vw, 64px); }
.activities > div { padding-top: 14px; border-top: 1px solid var(--line); }
.activities dt { font-weight: 600; }
.activities dd { margin-top: 4px; max-width: 40ch; color: var(--paper-soft); }

.figure-pair { display: grid; gap: 28px var(--col-gap); margin-top: clamp(48px, 6vw, 88px); align-items: end; }
.figure-stack { display: grid; gap: clamp(40px, 5vw, 64px); margin-top: clamp(48px, 6vw, 88px); }
.figure-stack > .figure-pair { margin-top: 0; }

/* A process shown as big steps joined by arrows. */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: clamp(48px, 6vw, 80px);
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.flow-steps li { display: flex; align-items: center; gap: 0.5em; flex-wrap: wrap; }
.flow-steps li:not(:last-child)::after { content: "\2193"; color: var(--accent); font-weight: 400; }

.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(6px, 1.2cqw, 12px);
  padding: 7cqw;
}
.mini {
  position: relative;
  aspect-ratio: 9 / 19;
  border-radius: clamp(4px, 1.1cqw, 9px);
  background: #ffffff;
  overflow: hidden;
}
.mini::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 38%;
  background: var(--c, #dfe6ea);
}
.mini::after {
  content: "";
  position: absolute;
  top: 46%;
  right: 12%;
  left: 12%;
  height: 42%;
  background: repeating-linear-gradient(to bottom, #e5e8ea 0 9%, transparent 9% 19%);
}
.mini:nth-child(6n + 1) { --c: #1f2a36; }
.mini:nth-child(6n + 2) { --c: #f2c14e; }
.mini:nth-child(6n + 3) { --c: #e56b6f; }
.mini:nth-child(6n + 4) { --c: #6c8ef5; }
.mini:nth-child(6n + 5) { --c: #37b37e; }
.mini:nth-child(6n + 6) { --c: #f08a4b; }
.mini:nth-child(n + 7) { transform: translateY(14%); }

.affinity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7cqw 6cqw;
  padding: 8cqw;
}
.cluster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4cqw; align-content: start; }
.cluster__label { grid-column: 1 / -1; width: 62%; height: 2.6cqw; margin-bottom: 1cqw; border-radius: 1cqw; background: #1f2a36; opacity: 0.85; }
.sticky { aspect-ratio: 1; border-radius: 0.6cqw; background: var(--s); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.cluster:nth-child(1) { --s: #ffe27a; }
.cluster:nth-child(2) { --s: #ffb3d1; }
.cluster:nth-child(3) { --s: #b8ec9b; }
.cluster:nth-child(4) { --s: #a9d4ff; }
.sticky:nth-child(3n) { transform: rotate(-3deg); }
.sticky:nth-child(4n) { transform: rotate(2.5deg); }

.principles > div {
  display: grid;
  gap: 2px var(--col-gap);
  padding-block: 14px;
  border-top: 1px solid var(--line);
}
.principles > div:last-child { border-bottom: 1px solid var(--line); }
.principles dt { font-weight: 600; }
.principles dd { color: var(--paper-soft); }

.specimen__card {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-media);
  background: #ffffff;
}
.specimen__button {
  display: block;
  padding: 16px;
  border-radius: 12px;
  background: var(--tapsos-teal);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
}
.specimen__swatches { display: flex; gap: 8px; }
.specimen__swatches span { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(22, 32, 41, 0.2); }
.specimen__note { position: relative; margin-top: 18px; padding-left: 76px; }
.specimen__note .pen { left: 8px; top: -14px; width: 54px; height: auto; }
.specimen__ratio {
  display: block;
  font-size: var(--text-xl);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.035em;
}
.specimen__verdict { display: block; margin-top: 6px; color: var(--paper-soft); font-size: 0.9375rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--paper-soft);
  font-size: var(--text-sm);
}

.fidelity {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 3cqw, 40px);
  padding: clamp(24px, 6cqw, 72px) clamp(20px, 7cqw, 88px) clamp(40px, 9cqw, 104px);
}
.fid-col:nth-child(2) { transform: translateY(6%); }
.fid-col:nth-child(3) { transform: translateY(12%); }
.fid {
  display: flex;
  flex-direction: column;
  gap: 5%;
  aspect-ratio: 9 / 17;
  padding: 10% 8%;
  border-radius: clamp(8px, 1.6cqw, 16px);
  background: #ffffff;
}
.fid span { display: block; flex: none; border-radius: 4px; }
.fid__title { height: 4.5%; width: 56%; }
.fid__block { height: 20%; border-radius: 8px; }
.fid__row { height: 7.5%; }
.fid__btn { height: 8%; margin-top: auto; border-radius: 6px; }
.fid--lo span { border: 1.5px dashed #a3a9ae; }
.fid--lo .fid__block {
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), #c8cdd1 50%, transparent calc(50% + 1px)),
    linear-gradient(to top left, transparent calc(50% - 1px), #c8cdd1 50%, transparent calc(50% + 1px));
}
.fid--mid span { background: #dcdfe2; }
.fid--mid .fid__btn { background: #9aa3ab; }
.fid--hi .fid__title { background: var(--tapsos-ink); }
.fid--hi .fid__block { background: #e4f1f3; }
.fid--hi .fid__row { background: #ffffff; box-shadow: 0 1px 5px rgba(22, 32, 41, 0.16); border-left: 6px solid var(--tapsos-teal); }
.fid--hi .fid__btn { background: var(--tapsos-teal); }
.fid-col figcaption { margin-top: 12px; color: var(--paper-faint); font-size: var(--text-sm); }
.media--surface .fid-col figcaption { color: var(--paper-soft); }

.pull__cite { display: block; margin-top: 12px; color: var(--paper-faint); font-size: var(--text-sm); font-weight: 500; letter-spacing: 0; }
.pull {
  max-width: 34ch;
  margin-top: clamp(40px, 5vw, 64px);
  font-size: var(--text-lg);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 3cqw, 40px);
  padding: clamp(20px, 6cqw, 72px);
}
.compare__panel {
  padding: clamp(14px, 2.6cqw, 28px);
  border-radius: 18px;
  background: #ffffff;
  color: var(--tapsos-ink);
}
.compare__label { margin-bottom: 14px; font-size: 0.9375rem; font-weight: 700; }
.compare__label .pen--loop { stroke-width: 18; } /* no-JS fallback */
.compare__label .circled .pen--loop { left: -22%; width: 144%; }
.compare__list { display: grid; gap: 10px; }
.compare__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(22, 32, 41, 0.14);
  font-size: clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);
  font-weight: 600;
  line-height: 1.2;
}
.compare__list svg {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--tapsos-teal);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.outcomes { display: grid; margin-top: clamp(36px, 4.5vw, 64px); column-gap: var(--col-gap); }
.outcomes li { padding-block: 22px; border-top: 1px solid var(--line); }
.outcomes .outcomes__num {
  max-width: none;
  margin: 0 0 10px;
  color: var(--accent);
  font-size: clamp(2.5rem, 1.6rem + 3vw, 4rem);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.045em;
}
.outcomes h3 { font-size: var(--text-md); font-weight: 500; letter-spacing: -0.015em; }
.outcomes p { max-width: 40ch; margin-top: 6px; color: var(--paper-soft); }

.cs-reflection .cs-h2 { max-width: 23ch; font-size: var(--text-2xl); font-weight: 300; letter-spacing: -0.04em; line-height: 1.04; }
.cs-reflection .prose { margin-top: clamp(32px, 4vw, 56px); }

.cs-next {
  display: grid;
  gap: 8px;
  padding-block: clamp(72px, 9vw, 128px);
  border-top: 1px solid var(--line);
}
.cs-next__kicker { color: var(--paper-faint); font-size: var(--text-sm); }
.cs-next__title { font-size: var(--text-xl); font-weight: 300; letter-spacing: -0.035em; line-height: 1.1; }
.cs-next__status { color: var(--paper-soft); }
.cs-next .button { justify-self: start; margin-top: 20px; }

/* 404 */
.lost { min-height: 70vh; display: grid; align-content: center; gap: 24px; padding-block: 80px; }
.lost h1 { max-width: 16ch; font-size: var(--text-2xl); font-weight: 300; letter-spacing: -0.04em; line-height: 1.04; }
.lost p { color: var(--paper-soft); max-width: 44ch; }

/* ==========================================================================
   Wider screens
   ========================================================================== */
@media (min-width: 640px) {
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history__item { grid-template-columns: 8.5rem minmax(0, 1fr); }
  .activities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles > div { grid-template-columns: 10rem minmax(0, 1fr); }
  .outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-hero-media .media { aspect-ratio: 16 / 10; }
  .art-trio .phone { --w: 24cqw; }
  .art-trio .phone:nth-child(1),
  .art-trio .phone:nth-child(3) { display: block; }
  .art-trio .phone:nth-child(1) { transform: translateY(8cqw) rotate(-3deg); margin-right: -2cqw; }
  .art-trio .phone:nth-child(2) { --w: 27cqw; z-index: 1; }
  .art-trio .phone:nth-child(3) { transform: translateY(4cqw) rotate(2.5deg); margin-left: -2cqw; }
}

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

  /* Hero */
  .hero__hello { grid-column: 1 / -1; }
  .hero__title { grid-column: 1 / -1; }
  .hero__aside { grid-column: 1 / span 10; grid-row: 3; }

  /* Section scaffolding: quiet label in the margin, content to the right */
  .section__label { grid-column: 1 / span 3; margin-bottom: 0; padding-top: 0.2rem; }
  .section__intro { grid-column: 4 / span 8; }
  /* A short intro that reads as one quiet line on desktop. */
  .section__intro--line { grid-column: 4 / -1; max-width: none; font-size: var(--text-md); }

  /* Work: orbit runs the full width, Together and TapSOS share the row below. */
  .project--feature { grid-column: 1 / -1; }
  .project--second,
  .project--third { grid-column: span 6; }
  /* Exactly double the base 16/11: at double the width (full row vs. half),
     this keeps orbit's card the same height as Together and TapSOS below it. */
  .project--feature .project__media { aspect-ratio: 32 / 11; }
  .project--feature .project__text { max-width: 640px; }

  /* About */
  .about__statement { grid-column: 4 / span 9; }
  .about__body { grid-column: 4 / span 5; }
  .about__principles { grid-column: 10 / span 3; margin-top: clamp(36px, 5vw, 64px); }
  .about__block { grid-column: 1 / -1; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-columns: subgrid; }
  .about__subhead { grid-column: 1 / span 3; padding-top: 18px; }
  .skills,
  .tools,
  .history,
  .about__cv { grid-column: 4 / span 9; }
  .history + .about__subhead { margin-top: 0; }

  /* Recommendations */
  .rec--lead { grid-column: 4 / span 8; }
  .rec--a { grid-column: 1 / span 6; }
  .rec--b { grid-column: 7 / span 6; }

  /* Contact */
  .contact__title { grid-column: 1 / -1; }
  .contact__body { grid-column: 4 / span 9; }
  .pen--arrow {
    display: block;
    top: 50%;
    right: 100%;
    width: clamp(72px, 7vw, 112px);
    height: auto;
    margin-right: 18px;
    transform: translateY(-62%);
  }

  /* Case study hero */
  .crumbs { grid-column: 1 / -1; }
  .cs-hero__heading { grid-column: 1 / span 11; }
  .cs-hero__lead { grid-column: 1 / span 6; }
  .facts { grid-column: 8 / span 5; align-self: end; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda { grid-template-columns: 5fr 4fr 4fr; column-gap: var(--col-gap); }

  .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(2) { margin-top: 3.5rem; }
  .stat:nth-child(3) { margin-top: 7rem; }
  .figure-pair { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .figure-pair--even { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .stats--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats--pair .stat:nth-child(2) { margin-top: 3.5rem; }
  .flow-steps { flex-direction: row; flex-wrap: wrap; column-gap: 0.5em; }
  .flow-steps li:not(:last-child)::after { content: "\2192"; }
}

@media (min-width: 1120px) {
  .section__intro--line { white-space: nowrap; }
  .skills { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .cs-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: clamp(40px, 5vw, 96px);
  }
  .cs-index {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 40px);
    align-self: start;
    padding-top: clamp(72px, 9vw, 136px);
    font-size: var(--text-sm);
  }
  .cs-index__group + .cs-index__group { margin-top: 26px; }
  .cs-index__heading { margin-bottom: 6px; color: var(--paper-faint); font-weight: 500; }
  .cs-index a {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 4px 0;
    color: var(--paper-soft);
    text-decoration: none;
    transition: color 0.2s;
  }
  .cs-index a span { color: var(--paper-faint); font-variant-numeric: tabular-nums; }
  .cs-index a:hover,
  .cs-index a[aria-current] { color: var(--paper); }
  .cs-index a[aria-current]::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -22px;
    width: 14px;
    height: 1px;
    background: var(--accent);
  }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js .pen[data-draw] path { stroke-dashoffset: 0; }
  .media--zoom .media__img { transform: none !important; }
}

/* ---------- Case studies on hold ("not available" cards) ---------- */
.project--off .project__link { cursor: default; }
.pending { display: grid; place-items: center; overflow: hidden; }
.pending__mark {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(13, 23, 63, 0.05) 0 12px, transparent 12px 24px);
}
.media--night .pending__mark {
  background: repeating-linear-gradient(-45deg, rgba(243, 241, 234, 0.05) 0 12px, transparent 12px 24px);
}
.pending__band {
  position: relative;
  z-index: 2;
  width: 130%;
  transform: rotate(-6deg);
  background: var(--navy);
  border-block: 3px solid var(--pen);
  padding: 14px 0;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(13, 23, 63, 0.25);
}
.media--night .pending__band { background: var(--night-light); border-color: var(--navy); }
.pending__track { display: flex; width: max-content; animation: pending-scroll 22s linear infinite; }
.pending__set { display: flex; flex: none; }
.pending__set span {
  flex: none;
  padding-inline: 1.4em;
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pending__set span::after { content: "\2022"; margin-left: 2.8em; color: var(--pen); }
.media--night .pending__set span { color: var(--navy); }
.media--night .pending__set span::after { color: var(--navy); }
@keyframes pending-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .pending__track { animation: none; }
}

/* ---------- orbit ---------- */
.media--orbit { background: radial-gradient(120% 90% at 50% 0%, #1b2a6b 0%, #0d173f 60%, #0a1233 100%); }
.media--orbit .media__art svg { width: 100%; height: 100%; }
.cs-hero-media .media--orbit { aspect-ratio: 16 / 10; }
.project--feature .media--orbit { aspect-ratio: 16 / 11; }
.activities dt a { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
.activities dt a:hover { color: var(--accent); }
.media--slide { aspect-ratio: 16 / 9; }

/* ---------- Project cards: skill tags ---------- */
.cs-hero__eyebrow {
  color: var(--paper-faint);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cs-hero__eyebrow { margin-top: clamp(28px, 4vw, 48px); }
.cs-hero__eyebrow + .cs-hero__heading { margin-top: 12px; }
.on-dark .cs-hero__eyebrow { color: rgba(255, 255, 255, 0.72); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags li {
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--paper-soft);
  font-size: var(--text-sm);
}
.tags--hero { margin-top: 24px; }
.on-dark .tags li { border-color: rgba(255, 255, 255, 0.35); color: rgba(255, 255, 255, 0.85); }
.tags + .project__cta { margin-top: 18px; }

/* ---------- "More selected work" at the end of a case study ---------- */
.more-work {
  display: grid;
  gap: 8px;
  padding-block: clamp(72px, 9vw, 128px);
  border-top: 1px solid var(--line);
}
.more-work__card { max-width: 520px; margin-top: 32px; }
.more-work .button { justify-self: start; margin-top: 32px; }
@media (min-width: 900px) {
  .cs-hero__eyebrow { grid-column: 1 / -1; }
  .cs-hero__intro { grid-column: 1 / span 6; }
}

/* ---------- Together placeholder: branded indigo mark behind the banner ---------- */
.media--together { background: linear-gradient(135deg, #eef0fc 0%, #dde2fa 100%); }
.media--together .pending__mark { display: none; }
.pending__icon { position: absolute; top: 50%; left: 50%; width: 58%; transform: translate(-50%, -50%); }
.media--together .pending__band { background: #4c5fd9; border-color: #fff; }
.media--together .pending__set span::after { color: #fff; }


/* orbit case study hero: the Together placeholder wash with a tinge of pink */
.media--orbit-hero { background: linear-gradient(135deg, #eef0fc 0%, #e4e7fb 55%, #fbe3f1 100%); }
.cs-hero-media .media--orbit-hero:hover .media__img { transform: scale(1.09); }
/* Same shape as the orbit card on the home page: 16:11, then 32:11 once the
   home grid goes wide, at the same full content width. */
.cs-hero-media .media--orbit-hero { aspect-ratio: 16 / 11; }
@media (min-width: 900px) {
  .cs-hero-media .media--orbit-hero { aspect-ratio: 32 / 11; }
}

/* orbit home card: same wash as the Together placeholder, no hover animation */
.media--orbit-card { background: linear-gradient(135deg, #eef0fc 0%, #dde2fa 100%); }

/* Research figures: full-width, on white with a hairline so they sit in the page like cards. */
.media--plain { min-height: 200px; border: 1px solid var(--line); background: #fff; }
.media--plain .media__img { position: static; display: block; height: auto; }

/* A lone phone screen: no box, sits directly on the page. */
.phone-figure { display: grid; justify-items: center; align-content: start; }
.phone-figure img { width: min(100%, 405px); height: auto; }
.phone-figure .caption { justify-self: stretch; text-align: center; }

/* ---------- TapSOS password gate ---------- */
.cs-gate { padding-block: clamp(96px, 16vw, 220px); text-align: center; }
.cs-gate .crumbs { justify-content: center; margin-bottom: clamp(28px, 4vw, 48px); }
.gate__icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.gate__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gate__title { max-width: 18ch; margin: 0 auto; font-size: var(--text-xl); font-weight: 300; letter-spacing: -0.03em; line-height: 1.08; }
.gate__lead { max-width: 44ch; margin: 16px auto 0; color: var(--paper-soft); font-size: var(--text-md); }
.gate__form { max-width: 380px; margin: clamp(32px, 4vw, 48px) auto 0; text-align: left; }
.gate__label { display: block; margin-bottom: 8px; color: var(--paper-faint); font-size: var(--text-sm); }
.gate__row { display: flex; gap: 10px; }
.gate__input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
  font: inherit;
  font-size: var(--text-base);
}
.gate__input::placeholder { color: var(--paper-faint); }
.gate__input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.gate__row .button { flex: none; }
.gate__error { margin-top: 12px; color: #ffb4de; font-size: var(--text-sm); }

/* ---------- Generic "image withheld" placeholder (no product-specific art) ---------- */
/* Sits over the abstract placeholder wall (images/tapsos-card.webp), which uses
   TapSOS colours but no real screens while the work is under review. */
.media-locked {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--paper-faint);
}
.media-locked__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--navy);
}
.media-locked__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.media-locked__text {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(13, 23, 63, 0.9);
  font-size: var(--text-sm);
  font-weight: 500;
}
