/* Dean Javed Portfolio — shared tokens + homepage. Source: Figma "Portfolio - Homepage" (395:590).
   Rules: portfolio-starter/starter/docs/design-system.md and portfolio-starter/starter/CLAUDE.md.
   Loaded by every page; casestudy.css adds the case-study layout on top. */

:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #636363;
  --line: #e6e6e6;
  --ghost: #f1f1ef;
  --card-ink: #1a1a1a;
  --card-muted: #5c5c5c;
  --card-label: #6b6b6b; /* design-system "faint" #999 fails AA at 11px. #6b6b6b (not #737373) keeps 4.5:1 on the homepage's paper grain */
  --accent: #d4a0a0;     /* rose; change the accent here only */
  --card-shadow: 0 12px 40px 0 rgba(26, 18, 11, 0.08);
  --page-max: 1152px;
  --gutter: 48px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Homepage display type (scratch/typography.html, "Confident" scale): Figtree Bold, tracked tight */
  --display: var(--font);
  --display-weight: 700;
  --display-track: -0.035em;
  --type-hero: clamp(44px, 6.6vw, 96px);
  --type-h2: clamp(32px, 4vw, 52px);
  --type-card: clamp(34px, 4.4vw, 64px);
  --type-row: clamp(18px, 1.5vw, 21px);
  --type-lede: clamp(18px, 1.5vw, 22px);
  --type-about: clamp(26px, 2.6vw, 38px);
}

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

html { color-scheme: light; scroll-behavior: smooth; }
/* With scroll motion on (home.js), CSS smooth scrolling would upset ScrollTrigger's measurements;
   home.js glides in-page links itself instead. */
html.has-motion { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}

p { margin: 0; }
a { color: inherit; }
:where(a, button):focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 2px; }

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

/* Homepage paper grain (the "Grain" background from scratch/hero.html, without the flicker): a fixed layer
   of fine noise over the whole page. Each pixel darkens what's under it by 0–7% (the tile is black with a
   random 0–7% alpha), so it reads as paper; clicks pass straight through. Above the intro and the nav,
   below the dot cursor. */
.hm-home::after { content: ""; position: fixed; inset: 0; z-index: 9000; pointer-events: none; background: url("images/paper-grain.png") 0 0 / 128px 128px repeat; }
@media print { .hm-home::after { display: none; } }

/* Underlined text links (hero, footer) */
.hm-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--fg); }
.hm-links a { text-decoration: underline; text-underline-position: from-font; transition: color 200ms ease-out; }
.hm-links a:hover { color: var(--muted); }

/* Nav (case studies and the welcome intro; the homepage uses the sticky .nv below) */
.hm-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; padding-block: 28px; }
.hm-nav__name { font-size: 15px; font-weight: 600; letter-spacing: -0.15px; color: var(--fg); text-decoration: none; }
.hm-nav__links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.hm-nav__links a { color: var(--muted); text-decoration: none; transition: color 200ms ease-out; }
.hm-nav__links a:hover { color: var(--fg); }

/* Homepage sticky nav (nav.js; explored in scratch/nav.html). A frosted bar floats at the top; as you scroll
   down it collapses into a "Dean Javed" + menu pill on the content's left edge, and opens again as you
   scroll up. A rose dot marks the section you're reading. Phones always get the pill and a drop-down.
   Without JS it stays an open, centred bar. */
.nv-spacer { height: 74px; }                 /* the old in-page nav's height, so the hero stays where it was */
.hm-home [id] { scroll-margin-top: 96px; }   /* in-page links land below the floating bar */
.nv { --nv-top: 20px; --nv-h: 56px; --nv-ease: cubic-bezier(0.16, 1, 0.3, 1); position: fixed; top: var(--nv-top); left: 0; right: 0; z-index: 50; height: 0; }
.nv__bar { position: absolute; top: 0; left: 24px; right: 24px; display: flex; align-items: center; max-width: 880px; height: var(--nv-h); margin: 0 auto; padding: 0 8px 0 20px;
           overflow: hidden; border-radius: 12px; color: var(--fg); }
.nv.is-driven .nv__bar { right: auto; margin: 0; max-width: none; }   /* nav.js sets its left edge and width */
.nv__bar, .nv__panel { background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
                       box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.07), 0 10px 30px rgba(26, 18, 11, 0.06); }
.nv__brand { flex: none; font-size: 15px; font-weight: 600; letter-spacing: -0.15px; color: inherit; text-decoration: none; white-space: nowrap; }
/* Links sit in the middle of the bar whatever its width, so they don't squash while it resizes */
.nv__links { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.nv__links ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nv__link { position: relative; display: block; padding: 8px 12px; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color 200ms ease-out; }
.nv__link::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left center;
                   transition: transform 400ms var(--nv-ease); }
.nv__link:hover, .nv__link[aria-current="true"] { color: var(--fg); }
.nv__link:hover::after { transform: scaleX(1); }
.nv__dot { position: absolute; top: 5px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0; pointer-events: none; }
.nv__cta { flex: none; display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 10px 16px; border-radius: 100px; background: var(--card-ink); color: #ffffff;
           font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color 300ms ease-out; }
.nv__cta:hover { background: #000000; }
.nv__cta svg { transition: transform 350ms var(--nv-ease); }
.nv__cta:hover svg { transform: translateX(3px); }
.nv__menu { position: absolute; top: 50%; right: 8px; display: grid; place-items: center; width: 40px; height: 40px; margin-top: -20px; padding: 0; border: 0; border-radius: 8px;
            background: none; color: inherit; cursor: pointer; opacity: 0; visibility: hidden; }
.nv__menu:hover { background: rgba(10, 10, 10, 0.05); }
/* Phones: the drop-down under the pill */
.nv__panel { position: absolute; top: calc(var(--nv-h) + 8px); left: 24px; right: 24px; padding: 12px 20px 20px; border-radius: 12px; }
.nv__panel ul { margin: 0 0 16px; padding: 0; list-style: none; }
.nv__panel li a { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; font-size: 24px; font-weight: var(--display-weight);
                  letter-spacing: -0.02em; text-decoration: none; }
.nv__panel li a[aria-current="true"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Hero (Figma 480:1847): the portrait beside a short introduction, the two aligned at the bottom.
   images/portrait.webp is the Figma crop of avatar.jpg at 2x. The photo narrows a little on smaller
   screens and sits above the text on phones. */
.hm-hero { display: flex; align-items: flex-end; gap: 47px; padding: clamp(64px, 9vw, 120px) 0 clamp(96px, 10vw, 140px); }
.hm-hero__photo { flex: none; width: clamp(240px, 30vw, 336px); aspect-ratio: 336 / 510; border-radius: 22px; overflow: hidden; background: var(--ghost); }
.hm-hero__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hm-hero__body { display: flex; flex-direction: column; gap: 49px; width: 504px; min-width: 0; max-width: 100%; }
.hm-hero__text { display: flex; flex-direction: column; gap: 20px; font-size: 17px; line-height: 26px; color: var(--muted); }
.hm-hero__bio { display: flex; flex-direction: column; gap: 26px; }
.hm-hero__text strong { font-weight: 500; color: var(--fg); }
@media (max-width: 760px) {
  .hm-hero { flex-direction: column; align-items: flex-start; gap: 36px; }
  .hm-hero__photo { width: min(240px, 66%); }
  .hm-hero__body { gap: 40px; }
}
/* The welcome intro's small portrait (index.html [data-avatar], intro.js) */
.hm-hero__avatar { position: relative; flex: none; width: 71px; height: 74px; border-radius: 22px; overflow: hidden; }
.hm-hero__avatar img { position: absolute; left: -44.1%; top: -41.78%; width: 176.32%; height: 224%; max-width: none; }

/* Section header: number, big display title, note, and an ink rule (home.js draws it in on scroll) */
.hm-section { padding-bottom: 120px; }
.hm-section__head { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: end; gap: 16px; margin-bottom: clamp(32px, 4vw, 56px); padding-top: 24px; }
.hm-section__rule { position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--fg); transform-origin: left center; }
.hm-section__num { align-self: start; padding-top: 0.5em; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hm-section__title { grid-column: 2; margin: 0; font-size: var(--type-h2); font-weight: var(--display-weight); line-height: 1; letter-spacing: var(--display-track); color: var(--fg); }
.hm-section__meta { grid-column: 3; padding-bottom: 0.35em; font-size: 15px; color: var(--muted); white-space: nowrap; }
.hm-section__meta a { text-decoration: none; }
.hm-section__meta a:hover { color: var(--fg); text-decoration: underline; }

/* Selected projects */
.hm-projects__list { display: flex; flex-direction: column; gap: 36px; margin: 0; padding: 0; list-style: none; }

.hm-card { --pad: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 301px; padding: var(--pad); background: #ffffff; border-radius: 12px; box-shadow: var(--card-shadow); }
.hm-card__top { display: flex; flex-direction: column; gap: 20px; }
.hm-card__title { margin: 0; font-size: var(--type-card); font-weight: var(--display-weight); line-height: 1; letter-spacing: var(--display-track); color: var(--card-ink); }
.hm-card__summary { max-width: 680px; font-size: 18px; line-height: 1.6; color: var(--card-muted); }
.hm-card__bottom { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hm-card__meta { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 0; }
.hm-card__meta div { display: flex; flex-direction: column; gap: 4px; padding-left: 16px; border-left: 2px solid var(--accent); }
.hm-card__meta dt { font-size: 11px; font-weight: 700; color: var(--card-label); }
.hm-card__meta dd { margin: 0; font-size: 14px; color: var(--card-ink); }
.hm-card__cta { display: inline-flex; padding: 12px 24px; border-radius: 100px; background: var(--card-ink); color: #ffffff; font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; transition: background-color 300ms ease-out; }
.hm-card__cta:hover { background: #000000; }
/* A step up inside the project cards only (the intro footer and case studies share these classes) */
.hm-card .hm-card__meta dd { font-size: 15px; }
.hm-card .hm-card__cta { padding: 14px 28px; font-size: 14px; }

/* Case study cards: hover (scratch/cards.html, "Peek" + "Sweep").
   The whole card is the link: the button's ::after covers it, so the focus ring moves to the card.
   The lift uses `translate`, not `transform`, because home.js animates the card's transform as it arrives. */
.hm-card { --ease: cubic-bezier(0.16, 1, 0.3, 1);
           --rg: linear-gradient(110deg, #7f4a45 0%, #b9776b 16%, #e7b19e 30%, #c98b7b 42%, #9c5b54 56%, #dca592 70%, #a8695f 84%, #7f4a45 100%);
           position: relative; isolation: isolate; overflow: hidden; transition: translate 700ms var(--ease), box-shadow 700ms var(--ease); }
.hm-card .hm-card__cta::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.hm-card .hm-card__cta:focus-visible { outline: none; }
.hm-card:has(.hm-card__cta:focus-visible) { outline: 2px solid var(--fg); outline-offset: 4px; }
.hm-card:is(:hover, :has(.hm-card__cta:focus-visible)) .hm-card__cta { background: #000000; }

/* The title: an ink layer over rose gold. On hover the ink wipes away left to right (--gp), and back on leave.
   It paints through background-clip, so a little padding keeps the descenders (g, p) inside the painted box.
   Not while home.js has the title split into rising lines (.is-masked): it stays plain ink until they land. */
@property --gp { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.hm-card__title:not(.is-masked) { padding: 0.08em 0 0.16em; margin: -0.08em 0 -0.16em; color: transparent; -webkit-background-clip: text; background-clip: text;
                                  background-image: linear-gradient(90deg, transparent calc(var(--gp) - 14%), var(--card-ink) var(--gp)), var(--rg); transition: --gp 1000ms var(--ease); }
/* .is-lit: touch screens play the sweep once as the card arrives (home.js) */
.hm-card:is(:hover, .is-lit, :has(.hm-card__cta:focus-visible)) .hm-card__title { --gp: 114%; }

/* The picture: by default a band across the top of the card (phones, tablets, touch screens) */
.hm-card__media { flex: none; order: -1; aspect-ratio: 16 / 9; max-height: 340px; margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 0; overflow: hidden; background: var(--ghost); }
.hm-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (hover: hover) and (pointer: fine) {
  .hm-card:hover { translate: 0 -4px; box-shadow: 0 22px 60px rgba(26, 18, 11, 0.12); }
}
/* With a mouse and room beside the text: a print tucked off the right edge, only its corner showing.
   On hover it slides in and straightens. The text keeps clear of where it lands: the title and summary stop
   short of it, and they hold enough height that the details and button always start below it. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .hm-card__media { position: absolute; top: 40px; right: 48px; z-index: 1; width: 260px; max-height: none; aspect-ratio: 4 / 3; margin: 0; border-radius: 10px;
                    box-shadow: 0 18px 40px rgba(26, 18, 11, 0.22); transform: translateX(78%) rotate(9deg); transition: transform 900ms var(--ease); }
  .hm-card:is(:hover, :has(.hm-card__cta:focus-visible)) .hm-card__media { transform: translateX(0) rotate(-3deg); }
  .hm-card__top { max-width: calc(100% - 292px); min-height: 184px; }
}

/* Recent work: lighter than a case study card, two columns that stack on small screens */
.hm-recent__item { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px 72px; }
/* Logo panel: the campaign's white logo on a gradient built around its purple, rgb(64, 0, 63) */
.hm-recent__media { grid-column: 1 / -1; display: grid; place-items: center; min-height: 320px; margin: 0 0 8px; padding: 40px; border-radius: 12px; background: linear-gradient(135deg, #63175f 0%, rgb(64, 0, 63) 48%, #270026 100%); }
.hm-recent__media img { display: block; width: min(260px, 70%); height: auto; }
.hm-recent__about { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.hm-recent__client, .hm-recent__label { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--card-label); }
.hm-recent__title { margin: 0; font-size: clamp(32px, 3.4vw, 48px); font-weight: var(--display-weight); line-height: 1.05; letter-spacing: var(--display-track); color: var(--card-ink); }
.hm-recent__desc { max-width: 560px; font-size: 18px; line-height: 1.6; color: var(--card-muted); }
.hm-recent__link { margin-top: 8px; font-size: 16px; color: var(--fg); text-decoration: underline; text-underline-position: from-font; transition: color 200ms ease-out; }
.hm-recent__link:hover { color: var(--muted); }
.hm-recent__part { display: flex; flex-direction: column; gap: 12px; padding-left: 24px; border-left: 2px solid var(--accent); }
.hm-recent__intro { font-size: 17px; line-height: 1.6; color: var(--card-muted); }
.hm-recent__list { margin: 0; padding: 0; list-style: none; }
.hm-recent__list li { padding-block: 12px; border-top: 1px solid var(--line); font-size: 17px; line-height: 1.5; color: var(--card-ink); }
/* The personas line: the whole line opens the reader; its cover shows on hover */
.hm-recent__list .hm-recent__personas { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.hm-recent__view { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.hm-recent__view .ac-open { text-decoration-color: currentColor; }

/* Skills & approach ("Explorer" with the "Editorial" drawings in scratch/skills.html).
   Base = stacked: phones, and anyone without skills.js. On screens 640px and up, skills.js turns the
   three areas into vertical tabs beside the chosen area's drawing and skills.
   Drawings: original inline SVG line art (400×300 viewBox) drawn in currentColor on the ghost tile. */
.sk { --art-bg: var(--ghost); --art-ink: var(--fg); --art-acc: var(--accent); --sw: 1.5; --ease: cubic-bezier(0.16, 1, 0.3, 1); }
.sk__list { display: flex; flex-direction: column; gap: 56px; margin: 0; padding: 0; list-style: none; }
.sk__item { display: flex; flex-direction: column; gap: 24px; }
.sk__item[hidden] { display: none; }
.sk__art { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--art-bg); color: var(--art-ink); overflow: hidden; }
.sk__head { display: flex; flex-direction: column; gap: 10px; }
.sk__num { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--card-label); }
.sk__title { margin: 0; font-size: clamp(30px, 3.4vw, 44px); font-weight: var(--display-weight); line-height: 1.05; letter-spacing: var(--display-track); color: var(--fg); }
/* The approach line borrows the homepage's rose-ruled label pattern */
.sk__approach { padding-left: 12px; border-left: 2px solid var(--accent); font-size: 16px; line-height: 1.45; color: var(--muted); }
.sk__skills { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.sk__skills li { padding-block: 13px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--fg); }
.sk__skills small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--muted); }
/* Where each area shows up in the work */
.sk__proof { margin-top: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.sk__proof a { color: var(--fg); text-decoration: underline; text-underline-position: from-font; transition: color 200ms ease-out; }
.sk__proof a:hover { color: var(--muted); }

/* Drawings */
.sk__svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.sk__svg .l { fill: none; stroke: currentColor; stroke-width: var(--sw); stroke-linecap: round; stroke-linejoin: round; }
.sk__svg .tx { stroke-width: calc(var(--sw) * 2.4); }   /* lines of "text" */
.sk__svg .f { fill: currentColor; stroke: none; }
.sk__svg .acc { stroke: var(--art-acc); }
.sk__svg .facc { fill: var(--art-acc); stroke: none; }
.sk__svg .o1 { opacity: 0.92; }
.sk__svg .o2 { opacity: 0.55; }
.sk__svg .o3 { opacity: 0.32; }
.sk__svg .o4 { opacity: 0.18; }
.sk__svg .dash { stroke-dasharray: 3 6; }
.sk__svg .glyph { font: 600 150px var(--font); }
.sk__svg .draw { stroke-dasharray: 1 2; } /* with pathLength="1": one dash covers the whole path */
.sk__svg :is(.pop, .rise) { transform-box: fill-box; transform-origin: center; }
.sk__svg .growx { transform-box: fill-box; transform-origin: left center; }

/* Explorer tabs (built by skills.js on screens 640px and up) */
.sk__tablist { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.sk__tab { position: relative; display: flex; flex-direction: column; width: 100%; padding: 24px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none;
           color: inherit; font: inherit; text-align: left; cursor: pointer; transition: padding-left 500ms var(--ease); }
.sk__tab::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 2px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform 500ms var(--ease); }
.sk__tab .sk__title { margin-top: 8px; color: var(--card-label); transition: color 300ms ease-out; }
.sk__tab .sk__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 500ms var(--ease); }
.sk__tab .sk__more > span { min-height: 0; overflow: hidden; }
.sk__tab .sk__approach { display: block; padding: 10px 0 0; border: 0; }
.sk__tab:hover .sk__title, .sk__tab[aria-selected="true"] .sk__title { color: var(--fg); }
.sk__tab[aria-selected="true"] { padding-left: 20px; }
.sk__tab[aria-selected="true"]::before { transform: scaleY(1); }
.sk__tab[aria-selected="true"] .sk__more { grid-template-rows: 1fr; }
.sk__item[role="tabpanel"]:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 12px; }

@media (min-width: 640px) {
  .sk.has-tabs .sk__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
  .sk.has-tabs .sk__list { display: block; }
  .sk.has-tabs .sk__item .sk__head { display: none; }
  .sk.has-tabs .sk__art { aspect-ratio: 3 / 2; --sw: 1; }
  .sk.has-tabs .sk__skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}
@media (min-width: 640px) and (max-width: 900px) {
  .sk.has-tabs .sk__body { gap: 32px; }
  .sk.has-tabs .sk__skills { grid-template-columns: minmax(0, 1fr); }
}

/* Skills motion (skills.js; none with reduced motion):
   1. The tabs, then the chosen area, rise in as they scroll into view.
   2. The area's drawing then plays once (~2.5s) and stops. No loops, so nothing moves for more than
      5 seconds (WCAG 2.2.2). Changing tabs replays it. Each drawing part sets its own start with --t. */
.sk__item { --d: 160ms; }
.sk__item, .sk__tablist { transition: opacity 700ms ease-out var(--d, 0ms), transform 1000ms var(--ease) var(--d, 0ms); }
.sk__svg { transition: opacity 900ms ease-out calc(var(--d, 0ms) + 100ms), transform 1400ms var(--ease) calc(var(--d, 0ms) + 100ms); }
.sk.is-reveal :is(.sk__item, .sk__tablist):not(.is-in) { opacity: 0; transform: translateY(36px); }
.sk.is-reveal .sk__item:not(.is-in) .sk__svg { opacity: 0; transform: scale(1.06); }
.sk.no-anim :is(.sk__item, .sk__tablist, .sk__svg) { transition: none !important; }
@keyframes sk-in { from { opacity: 0; transform: translateY(14px); } }
.sk__item.is-switching { animation: sk-in 600ms var(--ease) both; }

@keyframes sk-draw { from { stroke-dashoffset: 1.01; } }
@keyframes sk-pop { from { opacity: 0; transform: scale(0.4); } }
@keyframes sk-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes sk-fade { from { opacity: 0; } }
@keyframes sk-growx { from { transform: scaleX(0); } }
@keyframes sk-dim { from { opacity: 0.92; } }
.sk.is-reveal .is-playing .sk__svg .draw  { animation: sk-draw var(--dur, 1000ms) var(--ease) calc(var(--d, 0ms) + var(--t, 0ms)) both; }
.sk.is-reveal .is-playing .sk__svg .pop   { animation: sk-pop var(--dur, 700ms) var(--ease) calc(var(--d, 0ms) + var(--t, 0ms)) both; }
.sk.is-reveal .is-playing .sk__svg .rise  { animation: sk-rise var(--dur, 800ms) var(--ease) calc(var(--d, 0ms) + var(--t, 0ms)) both; }
.sk.is-reveal .is-playing .sk__svg .fade  { animation: sk-fade var(--dur, 600ms) ease-out calc(var(--d, 0ms) + var(--t, 0ms)) both; }
.sk.is-reveal .is-playing .sk__svg .growx { animation: sk-growx var(--dur, 700ms) var(--ease) calc(var(--d, 0ms) + var(--t, 0ms)) both; }
.sk.is-reveal .is-playing .sk__svg .dim   { animation: sk-dim 500ms ease-out calc(var(--d, 0ms) + var(--t2, 0ms)) both; }

@media (prefers-reduced-motion: reduce) {
  .sk__item, .sk__tablist, .sk__svg, .sk__tab, .sk__tab::before, .sk__tab .sk__more, .sk__tab .sk__title { transition: none; }
  .sk__item.is-switching, .sk__svg * { animation: none !important; }
}

/* Ruled list rows (academic, writing, play) */
.hm-rows { margin: 0; padding: 0; list-style: none; }
.hm-row { display: flex; align-items: flex-start; gap: 24px; padding-block: 24px; border-bottom: 1px solid var(--line); }
.hm-row__title { flex: 1 1 0; min-width: 0; font-size: var(--type-row); font-weight: 600; letter-spacing: -0.01em; color: var(--fg); }
.hm-row__type { flex: none; width: 180px; font-size: 15px; color: var(--muted); }
.hm-row__year { flex: none; width: 64px; font-size: 15px; color: var(--muted); text-align: right; }


/* Academic reports (academic.js; explored in scratch/academic.html). The whole row opens the report in the
   reader: its pages on the left (pre-rendered images, since phones can't show a PDF inside a page) and its
   details on the right. Hovering a row shows the report's cover beside the pointer. */
.ac-row { position: relative; align-items: center; }
.ac-row .hm-row__title { display: flex; align-items: center; gap: 12px; }
.ac-open { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; transition: text-decoration-color 200ms ease-out; }
.ac-open::after { content: ""; position: absolute; inset: 0; }
.ac-open:focus-visible { outline: none; }
.ac-row:has(.ac-open:focus-visible) { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 4px; }
.ac-row:hover .ac-open { text-decoration-color: currentColor; }
.ac-badge { flex: none; padding: 3px 8px; border: 1px solid var(--line); border-radius: 100px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--card-label); }
.ac-arrow { flex: none; color: var(--muted); transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), color 200ms ease-out; }
.ac-row:hover .ac-arrow { color: var(--fg); transform: translateX(4px); }
.ac-float { position: fixed; top: 0; left: 0; z-index: 45; pointer-events: none; }
.ac-float img { display: block; width: 190px; height: auto; border-radius: 6px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
                opacity: 0; transform: scale(0.85) rotate(-4deg); transition: opacity 200ms ease-out, transform 450ms cubic-bezier(0.16, 1, 0.3, 1); }
.ac-float.is-on img { opacity: 1; transform: none; }

/* The reader */
html:has(.ac-viewer[open]) { overflow: hidden; }
.ac-viewer { width: min(1180px, calc(100vw - 48px)); height: min(900px, calc(100dvh - 48px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 0;
             border-radius: 16px; background: var(--bg); color: var(--fg); overflow: hidden; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25); }
.ac-viewer::backdrop { background: rgba(10, 10, 10, 0.5); }
.ac-viewer[open] { display: flex; flex-direction: column; animation: ac-fade 250ms ease-out; }
@keyframes ac-fade { from { opacity: 0; } }
.ac-bar { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px 12px 28px; border-bottom: 1px solid var(--line); }
.ac-bar__label { font-size: 13px; color: var(--muted); }
.ac-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border: 1px solid var(--card-ink); border-radius: 100px; background: transparent; color: var(--card-ink);
          font: 600 13px/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 200ms ease-out; }
.ac-btn:hover { background: var(--ghost); }
.ac-btn--solid { background: var(--card-ink); color: #ffffff; }
.ac-btn--solid:hover { background: #000000; }
.ac-btn small { font-size: 12px; font-weight: 500; opacity: 0.7; }
.ac-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; flex: 1; min-height: 0; }
.ac-preview { position: relative; min-height: 0; background: var(--ghost); }
.ac-pages { display: flex; flex-direction: column; align-items: center; gap: 24px; height: 100%; padding: 32px; overflow-y: auto; outline: none; }
.ac-preview:has(.ac-pages:focus-visible) { outline: 2px solid var(--fg); outline-offset: -2px; }
.ac-page { flex: none; width: min(100%, 660px); margin: 0; background: #ffffff; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); }
.ac-page img { display: block; width: 100%; height: auto; }
/* A project's images: never wider than the image itself (--w), with any caption above it */
.ac-shot { flex: none; width: min(100%, 520px, var(--w, 520px)); margin: 0; }
.ac-shot img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); }
.ac-shot figcaption { margin-bottom: 10px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.ac-shot figcaption b { color: var(--fg); font-weight: 600; }
/* Landscape, text-heavy pieces (the persona cards) get the full width of the pane, plus their text and a full-size link */
.ac-shot--wide { width: min(100%, 760px, var(--w, 760px)); }
.ac-shot--wide figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.ac-shot__full { font-size: 13px; color: var(--fg); text-decoration: underline; text-underline-position: from-font; white-space: nowrap; }
.ac-shot__full:hover { color: var(--muted); }
.ac-shot__more { margin-top: 12px; }
.ac-transcript { font-size: 14px; line-height: 1.55; color: var(--card-muted); }
.ac-transcript summary { display: inline-block; font-size: 13px; font-weight: 600; color: var(--fg); cursor: pointer; text-decoration: underline; text-underline-position: from-font; }
.ac-transcript[open] { padding: 16px 20px 6px; border-radius: 8px; background: #ffffff; box-shadow: 0 0 0 1px var(--line); }
.ac-transcript[open] summary { margin-bottom: 10px; }
.ac-transcript h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; color: var(--fg); }
.ac-transcript h4 { margin: 14px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--card-label); }
.ac-transcript p, .ac-transcript ul { margin: 0 0 8px; }
.ac-transcript ul { padding-left: 18px; }
.ac-transcript li + li { margin-top: 6px; }
.ac-transcript b { color: var(--fg); font-weight: 600; }
.ac-count { position: absolute; bottom: 16px; left: 50%; padding: 7px 12px; border-radius: 100px; background: rgba(10, 10, 10, 0.78); color: #ffffff;
            font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; transform: translateX(-50%); pointer-events: none; }
.ac-details { min-height: 0; padding: 32px 28px 36px; overflow-y: auto; border-left: 1px solid var(--line); }
.ac-title { margin: 0; font-size: clamp(26px, 2.4vw, 34px); font-weight: var(--display-weight); line-height: 1.05; letter-spacing: var(--display-track); }
.ac-sub { margin-top: 10px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.ac-summary { margin-top: 20px; font-size: 16px; line-height: 1.6; color: var(--card-muted); }
.ac-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin: 24px 0 0; }
.ac-facts div { display: flex; flex-direction: column; gap: 4px; padding-left: 12px; border-left: 2px solid var(--accent); }
.ac-facts dt, .ac-group__label { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--card-label); }
.ac-facts dd { margin: 0; font-size: 14px; line-height: 1.4; }
.ac-group { margin-top: 28px; }
.ac-group__label { margin: 0 0 10px; }
.ac-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ac-tags li { padding: 7px 12px; border: 1px solid var(--line); border-radius: 100px; font-size: 13px; font-weight: 500; line-height: 1.3; }
.ac-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }

/* About */
.hm-about__body { display: flex; align-items: flex-start; gap: 81px; }
/* About gallery: two columns drift on a loop, one up and one down ("Drifting columns" in scratch/gallery.html;
   photos and crops from Figma Gallery 398:854). Each track holds its column twice, so moving it by half loops
   without a seam. Hover pauses it and the Pause button (gallery.js) stops it. With reduced motion the columns
   stand still at full height. */
.hm-gallery { --gallery-gap: 30px; flex: none; width: 485px; }
/* The side padding keeps the shadows clear of the clip; the negative margin keeps the photos on the grid */
.hm-gallery__window { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gallery-gap); height: 760px; margin-inline: -16px; padding-inline: 16px; overflow: hidden;
                      -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent); }
.hm-gallery__col { min-width: 0; }
.hm-gallery__set { display: flex; flex-direction: column; gap: var(--gallery-gap); padding-bottom: var(--gallery-gap); }
@keyframes hm-drift { to { transform: translate3d(0, -50%, 0); } }
.hm-gallery__track { animation: hm-drift var(--drift-dur, 45s) linear infinite; }
.hm-gallery__col + .hm-gallery__col .hm-gallery__track { animation-direction: reverse; }
.hm-gallery:is(:hover, .is-paused) .hm-gallery__track { animation-play-state: paused; }
.hm-gallery__pause { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding: 8px 16px 8px 12px; border: 1px solid var(--line); border-radius: 100px; background: #ffffff;
                     color: var(--fg); font: 600 12px/1 var(--font); cursor: pointer; transition: border-color 200ms ease-out; }
.hm-gallery__pause:hover { border-color: var(--fg); }
.hm-gallery__pause[hidden] { display: none; }

.hm-gallery__item { position: relative; margin: 0; border-radius: 56px; overflow: hidden; background: var(--ghost); box-shadow: 2px 4px 8px 0 rgba(0, 0, 0, 0.25); }
.hm-gallery__item img { position: absolute; max-width: none; object-fit: cover; }
.hm-gallery__item--1 { aspect-ratio: 800 / 1200; }
.hm-gallery__item--1 img { left: -14.21%; top: -24.53%; width: 128.88%; height: 129%; }
.hm-gallery__item--2 { aspect-ratio: 347 / 371; }
.hm-gallery__item--2 img { left: 0; top: -0.07%; width: 100%; height: 140.3%; }
.hm-gallery__item--3 { aspect-ratio: 350 / 358; }
.hm-gallery__item--3 img { left: -69.36%; top: -86.38%; width: 185.65%; height: 242%; }
.hm-gallery__item--4 { aspect-ratio: 1440 / 2160; }
.hm-gallery__item--4 img { left: -24%; top: -24%; width: 148%; height: 148%; }
.hm-gallery__item--5 { aspect-ratio: 227 / 356; }
.hm-gallery__item--5 img { left: -99.6%; top: 0; width: 236.54%; height: 100%; }
.hm-gallery__item--6 { aspect-ratio: 350 / 358; }
.hm-gallery__item--6 img { left: -13.67%; top: -3.29%; width: 127%; height: 124.16%; }
.hm-gallery__item--7 { aspect-ratio: 350 / 358; }
.hm-gallery__item--7 img { left: -46.78%; top: -26.08%; width: 153%; height: 149.58%; }
.hm-gallery__item--8 { aspect-ratio: 227 / 356; }
.hm-gallery__item--8 img { inset: 0; width: 100%; height: 100%; }

.hm-about__copy { display: flex; flex-direction: column; gap: 24px; max-width: 620px; padding-block: 10px; }
.hm-about__lead { font-size: var(--type-about); font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; color: var(--fg); }
.hm-about__copy p:not(.hm-about__lead) { font-size: 17px; line-height: 1.6; color: var(--muted); }

/* Footer */
.hm-footer { display: flex; flex-direction: column; gap: 48px; padding-top: 28px; border-top: 1px solid var(--line); overflow: hidden; }
.hm-footer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; font-size: 14px; }
.hm-footer__note { color: var(--muted); }
.hm-footer__ghost { margin: 0; font-size: min(200px, 17.36vw); font-weight: 600; line-height: 0.95; letter-spacing: -0.05em; color: var(--ghost); text-align: center; white-space: nowrap; user-select: none; }
.hm-home .hm-footer__ghost { font-weight: var(--display-weight); }

/* Scroll motion (home.js) */
/* No intro on this visit: the hero stays hidden for the moment until home.js starts its entrance */
html.hero-wait .hm-hero { opacity: 0; }
/* Headlines rise out of masks. SplitText clips each mask at its own box, which cuts off descenders
   like g, p and j (line-height is 1) and the last letter's overhang from the tight tracking. Here the
   clip reaches past the box instead: a clip-path with negative insets, which leaves layout untouched
   (padding with negative margins would collapse between stacked lines and shift the page). */
.is-masked > div { overflow: visible !important; clip-path: inset(-0.12em -0.14em -0.28em -0.14em); }
/* Sections take focus after an in-page link glides to them (so Tab carries on from there); no ring on the whole section */
[tabindex="-1"]:focus { outline: none; }
/* Text for screen readers only (also defined in intro.css) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.hm-credits { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; font-weight: 300; }
.hm-credits__copy { width: 100%; font-family: "Inter", var(--font); color: var(--card-label); line-height: normal; padding-bottom: 14px; }
.hm-credits__note { width: 100%; padding-bottom: 16px; color: #000000; text-align: right; letter-spacing: 0.24px; line-height: 16px; text-wrap: pretty; }

/* Dot cursor (cursor.js). Ink dot: 19.8:1 on white, 17:1 on the ghost panels.
   The white halo keeps it above 3:1 (WCAG 1.4.11) on the dark pill buttons too. */
.has-dot-cursor, .has-dot-cursor * { cursor: none !important; }
.cursor { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; visibility: hidden; opacity: 0; }
.cursor__dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 1.5px #ffffff; }
.cursor__rings { position: absolute; opacity: 0; transition: opacity 200ms ease-out; }
.cursor.is-active .cursor__rings { opacity: 1; }
.cursor__ring { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 1.5px solid var(--fg); border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.8); }
/* Reduced motion: no pulse, one still ring marks the interaction */
@media (prefers-reduced-motion: reduce) {
  .cursor__ring + .cursor__ring { display: none; }
  .cursor__ring { transform: scale(1.3); }
}

/* Tablet */
@media (max-width: 1100px) {
  .hm-recent__item { grid-template-columns: minmax(0, 1fr); }
  .hm-about__body { flex-direction: column; gap: 48px; }
  .hm-gallery { width: min(485px, 100%); }
}

/* Phone */
@media (max-width: 639px) {
  :root { --gutter: 24px; }
  .hm-section { padding-bottom: 80px; }
  .hm-section__head { grid-template-columns: minmax(0, 1fr) auto; }
  .hm-section__num { grid-column: 1 / -1; padding-top: 0; }
  .hm-section__title { grid-column: 1; }
  .hm-section__meta { grid-column: 2; }
  .hm-card { --pad: 28px; min-height: 0; }
  .hm-recent__part { padding-left: 16px; }
  .hm-recent__media { min-height: 200px; padding: 28px; }
  .hm-row { flex-wrap: wrap; gap: 4px 16px; }
  .hm-row__title { flex-basis: 100%; }
  .hm-row__type { width: auto; flex: 1 1 0; }
  .hm-gallery { --gallery-gap: 16px; }
  .hm-gallery__window { height: 520px; }
  .hm-gallery__item { border-radius: 32px; }
}

/* Academic reader on small screens: it fills the screen, with the details first and then the pages, in one scroll */
@media (max-width: 760px) {
  .ac-viewer { width: 100vw; height: 100dvh; margin: 0; border-radius: 0; }
  .ac-body { display: flex; flex-direction: column; overflow-y: auto; }
  .ac-body > * { flex: none; }
  .ac-details { order: -1; padding: 28px 24px; border-left: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .ac-pages { height: auto; padding: 24px 16px 8px; gap: 16px; overflow: visible; }
  .ac-count { position: sticky; bottom: 16px; display: table; margin: 0 auto 16px; transform: none; }
  .ac-bar { padding: 10px 12px 10px 24px; }
  .ac-facts { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hm-links a, .hm-nav__links a, .hm-card__cta, .hm-recent__link, .nv__link, .nv__link::after, .nv__cta, .nv__cta svg { transition: none; }
  .ac-open, .ac-arrow, .ac-float img, .ac-btn { transition: none; }
  /* Case study cards: no lift, wipe or slide; the title simply turns a solid rose gold on hover */
  .hm-card, .hm-card__media { transition: none; }
  .hm-card:hover { translate: none; }
  .hm-card .hm-card__title { background-image: none; color: var(--card-ink); transition: none; }
  .hm-card:is(:hover, :has(.hm-card__cta:focus-visible)) .hm-card__title { color: #9c5b54; }
  .ac-viewer[open] { animation: none; }
  /* About gallery: the columns stand still at full height, without the loop's second copy */
  .hm-gallery__window { height: auto; -webkit-mask-image: none; mask-image: none; }
  .hm-gallery__track { animation: none; }
  .hm-gallery__set[aria-hidden="true"], .hm-gallery__pause { display: none; }
}
