/* =========================================================
   Arka Dasgupta — Portfolio
   Design system: fonts → tokens → base → components → pages
   ========================================================= */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Long Cang"; src: url("../fonts/long-cang-latin-400-normal.woff2") format("woff2"); font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  /* Colour */
  --c-ink: #111;
  --c-ink-2: #3d3d3d;
  --c-muted: #6b6b6b;
  --c-line: #e7e3dc;
  --c-paper: #fff;
  --c-cream: #fbf8f3;
  --c-red: #d4543d;
  --c-squiggle: #ff9500;
  --c-arrow: #ffa202;
  --c-amber: #ffb300;
  --c-orange: #ff7b00;
  --c-orange-strong: #ff7300;
  --c-concept: #ffc745;
  --c-concept-line: #ff7f07;
  --c-frame: #787878;
  --c-mint: #f0fff8;
  --c-green: #0a8f66;
  --c-nav-active: rgba(150, 23, 23, .12);

  /* Project palettes */
  --bmi: #108275;  --bmi-bg: #effbf7;
  --shr: #b8401f;  --shr-bg: #f6e2d6;
  --fit: #5e3e4d;  --fit-bg: #ffebfb;  --fit-tag: #4f334a;
  --kno: #3b6fd6;  --kno-bg: #f2f6ff;  --kno-tag: #426fc7;

  /* Type families */
  --f-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Bricolage Grotesque", var(--f-sans);
  --f-hand: "Long Cang", "Comic Sans MS", cursive;

  /* Fluid type scale (360 → 1440) */
  --fs-eyebrow: 12px;
  --fs-xs: 13px;
  --fs-sm: 15px;
  --fs-base: clamp(16px, .25vw + 15px, 18px);
  --fs-md: clamp(17px, .5vw + 15px, 20px);
  --fs-lg: clamp(19px, .9vw + 15px, 24px);
  --fs-xl: clamp(22px, 1.3vw + 16px, 30px);
  --fs-2xl: clamp(28px, 2.4vw + 16px, 44px);
  --fs-quote: clamp(24px, 1.6vw + 14px, 36px);
  --fs-page: clamp(48px, 7.4vw, 108px);
  --fs-hero: clamp(60px, 10.4vw, 150px);

  /* Spacing (4px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 128px;
  --section: clamp(64px, 8vw, 120px);

  /* Layout */
  --container: 1160px;
  --gutter: clamp(20px, 4vw, 48px);
  --nav-h: 76px;

  /* Radii, borders, shadows, motion */
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px; --r-2xl: 40px; --r-pill: 999px;
  --bw: 2px;
  --shadow-pop: 4px 4px 0 var(--c-ink);
  --shadow-soft: 0 24px 60px -30px rgba(17, 17, 17, .35);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 700; line-height: 1.05; letter-spacing: -.025em; }
ul { margin: 0; padding: 0; }
button { font: inherit; }
::selection { background: var(--c-amber); color: var(--c-ink); }

.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: var(--sp-4); top: -60px; z-index: 100; padding: var(--sp-2) var(--sp-4); background: var(--c-ink); color: var(--c-paper); border-radius: var(--r-sm); transition: top .2s; }
.skip-link:focus { top: var(--sp-4); }
:focus-visible { outline: 3px solid var(--c-orange); outline-offset: 3px; border-radius: 6px; }
.eyebrow { font-family: var(--f-sans); font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- Reveal animations ---------- */
[data-reveal] { opacity: 0; transition: opacity .8s var(--ease), transform .9s var(--ease), filter .8s var(--ease); transition-delay: var(--delay, 0s); }
[data-reveal="right"] { transform: translateX(120px); }
[data-reveal="left"]  { transform: translateX(-120px) rotate(-12deg); }
[data-reveal="up"]    { transform: translateY(32px); }
[data-reveal="pop"]   { transform: scale(.6) rotate(-4deg); }
[data-reveal].is-in { opacity: 1; transform: none; filter: none; }
[data-reveal="left"].is-in { transform: rotate(-12deg); }

.split-word { display: inline-block; white-space: nowrap; }
.split-char { display: inline-block; opacity: 0; transform: translateY(.4em); transition: opacity .4s var(--ease), transform .5s var(--ease); transition-delay: calc(var(--i) * 10ms + .35s); white-space: pre; }
.is-in .split-char { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal], .split-char { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  [data-reveal="left"] { transform: rotate(-12deg) !important; }
  [data-blur-out] { filter: none !important; }
}

/* ---------- Buttons / chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-pill);
  background: var(--c-paper); color: var(--c-ink);
  font-weight: 600; font-size: var(--fs-sm); line-height: 1.1; text-decoration: none; white-space: nowrap;
  box-shadow: 3px 3px 0 var(--c-ink);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.chip:hover, .chip:focus-visible { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--c-ink); background: var(--c-amber); }
.chip:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--c-ink); }
.chip svg, .chip .ico-txt { flex: 0 0 auto; width: 18px; height: 18px; }
.chip .ico-txt { display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 14px; letter-spacing: -.04em; }
.chip--dark { background: var(--c-ink); color: var(--c-paper); box-shadow: 3px 3px 0 var(--c-amber); }
.chip--dark:hover, .chip--dark:focus-visible { background: var(--c-ink); color: var(--c-amber); box-shadow: 5px 5px 0 var(--c-amber); }

/* ---------- Top nav (inner pages) ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-inline: clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; justify-self: start; }
.brand__cat { position: relative; width: 40px; height: 42px; flex: 0 0 auto; }
.brand__cat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .12s, transform .35s var(--spring); }
.brand__cat .cat-angry { opacity: 0; }
.brand:hover .cat-happy, .brand:focus-visible .cat-happy { opacity: 0; }
.brand:hover .cat-angry, .brand:focus-visible .cat-angry { opacity: 1; transform: rotate(-10deg) scale(1.12); }
.brand:hover .brand__cat, .brand:focus-visible .brand__cat { animation: hiss .4s ease-in-out; }
@keyframes hiss { 0%, 100% { translate: 0; } 25% { translate: -2px 0; } 50% { translate: 2px 0; } 75% { translate: -1px 0; } }
.brand__say { display: grid; color: var(--c-red); font-weight: 600; font-size: var(--fs-sm); }
.brand__say > span { grid-area: 1 / 1; transition: opacity .2s, transform .25s var(--ease); white-space: nowrap; }
.brand__say .say-hiss { opacity: 0; transform: translateY(6px); font-weight: 700; }
.brand:hover .say-calm, .brand:focus-visible .say-calm { opacity: 0; transform: translateY(-6px); }
.brand:hover .say-hiss, .brand:focus-visible .say-hiss { opacity: 1; transform: none; }

.icon-nav { display: flex; align-items: center; gap: clamp(16px, 3.4vw, 48px); list-style: none; }
.icon-nav a { position: relative; display: grid; place-items: center; width: 62px; height: 50px; border-radius: var(--r-md); text-decoration: none; transition: background .2s; }
.icon-nav a:hover { background: rgba(0, 0, 0, .04); }
.icon-nav a[aria-current="page"] { background: var(--c-nav-active); }
.icon-nav img { width: auto; height: 42px; transition: transform .35s var(--spring); }
.icon-nav a:hover img, .icon-nav a:focus-visible img { transform: rotate(-8deg) scale(1.12); }
.icon-nav .tip {
  position: absolute; top: calc(100% + 6px); left: 50%; translate: -50% 0;
  white-space: nowrap; font-size: var(--fs-xs); font-weight: 600;
  background: var(--c-ink); color: var(--c-paper); padding: 4px 10px; border-radius: var(--r-pill);
  opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .2s, transform .2s var(--ease);
}
.icon-nav a:hover .tip, .icon-nav a:focus-visible .tip { opacity: 1; transform: none; }
.nav-cta { justify-self: end; }

@media (max-width: 900px) { .nav-cta { display: none; } .site-nav { grid-template-columns: auto 1fr; } .icon-nav { justify-self: end; } }
@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .brand__say { display: none; }
  .icon-nav { gap: var(--sp-2); }
  .icon-nav a { width: 50px; height: 44px; }
  .icon-nav img { height: 32px; }
  .icon-nav .tip { display: none; }
}

/* ---------- CTA band + footer ---------- */
.cta-band { width: min(var(--container), 100% - 2 * var(--gutter)); margin: var(--section) auto 0; padding: clamp(28px, 5vw, 56px); border: var(--bw) solid var(--c-ink); border-radius: var(--r-2xl); background: var(--c-mint); box-shadow: 6px 6px 0 var(--c-ink); display: grid; grid-template-columns: 1fr auto; gap: var(--sp-6); align-items: center; }
.cta-band__kicker { font-family: var(--f-hand); font-size: var(--fs-xl); color: var(--c-green); line-height: 1.1; }
.cta-band h2 { margin-top: var(--sp-2); font-size: var(--fs-2xl); max-width: 16ch; }
.cta-band .links { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: flex-end; max-width: 440px; }
@media (max-width: 860px) { .cta-band { grid-template-columns: 1fr; } .cta-band .links { justify-content: flex-start; } }

.site-footer { width: min(var(--container), 100% - 2 * var(--gutter)); margin: var(--sp-8) auto 0; padding: var(--sp-5) 0 var(--sp-6); border-top: 1px solid var(--c-line); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-4); font-size: var(--fs-xs); color: var(--c-muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--sp-5); }
.site-footer a { color: var(--c-ink-2); font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: var(--c-red); }

/* =========================================================
   HOME
   ========================================================= */
.hero { padding-top: clamp(40px, 6vw, 88px); }
.hero__intro { font-size: var(--fs-md); line-height: 1.5; color: var(--c-ink-2); }
.hero__intro span { display: block; }
@media (min-width: 640px) { .hero__intro span { white-space: nowrap; } }
.hero__hi { margin-top: var(--sp-5); font-family: var(--f-hand); font-size: var(--fs-xl); line-height: 1; }
.hero__name { position: relative; isolation: isolate; display: inline-block; margin-top: var(--sp-2); font-family: var(--f-display); font-weight: 800; font-size: var(--fs-hero); line-height: .95; letter-spacing: -.045em; white-space: nowrap; }
.hero__name .squiggle { position: absolute; left: -1%; top: 88%; width: 102%; height: auto; overflow: visible; z-index: -1; }
.hero__quote { margin-top: clamp(40px, 5vw, 72px); font-family: var(--f-hand); font-size: var(--fs-quote); line-height: 1.2; }
.hero__quote strong { font-weight: 400; }

.stage { --col-gap: 40px; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) min(560px, 50%); margin-top: clamp(48px, 5vw, 72px); }
.stage__portrait { grid-column: 1 / -1; grid-row: 1 / span 3; align-self: end; width: min(700px, 62%); aspect-ratio: 1400 / 1403; position: relative; z-index: 1; }
.stage__portrait img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; border-radius: 0 0 var(--r-xl) var(--r-xl); }
.stage__arrow { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.stage__arrow path { fill: none; stroke: var(--c-arrow); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.stage__arrow .shaft { stroke-dasharray: var(--len, 400); stroke-dashoffset: var(--len, 400); transition: stroke-dashoffset 1.1s var(--ease) .5s; }
.stage__arrow .head { opacity: 0; transition: opacity .3s 1.4s; }
.stage__arrow.is-in .shaft { stroke-dashoffset: 0; }
.stage__arrow.is-in .head { opacity: 1; }
.stage__right { grid-column: 2; grid-row: 1 / span 3; position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--col-gap); }

/* Highlights card */
.highlight { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; position: relative; background: var(--c-red); color: var(--c-paper); border-radius: var(--r-lg); padding: 28px 30px 30px; box-shadow: 0 0 0 0 var(--c-ink), var(--shadow-soft); transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s var(--ease), box-shadow .35s var(--ease), opacity .8s var(--ease); transition-delay: 0s; isolation: isolate; }
.highlight[data-reveal]:not(.is-in) { transform: translateX(120px); }
.highlight.is-in { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); }
.highlight:hover { box-shadow: 6px 6px 0 var(--c-ink), var(--shadow-soft); }
/* marching stitched border */
.highlight::before { content: ""; position: absolute; inset: 7px; border-radius: calc(var(--r-lg) - 6px); pointer-events: none; z-index: -1;
  background:
    repeating-linear-gradient(90deg, #f3c200 0 7px, transparent 7px 12px) top / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, #f3c200 0 7px, transparent 7px 12px) bottom / 100% 2px no-repeat,
    repeating-linear-gradient(0deg, #f3c200 0 7px, transparent 7px 12px) left / 2px 100% no-repeat,
    repeating-linear-gradient(0deg, #f3c200 0 7px, transparent 7px 12px) right / 2px 100% no-repeat; }
.highlight:hover::before { animation: march .6s linear infinite; }
@keyframes march { to { background-position: 12px 0, -12px 100%, 0 -12px, 100% 12px; } }
/* glare that follows the pointer */
.highlight::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(360px circle at var(--mx) var(--my), rgba(255, 255, 255, .18), transparent 60%); opacity: 0; transition: opacity .3s; }
.highlight:hover::after { opacity: 1; }
.highlight__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); }
.highlight__title { font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 1.5vw + 12px, 31px); line-height: 1.1; letter-spacing: -.02em; }
.highlight__chip { position: absolute; right: -14px; top: -16px; z-index: 2; display: inline-flex; align-items: center; gap: 0; padding: 6px 13px; border: 1.5px solid var(--c-ink); border-radius: var(--r-pill); background: var(--c-amber); color: var(--c-ink); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; transform: rotate(3deg); box-shadow: 2px 2px 0 var(--c-ink); transition: transform .35s var(--spring); }
.highlight:hover .highlight__chip { transform: rotate(-6deg) scale(1.1); }
.highlight__chip b { font-variant-numeric: tabular-nums; margin-right: 4px; }
.highlight__list { list-style: none; margin-top: var(--sp-5); display: grid; gap: 6px; }
.highlight__list li { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: var(--sp-3); align-items: start; padding: 8px 10px; margin-inline: -10px; border-radius: var(--r-md); font-size: var(--fs-md); line-height: 1.4; transition: background .25s, transform .25s var(--ease); }
.highlight__list li:hover { background: rgba(255, 255, 255, .12); transform: translateX(6px); }
.highlight__list .tick { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .16); transition: background .25s, transform .35s var(--spring); }
.highlight__list li:hover .tick { background: var(--c-amber); color: var(--c-ink); transform: rotate(-12deg) scale(1.1); }
.highlight__list svg { width: 16px; height: 16px; }
.highlight__list svg path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .5s var(--ease); transition-delay: calc(.9s + var(--n) * .25s); }
.highlight.is-in .highlight__list svg path { stroke-dashoffset: 0; }
.highlight-tag { position: absolute; left: -40px; top: -20px; z-index: 2; padding: 5px 14px; background: var(--c-paper); color: var(--c-red); border: 1.5px solid var(--c-red); border-radius: var(--r-sm); font-weight: 700; font-size: var(--fs-sm); letter-spacing: .02em; transform: rotate(-12deg); transform-origin: 90% 50%; }
.highlight:hover .highlight-tag { animation: swing .9s var(--ease); }
@keyframes swing { 25% { transform: rotate(-20deg); } 55% { transform: rotate(-6deg); } 80% { transform: rotate(-14deg); } 100% { transform: rotate(-12deg); } }
@media (prefers-reduced-motion: reduce) { .highlight { transform: none !important; } .highlight__list svg path { stroke-dashoffset: 0; } .highlight:hover::before, .highlight:hover .highlight-tag { animation: none; } }

/* Doodle icon nav */
.home-nav { --ico: 100px; display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; margin: 0; padding: var(--sp-2) 0; }
.home-nav li { display: flex; justify-content: center; }
.home-nav a { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
.home-nav .ico { height: var(--ico); display: flex; align-items: flex-end; justify-content: center; }
.home-nav img { height: var(--ico); width: auto; max-width: none; transition: transform .4s var(--spring); }
.home-nav li:nth-child(1) img { height: calc(var(--ico) * .96); }
.home-nav a:hover img, .home-nav a:focus-visible img { transform: rotate(-8deg) scale(1.1); }
.home-nav a:hover span:last-child { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Contact card */
.contact-card { margin: 0; width: 100%; padding: 26px 26px 24px; background: var(--c-mint); border: var(--bw) solid var(--c-ink); border-radius: var(--r-xl); box-shadow: 6px 6px 0 var(--c-ink); position: relative; }
.contact-card__kicker { font-family: var(--f-hand); font-size: clamp(24px, 1.2vw + 14px, 30px); line-height: 1.05; color: var(--c-green); }
.contact-card__text { margin-top: var(--sp-2); font-size: var(--fs-sm); line-height: 1.5; color: var(--c-ink-2); }
.contact-card__grid { margin-top: var(--sp-5); display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.contact-card__grid .chip { justify-content: flex-start; padding: 11px 14px; }
.contact-card__mail { grid-column: 1 / -1; }
.contact-card__status { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--sp-4); font-size: var(--fs-xs); font-weight: 600; color: var(--c-ink-2); }
.contact-card__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1fbf6a; box-shadow: 0 0 0 4px rgba(31, 191, 106, .2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(31, 191, 106, 0); } }

@media (max-width: 1100px) { .stage { grid-template-columns: 1fr 1fr; } .stage__portrait { width: 56%; } }
@media (max-width: 860px) {
  .hero__name { white-space: normal; font-size: clamp(60px, 17vw, 120px); line-height: .92; }
  .hero__name .line { display: block; position: relative; width: fit-content; }
  .hero__name .squiggle { display: none; }
  .hero__name .line::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: 4%; height: 8px; z-index: -1; border-radius: 8px; background: repeating-linear-gradient(90deg, var(--c-squiggle) 0 14px, transparent 14px 17px); }
  .stage { display: flex; flex-direction: column; margin-top: var(--sp-8); }
  .stage__arrow { display: none; }
  .stage__right { display: contents; }
  .highlight { order: 1; }
  .highlight-tag { left: -6px; top: -20px; }
  .stage__portrait { order: 2; width: min(100%, 520px); margin: var(--sp-7) auto 0; }
  .stage__right > nav { order: 3; }
  .home-nav { --ico: 80px; margin-top: var(--sp-7); }
  .contact-card { order: 4; margin: var(--sp-7) auto 0; }
}
@media (max-width: 480px) {
  .highlight { padding: 24px 20px; }
  .home-nav { --ico: 62px; }
  .home-nav a { font-size: 14px; }
  .contact-card { padding: 22px 18px; }
  .contact-card__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   SELECTED WORKS
   ========================================================= */
.page-head { text-align: center; padding-top: clamp(16px, 3vw, 36px); }
.page-head .eyebrow { color: var(--c-muted); }
.page-title { margin-top: var(--sp-3); font-family: var(--f-display); font-weight: 800; font-size: var(--fs-page); line-height: .95; letter-spacing: -.045em; }
.page-sub { max-width: 52ch; margin: var(--sp-4) auto 0; font-size: var(--fs-md); color: var(--c-ink-2); }
.works-title { color: var(--c-amber); text-transform: uppercase; }

.frame {
  --pad-t: 200px; --pad-x: 148px; --pad-b: 88px;
  --badge-w: 238px;
  position: relative;
  width: min(1245px, 100% - 2 * var(--gutter));
  margin: clamp(48px, 5vw, 80px) auto 0;
  padding: var(--pad-t) var(--pad-x) var(--pad-b);
}
.frame + .frame { margin-top: clamp(72px, 7vw, 104px); }
.frame__edge { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.frame__edge path { vector-effect: non-scaling-stroke; stroke-linejoin: miter; stroke-miterlimit: 8; stroke-width: 17px; }
.frame--real .frame__edge path { fill: var(--c-paper); stroke: var(--c-frame); }
.frame--concept .frame__edge path { fill: var(--c-concept); stroke: var(--c-concept-line); }

.badge { position: absolute; left: calc(var(--badge-w) * -.1); top: calc(var(--badge-w) * -.13); width: var(--badge-w); aspect-ratio: 238 / 216; z-index: 3; display: grid; place-items: center; }
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.badge h2 { position: relative; margin: 0; display: grid; place-items: center; }
.badge span { position: relative; font-family: var(--f-display); font-weight: 800; font-size: calc(var(--badge-w) * .128); line-height: 1; letter-spacing: -.01em; transform: rotate(-41deg) translate(3%, -7%); white-space: nowrap; }
.frame--real .badge path { fill: var(--c-amber); stroke: var(--c-amber); }
.frame--real .badge span { color: var(--c-paper); }
.frame--concept .badge path { fill: var(--c-paper); stroke: var(--c-concept-line); }
.frame--concept .badge span { color: var(--c-concept-line); }

.cards { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 70px); max-width: 948px; margin-inline: auto; align-items: stretch; }

.card { position: relative; display: flex; flex-direction: column; border-radius: var(--r-xl); background: var(--card-bg); color: var(--card-c); box-shadow: inset 0 0 0 1.5px var(--card-c); text-decoration: none; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.card:hover, .card:focus-visible { transform: translateY(-6px) rotate(-.6deg); box-shadow: inset 0 0 0 1.5px var(--card-c), 0 22px 44px -22px var(--card-c); }
.card__media { aspect-ratio: 16 / 10.4; border-radius: var(--r-xl) var(--r-xl) var(--r-2xl) var(--r-2xl); overflow: hidden; background: #fff; box-shadow: 0 0 0 1.5px var(--card-c); }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .6s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 24px 28px 28px; display: flex; flex-direction: column; flex: 1; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.card__title { font-family: var(--f-display); font-size: clamp(22px, .6vw + 18px, 26px); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; background: #fff; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; line-height: 1.2; white-space: nowrap; box-shadow: inset 0 0 0 1.5px currentColor; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.card__desc { margin-top: var(--sp-3); font-size: var(--fs-sm); line-height: 1.5; }
.card__desc strong { font-weight: 700; }
.card__more { margin-top: auto; padding-top: var(--sp-4); display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--fs-sm); }
.card__more svg { transition: transform .3s var(--ease); }
.card:hover .card__more svg { transform: translateX(4px); }

.card--bmi { --card-c: var(--bmi); --card-bg: var(--bmi-bg); }
.card--shr { --card-c: var(--shr); --card-bg: var(--shr-bg); }
.card--fit { --card-c: var(--fit); --card-bg: var(--fit-bg); --tag-bg: var(--fit-tag); }
.card--kno { --card-c: var(--kno); --card-bg: var(--kno-bg); --tag-bg: var(--kno-tag); }

@media (max-width: 1180px) { .frame { --pad-x: 9%; --pad-t: 184px; --badge-w: 200px; } }
@media (max-width: 999px) {
  .frame { --pad-t: 150px; --pad-x: 52px; --pad-b: 56px; --badge-w: 156px; }
  .frame__edge path { stroke-width: 12px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 40px; }
}
@media (max-width: 520px) {
  .frame { --pad-t: 116px; --pad-x: 28px; --pad-b: 36px; --badge-w: 124px; width: calc(100% - 32px); }
  .frame__edge path { stroke-width: 9px; }
  .card__body { padding: 20px 20px 22px; }
  .card__head { flex-wrap: wrap; }
}

/* =========================================================
   ABOUT
   ========================================================= */
.about-title { color: var(--c-orange); }
.about-lede { width: min(1160px, 100% - 2 * var(--gutter)); margin: var(--sp-5) auto 0; font-size: var(--fs-lg); line-height: 1.45; text-align: center; color: var(--c-ink-2); }
.about-lede strong { color: var(--c-orange-strong); }

.carousel { position: relative; margin-top: clamp(32px, 4vw, 56px); }
.carousel__track { display: flex; gap: clamp(20px, 6vw, 96px); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: clamp(16px, 4.2vw, 60px); padding: 0 clamp(16px, 4.2vw, 60px) var(--sp-4); list-style: none; margin: 0; scrollbar-width: none; overscroll-behavior-x: contain; }
.carousel__track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 auto; width: min(530px, 82vw); scroll-snap-align: start; }
.slide figure { margin: 0; position: relative; }
.slide img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); cursor: none; }
.slide figcaption { display: none; }
.carousel__btn { position: absolute; top: calc(50% - var(--sp-4) / 2); translate: 0 -50%; z-index: 2; width: 48px; height: 48px; border: var(--bw) solid var(--c-ink); border-radius: 50%; background: var(--c-paper); color: var(--c-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 3px 3px 0 var(--c-ink); transition: opacity .25s, transform .2s var(--ease), box-shadow .2s; }
.carousel__btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--c-ink); background: var(--c-amber); }
.carousel__btn[disabled] { opacity: 0; pointer-events: none; }
.carousel__btn--prev { left: clamp(16px, 4.2vw, 60px); }
.carousel__btn--next { right: clamp(16px, 4.2vw, 60px); }

.cursor-caption { position: fixed; left: 0; top: 0; z-index: 60; max-width: 260px; padding: 9px 13px; background: #fff; border: 2px solid var(--cap); border-radius: var(--r-md); color: var(--cap); font-size: var(--fs-xs); font-weight: 700; line-height: 1.4; pointer-events: none; opacity: 0; box-shadow: 3px 3px 0 var(--cap); transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(.9); transition: opacity .18s, transform .08s linear; }
.cursor-caption.is-on { opacity: 1; transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(1); }

@media (hover: none), (max-width: 760px) {
  .slide img { cursor: auto; }
  .slide figcaption { display: block; margin-top: var(--sp-3); padding: 9px 13px; border: 2px solid var(--cap); border-radius: var(--r-md); color: var(--cap); font-size: var(--fs-xs); font-weight: 700; line-height: 1.4; }
  .cursor-caption { display: none; }
  .carousel__btn { top: calc((min(530px, 82vw)) / 2); }
}
[data-blur-out] { will-change: filter; }

/* =========================================================
   CASE STUDY
   ========================================================= */
.page-case { --accent: var(--card-c); --accent-bg: var(--card-bg); }
.case-hero { padding-top: clamp(24px, 4vw, 56px); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-sm); color: var(--c-ink-2); text-decoration: none; }
.back-link:hover { color: var(--accent); }
.case-hero__eyebrow { margin-top: var(--sp-6); display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; color: var(--accent); }
.case-hero h1 { margin-top: var(--sp-4); font-weight: 800; font-size: clamp(52px, 8vw, 120px); line-height: .92; letter-spacing: -.05em; color: var(--accent); }
.case-hero__lede { margin-top: var(--sp-5); max-width: 30ch; font-family: var(--f-display); font-weight: 500; font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.015em; color: var(--c-ink); }

.case-meta { margin-top: var(--sp-7); display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: var(--bw) solid var(--c-ink); }
.case-meta div { padding: var(--sp-4) var(--sp-4) var(--sp-4) 0; border-bottom: 1px solid var(--c-line); }
.case-meta dt { font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); }
.case-meta dd { margin: 6px 0 0; font-size: var(--fs-sm); font-weight: 600; line-height: 1.4; }

.case-summary { margin-top: var(--section); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.case-summary h2 { font-size: var(--fs-2xl); }
.case-summary__text { margin-top: var(--sp-5); display: grid; gap: var(--sp-4); font-size: var(--fs-base); line-height: 1.65; color: var(--c-ink-2); }
.case-summary__text strong { color: var(--c-ink); }
.case-points { display: grid; gap: var(--sp-4); }
.case-point { padding: 20px 22px; border-radius: var(--r-lg); background: var(--accent-bg); box-shadow: inset 0 0 0 1.5px var(--accent); }
.case-point .eyebrow { color: var(--accent); }
.case-point p { margin-top: 6px; font-size: var(--fs-sm); line-height: 1.5; }
.case-point--dark { background: var(--accent); color: #fff; box-shadow: none; }
.case-point--dark .eyebrow { color: rgba(255, 255, 255, .8); }
.case-point--dark p { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-md); line-height: 1.3; letter-spacing: -.01em; }

.case-decisions { margin-top: var(--sp-8); display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: var(--sp-4); counter-reset: d; }
@media (max-width: 1100px) { .case-decisions { grid-template-columns: repeat(2, minmax(0, 1fr)); } .case-decisions li:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 560px) { .case-decisions { grid-template-columns: 1fr; } }
.case-decisions li { list-style: none; padding: 20px 18px; border: 1.5px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-cream); }
.case-decisions b { display: block; font-family: var(--f-display); font-size: clamp(17px, .4vw + 14px, 19px); letter-spacing: -.01em; line-height: 1.2; }
.case-decisions span { display: block; margin-top: 6px; font-size: var(--fs-sm); color: var(--c-ink-2); line-height: 1.5; }
.case-decisions li::before { counter-increment: d; content: "D" counter(d); display: inline-block; margin-bottom: var(--sp-3); padding: 2px 8px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: var(--fs-xs); font-weight: 700; }

.deck-head { margin-top: var(--section); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--sp-4); }
.deck-head h2 { font-size: var(--fs-2xl); }
.deck-head p { font-size: var(--fs-sm); color: var(--c-muted); }
.deck { width: min(1240px, 100% - 2 * var(--gutter)); margin: var(--sp-6) auto 0; }
.deck__slide { position: sticky; top: calc(var(--nav-h) + 16px); padding-bottom: var(--sp-6); }
.deck__slide:last-child { padding-bottom: 0; }
.deck__card { position: relative; border-radius: var(--r-xl); overflow: hidden; background: #fff; box-shadow: 0 0 0 1.5px var(--accent), 0 -10px 40px -24px rgba(0, 0, 0, .35); transform-origin: center top; will-change: transform; }
.deck__label { display: flex; align-items: center; gap: var(--sp-3); padding: 12px 18px; background: var(--accent); color: #fff; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; }
.deck__label b { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-sm); opacity: .7; }
.deck__card img { width: 100%; }
.deck__card--screen { background: var(--c-cream); }
.deck__card--screen img { padding: clamp(10px, 2vw, 28px); }
.deck-progress { position: fixed; left: 0; right: 0; top: var(--nav-h); height: 3px; z-index: 49; opacity: 0; transition: opacity .3s; pointer-events: none; }
.deck-progress.is-on { opacity: 1; }
.deck-progress span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

.case-next { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-top: var(--section); }
.case-next a { display: flex; flex-direction: column; gap: 4px; padding: 22px 24px; border: var(--bw) solid var(--c-ink); border-radius: var(--r-lg); text-decoration: none; box-shadow: 4px 4px 0 var(--c-ink); transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s; }
.case-next a:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--c-ink); background: var(--c-amber); }
.case-next a:last-child { text-align: right; }
.case-next small { font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); }
.case-next strong { font-family: var(--f-display); font-size: var(--fs-xl); letter-spacing: -.02em; }

@media (max-width: 860px) {
  .case-summary { grid-template-columns: 1fr; }
  .deck__slide { padding-bottom: var(--sp-4); }
  .deck__card { border-radius: var(--r-lg); }
}
@media (max-width: 560px) {
  .case-next { grid-template-columns: 1fr; }
  .case-next a:last-child { text-align: left; }
  .deck__label { padding: 10px 14px; }
}

/* =========================================================
   CV
   ========================================================= */
.cv-title { color: var(--c-red); }
.cv-actions { margin-top: var(--sp-6); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); }
.cv-pages { margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); max-width: 1100px; }
.cv-page { margin: 0; }
.cv-page img { width: 100%; border-radius: var(--r-md); background: #fff; box-shadow: 0 0 0 1px var(--c-line), var(--shadow-soft); }
.cv-page figcaption { margin-top: var(--sp-3); text-align: center; font-size: var(--fs-xs); font-weight: 600; color: var(--c-muted); }
@media (max-width: 760px) { .cv-pages { grid-template-columns: 1fr; max-width: 560px; } }

/* ---------- Arcade-ticket tags on project cards ---------- */
.ticket { position: absolute; left: -16px; top: -18px; z-index: 4; transform: rotate(-7deg); transform-origin: 30% 60%; filter: drop-shadow(2px 3px 0 rgba(17, 17, 17, .28)); transition: transform .4s var(--spring); pointer-events: none; }
.card:hover .ticket, .card:focus-visible .ticket { transform: rotate(-11deg) translateY(-3px) scale(1.04); }
.ticket__body {
  --notch: 7px;
  display: flex; align-items: stretch;
  background: var(--tag-bg, var(--card-c)); color: #fff;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 6px, transparent 6px 12px);
  border-radius: 4px;
  -webkit-mask: radial-gradient(circle var(--notch) at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
}
.ticket__no { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 7px 10px 7px 15px; border-right: 2px dashed rgba(255, 255, 255, .55); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.1; opacity: .9; }
.ticket__no b { font-family: var(--f-display); font-size: 13px; letter-spacing: .02em; }
.ticket__txt { display: flex; align-items: center; padding: 8px 18px 8px 12px; font-family: var(--f-display); font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 520px) { .ticket { left: -8px; top: -14px; } .ticket__txt { font-size: 11px; padding: 7px 14px 7px 10px; } .ticket__no { padding: 6px 8px 6px 12px; } }

/* ---------- Sticky frame stack (Selected Works) ---------- */
.frame-stack { position: relative; }
.frame-stack .frame { position: sticky; top: calc(var(--nav-h) + 24px); transform-origin: center top; will-change: transform; }
.frame-stack .frame + .frame { margin-top: clamp(72px, 9vw, 140px); }
.frame-stack .frame:last-child { margin-bottom: 0; }

/* ---------- Top nav: sliding blob, hop + click spin, page transitions ---------- */
.icon-nav { position: relative; }
.icon-nav__blob { position: absolute; left: 0; top: 0; z-index: 0; list-style: none; border-radius: var(--r-md); background: rgba(0, 0, 0, .05); opacity: 0; pointer-events: none;
  transition: transform .45s var(--spring), width .45s var(--spring), height .45s var(--spring), background .3s, opacity .25s, box-shadow .3s; }
.icon-nav__blob.is-current { background: var(--c-nav-active); }
.icon-nav.has-blob a[aria-current="page"], .icon-nav.has-blob a:hover { background: transparent; }
.icon-nav li { position: relative; z-index: 1; }
.icon-nav a:hover img, .icon-nav a:focus-visible img { transform: none; animation: hop .6s var(--spring); }
.icon-nav a.is-clicked img { animation: spin .5s var(--ease); }
@keyframes hop { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-7px) scale(1.12, .92) rotate(-6deg); } 55% { transform: translateY(0) scale(.94, 1.06) rotate(3deg); } 75% { transform: translateY(-2px) scale(1.04) rotate(-2deg); } 100% { transform: translateY(0) scale(1.08) rotate(-4deg); } }
@keyframes spin { 0% { transform: scale(1); } 40% { transform: scale(.82) rotate(-25deg); } 100% { transform: scale(1.12) rotate(360deg); } }
.icon-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--c-red); animation: dot-in .5s var(--spring) both; }
@keyframes dot-in { from { transform: scale(0); } to { transform: scale(1); } }
.nav-cta svg { transition: transform .35s var(--spring); }
.nav-cta:hover svg { transform: rotate(-14deg) translateY(-2px) scale(1.15); }

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .25s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .4s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }
.site-nav { view-transition-name: site-nav; }
::view-transition-group(site-nav) { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .icon-nav a img, .icon-nav a.is-clicked img { animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Case study hero ticket */
.case-hero__eyebrow .ticket { position: relative; left: auto; top: auto; transform: rotate(-4deg); }
.case-hero__eyebrow .ticket:hover { transform: rotate(-8deg) scale(1.05); }
