/* ==========================================================================
   Adrian Rachman — portfolio design system
   One stylesheet for every page. Page-specific art lives in css/pages/*.css.
   ========================================================================== */

/* ── Tokens ──────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  /* Charcoal with a whisper of blue. Lifted a step above RideCheck's ink
     (#0B0E14) so long pages read as calm rather than cavernous. */
  --bg: #131418;
  --bg-2: #17181d;
  --surface: #1b1c21;
  --surface-2: #212228;
  --surface-3: #292a31;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.2);

  --fg: #f5f5f7;
  --fg-2: #a1a1a8;
  --fg-3: #6f6f78;
  --fg-4: #4a4b52;

  --accent: #2997ff;
  --accent-2: #6cb8ff;
  --green: #30d158;
  --amber: #ffb340;
  --red: #ff5a5f;

  /* Project colours, used for small accents outside each project's own page. */
  --rc: #4aa3f5;
  --rc-400: #7dc4ff;
  --rc-ink: #0b0e14;
  --swi: #ff7a3d;
  --swi-2: #f2548f;
  --bomb: #ff8a00;
  --rpt: #34d399;
  --recipe: #7bd88f;
  --journal: #a78bfa;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --r-xs: 8px;
  --r-s: 12px;
  --r-m: 18px;
  --r-l: 26px;
  --r-xl: 34px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  --maxw: 1200px;
  --maxw-wide: 1400px;
  --maxw-text: 680px;
  --gutter: clamp(16px, 4.2vw, 44px);
  --section-y: clamp(96px, 13vw, 176px);

  --nav-h: 64px;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  hanging-punctuation: first last;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.52;
  letter-spacing: -0.011em;
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

img {
  height: auto;
}

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

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

::selection {
  background: rgba(41, 151, 255, 0.4);
  color: #fff;
}

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

[hidden] {
  display: none !important;
}

/* Film grain over the whole document. It kills banding on the large, soft
   gradients and gives the flat charcoal a printed, physical quality. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Thin, quiet scrollbars. */
html {
  scrollbar-width: thin;
  scrollbar-color: #3a3b43 transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #34353c;
  border-radius: 10px;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #4a4b53;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

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

.container--wide {
  max-width: calc(var(--maxw-wide) + var(--gutter) * 2);
}

.container--text {
  max-width: calc(var(--maxw-text) + var(--gutter) * 2);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.section--flush-top {
  padding-top: 0;
}

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

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap, 20px);
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
}

/* ── Typography ──────────────────────────────────────────────────────────── */

.display {
  font-size: clamp(52px, 9.4vw, 136px);
  line-height: 0.94;
  letter-spacing: -0.052em;
  font-weight: 650;
}

.h1 {
  font-size: clamp(44px, 7.2vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.048em;
  font-weight: 650;
}

.h2 {
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.044em;
  font-weight: 650;
}

.h3 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.034em;
  font-weight: 600;
}

.h4 {
  font-size: clamp(21px, 1.9vw, 26px);
  line-height: 1.22;
  letter-spacing: -0.024em;
  font-weight: 600;
}

.h5 {
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.lead {
  font-size: clamp(19px, 1.65vw, 23px);
  line-height: 1.45;
  letter-spacing: -0.019em;
  color: var(--fg-2);
}

.lead strong,
.body strong,
.muted strong {
  color: var(--fg);
  font-weight: 600;
}

.body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-2);
}

.small {
  font-size: 14px;
  line-height: 1.5;
}

.tiny {
  font-size: 12px;
  line-height: 1.45;
}

.muted {
  color: var(--fg-2);
}

.faint {
  color: var(--fg-3);
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "calt" 0, "liga" 0;
  letter-spacing: 0;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.gradient-text {
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.62) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dim {
  color: var(--fg-3);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.eyebrow__index {
  color: var(--accent);
}

.eyebrow__rule {
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.section-head {
  display: grid;
  gap: 22px;
  margin-bottom: clamp(48px, 6vw, 88px);
  max-width: 820px;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

.section-head--split {
  max-width: none;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: end;
  column-gap: 64px;
}

@media (max-width: 900px) {
  .section-head--split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.link {
  color: var(--accent);
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size 0.4s var(--ease-out), color 0.2s;
}

.link:hover {
  background-size: 100% 1px;
}

.link--plain {
  color: inherit;
}

kbd,
.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--fg-2);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
}

/* ── Icons ───────────────────────────────────────────────────────────────── */

.i {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i--fill {
  fill: currentColor;
  stroke: none;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  --btn-h: 48px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: var(--btn-h);
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.012em;
  white-space: nowrap;
  isolation: isolate;
  transition:
    transform 0.45s var(--ease-out),
    background-color 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    color 0.3s var(--ease-out),
    box-shadow 0.45s var(--ease-out);
  will-change: transform;
}

.btn .i {
  font-size: 17px;
  transition: transform 0.45s var(--ease-out);
}

.btn:hover .i--arrow {
  transform: translateX(3px);
}

.btn:hover .i--up-right {
  transform: translate(2px, -2px);
}

.btn:hover .i--down {
  transform: translateY(2px);
}

.btn:active {
  transform: scale(0.965);
  transition-duration: 0.12s;
}

.btn--primary {
  background: var(--fg);
  color: #0a0a0c;
}

.btn--primary:hover {
  background: #fff;
  box-shadow: 0 12px 34px -12px rgba(255, 255, 255, 0.45);
}

.btn--glass {
  background: rgba(255, 255, 255, 0.055);
  color: var(--fg);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.btn--glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-3);
}

.btn--accent {
  background: var(--accent);
  color: #fff;
}

.btn--accent:hover {
  background: #3aa2ff;
  box-shadow: 0 12px 34px -12px rgba(41, 151, 255, 0.7);
}

.btn--sm {
  --btn-h: 36px;
  padding: 0 15px;
  font-size: 13.5px;
  gap: 7px;
}

.btn--sm .i {
  font-size: 15px;
}

.btn--lg {
  --btn-h: 56px;
  padding: 0 28px;
  font-size: 16.5px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* A text link with an arrow that walks forward on hover. */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 550;
  color: var(--fg);
  transition: color 0.3s;
}

.arrow-link .i {
  transition: transform 0.45s var(--ease-out);
}

.arrow-link:hover .i--arrow {
  transform: translateX(4px);
}

.arrow-link:hover .i--up-right {
  transform: translate(2px, -2px);
}

.arrow-link--accent {
  color: var(--accent);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--fg-2);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.3s, background-color 0.3s, border-color 0.3s, transform 0.45s var(--ease-out);
}

.icon-btn .i {
  font-size: 18px;
}

.icon-btn:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-2);
  transform: translateY(-2px);
}

/* ── Chips & tags ────────────────────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--fg-2);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}

.chip--mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
}

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

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.7);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: ping 2.4s var(--ease-out) infinite;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }

  80%,
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

/* ── Surfaces ────────────────────────────────────────────────────────────── */

.glass {
  background: rgba(30, 31, 37, 0.62);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card {
  --mx: 50%;
  --my: -20%;
  position: relative;
  border-radius: var(--r-l);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008) 60%),
    var(--surface);
  border: 1px solid var(--line);
  isolation: isolate;
  overflow: hidden;
  transition: border-color 0.5s var(--ease-out), transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
}

/* Pointer-tracked spotlight and a matching rim of light on the border. The
   variables are written by main.js; without JS the card simply stays still. */
.card[data-spotlight]::before,
.card[data-spotlight]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}

.card[data-spotlight]::before {
  z-index: 0;
  background: radial-gradient(640px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.055), transparent 42%);
}

.card[data-spotlight]::after {
  z-index: 3;
  padding: 1px;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.28), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.card[data-spotlight]:hover::before,
.card[data-spotlight]:hover::after {
  opacity: 1;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card--pad {
  padding: clamp(24px, 3vw, 36px);
}

.card--link {
  display: block;
  cursor: pointer;
}

.card--link:hover {
  border-color: var(--line-2);
  transform: translateY(-4px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}

.card--link:active {
  transform: translateY(-1px) scale(0.995);
  transition-duration: 0.2s;
}

/* ── Device frames ───────────────────────────────────────────────────────── */

/* A drawn iPhone for raw screenshots that ship without a bezel. */
.phone {
  --pw: 280px;
  position: relative;
  width: var(--pw);
  aspect-ratio: 402 / 874;
  padding: calc(var(--pw) * 0.034);
  border-radius: calc(var(--pw) * 0.17);
  background: linear-gradient(145deg, #3a3b40, #151518 42%, #2a2b30);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 40px 90px -30px rgba(0, 0, 0, 0.8);
  flex-shrink: 0;
}

.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--pw) * 0.14);
  overflow: hidden;
  background: #000;
}

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

.phone__island {
  position: absolute;
  top: calc(var(--pw) * 0.056);
  left: 50%;
  width: 31%;
  height: calc(var(--pw) * 0.085);
  transform: translateX(-50%);
  border-radius: 999px;
  background: #000;
  z-index: 2;
}

/* A macOS window for desktop screenshots. */
.window {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #1e1e22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.8),
    0 50px 120px -40px rgba(0, 0, 0, 0.9),
    0 20px 40px -20px rgba(0, 0, 0, 0.6);
}

.window__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  background: linear-gradient(180deg, #2c2c31, #26262b);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}

.window__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}

.window__dot:nth-child(2) {
  background: #febc2e;
}

.window__dot:nth-child(3) {
  background: #28c840;
}

.window__title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  margin-right: 50px;
}

.window img {
  width: 100%;
}

/* A browser window for web work. */
.browser {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #1c1c20;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.9), 0 20px 40px -20px rgba(0, 0, 0, 0.6);
}

.browser__bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  height: 38px;
  padding: 0 14px;
  background: #26262b;
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
}

.browser__dots {
  display: flex;
  gap: 7px;
}

.browser__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4a4a50;
}

.browser__url {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 7px;
  width: min(420px, 100%);
  height: 24px;
  padding: 0 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  overflow: hidden;
  white-space: nowrap;
}

.browser__url .i {
  font-size: 11px;
  opacity: 0.7;
}

.browser img {
  width: 100%;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */

site-header {
  display: block;
}

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: flex;
  justify-content: center;
  padding: 12px var(--gutter) 0;
  pointer-events: none;
  view-transition-name: site-nav;
  transition: transform 0.6s var(--ease-out);
}

.nav.is-hidden {
  transform: translateY(calc(-100% - 12px));
}

.nav__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  max-width: 1120px;
  height: 56px;
  padding: 0 10px 0 18px;
  border-radius: 999px;
  pointer-events: auto;
  border: 1px solid transparent;
  transition:
    max-width 0.7s var(--ease-out),
    background-color 0.5s var(--ease-out),
    border-color 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out),
    -webkit-backdrop-filter 0.5s,
    backdrop-filter 0.5s;
}

.nav.is-scrolled .nav__bar {
  max-width: 820px;
  background: rgba(24, 25, 30, 0.72);
  border-color: var(--line-2);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow: 0 16px 50px -18px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, #2d2e35, #18191d);
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.6s var(--ease-spring);
}

.nav__brand:hover .nav__mark {
  transform: rotate(-8deg) scale(1.06);
}

/* A blinking caret after the name: the one wink at the terminal. */
.caret {
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.16em;
  background: var(--accent);
  border-radius: 1px;
  animation: caret 1.15s steps(1) infinite;
}

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

.nav__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-2);
  transition: color 0.3s;
}

.nav__link:hover,
.nav__link[aria-current="page"],
.nav__link.is-active {
  color: var(--fg);
}

/* The pill that glides between links. */
.nav__indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.5s var(--ease-out),
    width 0.5s var(--ease-out),
    opacity 0.3s;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__cmd {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--fg-3);
  transition: background-color 0.3s, color 0.3s;
}

.nav__cmd kbd {
  height: 20px;
  min-width: 20px;
  font-size: 11.5px;
}

.nav__cmd:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
}

.nav__menu {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
}

.nav__burger {
  position: relative;
  width: 18px;
  height: 10px;
}

.nav__burger::before,
.nav__burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.5s var(--ease-out), top 0.5s var(--ease-out);
}

.nav__burger::before {
  top: 0;
}

.nav__burger::after {
  top: calc(100% - 1.6px);
}

.nav.is-open .nav__burger::before {
  top: calc(50% - 0.8px);
  transform: rotate(45deg);
}

.nav.is-open .nav__burger::after {
  top: calc(50% - 0.8px);
  transform: rotate(-45deg);
}

/* Full-screen sheet on small screens. */
.menu-sheet {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--nav-h) + 48px) var(--gutter) 36px;
  background: rgba(15, 16, 19, 0.86);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  backdrop-filter: blur(30px) saturate(150%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease-out), visibility 0s linear 0.45s;
}

.menu-sheet.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s var(--ease-out);
}

.menu-sheet__links {
  display: grid;
  gap: 6px;
}

.menu-sheet__links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 0;
  font-size: clamp(38px, 11vw, 56px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.05;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms);
}

.menu-sheet__links a span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--fg-3);
}

.menu-sheet.is-open .menu-sheet__links a {
  opacity: 1;
  transform: none;
}

.menu-sheet__foot {
  display: grid;
  gap: 14px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out) 0.25s, transform 0.6s var(--ease-out) 0.25s;
}

.menu-sheet.is-open .menu-sheet__foot {
  opacity: 1;
  transform: none;
}

@media (max-width: 820px) {
  .nav__links,
  .nav__cmd,
  .nav__resume {
    display: none;
  }

  .nav__menu {
    display: grid;
  }

  .nav__bar {
    height: 52px;
    padding: 0 4px 0 14px;
  }

  .nav.is-scrolled .nav__bar,
  .nav.is-open .nav__bar {
    max-width: 100%;
    background: rgba(24, 25, 30, 0.8);
    border-color: var(--line-2);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    backdrop-filter: blur(24px) saturate(170%);
  }
}

/* Scroll progress: a single hairline under the nav. */
.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 70;
  height: 2px;
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
  background: linear-gradient(90deg, rgba(41, 151, 255, 0), var(--accent) 30%, var(--accent-2));
  pointer-events: none;
  opacity: 0.85;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

site-footer {
  display: block;
}

.footer {
  position: relative;
  padding-top: var(--section-y);
  overflow: hidden;
}

.footer__glow {
  position: absolute;
  left: 50%;
  bottom: -40%;
  width: min(1400px, 140vw);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(41, 151, 255, 0.16), rgba(41, 151, 255, 0.05) 50%, transparent);
  pointer-events: none;
  filter: blur(10px);
}

.next-project {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  padding: clamp(28px, 4vw, 48px);
  margin-bottom: var(--section-y);
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  isolation: isolate;
  transition: border-color 0.5s, transform 0.7s var(--ease-out);
}

.next-project::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 140% at 100% 100%, var(--np-color, rgba(41, 151, 255, 0.3)), transparent 55%);
  opacity: 0.55;
  transition: opacity 0.6s var(--ease-out);
}

.next-project:hover {
  border-color: var(--line-2);
  transform: translateY(-4px);
}

.next-project:hover::before {
  opacity: 1;
}

.next-project__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 18px;
}

.next-project__title {
  font-size: clamp(40px, 7vw, 96px);
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.next-project__sub {
  margin-top: 14px;
  color: var(--fg-2);
}

.next-project__go {
  display: grid;
  place-items: center;
  width: clamp(56px, 7vw, 84px);
  height: clamp(56px, 7vw, 84px);
  border-radius: 50%;
  background: var(--fg);
  color: #000;
  transition: transform 0.7s var(--ease-spring);
}

.next-project__go .i {
  font-size: 26px;
}

.next-project:hover .next-project__go {
  transform: rotate(-45deg) scale(1.06);
}

.contact {
  position: relative;
  text-align: center;
}

.contact__title {
  font-size: clamp(48px, 9vw, 132px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.contact__title .contact__dim {
  display: block;
  color: var(--fg-3);
}

.contact__lede {
  max-width: 560px;
  margin: 28px auto 0;
}

.contact__email {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 44px;
  padding: 10px 10px 10px 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-2);
  font-size: clamp(16px, 2.1vw, 22px);
  font-weight: 550;
  letter-spacing: -0.02em;
  transition: border-color 0.4s, background-color 0.4s, transform 0.6s var(--ease-out);
}

.contact__email:hover {
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.08);
}

.contact__copy {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--fg);
  color: #000;
  overflow: hidden;
}

.contact__copy .i {
  position: absolute;
  font-size: 18px;
  transition: transform 0.5s var(--ease-spring), opacity 0.3s;
}

.contact__copy .i--check {
  transform: translateY(140%);
  opacity: 0;
}

.contact__email.is-copied .contact__copy .i--copy {
  transform: translateY(-140%);
  opacity: 0;
}

.contact__email.is-copied .contact__copy .i--check {
  transform: none;
  opacity: 1;
}

.contact__socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.footer__base {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  margin-top: var(--section-y);
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--fg-3);
}

.footer__base nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.footer__base a {
  transition: color 0.3s;
}

.footer__base a:hover {
  color: var(--fg);
}

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}

/* ── Command palette ─────────────────────────────────────────────────────── */

.cmdk {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: min(16vh, 140px) 16px 16px;
  background: rgba(8, 8, 10, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-out), visibility 0s linear 0.3s;
}

.cmdk.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s var(--ease-out);
}

.cmdk__panel {
  width: min(640px, 100%);
  max-height: min(560px, 72vh);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(28, 29, 34, 0.88);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-10px) scale(0.975);
  transition: transform 0.45s var(--ease-out);
}

.cmdk.is-open .cmdk__panel {
  transform: none;
}

.cmdk__search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  height: 60px;
  border-bottom: 1px solid var(--line);
}

.cmdk__search .i {
  font-size: 19px;
  color: var(--fg-3);
}

.cmdk__input {
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  letter-spacing: -0.015em;
}

.cmdk__input::placeholder {
  color: var(--fg-3);
}

.cmdk__list {
  overflow-y: auto;
  padding: 8px;
  overscroll-behavior: contain;
}

.cmdk__group {
  padding: 12px 12px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.cmdk__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 12px;
  text-align: left;
  font-size: 15px;
  color: var(--fg-2);
  scroll-margin: 8px;
}

.cmdk__item .i {
  font-size: 17px;
  flex-shrink: 0;
}

.cmdk__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--fg-2);
  flex-shrink: 0;
  overflow: hidden;
}

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

.cmdk__label {
  flex: 1;
  min-width: 0;
}

.cmdk__hint {
  font-size: 12.5px;
  color: var(--fg-3);
}

.cmdk__item.is-active {
  background: rgba(255, 255, 255, 0.075);
  color: var(--fg);
}

.cmdk__item.is-active .cmdk__icon {
  color: var(--fg);
  border-color: var(--line-2);
}

.cmdk__empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--fg-3);
  font-size: 14px;
}

.cmdk__foot {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--fg-3);
}

.cmdk__foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cmdk__foot kbd {
  height: 19px;
  min-width: 19px;
  font-size: 11px;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 130;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transform: translate(-50%, 24px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.55s var(--ease-spring), opacity 0.3s var(--ease-out);
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast .i {
  font-size: 18px;
  color: var(--green);
}

/* ── Lightbox ────────────────────────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(8, 8, 10, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  visibility: hidden;
  transition: background-color 0.45s var(--ease-out), backdrop-filter 0.45s, -webkit-backdrop-filter 0.45s, visibility 0s linear 0.45s;
}

.lightbox.is-open {
  visibility: visible;
  background: rgba(8, 8, 10, 0.86);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: background-color 0.45s var(--ease-out), backdrop-filter 0.45s, -webkit-backdrop-filter 0.45s;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  border-radius: 14px;
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.9);
  transform-origin: 0 0;
  will-change: transform;
}

.lightbox__caption {
  position: absolute;
  left: 50%;
  bottom: 24px;
  max-width: min(640px, calc(100% - 140px));
  transform: translateX(-50%);
  text-align: center;
  font-size: 14px;
  color: var(--fg-2);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out) 0.15s;
}

.lightbox.is-open .lightbox__caption {
  opacity: 1;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out), background-color 0.3s, transform 0.45s var(--ease-out);
}

.lightbox.is-open .lightbox__close,
.lightbox.is-open .lightbox__nav {
  opacity: 1;
}

.lightbox__close {
  top: 20px;
  right: 20px;
}

.lightbox__nav--prev {
  left: 20px;
  top: 50%;
  translate: 0 -50%;
}

.lightbox__nav--next {
  right: 20px;
  top: 50%;
  translate: 0 -50%;
}

[data-lightbox] {
  cursor: zoom-in;
}

/* ── Stats ───────────────────────────────────────────────────────────────── */

.stat__value {
  font-size: clamp(44px, 5.6vw, 76px);
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.012em;
}

.stat__note {
  margin-top: 4px;
  font-size: 13px;
  color: var(--fg-3);
}

/* ── Experience list ─────────────────────────────────────────────────────── */

.xp {
  border-top: 1px solid var(--line);
}

.xp__item {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.xp__head {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1.3fr) minmax(0, 1fr) 120px 32px;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 30px 0;
  text-align: left;
  transition: padding 0.5s var(--ease-out);
}

.xp__head::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--gutter) * -0.5);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  opacity: 0;
  transform: scaleY(0.9);
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
  z-index: -1;
}

.xp__head:hover::before,
.xp__item.is-open .xp__head::before {
  opacity: 1;
  transform: none;
}

.xp__when {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-3);
}

.xp__org {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 600;
  letter-spacing: -0.024em;
  line-height: 1.25;
}

.xp__logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex-shrink: 0;
  background: linear-gradient(145deg, #2b2c33, #1a1b20);
  border: 1px solid var(--line-2);
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
}

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

.xp__role {
  color: var(--fg-2);
  font-size: 15.5px;
}

.xp__where {
  color: var(--fg-3);
  font-size: 14px;
  text-align: right;
}

.xp__toggle {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  justify-self: end;
  transition: transform 0.6s var(--ease-spring), background-color 0.3s;
}

.xp__toggle::before,
.xp__toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--fg-2);
  transform: translate(-50%, -50%);
  transition: transform 0.5s var(--ease-out);
}

.xp__toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.xp__item.is-open .xp__toggle {
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(180deg);
}

.xp__item.is-open .xp__toggle::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.xp__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease-out);
}

.xp__item.is-open .xp__body {
  grid-template-rows: 1fr;
}

.xp__inner {
  min-height: 0;
  overflow: hidden;
}

.xp__content {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 24px;
  padding: 0 0 36px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.4s var(--ease-out), transform 0.6s var(--ease-out);
}

.xp__item.is-open .xp__content {
  opacity: 1;
  transform: none;
  transition-delay: 0.08s;
}

.xp__points {
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.xp__points li {
  position: relative;
  padding-left: 22px;
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.55;
}

.xp__points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 8px;
  height: 1px;
  background: var(--fg-3);
}

.xp__points strong {
  color: var(--fg);
  font-weight: 600;
}

.xp__chips {
  margin-top: 18px;
}

@media (max-width: 900px) {
  .xp__head {
    grid-template-columns: minmax(0, 1fr) 32px;
    grid-template-areas:
      "when toggle"
      "org toggle"
      "role toggle";
    row-gap: 8px;
    padding: 24px 0;
  }

  .xp__when {
    grid-area: when;
  }

  .xp__org {
    grid-area: org;
  }

  .xp__role {
    grid-area: role;
  }

  .xp__where {
    display: none;
  }

  .xp__toggle {
    grid-area: toggle;
  }

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

  .xp__content > :first-child {
    display: none;
  }
}

/* ── Split media section helper ──────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.split--reverse > :first-child {
  order: 2;
}

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

  .split--reverse > :first-child {
    order: 0;
  }
}

/* Feature list used by case studies. */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.feature {
  padding: 28px;
}

.feature__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--tone, var(--accent)) 16%, transparent);
  color: var(--tone, var(--accent));
  border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 26%, transparent);
}

.feature__icon .i {
  font-size: 21px;
}

.feature h3 {
  font-size: 18px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.feature p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-2);
}

/* Role list: what I actually did, as numbered rows. */
.roles {
  display: grid;
  border-top: 1px solid var(--line);
}

.role {
  display: grid;
  grid-template-columns: 64px minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.role__n {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-3);
  padding-top: 4px;
}

.role h3 {
  font-size: clamp(19px, 1.7vw, 22px);
  letter-spacing: -0.024em;
}

.role p {
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .role {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .role p {
    grid-column: 2;
  }
}

/* Spec sheet for architecture details. */
.spec {
  display: grid;
  border-top: 1px solid var(--line);
}

.spec__row {
  display: grid;
  grid-template-columns: minmax(140px, 0.36fr) minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.spec__key {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding-top: 3px;
}

.spec__val {
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.6;
}

.spec__val strong {
  color: var(--fg);
  font-weight: 600;
}

@media (max-width: 640px) {
  .spec__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

/* Case study hero shared bits. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-2);
  transition: color 0.3s;
}

.back-link .i {
  transition: transform 0.45s var(--ease-out);
}

.back-link:hover {
  color: var(--fg);
}

.back-link:hover .i {
  transform: translateX(-3px);
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: 26px 0;
  border-block: 1px solid var(--line);
}

.meta-row dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 8px;
}

.meta-row dd {
  font-size: 15px;
  color: var(--fg);
  line-height: 1.45;
}

@media (max-width: 760px) {
  .meta-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Gallery grid with hover zoom. */
.gallery {
  display: grid;
  gap: 16px;
}

.shot {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--surface);
}

.shot img {
  width: 100%;
  transition: transform 1.2s var(--ease-out);
}

.shot:hover img {
  transform: scale(1.03);
}

.shot figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--fg);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}

.shot:hover figcaption {
  opacity: 1;
  transform: none;
}

/* Horizontal scroller with snap. */
.rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding-inline: var(--gutter);
  padding-block: 10px 30px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

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

.rail > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

.rail-controls {
  display: flex;
  gap: 8px;
}

/* Marquee */
.marquee {
  --gap: 56px;
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
  display: flex;
  flex-shrink: 0;
  gap: var(--gap);
  padding-right: var(--gap);
  animation: marquee var(--duration, 40s) linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

@keyframes marquee {
  to {
    transform: translateX(-100%);
  }
}

/* Quote block */
.pullquote {
  font-size: clamp(26px, 3.3vw, 44px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

/* Only the authored second half dims. data-split wraps every word in
   span.w, and those must keep inheriting from whatever they sit in. */
.pullquote > span:not(.w) {
  color: var(--fg-3);
}

/* ── Motion ──────────────────────────────────────────────────────────────── */

/* Reveal-on-scroll. Only armed once JS has marked the document, so content is
   never hidden from a reader (or a crawler) that runs no script. */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  filter: blur(6px);
  transition:
    opacity 1s var(--ease-out),
    transform 1.2s var(--ease-out),
    filter 1s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 1ms);
}

.js [data-reveal="fade"] {
  transform: none;
}

.js [data-reveal="scale"] {
  transform: scale(0.94);
}

.js [data-reveal="left"] {
  transform: translate3d(-36px, 0, 0);
}

.js [data-reveal="right"] {
  transform: translate3d(36px, 0, 0);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Word-by-word headline reveal. */
.js [data-split] .w {
  display: inline-block;
  overflow: clip;
  overflow-clip-margin: 0.2em;
  vertical-align: top;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.js [data-split] .w > span {
  display: inline-block;
  transform: translate3d(0, 105%, 0) rotate(2deg);
  transform-origin: 0 100%;
  opacity: 0;
  transition:
    transform 1.1s var(--ease-out),
    opacity 0.8s var(--ease-out);
  transition-delay: calc(var(--wi, 0) * 42ms + var(--d, 0) * 1ms);
}

.js [data-split].is-in .w > span {
  transform: none;
  opacity: 1;
}

/* Stagger children */
.js [data-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: calc(var(--si, 0) * 70ms + var(--d, 0) * 1ms);
}

.js [data-stagger].is-in > * {
  opacity: 1;
  transform: none;
}

/* ── Page transitions (cross-document View Transitions) ──────────────────── */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vt-out 0.35s var(--ease-in-out) both;
}

::view-transition-new(root) {
  animation: vt-in 0.6s var(--ease-out) both;
}

::view-transition-group(*) {
  animation-duration: 0.6s;
  animation-timing-function: var(--ease-out);
}

@keyframes vt-out {
  to {
    opacity: 0;
    transform: scale(0.985);
    filter: blur(4px);
  }
}

@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
  }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@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: 0ms !important;
  }

  .js [data-reveal],
  .js [data-split] .w > span,
  .js [data-stagger] > * {
    opacity: 1;
    transform: none;
    filter: none;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ── Utilities ───────────────────────────────────────────────────────────── */

.center {
  text-align: center;
}

.mx-auto {
  margin-inline: auto;
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mt-48 { margin-top: 48px; }
.mt-64 { margin-top: 64px; }
.mt-96 { margin-top: 96px; }

.w-text {
  max-width: var(--maxw-text);
}

.nowrap {
  white-space: nowrap;
}

.relative {
  position: relative;
}

.hide-sm {
  display: initial;
}

@media (max-width: 640px) {
  .hide-sm {
    display: none;
  }
}
