/* ==========================================================================
   Djazzbones — portfolio
   Tokens (+ themes) → base → top bar / menu / loader → sections → gallery → responsive
   See DESIGN.md for the rationale behind every value.
   ========================================================================== */

:root {
  --bg: #0b0a0f;
  --bg-2: #14121c;
  --ink: #f1ebe0;
  --ink-2: rgba(241, 235, 224, .55);
  --ink-3: rgba(241, 235, 224, .28);
  --line: rgba(241, 235, 224, .16);

  /* Theme: --accent is tweened by GSAP; --accent-ink switches instantly with [data-theme]. */
  --purple: #8A3FFC;
  --orange: #E8461E;
  --blue: #2F7CFF;
  --accent: var(--purple);
  --accent-ink: #f1ebe0;

  --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;

  --top: 64px;
  --gutter: clamp(20px, 4vw, 64px);
  --section: clamp(96px, 14vh, 180px);

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --t-text: .3s;
  --t-img: .5s;
}
:root[data-theme="orange"] { --accent-ink: #1a0d08; }
:root[data-theme="blue"] { --accent-ink: #f1ebe0; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ol, ul, dl, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
strong { font-weight: 500; }
em { font-family: var(--serif); font-style: italic; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.skip { position: fixed; top: -100px; left: var(--gutter); z-index: 300; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); }
.skip:focus { top: 12px; }

/* Type utilities */
.label {
  font: 500 11px/1.5 var(--sans);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.giant, .h2 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: .86;
  letter-spacing: .005em;
}
.giant { font-size: clamp(44px, 8.6vw, 170px); }
.h2 { font-size: clamp(40px, 7vw, 120px); }
.w { display: inline-block; white-space: nowrap; }

/* Masks: every revealed line lives in an overflow-hidden box, content slides up (yPercent 100 → 0). */
.mask { display: block; overflow: hidden; }
.mask__in { display: block; will-change: transform; }
h1 .mask, h2 .mask { padding-bottom: .04em; margin-bottom: -.04em; }

/* ---------- Grain + theme glow ---------- */
.grain {
  position: fixed; inset: -10%;
  z-index: 50;
  pointer-events: none;
  opacity: .085;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 300px 300px;
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}
.glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 85% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    radial-gradient(40% 40% at 10% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  overflow: hidden;
  pointer-events: none;
}
.loader__lines { position: absolute; inset: 0; display: flex; flex-direction: column; }
.loader__line { flex: 0 0 30px; width: 100%; background: var(--accent); transform-origin: top; margin-bottom: -1px; }
.loader__word {
  position: relative; z-index: 2;
  font-family: var(--display);
  font-size: clamp(56px, 12vw, 200px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--bg);
  opacity: 0;
}
.loader__quote { position: absolute; right: var(--gutter); bottom: var(--gutter); z-index: 2; color: var(--bg); font-size: 15px; opacity: 0; }

/* ---------- Top bar (SMV) ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--top);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(11,10,15,.7), rgba(11,10,15,0));
  text-transform: uppercase;
}
.top__left { display: flex; align-items: center; gap: 18px; }
.top__burger { display: none; width: 44px; height: 44px; margin-left: -10px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.top__burger span { display: block; width: 26px; height: 2px; background: var(--ink); transition: transform .4s var(--ease-out), opacity .2s; }
.top__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.top__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.top__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.top__lang { font: 500 11px/1 var(--sans); letter-spacing: .3em; display: flex; gap: 6px; }
.top__lang i { font-style: normal; color: var(--ink-3); }
.top__lang [data-l] { color: var(--ink-3); transition: color .2s; }
.top__lang [data-l].is-on { color: var(--ink); }
.top__lang:hover [data-l] { color: var(--accent); }
.top__nav { display: flex; gap: clamp(16px, 2.2vw, 34px); font-family: var(--display); font-size: 17px; letter-spacing: .04em; line-height: 1; }
.top__nav a { position: relative; padding: 6px 0; transition: color .2s; }
.top__nav a:hover { color: var(--accent); }
.top__nav a.is-active { color: var(--accent); text-decoration: line-through; text-decoration-thickness: 2px; }
.top__logo { justify-self: end; font-family: var(--display); font-size: 19px; letter-spacing: .06em; transition: color .2s; }
.top__logo:hover { color: var(--accent); }

/* ---------- Mobile menu overlay ---------- */
.menu { position: fixed; inset: 0; z-index: 90; display: none; color: var(--accent-ink); }
.menu.is-open { display: block; }
.menu__box { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(0); }
.menu__inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 48px; padding: var(--top) var(--gutter) var(--gutter); opacity: 0; }
.menu__col { display: flex; flex-direction: column; align-items: flex-start; }
.menu__big { font-family: var(--display); font-size: clamp(40px, 11vw, 88px); line-height: .92; text-transform: uppercase; margin-bottom: .1em; }
.menu__small { font: 400 14px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; margin-bottom: 18px; }

/* ---------- Page ---------- */
.page { position: relative; z-index: 1; }
.section { position: relative; padding: var(--section) var(--gutter); }
.section--alt { background: var(--bg-2); }
.section__head { margin-bottom: clamp(40px, 6vh, 80px); }
.section__head--split { display: grid; grid-template-columns: 1fr minmax(0, 46ch); gap: var(--gutter); align-items: end; }
.section__num { margin-bottom: 18px; color: var(--accent); }
.section__intro { font-size: 19px; color: var(--ink-2); max-width: 46ch; }

/* ---------- Hero ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
.hero__media { position: absolute; inset: 0; overflow: hidden; }
.hero__media img { width: 100%; height: 130%; object-fit: cover; object-position: center 30%; will-change: transform; }
.hero__grad { position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(0deg, var(--bg) 0%, rgba(11,10,15,.6) 45%, transparent 100%); }
.hero__content { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--gutter) + 24px); }
.hero__kicker { color: var(--accent); margin-bottom: 22px; }
.hero__name { font-family: var(--display); font-weight: 400; font-size: clamp(56px, 10.5vw, 190px); line-height: .86; text-transform: uppercase; margin-left: -.03em; }
.hero__aka { margin-top: 22px; color: var(--ink); }
.hero__aka em { color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: 15px; margin-right: 6px; }
.hero__scroll { position: absolute; right: var(--gutter); bottom: calc(var(--gutter) + 24px); display: flex; flex-direction: column; align-items: center; gap: 14px; font: 500 10px/1 var(--sans); letter-spacing: .35em; text-transform: uppercase; color: var(--ink-2); }
.hero__scroll i { width: 1px; height: 64px; background: var(--ink-2); position: relative; overflow: hidden; }
.hero__scroll i::after { content: ''; position: absolute; left: 0; top: -100%; width: 100%; height: 100%; background: var(--accent); animation: scrollcue 1.8s var(--ease-out) infinite; }
@keyframes scrollcue { 0% { top: -100%; } 60%, 100% { top: 100%; } }

/* ---------- Welcome ---------- */
.welcome { padding: var(--section) var(--gutter); text-align: center; }
.welcome__text .mask__in { display: inline-block; }
.welcome__sub { margin: 36px auto 0; max-width: 38ch; font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.2vw, 30px); line-height: 1.35; color: var(--ink-2); }

/* ---------- Intro (pinned) ---------- */
.intro { position: relative; height: 300vh; }
.intro__pin { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.intro__mask { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 28vw; height: 58vh; overflow: hidden; background: var(--bg-2); }
.intro__mask img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 100vw; height: 100vh; max-width: none; object-fit: cover; }
.intro__word { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); display: flex; font-family: var(--display); font-weight: 400; font-size: 18.5vw; line-height: .9; text-transform: uppercase; color: var(--ink); white-space: nowrap; text-shadow: 0 2px 40px rgba(0,0,0,.35); }
.intro__lm { display: block; overflow: hidden; }
.intro__l { display: block; }
.intro__sub { position: absolute; left: 50%; bottom: calc(var(--gutter) + 16px); transform: translateX(-50%); display: flex; gap: .5em; font-family: var(--display); font-size: clamp(22px, 3.6vw, 60px); line-height: 1; text-transform: uppercase; color: var(--accent); white-space: nowrap; }

/* ---------- Talk ---------- */
.talk { position: relative; height: 380vh; }
.talk__pin { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.talk__dialog { position: absolute; inset: 0; padding: 0 var(--gutter); display: flex; flex-direction: column; justify-content: center; gap: clamp(28px, 6vh, 72px); }
.talk__row { display: grid; grid-template-columns: 12ch 1fr; gap: 24px; align-items: start; }
.talk__tag { font: 500 11px/1.5 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-2); padding-top: .6em; }
.talk__q, .talk__a { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5.4vw, 92px); line-height: .95; text-transform: uppercase; max-width: 18ch; }
.talk__a { color: var(--accent); }
.ch { display: inline-block; white-space: pre; }
.talk__pop { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.talk__word { position: relative; z-index: 2; font-family: var(--display); font-weight: 400; font-size: 20vw; line-height: 1; text-transform: uppercase; color: var(--accent); white-space: nowrap; opacity: 0; }
.talk__pics { position: absolute; inset: 0; }
.talk__pics figure { position: absolute; left: 50%; top: 50%; width: clamp(120px, 15vw, 280px); aspect-ratio: 3 / 4; margin: calc(-1 * clamp(120px, 15vw, 280px) * 2 / 3) 0 0 calc(-1 * clamp(120px, 15vw, 280px) / 2); overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.5); opacity: 0; background: var(--bg-2); }
.talk__pics img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Work list ---------- */
.work__bg { position: fixed; inset: 0; z-index: 0; opacity: 0; pointer-events: none; }
.work__bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.05); }
.work__bgGrad { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,10,15,.8), rgba(11,10,15,.35)); }
.work .section__head, .work__list, .work__hint { position: relative; z-index: 1; }
.filters, .process__tabs, .process__stages { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.filters { margin-top: 28px; }
.filters button, .process__tabs button, .process__stages button { font: 500 11px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-2); padding: 10px 0; position: relative; transition: color .2s; }
.filters button::after, .process__tabs button::after, .process__stages button::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out); }
.filters button:hover, .process__tabs button:hover, .process__stages button:hover, .filters button.is-on, .process__tabs button.is-on, .process__stages button.is-on { color: var(--ink); }
.filters button.is-on::after, .process__tabs button.is-on::after, .process__stages button.is-on::after { transform: scaleX(1); }
.work__list { border-top: 1px solid var(--line); }
.work__item { border-bottom: 1px solid var(--line); }
.work__item[hidden] { display: none; }
.work__btn { width: 100%; display: grid; grid-template-columns: 4ch 1fr auto; align-items: baseline; gap: clamp(12px, 2vw, 32px); padding: clamp(10px, 1.4vw, 22px) 0; text-align: left; }
.work__idx { font: 400 12px/1 var(--sans); letter-spacing: .2em; color: var(--ink-3); }
.work__title { position: relative; font-family: var(--display); font-weight: 400; font-size: clamp(32px, 5.8vw, 108px); line-height: .92; text-transform: uppercase; overflow: hidden; }
.work__title .wt { position: relative; display: block; }
.work__title .wt--b { position: absolute; inset: 0; color: var(--accent); }
.work__title .ch { overflow: hidden; vertical-align: top; line-height: 1; padding: .14em 0 .05em; margin: -.14em 0 -.05em; }
.work__title .ch__in { display: block; }
.wt--b .ch__in { transform: translateY(105%); }
.work__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font: 400 12px/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.work__meta b { font-weight: 400; color: var(--ink); }
.work__meta i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--accent)); margin-right: 8px; vertical-align: middle; }
.work__thumb { display: none; width: 72px; height: 54px; object-fit: cover; opacity: .9; }
.work__hint { margin-top: 28px; }
.is-touch .work__hint { display: none; }
.is-touch .work__btn { grid-template-columns: 4ch 1fr auto auto; }
.is-touch .work__thumb { display: block; }
.work__item.is-hover .work__meta { color: var(--ink); }

/* ---------- Purple Drain (pinned, SMV home-work) ---------- */
.pd { position: relative; height: 260vh; }
.pd__pin { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: var(--gutter); padding: var(--top) var(--gutter) 0; }
.pd__title { font-family: var(--display); font-weight: 400; font-size: clamp(56px, 9.5vw, 170px); line-height: .86; text-transform: uppercase; color: var(--accent); }
.pd__kicker { margin: 26px 0 14px; }
.pd__pitch { max-width: 42ch; font-family: var(--serif); font-style: italic; font-size: clamp(19px, 1.8vw, 26px); line-height: 1.35; color: var(--ink-2); margin-bottom: 32px; }
.pd__pics { position: relative; height: min(78vh, 100%); }
.pd__pic { position: absolute; top: 50%; left: 50%; height: 100%; aspect-ratio: 2480 / 3508; transform: translate(-50%, -50%); width: 0; max-width: 100%; overflow: hidden; box-shadow: 0 40px 80px rgba(0,0,0,.55); background: var(--bg-2); }
.pd__pic img { height: 100%; width: auto; max-width: none; }
.pd__pic--1 { transform: translate(-50%, -50%) translate(8%, 4%) rotate(3deg); opacity: .9; }
.pd__pic--2 { transform: translate(-50%, -50%) translate(-10%, -3%) rotate(-4deg); opacity: .75; }
.pd__pic--3 { transform: translate(-50%, -50%) translate(16%, -8%) rotate(7deg); opacity: .6; }

/* ---------- Universes ---------- */
.uni { padding-right: 0; padding-left: 0; }
.uni .section__head { padding: 0 var(--gutter); }
.uni__track { display: flex; gap: clamp(12px, 2vw, 32px); padding: 0 var(--gutter) 24px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-left: var(--gutter); scrollbar-width: none; cursor: grab; }
.uni__track::-webkit-scrollbar { display: none; }
.uni__track.is-drag { cursor: grabbing; scroll-snap-type: none; }
.uni__card { position: relative; flex: 0 0 clamp(250px, 30vw, 500px); aspect-ratio: 4 / 5; overflow: hidden; scroll-snap-align: start; background: var(--bg-2); text-align: left; }
.uni__card img { width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: transform var(--t-img) var(--ease-out), opacity var(--t-img); will-change: transform; }
.uni__card:hover img, .uni__card:focus-visible img { transform: scale(1.1); opacity: 1; }
.uni__card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11,10,15,.9), transparent 55%); }
.uni__cap { position: absolute; left: 22px; right: 22px; bottom: 22px; z-index: 1; }
.uni__cap .label { margin-bottom: 10px; color: var(--accent); }
.uni__name { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 3.2vw, 58px); line-height: .92; text-transform: uppercase; }
.uni__card.is-on { outline: 1px solid var(--accent); outline-offset: -1px; }
.uni__card.is-on img { opacity: 1; }

/* ---------- Process / compare ---------- */
.process__tabs { margin-bottom: 28px; }
.compare { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 78vh; margin: 0 auto; overflow: hidden; background: var(--bg); user-select: none; outline: 1px solid var(--line); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.compare__before { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); background: var(--bg); }
.compare__handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--ink); transform: translateX(-50%); pointer-events: none; }
.compare__handle span { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border: 1px solid var(--ink); border-radius: 50%; background: var(--bg); }
.compare__handle span::before, .compare__handle span::after { content: ''; position: absolute; top: 50%; width: 8px; height: 8px; border-top: 1px solid var(--ink); }
.compare__handle span::before { left: 11px; border-left: 1px solid var(--ink); transform: translateY(-50%) rotate(-45deg); }
.compare__handle span::after { right: 11px; border-right: 1px solid var(--ink); transform: translateY(-50%) rotate(45deg); }
.compare__tag { position: absolute; top: 16px; color: var(--ink); background: rgba(11,10,15,.65); padding: 8px 12px; pointer-events: none; }
.compare__tag--l { left: 16px; }
.compare__tag--r { right: 16px; }
.compare__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.compare__range::-webkit-slider-thumb { -webkit-appearance: none; width: 60px; height: 100%; }
.process__stages { margin-top: 22px; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gutter); align-items: center; }
.about__visual { position: relative; width: min(100%, 460px); aspect-ratio: 1; }
.about__portrait { position: absolute; inset: 12%; opacity: 0; }
.about__portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .6s; }
.about__portrait:hover img { filter: none; }
.about__frame { position: absolute; inset: 6%; border: 1px solid var(--accent); transform: translate(5%, 5%); transform-origin: left top; }
.about__text { max-width: 62ch; }
.about__lead { font-family: var(--serif); font-style: italic; font-size: clamp(24px, 2.6vw, 38px); line-height: 1.3; margin: 32px 0 24px; }
.about__lead strong { font-family: var(--sans); font-style: normal; font-weight: 500; }
.about__p { color: var(--ink-2); margin-bottom: 18px; }
.skills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.skills li { font: 500 11px/1 var(--sans); letter-spacing: .28em; text-transform: uppercase; padding: 11px 14px 10px; border: 1px solid var(--line); color: var(--ink); opacity: 0; }
.stats { display: grid; grid-template-columns: repeat(3, auto); gap: 32px; margin-top: 44px; justify-content: start; }
.stats dt { font-family: var(--display); font-size: clamp(40px, 4.5vw, 72px); line-height: 1; }
.stats dd { margin: 8px 0 0; font: 500 11px/1.5 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--ink-2); max-width: 14ch; }

/* ---------- Contact ---------- */
.contact { padding: var(--section) var(--gutter); text-align: center; }
.contact .label { color: var(--accent); margin-bottom: 28px; }
.contact__title .mask__in { display: inline-block; }
.contact__lede { margin: 32px auto 0; max-width: 42ch; font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.2vw, 30px); line-height: 1.35; color: var(--ink-2); }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 44px; }
.btn { display: inline-flex; align-items: center; gap: 14px; padding: 20px 30px; font: 500 12px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); transition: background .25s, color .25s, border-color .25s; }
.btn i { font-style: normal; transition: transform .3s var(--ease-out); }
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn:hover i { transform: translateX(4px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); }
.footer__band { height: 8px; background: var(--ink); box-shadow: 0 0 10px rgba(241,235,224,.6); }
.footer__marquee { overflow: hidden; padding: 14px 0 10px; border-bottom: 1px solid var(--line); }
.footer__track { display: flex; white-space: nowrap; width: max-content; font-family: var(--display); font-size: clamp(48px, 7.5vw, 132px); line-height: 1; text-transform: uppercase; }
.footer__track span { padding-right: .18em; }
.footer__track span:nth-child(2n) { color: transparent; -webkit-text-stroke: 1px var(--ink); }
.footer__cols { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: var(--gutter); padding: 44px var(--gutter) 56px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.footer__cols .label { color: var(--accent); margin-bottom: 14px; }
.footer__cols a { color: var(--ink); border-bottom: 1px solid transparent; transition: border-color .2s; }
.footer__cols a:hover { border-color: var(--accent); }
.footer__top { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 22px; color: var(--ink); transition: background .25s, color .25s, border-color .25s; align-self: start; }
.footer__top:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Gallery / reader ---------- */
.gallery { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); display: none; grid-template-rows: 84px 1fr 96px; }
.gallery[open] { display: grid; }
.gallery::backdrop { background: var(--bg); }
.gallery__bar { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; border-bottom: 1px solid var(--line); height: 84px; }
.gallery__count { display: flex; align-items: center; gap: 10px; height: 100%; padding: 0 32px; border-right: 1px solid var(--line); font-family: var(--serif); font-style: italic; font-size: 30px; min-width: 150px; justify-content: center; }
.gallery__count #gIndex { color: var(--accent); min-width: 1.2ch; text-align: right; }
.gallery__sep { color: var(--ink-3); }
.gallery__nav { display: flex; height: 100%; border-right: 1px solid var(--line); }
.gallery__btn { width: 84px; height: 100%; display: grid; place-items: center; font-size: 24px; transition: color .2s; }
.gallery__btn:hover { color: var(--accent); }
.gallery__nav .gallery__btn + .gallery__btn { border-left: 1px solid var(--line); }
.gallery__meta { padding: 0 32px; min-width: 0; }
.gallery__title { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery__desc { font-size: 13px; line-height: 1.4; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 6px; }
.gallery__desc:empty { display: none; }
.gallery__link { padding: 0 24px; height: 100%; display: flex; align-items: center; border-left: 1px solid var(--line); color: var(--ink); transition: color .2s; }
.gallery__link[hidden] { display: none; }
.gallery__link:hover { color: var(--accent); }
.gallery__close { border-left: 1px solid var(--line); }
/* Two stacked images: the incoming one is clipped by a wavy polygon that sweeps across (sketch → colour "wipe"). */
.gallery__stage { position: relative; overflow: hidden; min-height: 0; touch-action: none; cursor: grab; }
.gallery__stage.is-dragging { cursor: grabbing; }
.gallery__stage img { position: absolute; inset: 24px; width: calc(100% - 48px); height: calc(100% - 48px); object-fit: contain; opacity: 0; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.gallery__stage img.is-current { opacity: 1; z-index: 1; }
.gallery__stage img.is-incoming { opacity: 1; z-index: 2; }
.gallery__thumbs { display: flex; gap: 8px; padding: 16px 32px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: none; }
.gallery__thumbs::-webkit-scrollbar { display: none; }
.gallery__thumbs button { flex: 0 0 auto; width: 86px; height: 64px; opacity: .45; outline: 1px solid transparent; transition: opacity .2s, outline-color .2s; }
.gallery__thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs button:hover, .gallery__thumbs button.is-on { opacity: 1; }
.gallery__thumbs button.is-on { outline-color: var(--accent); }
.gallery--reader .gallery__thumbs button { width: 46px; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .top { grid-template-columns: auto 1fr auto; }
  .top__burger { display: flex; }
  .top__nav { display: none; }
  .hero__scroll { display: none; }
  .intro__mask { width: 60vw; height: 46vh; }
  .intro__word { font-size: 17.5vw; }
  .talk__row { grid-template-columns: 1fr; gap: 10px; }
  .talk__word { font-size: 24vw; white-space: normal; text-align: center; line-height: .9; }
  .section__head--split { grid-template-columns: 1fr; align-items: start; }
  .pd { height: auto; }
  .pd__pin { position: relative; height: auto; grid-template-columns: 1fr; padding: var(--section) var(--gutter); gap: 48px; }
  .pd__pics { height: 70vh; }
  .about { grid-template-columns: 1fr; }
  .about__visual { width: min(100%, 360px); margin: 0 auto; }
  .footer__cols { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-rows: 64px 1fr 76px; }
  .gallery__stage img { inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
  .gallery__bar { grid-template-columns: auto auto 1fr auto; height: 72px; }
  .gallery__count { padding: 0 18px; min-width: 0; font-size: 24px; }
  .gallery__btn { width: 64px; }
  .gallery__meta { padding: 0 16px; }
  .gallery__link { display: none; }
  .gallery__thumbs { padding: 12px 16px; }
  .gallery__thumbs button { width: 70px; height: 52px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .work__btn { grid-template-columns: 1fr; gap: 6px; }
  .work__idx { display: none; }
  .work__meta { flex-direction: row; align-items: center; gap: 14px; }
  .is-touch .work__btn { grid-template-columns: 1fr auto; }
  .is-touch .work__meta { grid-column: 1; }
  .is-touch .work__thumb { grid-column: 2; grid-row: 1 / span 2; width: 64px; height: 64px; }
  .talk__pics figure { width: 30vw; margin: -20vw 0 0 -15vw; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer__cols { grid-template-columns: 1fr; }
  .footer__top { justify-self: start; }
  .gallery__desc { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  .hero__scroll i::after { animation: none; }
  .loader { display: none; }
  .mask__in, .ch__in { transform: none !important; opacity: 1 !important; }
  .intro, .talk, .pd { height: auto; }
  .intro__pin, .talk__pin, .pd__pin { position: relative; height: auto; }
  .intro__mask { position: relative; left: auto; top: auto; transform: none; width: 100%; height: 70vh; }
  .intro__word { position: relative; left: auto; top: auto; transform: none; justify-content: center; padding: 40px 0 0; font-size: 14vw; }
  .intro__sub { position: relative; left: auto; bottom: auto; transform: none; justify-content: center; padding: 20px 0 60px; }
  .talk__dialog { position: relative; padding-top: 80px; padding-bottom: 80px; }
  .talk__pop { position: relative; display: block; padding-bottom: 80px; }
  .talk__word { opacity: 1; text-align: center; }
  .talk__pics { display: none; }
  .pd__pin { padding: var(--section) var(--gutter); }
  .pd__pics { height: 70vh; }
  .pd__pic { width: 100%; }
  .wt--b { display: none; }
  .about__portrait, .skills li { opacity: 1 !important; }
}
