/* ==========================================================================
   Mel Writes — site styles
   Minimal, bright, detail-oriented. Edit the tokens below to restyle.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #faf8f4;
  --ink: #111111;
  --ink-soft: #3d3d3d;
  --muted: #8a8a8a;
  --line: #e7e5e0;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;

  --font-sans: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 2.2vw, 32px);
  --max: 1600px;
  --header-h: 88px;

  --step--1: 0.8125rem;                          /* 13px — labels */
  --step-0: clamp(1.0625rem, 0.98rem + 0.3vw, 1.25rem);  /* body */
  --step-1: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
  --step-2: clamp(1.75rem, 1.3rem + 1.6vw, 2.75rem);    /* section titles */
  --step-3: clamp(2.125rem, 1.4rem + 2.8vw, 3.75rem);   /* pull quotes */
  --step-4: clamp(2.5rem, 1.4rem + 4.6vw, 6rem);        /* display */

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-feature-settings: "ss01", "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.015em; line-height: 1.12; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; font-size: var(--step--1);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Mono label — the small detail type used throughout */
.label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}
.label--ink { color: var(--ink); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 0 rgba(255, 90, 31, .5); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 31, .45); } 70%, 100% { box-shadow: 0 0 0 8px rgba(255, 90, 31, 0); } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

/* Inline links with a drawn underline */
.link {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .45s var(--ease), color .2s;
  padding-bottom: 1px;
}
.link:hover { color: var(--accent); background-size: 0 1px; background-position: 100% 100%; }

/* ---------- Meta strip + header ---------- */
.meta-strip {
  border-bottom: 1px solid var(--line);
}
.meta-strip .wrap {
  display: flex; gap: 24px; justify-content: space-between; align-items: center;
  min-height: 34px; flex-wrap: wrap;
}
.meta-strip .label { font-size: 11px; }
.meta-strip__group { display: flex; gap: 24px; }
@media (max-width: 640px) { .meta-strip__hide-sm { display: none; } }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 32px;
  min-height: var(--header-h); flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px;
}
.wordmark {
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.875rem);
  letter-spacing: -0.02em; line-height: 1; white-space: nowrap;
}
.wordmark:hover { color: var(--accent); }
.site-nav { display: flex; gap: clamp(16px, 2vw, 28px); flex-wrap: wrap; }
.site-nav a {
  position: relative; font-size: 1.0625rem; padding: 6px 0;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.site-nav a:hover::after, .site-nav a[aria-current]::after { transform: scaleX(1); transform-origin: left; }
.site-nav a[aria-current] { color: var(--ink); }

/* ---------- Sections ---------- */
.section { padding-top: clamp(64px, 9vw, 140px); }
.section-head {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px;
  border-top: 1px solid var(--ink);
  padding-top: 14px; margin-bottom: clamp(32px, 4.5vw, 64px);
}
.section-head__title { display: flex; gap: 20px; align-items: baseline; }
.section-head h2 { font-size: var(--step-2); }

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

/* ---------- Statement (home intro) ---------- */
.statement { padding-top: clamp(40px, 5vw, 72px); }
.statement h1 { font-size: var(--step-2); margin-bottom: clamp(28px, 3vw, 44px); }
.statement__text { grid-column: 1 / span 7; max-width: 46rem; }
.statement__text > p { color: var(--ink); }
.statement__figure { grid-column: 9 / span 4; margin: 0; padding-top: clamp(0px, 6vw, 88px); }
.pull {
  font-size: var(--step-3); line-height: 1.22; letter-spacing: -0.02em;
  margin: clamp(36px, 4vw, 56px) 0;
  text-wrap: balance;
}
.pull em { font-style: normal; color: var(--accent); }
@media (max-width: 900px) {
  .statement__text, .statement__figure { grid-column: 1 / -1; }
  .statement__figure { max-width: 420px; margin-top: 40px; padding-top: 0; }
}

/* ---------- Figures ---------- */
.figure { margin: 0; }
.figure__media { position: relative; overflow: hidden; background: var(--surface); }
.figure__media img, .figure__media video { width: 100%; height: 100%; object-fit: cover; }
.figure figcaption {
  display: flex; justify-content: space-between; gap: 16px;
  padding-top: 10px; border-top: 1px solid var(--line); margin-top: 10px;
}
.ratio-4x5 { aspect-ratio: 4 / 5; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-16x10 { aspect-ratio: 16 / 10; }

/* ---------- Work index ---------- */
.work-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(40px, 4vw, 64px) var(--gutter);
}
@media (max-width: 900px) { .work-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .work-grid { grid-template-columns: 1fr; } }
.work-group + .work-group { margin-top: clamp(72px, 9vw, 128px); }
.work-group__head {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr) auto; gap: 8px var(--gutter); align-items: baseline;
  border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: clamp(24px, 3vw, 40px);
}
.work-group__intro { margin: 0; color: var(--ink-soft); font-size: 1rem; }
@media (max-width: 700px) { .work-group__head { grid-template-columns: 1fr auto; } .work-group__intro { grid-column: 1 / -1; grid-row: 2; } }
.work-card { display: block; }
.work-card .figure__media img { transition: transform 1.1s var(--ease); }
.work-card:hover .figure__media img { transform: scale(1.035); }
.work-card__meta {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: baseline;
  border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px;
}
.work-card__title { font-size: var(--step-1); letter-spacing: -0.01em; line-height: 1.2; transition: color .2s; }
.work-card:hover .work-card__title { color: var(--accent); }
.work-card__tags { margin: 8px 0 0; }
.work-card__desc { color: var(--ink-soft); font-size: 1rem; margin: 6px 0 0; }
.arrow { display: inline-block; transition: transform .45s var(--ease); }
.work-card:hover .arrow, a:hover > .arrow { transform: translateX(4px); }

/* ---------- About / capabilities ---------- */
.about__lead { grid-column: 1 / span 7; font-size: var(--step-1); line-height: 1.45; letter-spacing: -0.005em; }
.about__aside { grid-column: 9 / span 4; }
.spec-list { list-style: none; margin: 0; padding: 0; }
.spec-list li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 1rem;
}
.spec-list li:first-child { border-top: 1px solid var(--line); }
.cap-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(32px, 4vw, 56px) var(--gutter); }
.cap .label + .label { display: block; margin-top: 2px; }
.cap h3 { font-size: var(--step-1); margin: 10px 0 10px; }
.cap p { color: var(--ink-soft); font-size: 1rem; }
.cap { border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 900px) {
  .about__lead, .about__aside { grid-column: 1 / -1; }
  .about__aside { margin-top: 40px; }
}
@media (max-width: 1000px) { .cap-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cap-grid { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.hero__eyebrow { display: block; margin-bottom: clamp(20px, 2.4vw, 32px); }
.hero__title { font-size: var(--step-3); line-height: 1.14; letter-spacing: -0.025em; text-wrap: balance; }
.hero__title em { font-style: normal; color: var(--accent); }
.hero__sub { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); margin-top: clamp(24px, 3vw, 40px); max-width: 40rem; }

/* ---------- About prose ---------- */
.prose { grid-column: 1 / span 7; }
.prose h3 { font-size: var(--step-2); margin-bottom: 0.8em; text-wrap: balance; }
.prose p { color: var(--ink-soft); max-width: 44rem; }
.prose p.prose__lead { color: var(--ink); font-size: var(--step-1); line-height: 1.45; }
.staccato { list-style: none; padding: 0; margin: 1.6em 0; display: flex; flex-wrap: wrap; gap: 8px; }
.staccato li { border: 1px solid var(--ink); padding: 6px 12px; font-size: 1rem; line-height: 1.3; border-radius: 999px; }
.staccato li:last-child { border-color: var(--accent); color: var(--accent); }
@media (max-width: 900px) { .prose { grid-column: 1 / -1; } }

/* Career path: media → … → analytics */
.path { grid-column: 1 / -1; margin-top: clamp(56px, 7vw, 104px); border-top: 1px solid var(--line); padding-top: 14px; }
.path ol { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 0; counter-reset: step; }
.path li { font-size: var(--step-1); letter-spacing: -0.01em; counter-increment: step; display: inline-flex; align-items: baseline; }
.path li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-right: 6px; transform: translateY(-0.7em); }
.path li:not(:last-child)::after { content: "→"; color: var(--muted); margin: 0 clamp(10px, 1.2vw, 18px); }
.path li:last-child { color: var(--accent); }

/* ---------- What I'm thinking about ---------- */
.thinking { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.thinking li { display: grid; grid-template-columns: 3fr 9fr; column-gap: var(--gutter); border-top: 1px solid var(--line); padding: clamp(24px, 3vw, 40px) 0; counter-increment: q; }
.thinking li:last-child { border-bottom: 1px solid var(--line); }
.thinking li::before { content: "Q." counter(q, decimal-leading-zero); font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: .06em; color: var(--muted); padding-top: 0.6em; }
.thinking h3 { font-size: var(--step-2); letter-spacing: -0.02em; text-wrap: balance; transition: color .2s; }
.thinking li:hover h3 { color: var(--accent); }
.thinking p { color: var(--ink-soft); margin: 12px 0 0; max-width: 44rem; }
.thinking__aside { font-style: italic; }
.thinking-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 700px) { .thinking li { grid-template-columns: 1fr; } .thinking li::before { padding: 0 0 10px; } }

/* ---------- Resume download ---------- */
.resume { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.resume__intro { grid-column: 1 / span 6; }
.resume__intro p { max-width: 34rem; color: var(--ink-soft); }
.resume__card {
  grid-column: 8 / span 5; min-width: 0;
  border: 1px solid var(--ink); background: var(--bg);
  padding: clamp(20px, 2.4vw, 32px);
  position: relative;
}
/* Registration marks on the card corners */
.resume__card::before, .resume__card::after {
  content: ""; position: absolute; width: 9px; height: 9px; border: 1px solid var(--accent);
}
.resume__card::before { top: -5px; left: -5px; }
.resume__card::after { bottom: -5px; right: -5px; }
.file-row { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.file-icon {
  flex: none; width: 44px; height: 56px; border: 1px solid var(--ink); position: relative;
  display: grid; place-items: end center; padding-bottom: 6px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em;
  clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%);
}
.file-icon::after { content: ""; position: absolute; top: -1px; right: -1px; width: 31%; height: 23%; border-left: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--surface); }
.file-row__name { font-size: 1.0625rem; line-height: 1.3; }
.captcha-slot { margin: 22px 0 18px; min-height: 65px; }
.btn {
  appearance: none; border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  font: inherit; font-size: 1rem; padding: 14px 20px; width: 100%;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  cursor: pointer; transition: background .25s, border-color .25s, color .25s;
}
.btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.btn:disabled { background: transparent; color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.form-status { min-height: 1.4em; margin: 12px 0 0; }
.form-status.is-error { color: #d0221b; }
.form-status.is-ok { color: #1a7f37; }
@media (max-width: 900px) {
  .resume { display: block; }
  .resume__card { margin-top: 32px; }
}

/* ---------- Footer / contact ---------- */
.site-footer { margin-top: clamp(96px, 12vw, 180px); border-top: 1px solid var(--ink); padding: 14px 0 32px; }
.contact-big {
  display: inline-block; font-size: min(var(--step-4), 7.4vw); letter-spacing: -0.035em; line-height: 1;
  margin: clamp(40px, 6vw, 80px) 0 clamp(48px, 7vw, 96px); word-break: break-word;
}
.contact-big:hover { color: var(--accent); }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
.footer-cols ul { list-style: none; padding: 0; margin: 8px 0 0; }
.footer-cols li { padding: 2px 0; font-size: 1rem; }
.colophon { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 64px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .footer-cols { grid-template-columns: 1fr 1fr; row-gap: 32px; } }

/* ==========================================================================
   Case study pages
   ========================================================================== */
.cs-hero { padding-top: clamp(32px, 4vw, 56px); }
.crumbs { display: flex; justify-content: space-between; gap: 16px; margin-bottom: clamp(40px, 6vw, 88px); }
.crumbs a:hover { color: var(--accent); }
.cs-title { font-size: var(--step-4); letter-spacing: -0.035em; line-height: 1.02; max-width: 15ch; text-wrap: balance; }
.cs-lede { grid-column: 1 / span 7; font-size: var(--step-1); line-height: 1.45; margin-top: clamp(28px, 3vw, 44px); color: var(--ink-soft); }
.cs-facts { grid-column: 9 / span 4; margin: clamp(28px, 3vw, 44px) 0 0; align-self: end; }
.cs-facts div { display: grid; grid-template-columns: 9rem 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.cs-facts div:first-child { border-top: 1px solid var(--ink); }
.cs-facts dt { margin: 0; } .cs-facts dd { margin: 0; }
@media (max-width: 900px) { .cs-lede, .cs-facts { grid-column: 1 / -1; } }

.cs-cover { margin-top: clamp(48px, 6vw, 88px); }

/* Chapter: sticky label on the left, prose on the right */
.chapter { padding-top: clamp(64px, 8vw, 128px); }
.chapter__label { grid-column: 1 / span 3; }
.chapter__label .label { position: sticky; top: calc(var(--header-h) + 24px); display: block; border-top: 1px solid var(--ink); padding-top: 12px; }
.chapter__body { grid-column: 5 / span 7; }
.chapter__body h2 { font-size: var(--step-2); margin-bottom: 0.7em; }
.chapter__body p { color: var(--ink-soft); }
.chapter__body p:first-of-type { color: var(--ink); }
.bullets { list-style: none; padding: 0; margin: 0 0 1em; counter-reset: b; }
.bullets li { position: relative; padding: 14px 0 14px 2.6em; border-top: 1px solid var(--line); color: var(--ink-soft); counter-increment: b; }
.bullets li:last-child { border-bottom: 1px solid var(--line); }
.bullets li::before { content: counter(b, decimal-leading-zero); position: absolute; left: 0; top: 17px; font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: .06em; color: var(--accent); }
@media (max-width: 900px) {
  .chapter__label, .chapter__body { grid-column: 1 / -1; }
  .chapter__label .label { position: static; margin-bottom: 20px; }
}

/* Full-bleed and paired media blocks */
.media-block { padding-top: clamp(48px, 6vw, 96px); }
.media-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.media-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.media-offset { grid-column: 5 / span 8; }
@media (max-width: 700px) {
  .media-pair, .media-trio { grid-template-columns: 1fr; }
  .media-offset { grid-column: 1 / -1; }
}

.cs-quote { grid-column: 3 / span 9; padding-top: clamp(64px, 8vw, 128px); }
.cs-quote blockquote { margin: 0; font-size: var(--step-3); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.cs-quote blockquote p { display: inline; margin: 0; }
.cs-quote blockquote { position: relative; }
.cs-quote blockquote::before { content: "“"; color: var(--accent); position: absolute; left: 0; top: 0; transform: translateX(-100%); }
.cs-quote figcaption { margin-top: 24px; }
@media (max-width: 900px) { .cs-quote { grid-column: 1 / -1; } }

.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); padding-top: clamp(64px, 8vw, 128px); }
.stat { border-top: 1px solid var(--ink); padding-top: 14px; }
.stat__num { display: block; font-size: var(--step-4); letter-spacing: -0.04em; line-height: 1; margin: 18px 0 10px; font-variant-numeric: tabular-nums; }
.stat__num sup { font-size: 0.4em; vertical-align: top; position: relative; top: 0.35em; color: var(--accent); margin-left: 2px; }
.stat p { color: var(--ink-soft); font-size: 1rem; max-width: 22rem; }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr; row-gap: 40px; } }

/* Data science project blocks */
.project { padding-top: clamp(72px, 9vw, 140px); }
.project--feature .project__title { font-size: var(--step-4); letter-spacing: -0.035em; }
.project__head { border-top: 1px solid var(--ink); padding-top: 14px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.project__title { font-size: var(--step-3); letter-spacing: -0.025em; margin: clamp(20px, 2.4vw, 32px) 0 clamp(28px, 3.5vw, 48px); max-width: 22ch; text-wrap: balance; }
.spec { grid-column: 1 / span 5; margin: 0; min-width: 0; }
.spec dl { margin: 0; }
.spec dl > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.spec dl > div:first-child { border-top: 1px solid var(--line); }
.spec dt { margin: 0; } .spec dd { margin: 0; color: var(--ink-soft); }
.project__media { grid-column: 7 / span 6; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); align-content: start; min-width: 0; }
@media (max-width: 900px) { .spec, .project__media { grid-column: 1 / -1; } .project__media { margin-top: 32px; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tags span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--line); padding: 3px 7px; color: var(--ink); }

/* Code snippets */
.code { margin: 0; border: 1px solid var(--ink); background: var(--bg); }
.code__bar { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.code pre { margin: 0; padding: 16px 14px 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.65; color: var(--ink); tab-size: 4; }
.code .c { color: var(--muted); }
.code .k { color: var(--accent); }

/* Next project */
.next-project { display: block; margin-top: clamp(96px, 12vw, 180px); border-top: 1px solid var(--ink); padding-top: 14px; }
.next-project__title { display: block; font-size: var(--step-4); letter-spacing: -0.035em; line-height: 1.02; margin-top: clamp(24px, 3vw, 40px); transition: color .2s; }
.next-project:hover .next-project__title { color: var(--accent); }

/* ==========================================================================
   Media components
   ========================================================================== */

/* YouTube — loads only on click (privacy + performance) */
.yt {
  position: relative; aspect-ratio: 16 / 9; background: #000 center / cover no-repeat;
  cursor: pointer; overflow: hidden;
}
.yt::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), transparent 30%, transparent 70%, rgba(0,0,0,.35)); transition: opacity .3s; }
.yt:hover::after { opacity: .6; }
.yt__btn {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  transition: transform .35s var(--ease);
}
.yt:hover .yt__btn { transform: translate(-50%, -50%) scale(1.08); }
.yt__btn svg { width: 26px; height: 26px; margin-left: 4px; }
.yt__title { position: absolute; z-index: 2; left: 20px; right: 20px; top: 16px; color: #fff; display: flex; justify-content: space-between; gap: 16px; }
.yt__title .label { color: #fff; }
.yt iframe, .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Paste-anything embed container (YouTube, Vimeo, Loom, Figma, Spotify…) */
.embed { position: relative; aspect-ratio: 16 / 9; background: var(--surface); overflow: hidden; }
.embed--auto { aspect-ratio: auto; }
.embed--auto iframe { position: static; }

/* Native video */
.video { position: relative; background: #000; }
.video video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* Custom audio player (progressively enhanced from <audio controls>) */
.audio {
  border: 1px solid var(--ink); padding: 18px clamp(16px, 2vw, 24px);
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px 20px; align-items: center;
  background: var(--bg);
}
.audio audio { grid-column: 1 / -1; width: 100%; }
.audio__play {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--ink); background: var(--bg);
  display: grid; place-items: center; cursor: pointer; grid-row: span 2; transition: background .2s, color .2s, border-color .2s;
}
.audio__play:hover, .audio.is-playing .audio__play { background: var(--accent); border-color: var(--accent); color: #fff; }
.audio__play svg { width: 18px; height: 18px; }
.audio__play .i-pause, .audio.is-playing .audio__play .i-play { display: none; }
.audio.is-playing .audio__play .i-pause { display: block; }
.audio__title { font-size: 1.0625rem; line-height: 1.3; }
.audio__time { font-family: var(--font-mono); font-size: var(--step--1); font-variant-numeric: tabular-nums; color: var(--muted); }
.audio__bar { grid-column: 2 / -1; position: relative; height: 22px; display: flex; align-items: center; }
.audio__bar input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; margin: 0; cursor: pointer; height: 22px; }
.audio__bar input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; background: linear-gradient(var(--accent), var(--accent)) 0 / var(--p, 0%) 100% no-repeat, var(--line);
}
.audio__bar input[type="range"]::-moz-range-track { height: 2px; background: var(--line); }
.audio__bar input[type="range"]::-moz-range-progress { height: 2px; background: var(--accent); }
.audio__bar input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); margin-top: -5px; }
.audio__bar input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ink); }
/* Tick marks under the scrubber — a small detail */
.audio__bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 10%);
}

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }
