/* =========================================================================
   Bao Nguyen — Wedding Planner Portfolio
   Mobile-first. Breakpoints: 640 (sm) · 768 (md) · 1024 (lg) · 1280 (xl)
   ========================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --stage: #000;
  --stage-2: #0d0d0d;
  --ivory: #fff;
  --paper: #f2f2f0;
  --ink: #0a0a0a;
  --charcoal: #18181a;
  --silver-hi: #f4f4f6;
  --silver: #cfcfd4;
  --silver-deep: #8c8c92;

  --font-sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "Space Mono", ui-monospace, Menlo, monospace;
  --font-display: "Anton", "Be Vietnam Pro", Impact, sans-serif;
  --font-script: "Pinyon Script", "Snell Roundhand", cursive;

  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section-y: clamp(5rem, 10vw, 8rem);
  --header-h: 4.5rem;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-soft: cubic-bezier(.16, 1, .3, 1);

  /* foreground tints; overridden per theme block below */
  --fg: var(--ivory);
  --fg-rgb: 255 255 255;
}

.dark { --fg: var(--ivory); --fg-rgb: 255 255 255; background: var(--stage); color: var(--ivory); }

/* ---------- 2. Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--stage);
  color: var(--ivory);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.1; overflow-wrap: break-word; }
em { font-style: italic; }
::selection { background: #6b6b6b; color: #fff; }

/* focus ring: white + black halo so it reads on both dark and light sections */
:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgb(0 0 0 / .85);
  border-radius: 2px;
}

.sr-only {
  position: absolute; 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: .75rem; left: .75rem; z-index: 200;
  padding: .6rem 1rem; background: #fff; color: #000;
  font: 700 .75rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
  transform: translateY(-200%); transition: transform .2s;
}
.skip-link:focus { transform: none; }

/* ---------- 3. Layout ---------- */
.container { width: 100%; max-width: 80rem; margin-inline: auto; padding-inline: var(--gutter); position: relative; }
.container--lg { max-width: 72rem; }

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

.section-head { position: relative; max-width: 42rem; margin-bottom: clamp(3rem, 6vw, 4rem); }
.section-head--wide { max-width: none; margin-bottom: clamp(3.5rem, 8vw, 5rem); }

/* ---------- 4. Typography ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgb(var(--fg-rgb) / .45);
  margin-bottom: 1rem;
}

.h-display { font-family: var(--font-serif); font-size: clamp(2.5rem, 8vw, 4.5rem); line-height: .95; }
.h-display--sans { font-family: var(--font-sans); font-weight: 900; text-transform: uppercase; margin-bottom: 1.5rem; }

.lead { color: rgb(var(--fg-rgb) / .6); line-height: 1.65; max-width: 42rem; }
.section-head .lead { margin-top: 1rem; }

/* soft pulsing glow, used by .echo on phones */
@keyframes text-glow {
  0%, 100% { text-shadow: 0 0 16px rgb(255 255 255 / .14), 0 0 3px rgb(255 255 255 / .10); }
  50%      { text-shadow: 0 0 34px rgb(255 255 255 / .34), 0 0 8px rgb(255 255 255 / .24); }
}

/* echo — stacked offset copies, done with text-shadow instead of 3 duplicate DOM nodes
   (the original duplicated markup was also read 4× by screen readers) */
@keyframes echo-glow {
  0%, 100% { text-shadow: 10px 8px 0 rgb(255 255 255 / .16), 20px 16px 0 rgb(255 255 255 / .10), 30px 24px 0 rgb(255 255 255 / .06), 0 0 16px rgb(255 255 255 / .14); }
  50%      { text-shadow: 10px 8px 0 rgb(255 255 255 / .16), 20px 16px 0 rgb(255 255 255 / .10), 30px 24px 0 rgb(255 255 255 / .06), 0 0 34px rgb(255 255 255 / .34); }
}
.echo { animation: text-glow 4.6s ease-in-out infinite; }
@media (min-width: 768px) {
  .echo { animation-name: echo-glow; padding-bottom: 24px; }
}

/* ---------- 5. Shared decorative layers ---------- */
.grain {
  position: absolute; inset: 0; opacity: .035; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 6. Buttons / tags ---------- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;   /* 44px — touch target */
  border: 1px solid rgb(255 255 255 / .2);
  color: inherit;
  transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s;
}
.icon-btn svg { width: 1rem; height: 1rem; }
.icon-btn:hover { background: #fff; color: #000; border-color: #fff; box-shadow: 0 0 26px -4px rgb(255 255 255 / .5); }

.tag {
  display: inline-block;
  font: .625rem var(--font-mono); letter-spacing: .15em; text-transform: uppercase;
  color: rgb(var(--fg-rgb) / .6);
  border: 1px solid rgb(var(--fg-rgb) / .25); border-radius: 999px; padding: .5rem 1rem;
}
.tag--sm { padding: .25rem .75rem; color: rgb(var(--fg-rgb) / .4); border-color: rgb(var(--fg-rgb) / .2); }

/* ---------- 7. Header + mobile nav ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  color: var(--ivory);
  transition: background-color .5s, box-shadow .5s, -webkit-backdrop-filter .5s, backdrop-filter .5s;
}
.site-header.is-scrolled {
  background: rgb(0 0 0 / .9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .3);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding-top: env(safe-area-inset-top); }
@media (min-width: 640px) { :root { --header-h: 5rem; } }

.brand { display: flex; align-items: center; gap: .75rem; }
.brand__badge {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .4);
  display: grid; place-items: center;
  font: italic 1.125rem var(--font-serif);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__name { font: italic 1.125rem var(--font-serif); letter-spacing: .025em; }
.brand__sub { font: .625rem var(--font-mono); letter-spacing: .25em; text-transform: uppercase; color: rgb(255 255 255 / .7); }

.menu-toggle {
  position: relative; z-index: 60;
  width: 2.75rem; height: 2.75rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.menu-toggle span { display: block; width: 24px; height: 1px; background: currentColor; transition: transform .35s var(--ease-out), opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(1.25rem, 4vh, 2rem);
  background: var(--stage); color: var(--ivory);
  clip-path: circle(0% at 100% 0%);
  visibility: hidden;
  transition: clip-path .5s cubic-bezier(.65, 0, .35, 1), visibility 0s .5s;
}
.mobile-nav.is-open { clip-path: circle(150% at 100% 0%); visibility: visible; transition-delay: 0s; }
.mobile-nav a { font: italic clamp(1.75rem, 7vw, 1.875rem) var(--font-serif); padding: .25rem 1rem; }
@media (min-width: 768px) { .menu-toggle, .mobile-nav { display: none; } }

/* ---------- 8. Floating dock (desktop) ---------- */
.dock { display: none; }
@media (min-width: 768px) {
  .dock {
    position: fixed; left: 50%; bottom: 1.5rem; z-index: 50;
    display: flex; align-items: center; gap: .5rem;
    padding: .75rem .875rem; border-radius: 999px;
    /* dark tinted base so the dock stays legible over bright photos */
    background: linear-gradient(145deg, rgb(255 255 255 / .08), rgb(255 255 255 / .02)), rgb(10 10 10 / .6);
    border: 1px solid rgb(255 255 255 / .12);
    box-shadow: 0 20px 45px -12px rgb(0 0 0 / .7), inset 0 1px 1px rgb(255 255 255 / .12);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    transform: translateX(-50%);
    animation: dock-in .7s var(--ease-out) both;
  }
}
@keyframes dock-in {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.dock__item {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .08);
  color: rgb(255 255 255 / .55);
  transform-origin: bottom center;
  transition: transform .18s var(--ease-out), background-color .25s, color .25s, border-color .25s;
}
.dock__item svg { width: 18px; height: 18px; }
.dock__item:hover, .dock__item:focus-visible { background: rgb(255 255 255 / .16); color: #fff; border-color: rgb(255 255 255 / .3); }
.dock__item.is-active { background: #fff; color: #000; border-color: #fff; }
.dock__tip {
  position: absolute; bottom: calc(100% + 12px); left: 50%;
  transform: translate(-50%, 4px);
  white-space: nowrap; pointer-events: none; opacity: 0;
  font: .625rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
  background: rgb(0 0 0 / .9); color: #fff; border: 1px solid rgb(255 255 255 / .15);
  padding: 5px 10px; border-radius: 6px;
  transition: opacity .2s, transform .2s;
}
.dock__item:hover .dock__tip, .dock__item:focus-visible .dock__tip { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 9. Hero ----------
   Visual-only: one centred silver vinyl. Stacking: texture (0) · vinyl (1) · bottom fade (2).
   --p is scroll progress through the hero (0–1), set from JS.
   --hero-pad is equal top and bottom so the disc sits at the true centre while
   clearing the header (phones) or the dock (768px+). */
.hero {
  --hero-pad: calc(var(--header-h) + .5rem);
  position: relative; overflow: hidden; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  /* woven charcoal: soft light pool behind the disc + fine dot weave */
  background:
    radial-gradient(circle at 50% 50%, rgb(255 255 255 / .07), transparent 55%),
    radial-gradient(rgb(255 255 255 / .045) 1px, transparent 1.4px) 0 0 / 4px 4px,
    linear-gradient(#141416, var(--charcoal) 55%, #0b0b0c);
}
.hero::after { /* melt into the black About section */
  content: ""; position: absolute; inset: auto 0 0; height: 22%; z-index: 2; pointer-events: none;
  background: linear-gradient(transparent, var(--stage));
}
.hero .grain { opacity: .08; }

.hero__inner {
  flex: 1; display: grid; place-items: center;
  padding: var(--hero-pad) var(--gutter);
}

/* vinyl */
.hero__visual {
  position: relative; z-index: 1;
  width: min(88vw, calc(100svh - 2 * var(--hero-pad)), 46rem);
  perspective: 1400px;
  animation: vinyl-in 1.6s var(--ease-soft) both;
}
.hero__visual::before { /* soft white halo under the disc */
  content: ""; position: absolute; inset: 6%; border-radius: 50%; z-index: -1;
  background: #fff; filter: blur(80px); opacity: .09;
}
@keyframes vinyl-in {
  from { opacity: 0; translate: 0 8%; rotate: -50deg; scale: .9; }
}
.vinyl {
  position: relative; aspect-ratio: 1;
  transform:
    translate3d(0, calc(var(--p, 0) * 14%), 0) scale(calc(1 - var(--p, 0) * .12))
    rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .7s var(--ease-soft);
}
.vinyl__disc {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background:
    /* two quiet track gaps */
    radial-gradient(circle closest-side, transparent 52%, rgb(0 0 0 / .16) 52.4% 53.2%, transparent 53.6% 74%, rgb(0 0 0 / .16) 74.4% 75.2%, transparent 75.6%),
    /* brushed silver: brighter mid, falling off towards label and rim */
    radial-gradient(circle closest-side, var(--silver-deep) 30%, var(--silver) 40%, var(--silver-hi) 68%, var(--silver) 92%, var(--silver-deep) 100%);
  box-shadow: 0 50px 90px -30px rgb(0 0 0 / .9), 0 0 0 1px rgb(0 0 0 / .5);
  rotate: calc(var(--p, 0) * 200deg);
  animation: vinyl-spin 30s linear infinite;
  transition: rotate .6s var(--ease-soft);
  will-change: transform;
}
.vinyl__disc::after { /* grooves pressed over the print, kept off the label */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-radial-gradient(circle closest-side, rgb(0 0 0 / .1) 0 1px, transparent 1px 3px);
  -webkit-mask: radial-gradient(circle closest-side, transparent 33%, #000 33.4% 98%, transparent 98.4%);
          mask: radial-gradient(circle closest-side, transparent 33%, #000 33.4% 98%, transparent 98.4%);
}
.hero.is-offscreen .vinyl__disc { animation-play-state: paused; }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }

.vinyl__art { width: 100%; height: 100%; }
.vinyl__print { mix-blend-mode: multiply; fill: #0e0e10; }
.vinyl__rim { font: 26px var(--font-display); letter-spacing: 2px; text-transform: uppercase; opacity: .8; }
.vinyl__big { font: 150px var(--font-display); letter-spacing: 6px; text-transform: uppercase; opacity: .9; }
.vinyl__label { fill: #111113; }
.vinyl__ring { fill: none; stroke: var(--silver-hi); stroke-width: 1.5; opacity: .5; }
.vinyl__ring--inner { opacity: .25; }
.vinyl__label-text { font: 18px var(--font-mono); letter-spacing: 3px; text-transform: uppercase; fill: var(--silver); }
.vinyl__hole { fill: var(--charcoal); stroke: rgb(255 255 255 / .4); stroke-width: 2; }

/* the light source stays still while the disc turns; it swings slightly with the tilt.
   Bright and dark bands together read as polished metal rather than plain grey. */
.vinyl__sheen {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 210deg,
    transparent 0deg, rgb(255 255 255 / .55) 16deg, transparent 40deg,
    rgb(0 0 0 / .14) 95deg, transparent 140deg,
    transparent 180deg, rgb(255 255 255 / .4) 196deg, transparent 220deg,
    rgb(0 0 0 / .12) 275deg, transparent 320deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 34%, #000 36% 97%, transparent 99%);
          mask: radial-gradient(circle closest-side, transparent 34%, #000 36% 97%, transparent 99%);
  rotate: calc(var(--ry, 0deg) * 3);
  transition: rotate .7s var(--ease-soft);
}

/* 768px+: the dock sits at the bottom, so pad both ends to clear it */
@media (min-width: 768px) { .hero { --hero-pad: 6.5rem; } }

/* ---------- 10–12. Profile: one CV-style sheet (about · journey · expertise) ----------
   Intro row (avatar · bubble · name), then three columns — on pitch black
   with a slow silver glow standing in for the reference's colour blob.
   Entrance motion lives in section 18. */
.profile { padding-block: clamp(3rem, 6vw, 5rem) clamp(6rem, 12vw, 9rem); }
.profile__glow {
  position: absolute; left: 62%; top: 55%; width: min(80vw, 54rem); aspect-ratio: 1;
  border-radius: 50%; pointer-events: none; filter: blur(90px);
  background: radial-gradient(circle, rgb(255 255 255 / .11), rgb(205 205 215 / .045) 45%, transparent 70%);
  translate: -50% -50%;
  animation: profile-drift 18s ease-in-out infinite alternate;
}
@keyframes profile-drift { to { translate: -40% -58%; scale: 1.12; } }
.profile__sheet { position: relative; z-index: 1; }

/* intro row: avatar + name on phones with the bubble below; one line from 1024px */
.profile__top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1.5rem; }
.profile__avatar {
  width: clamp(5.5rem, 11vw, 9rem); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: var(--stage-2);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .18), 0 0 0 9px rgb(255 255 255 / .03);
}
.profile__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; filter: grayscale(1) contrast(1.05); }
.profile__bubble {
  grid-column: 1 / -1; order: 3;
  padding: 1.25rem 1.5rem; border: 1px solid rgb(255 255 255 / .3); border-radius: 1.75rem;
  font-size: .875rem; line-height: 1.75; color: rgb(255 255 255 / .58);
}
.profile__bubble strong { font-weight: 600; color: var(--paper); }
.profile__name { font: 300 clamp(2rem, 2.6vw + 1.1rem, 3.25rem)/1.05 var(--font-serif); letter-spacing: -.01em; color: var(--paper); }
.profile__meta { margin-top: .75rem; font: italic .875rem/1.6 var(--font-serif); color: rgb(255 255 255 / .55); }
@media (min-width: 1024px) {
  .profile__top { grid-template-columns: auto minmax(0, 1fr) auto; gap: 2.5rem; }
  .profile__bubble { grid-column: auto; order: 0; border-radius: 999px; padding: 1.5rem 2.75rem; font-size: .8125rem; }
  .profile__id { text-align: right; }
}

/* three columns; the narrow side column drops below as a row of three on tablets */
.profile__cols { display: grid; gap: 3.5rem; margin-top: clamp(3.5rem, 7vw, 5.5rem); }
.profile__col { display: grid; gap: 3.25rem; align-content: start; }
@media (min-width: 768px) {
  .profile__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3.5rem; }
  .profile__col--side { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
}
@media (min-width: 1100px) {
  .profile__cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, .8fr); gap: 4rem; }
  .profile__col--side { grid-column: auto; grid-template-columns: none; gap: 3.25rem; }
}

.cv-block__title { margin-bottom: 1.5rem; font: 300 clamp(1.75rem, 1.4vw + 1.25rem, 2.375rem)/1.1 var(--font-serif); color: var(--paper); }
.cv-list { display: grid; gap: 1.375rem; }
.cv-list--tight { gap: 1rem; }
.cv-list h4 { font: 600 .9375rem/1.4 var(--font-sans); color: var(--paper); }
.cv-list p { margin-top: .2rem; font-size: .8125rem; line-height: 1.55; color: rgb(255 255 255 / .5); }
.cv-list a { overflow-wrap: anywhere; transition: color .3s; } /* long email in a narrow column */
.cv-list a:hover { color: #fff; }
.cv-bullets { display: grid; gap: .3rem; margin-top: .75rem; font-size: .8125rem; line-height: 1.55; color: rgb(255 255 255 / .62); }
.cv-bullets li { position: relative; padding-left: 1rem; }
.cv-bullets li::before { content: ""; position: absolute; left: .1rem; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.cv-bullets--plain { margin-top: 0; gap: .5rem; font-size: .875rem; }

/* skill levels: ten dots per row; the filled ones grow in on reveal */
.levels { display: grid; gap: 1.125rem; }
.levels li { display: grid; gap: .55rem; }
.levels li > span:first-child { font: 600 .9375rem var(--font-sans); color: var(--paper); }
.level {
  --step: 1.375rem; --dot: 5.5px;
  position: relative; display: block; width: calc(10 * var(--step)); height: calc(2 * var(--dot) + 2px);
  background: radial-gradient(circle, transparent calc(var(--dot) - 1.6px), rgb(255 255 255 / .55) calc(var(--dot) - 1px) var(--dot), transparent calc(var(--dot) + .6px)) 0 0 / var(--step) 100% repeat-x;
}
.level::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--n) * var(--step));
  background: radial-gradient(circle, var(--paper) var(--dot), transparent calc(var(--dot) + .6px)) 0 0 / var(--step) 100% repeat-x;
}

/* roles: outlined pills, like the reference's language tags */
.roles { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.roles li {
  display: grid; padding: .7rem 1.75rem .75rem 1.5rem;
  border: 1px solid rgb(255 255 255 / .35); border-radius: 999px;
  transition: border-color .3s, background-color .3s;
}
.roles li:hover { border-color: #fff; background: rgb(255 255 255 / .04); }
.roles strong { font: 600 .9375rem/1.3 var(--font-sans); color: var(--paper); }
.roles span { font-size: .8125rem; color: rgb(255 255 255 / .5); }

/* ---------- 13. On set strip (closes the portfolio section) ----------
   Header reuses .project__head; the strip bleeds right but starts flush
   with the container's left edge. */
.onset { --edge: max(var(--gutter), (100% - 80rem) / 2 + var(--gutter)); }
.onset__text { max-width: 24rem; color: rgb(255 255 255 / .55); font-size: .875rem; line-height: 1.65; }
@media (min-width: 768px) { .project__head .onset__text { justify-self: end; } }

.strip {
  position: relative; display: flex; gap: 1rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge, var(--gutter));
  padding: 0 var(--gutter) 1rem var(--edge, var(--gutter));
  scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .3) transparent;
  -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-thumb { background: rgb(255 255 255 / .3); border-radius: 3px; }
.strip li { flex: none; scroll-snap-align: start; }
.strip img {
  height: clamp(15rem, 55vw, 20rem); width: auto; max-width: none;
  border-radius: 2px; object-fit: cover;
  filter: grayscale(.85) contrast(1.05); transition: filter .6s;
}
.strip img:hover { filter: grayscale(0) contrast(1.05); }

/* ---------- 14. Portfolio mosaic ---------- */
.project { margin-bottom: clamp(5rem, 10vw, 7rem); }
.project__head { display: grid; gap: 1.5rem; align-items: end; margin-bottom: 2rem; }
.project__meta { font: .75rem var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: rgb(255 255 255 / .5); margin-bottom: .75rem; }
.project__title { font: italic clamp(1.875rem, 3vw + 1.2rem, 3rem)/1.1 var(--font-serif); }
.project__head .tag { justify-self: start; }
@media (min-width: 768px) {
  .project__head { grid-template-columns: 2fr 1fr; gap: 2rem; }
  .project__head .tag { justify-self: end; }
}

/* 4-col mosaic; every project uses the same 9-tile rhythm, so spans live
   in CSS instead of being repeated as classes on 27 buttons */
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 130px; gap: .75rem; }
.mosaic > * { grid-column: span 2; }
.mosaic > :nth-child(1) { grid-column: span 4; grid-row: span 2; }
.mosaic > :nth-child(2) { grid-row: span 2; }
.mosaic > :nth-child(5) { grid-column: span 4; grid-row: span 2; }
.mosaic > :nth-child(8),
.mosaic > :nth-child(9) { grid-column: span 4; }      /* no orphan hole on phones */
/* 12-tile variant: two tall portraits, then a full-width closer */
.mosaic--12 > :nth-child(10), .mosaic--12 > :nth-child(11) { grid-row: span 2; }
.mosaic--12 > :nth-child(12) { grid-column: 1 / -1; grid-row: span 2; }
@media (min-width: 640px) {
  .mosaic { grid-auto-rows: 170px; }
  .mosaic > :nth-child(5) { grid-column: span 2; }
  .mosaic > :nth-child(8), .mosaic > :nth-child(9) { grid-column: span 2; }
}
@media (min-width: 768px) {
  .mosaic { grid-auto-rows: 210px; }
  .mosaic > :nth-child(1) { grid-column: span 2; }
}

/* tile — desaturated by default, colour revealed on hover (editorial B&W convention) */
.tile { position: relative; overflow: hidden; border-radius: 2px; background: var(--stage-2); }
.tile img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(.85) contrast(1.05);
  transition: transform .7s cubic-bezier(.2, .7, .2, 1), filter .6s;
}
.tile::after { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / 0); transition: background-color .4s; }
@media (hover: hover) {
  .tile:hover img { transform: scale(1.08); filter: grayscale(0) contrast(1.05); }
  .tile:hover::after { background: rgb(0 0 0 / .2); }
}
.tile:focus-visible img { filter: grayscale(0) contrast(1.05); }

/* ---------- 15. Sket&Render expanding cards ----------
   Pure CSS sizing via flex-grow — vertical stack on phones, horizontal
   accordion from 768px. JS only toggles [data-active]. */
.sr-group { position: relative; margin-bottom: 4rem; }
.sr-group:last-child { margin-bottom: 0; }
.sr-group__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin-bottom: 1.25rem; }
.sr-group__num { font: .75rem var(--font-mono); letter-spacing: .2em; color: rgb(255 255 255 / .45); }
.sr-group__title { font: italic clamp(1.25rem, 1vw + 1rem, 1.5rem) var(--font-serif); }

.xcards { display: flex; flex-direction: column; gap: 3px; width: 100%; }
.xcard {
  position: relative; overflow: hidden; cursor: pointer;
  background: #0a0a0a;
  height: 64px; flex: none;
  transition: height .5s var(--ease-out), flex-grow .5s var(--ease-out);
}
.xcard[data-active="true"] { height: min(420px, 62svh); cursor: default; }
.xcard > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05); transform: scale(1.12);
  transition: filter .5s, transform .5s;
}
.xcard[data-active="true"] > img { filter: grayscale(0) contrast(1.05); transform: none; }
.xcard::before { /* scrim */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgb(0 0 0 / .9), rgb(0 0 0 / .28) 55%, transparent 85%);
}
.xcard:not([data-active="true"])::before { background: rgb(0 0 0 / .45); }

.xcard__label {
  position: absolute; left: 1.125rem; top: 50%; z-index: 2; transform: translateY(-50%);
  font: .6875rem var(--font-mono); letter-spacing: .16em; text-transform: uppercase;
  color: rgb(255 255 255 / .8); white-space: nowrap;
  transition: opacity .3s;
}
.xcard[data-active="true"] .xcard__label { opacity: 0; }

.xcard__body {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .625rem;
  padding: 1.5rem 1.5rem 2rem;
  pointer-events: none;
}
.xcard__body::before { /* icon — sketch = cube, render = sparkle, build = panel, photo = camera; drawn with a CSS mask */
  content: ""; width: 28px; height: 28px; background: #fff;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.xcard[data-kind="sketch"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Cpath d='M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z'/%3E%3Cpath d='M12 3v18M4 7.5l8 4.5 8-4.5'/%3E%3C/svg%3E"); }
.xcard[data-kind="build"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Crect x='5' y='3' width='14' height='18' rx='1'/%3E%3Cpath d='M12 3v18M5 9h14M5 15h14'/%3E%3C/svg%3E"); }
.xcard[data-kind="photo"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Cpath d='M3 8a2 2 0 0 1 2-2h2.5l1.5-2h6l1.5 2H19a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.xcard[data-kind="render"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c.6 3.6 2.4 5.4 6 6-3.6.6-5.4 2.4-6 6-.6-3.6-2.4-5.4-6-6 3.6-.6 5.4-2.4 6-6z'/%3E%3C/svg%3E"); }
.xcard__title { font: italic clamp(1.25rem, 2.4vw, 2rem) var(--font-serif); }
.xcard__desc { font-size: clamp(.85rem, 1.1vw, 1rem); line-height: 1.5; color: rgb(255 255 255 / .85); max-width: 26rem; }
.xcard__body > *, .xcard__body::before { opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
.xcard[data-active="true"] .xcard__body::before { opacity: 1; transform: none; transition-delay: .05s; }
.xcard[data-active="true"] .xcard__title { opacity: 1; transform: none; transition-delay: .12s; }
.xcard[data-active="true"] .xcard__desc { opacity: 1; transform: none; transition-delay: .19s; }

.xcard__expand {
  position: absolute; top: 1.125rem; right: 1.125rem; z-index: 3;
  width: 2.75rem; height: 2.75rem;
  border-color: rgb(255 255 255 / .3); color: rgb(255 255 255 / .85);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .3s, transform .3s, background-color .3s, color .3s, border-color .3s, box-shadow .3s;
}
.xcard[data-active="true"] .xcard__expand { opacity: 1; transform: none; pointer-events: auto; transition-delay: .1s; }

@media (min-width: 768px) {
  .xcards { flex-direction: row; height: clamp(440px, 58vh, 640px); }
  .xcard, .xcard[data-active="true"] { height: auto; flex: 1 1 0; min-width: 0; }
  .xcard[data-active="true"] { flex-grow: 5; }
  .xcards:has(> :nth-child(7)) .xcard[data-active="true"] { flex-grow: 9; } /* long groups: keep the open card roomy */
  .xcards:has(> :nth-child(12)) .xcard[data-active="true"] { flex-grow: 14; }
  .xcard__label { /* vertical label on narrow columns */
    top: auto; left: 22px; bottom: 28px;
    transform-origin: left bottom; transform: rotate(-90deg) translateX(0);
    font-size: .75rem; letter-spacing: .18em;
  }
  .xcard__body { padding: 2rem 2.5rem 2.75rem; gap: .875rem; }
  .xcard__expand { top: 1.5rem; right: 1.5rem; }
}

/* ---------- 16. Footer: closing card ----------
   Ticker · "This Exciting Journey" (caps over a big script word) · two
   numbered columns. Charcoal rather than pitch black so it reads as an end card. */
.footer {
  position: relative; overflow: hidden;
  background: #171718;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ticker: label · rule · label · rule … sliding left */
.ticker { overflow: hidden; padding-block: 1.25rem; }
.ticker__track { display: flex; align-items: center; width: max-content; animation: ticker 40s linear infinite; }
.ticker__track span {
  flex: none; padding-inline: 2.25rem;
  font: 400 .75rem/1.35 var(--font-sans); letter-spacing: .02em; text-transform: uppercase;
  color: rgb(255 255 255 / .85);
}
.ticker__track i { flex: none; width: clamp(6rem, 12vw, 12rem); height: 1px; background: rgb(255 255 255 / .6); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* title: script word sits across the caps, the way the reference stacks them */
.finale {
  position: relative; display: grid; justify-content: center;
  grid-template-columns: auto; justify-items: center;
  margin: clamp(3rem, 7vw, 5rem) auto 0; padding-inline: var(--gutter);
  font-weight: 400; line-height: 1;
  color: var(--paper);
}
.finale__word { position: relative; z-index: 1; font: 400 clamp(2.75rem, 7.5vw, 5.5rem)/.95 var(--font-sans); letter-spacing: -.01em; text-transform: uppercase; }
.finale__word--this { justify-self: center; translate: -18% 0; }
.finale__word--journey { justify-self: center; translate: -8% 0; }
.finale__script {
  position: relative; z-index: 2; margin-block: -.42em -.38em;
  font: 400 clamp(5.5rem, 20vw, 15rem)/1 var(--font-script);
  translate: 4% 0;
}
.finale__end {
  margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1.5px solid currentColor;
  min-width: min(20rem, 70vw); text-align: center;
  font: 400 clamp(1rem, 1.6vw, 1.5rem) var(--font-sans); letter-spacing: .02em; text-transform: uppercase;
}

/* entrance: words rise in turn, the script word draws in with a soft blur, the rule grows */
.js .finale > * { opacity: 0; transition: opacity 1s var(--ease-soft), transform 1s var(--ease-soft), filter 1.2s var(--ease-soft); }
.js .finale__word { transform: translateY(30px); }
.js .finale__script { transform: translateY(20px) scale(.96); filter: blur(10px); transition-delay: .15s; }
.js .finale__word--journey { transition-delay: .3s; }
.js .finale__end { transform: translateY(14px); transition-delay: .45s; }
.js .finale.is-in > * { opacity: 1; transform: none; filter: none; }

.finale__cols {
  display: grid; gap: 3rem;
  margin-top: clamp(3rem, 6vw, 4rem); padding-bottom: clamp(3rem, 6vw, 4rem);
}
.finale__num {
  display: grid; place-items: center; width: 5rem; height: 5rem; margin-bottom: 2rem;
  border: 1px solid rgb(255 255 255 / .75); border-radius: 50%;
  font: 300 1.75rem var(--font-sans); color: var(--paper);
}
.finale__heading { margin-bottom: 1rem; font: 500 clamp(1.5rem, 2vw, 1.875rem)/1.1 var(--font-sans); text-transform: uppercase; color: var(--paper); }
.finale__text { max-width: 21rem; font-size: .9375rem; line-height: 1.55; color: rgb(255 255 255 / .82); }
.finale__contact { display: grid; gap: .2rem; }
.finale__contact a { overflow-wrap: anywhere; transition: color .3s; }
.finale__contact a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 768px) {
  .finale__cols { grid-template-columns: 1fr 1fr; margin-top: -2.5rem; } /* circles tuck beside the title as in the reference */
  .finale__col--end { justify-self: end; }
  .finale__col--end .finale__num { margin-left: 4rem; }
}

.footer__copy {
  padding-block: 1.5rem; border-top: 1px solid rgb(255 255 255 / .1);
  font: .625rem var(--font-mono); letter-spacing: .15em; text-transform: uppercase; color: rgb(255 255 255 / .4);
}
@media (min-width: 768px) { .footer__copy { padding-bottom: 7rem; } } /* clear the dock */

/* ---------- 17. Lightbox (<dialog>) ---------- */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none;
  padding: 1rem; border: 0;
  background: rgb(0 0 0 / .92); color: var(--ivory);
  align-items: center; justify-content: center;
}
.lightbox[open] { display: flex; animation: fade-in .25s ease; }
.lightbox::backdrop { background: rgb(0 0 0 / .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes fade-in { from { opacity: 0; } }
.lightbox__figure { max-width: 64rem; width: 100%; text-align: center; touch-action: pan-y; }
.lightbox__img {
  margin-inline: auto; max-height: 78vh; max-height: 78svh; width: auto;
  border-radius: 2px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / .8);
  user-select: none; -webkit-user-drag: none;
}
.lightbox__caption { margin-top: 1rem; display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; font: .6875rem/1.5 var(--font-mono); letter-spacing: .05em; color: rgb(255 255 255 / .6); padding-inline: 3rem; }
.lightbox__count { color: rgb(255 255 255 / .4); }
.lightbox__btn { position: absolute; z-index: 2; border-color: rgb(255 255 255 / .3); background: rgb(0 0 0 / .4); }
.lightbox__close { top: max(1rem, env(safe-area-inset-top)); right: 1rem; }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: .75rem; }
.lightbox__next { right: .75rem; }
/* phones: arrows drop to the bottom corners so they never cover the photo */
@media (max-width: 639px) {
  .lightbox__prev, .lightbox__next { top: auto; bottom: max(1rem, env(safe-area-inset-bottom)); transform: none; }
}
@media (min-width: 640px) {
  .lightbox__close { top: 1.5rem; right: 1.5rem; }
  .lightbox__prev { left: 1.5rem; }
  .lightbox__next { right: 1.5rem; }
}

/* ---------- 18. Scroll reveal (replaces AOS) ---------- */
.js [data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.215, .61, .355, 1), transform .8s cubic-bezier(.215, .61, .355, 1);
  transition-delay: var(--delay, 0ms);
}
.js [data-reveal="left"] { transform: translateX(-24px); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* [data-stagger]: children rise one after another (--i set in JS) */
.js [data-stagger] > * {
  opacity: 0; transform: translateY(18px);
  transition: opacity .8s cubic-bezier(.215, .61, .355, 1), transform .8s cubic-bezier(.215, .61, .355, 1);
  transition-delay: calc(var(--i, 0) * 90ms + 150ms);
}
.js [data-stagger].is-in > * { opacity: 1; transform: none; }

/* skill dots fill left-to-right once their row has risen in */
.js [data-stagger] .level::before { width: 0; transition: width 1.2s var(--ease-soft); transition-delay: calc(var(--i, 0) * 90ms + 450ms); }
.js [data-stagger].is-in .level::before { width: calc(var(--n) * var(--step)); }

/* [data-split]: words slide up out of a clipping mask (wrapped in JS).
   The mask is padded so Vietnamese stacked diacritics aren't clipped. */
.split__word { display: inline-block; overflow: hidden; vertical-align: top; padding-block: .14em .06em; margin-block: -.14em -.06em; }
.split__inner { display: inline-block; }
.js [data-split] .split__inner {
  transform: translateY(105%); opacity: 0;
  transition: transform 1s var(--ease-soft), opacity .6s;
  transition-delay: calc(var(--i, 0) * 60ms);
}
.js [data-split].is-in .split__inner { transform: none; opacity: 1; }

/* ---------- 19. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .js [data-reveal], .js [data-stagger] > *, .js [data-split] .split__inner, .js .finale > * { opacity: 1; transform: none; filter: none; }
  .ticker__track { animation: none; }
  .js [data-stagger] .level::before { width: calc(var(--n) * var(--step)); }
  .xcard > img { transform: none; }
  .vinyl, .vinyl__disc, .vinyl__sheen { transform: none; rotate: none; }
}
