:root {
  /* colour — from the style sheet */
  --bg-1: #f7f7f2;
  --bg-2: #9ec9d0;
  --bg-3: #1b1b1b;
  --type-1: #1b1b1b;
  --type-2: #ff5712;
  --light: #ececea;
  --muted: #8a8a88;
  --grid: #86b2ba;

  /* type — from the style sheet */
  --script: "Ingrid Darling", cursive;
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;

  --pad: 40px;
  --gap: 80px; /* space between sections */
  --gutter: 40px; /* desktop grid: 5 columns, 40px margins and gutters */
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg-3); }
/* no rubber-band bounce past the top/bottom of the page (it tore the particle layer away from the gradient on iPhone) */
html, body { overscroll-behavior: none; }
html.lenis, html.lenis body { height: auto; }
body {
  margin: 0; background: var(--bg-3); color: var(--type-1);
  font: 400 12px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--type-2); outline-offset: 3px; }
/* buttons never get the orange ring (the Close button is focused automatically when a project opens) */
.pill:focus, .pill:focus-visible, .glass-btn:focus, .glass-btn:focus-visible { outline: none; }

.heading { font: 600 20px/1.2 var(--sans); text-transform: uppercase; }
.orange { color: var(--type-2); }
.title { font: 500 16px/1.2 var(--mono); text-transform: uppercase; }
.body { font: 400 16px/1.15 var(--mono); }

.pill {
  display: inline-flex; align-items: center; gap: 14px; height: 45px; padding: 0 22px;
  border: 1px solid currentColor; border-radius: 999px;
  font: 500 16px/1 var(--mono); text-transform: uppercase; white-space: nowrap;
  position: relative; overflow: hidden; isolation: isolate; transition: color .35s var(--ease);
}
.pill::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--type-1);
  transform: translateY(101%); transition: transform .45s var(--ease);
}
.pill:hover { color: var(--bg-1); }
.pill:hover::before { transform: none; }
.pill.light { color: var(--light); background: rgba(255,255,255,.04); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: rgba(255,255,255,.45); }
.pill.light.glass-pill { background: rgba(217,217,217,0); border-color: transparent; }
.pill.light.glass-pill::after { background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.12) 30%, rgba(255,255,255,.05) 65%, rgba(255,255,255,.45)); }
.pill.light::before { background: var(--light); }
.pill.light:hover { color: var(--type-1); }
/* one line-icon style for every arrow on the site: thin stroke, rounded ends */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s var(--ease); }
.pill:hover .ico-ur { transform: translate(2px, -2px); }
.pill:hover .ico-rt { transform: translateX(3px); }
.pill:hover .ico-x { transform: rotate(90deg); }
.glass-btn .ico { width: 18px; height: 18px; }
.glass-btn:hover .ico-up { transform: translateY(-2px); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid currentColor; border-radius: 999px; padding: 4px 12px; font-size: 12px; line-height: 1.3; }
.tools { display: flex; align-items: center; gap: 14px; font-size: 12px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--type-2); flex: none; }

/* glassmorphism, from the Figma glass effect (fill D9D9D9 at 0%, light 135° · 90%, frost ~12, dispersion).
   This is the containers' permanent look — it never changes on hover or tap. */
.glassy {
  position: relative; isolation: isolate;
  background: rgba(217, 217, 217, 0) !important; border-color: transparent !important;
  backdrop-filter: blur(12px) saturate(125%); -webkit-backdrop-filter: blur(12px) saturate(125%);
  box-shadow: inset 1px 1px 0 rgba(255, 150, 130, .16), inset -1px -1px 0 rgba(130, 190, 255, .16), 0 16px 36px rgba(0, 0, 0, .22) !important;
}
.glassy::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.12) 28%, rgba(255,255,255,.04) 62%, rgba(255,255,255,.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.glass-pill { background: rgba(217,217,217,0); backdrop-filter: blur(12px) saturate(125%); -webkit-backdrop-filter: blur(12px) saturate(125%); border-color: transparent;
  box-shadow: inset 1px 1px 0 rgba(255, 150, 130, .2), inset -1px -1px 0 rgba(130, 190, 255, .2), 0 8px 20px rgba(0, 0, 0, .12); }
.glass-pill::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.15) 30%, rgba(27,27,27,.25) 65%, rgba(255,255,255,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* ================= HERO ================= */
.hero-wrap { position: sticky; top: var(--stick, 0px); z-index: 1; }
/* a box-shadow, not a filter: a filter made the browser re-render the whole hero every frame */
.hero-shadow { }
.hero { box-shadow: 0 10px 14px rgba(27, 27, 27, .18); }
.hero { background: var(--bg-1); position: relative; }
.stage { position: relative; max-width: 1600px; margin: 0 auto; aspect-ratio: 1280 / 833; min-height: 600px; }
/* positions are the Figma frame's px values (1280 × 833) */
.stage > .obj, .stage > .group {
  position: absolute; left: calc(var(--x) / 1280 * 100%); top: calc(var(--y) / 833 * 100%); width: calc(var(--w) / 1280 * 100%);
}
.group { aspect-ratio: var(--ar); }
.group > .obj { position: absolute; left: calc(var(--gx) * 1%); top: calc(var(--gy) * 1%); width: calc(var(--gw) * 1%); }
.obj { cursor: pointer; user-select: none; -webkit-user-drag: none; will-change: transform; }
/* name + body copy sit in the exact centre of the screen */
.intro {
  position: absolute; left: 50%; top: min(50%, 50vh); /* centred via GSAP xPercent/yPercent -50 */
  width: min(400px, 88%); text-align: center;
}
.name { font: 400 clamp(40px, 5vw, 64px)/1 var(--script); color: var(--type-2); white-space: nowrap; } /* 64px from 1280px wide up */
.role { color: #b9b9b6; font-size: 12px; margin-top: 2px; }
.tagline { margin: 40px auto 0; max-width: 350px; font-size: 12px; line-height: 1.5; }
.voice { position: absolute; left: 50%; top: calc(100% + 80px); display: inline-flex; align-items: center; gap: 8px; color: #b9b9b6; font-size: 12px; white-space: nowrap; }
.voice svg { flex: none; }

@media (max-width: 720px) {
  .stage { aspect-ratio: 390 / 780; min-height: 0; }
  .stage > .obj, .stage > .group { left: calc(var(--mx) * 1%); top: calc(var(--my) * 1%); width: calc(var(--mw) * 1%); }
  .name { font-size: 54px; }
  .voice { top: calc(100% + 18px); white-space: normal; width: 280px; flex-direction: column; gap: 6px; text-align: center; text-wrap: balance; } /* speaker icon above, text centred */
}

/* ================= RECENTLY MADE ================= */
.recent {
  position: sticky; top: var(--stick, 0px); z-index: 2; background: var(--bg-2);
  padding: var(--gap) var(--pad) var(--gap);
}
.recent > * { position: relative; }
.recent::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 40px; background: var(--bg-2); }
.grid-lines { position: absolute !important; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.grid-lines line { stroke: var(--grid); stroke-width: 1.5; }
.recent .heading { position: relative; margin-bottom: var(--pad); }
.glass {
  width: calc((100% - 4 * var(--gutter)) / 5 * 3 + 2 * var(--gutter)); padding: 40px;
  background: rgba(190, 222, 228, .35); border: 1px solid rgba(225, 242, 245, .9);
}
/* frosted look without a live backdrop blur (re-blurring the moving grid every frame made scrolling stutter):
   the same frosted blue, nearly opaque, so the lines behind it read as blurred away */
.glass.glassy { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(149, 203, 212, .94) !important; }
.glass-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.glass .title { margin-bottom: 24px; }
.glass .tags { margin-bottom: 32px; }
.glass .tags li { font-size: 13px; }
.glass .tools { font-size: 10px; }

/* ================= DARK ================= */
.dark {
  position: relative; z-index: 3; background: var(--bg-3); color: var(--light);
  /* the rounded top corners are two small caps in the blue of the section it slides over (a real border-radius
     on this tall, animated section was one of the main scroll costs) */
}
.dark::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 32px; z-index: 5; pointer-events: none;
  background:
    radial-gradient(circle at 32px 32px, transparent 31.5px, var(--bg-2) 32px) left top / 32px 32px no-repeat,
    radial-gradient(circle at 0 32px, transparent 31.5px, var(--bg-2) 32px) right top / 32px 32px no-repeat;
}
.particles { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1; }
.work, .about { position: relative; z-index: 2; }

.work { padding: var(--gap) var(--pad) 0; }
.work .heading { margin-bottom: var(--pad); }
.work-body { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.collage-area { grid-column: 3 / 6; grid-row: 1; height: 1px; }
.cards { grid-column: 1 / 3; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; position: relative; z-index: 2; }
.card.glassy { backdrop-filter: none; -webkit-backdrop-filter: none; } /* on flat black the blur is invisible but costly */
.card {
  padding: 20px 36px 40px 40px; cursor: pointer; border: 1px solid #4a4a4a;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(160deg, #232323 0%, #1a1a1a 70%, #121212 100%);
  box-shadow: inset -18px -18px 30px rgba(0,0,0,.35);
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card .meta { margin-top: 16px; max-width: 360px; }
.card.is-open .meta { max-width: none; } /* one line when it fits; the tile width never changes */
.meta-year { display: none; }
.card.is-open .meta-year { display: inline; }
.more { height: 0; overflow: hidden; }
.more-inner { padding-top: 24px; }
.dark-tags { margin-bottom: 24px; }
.dark-tags li { color: var(--light); border-color: #bdbdbd; }
.card .tools { font-size: 10px; }

/* hover mockups, rebuilt from the Figma pieces (px values from the "On hover" frames) */
.collages { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 1; } /* fixed to the window so mockups are never cut off */
.collage { position: absolute; left: 0; top: 0; width: 780px; height: calc(var(--ch) * 1px); visibility: hidden; transform-origin: 0 0; }
.collage img {
  position: absolute; left: calc(var(--x) * 1px); top: calc(var(--y) * 1px); width: calc(var(--w) * 1px);
  rotate: calc(var(--r, 0) * 1deg); max-width: none;
}
.collage-inline { display: none; position: relative; margin-top: 20px; width: 100%; overflow: hidden; }
.collage-inline .collage { left: 0; top: 0; visibility: visible; transform-origin: 0 0; }

.about { padding: var(--gap) var(--pad) 200px; min-height: 850px; }
.about .heading { margin-bottom: var(--pad); }
.about-body { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gutter); }
.bio { grid-column: 1 / 3; }
.records { grid-column: 3 / 6; }
.bio p { font-size: 12px; line-height: 1.5; color: #e2e2e0; max-width: 470px; }
.bio p + p { margin-top: 18px; }
.bio a { text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 3px; }
.bio a:hover { text-decoration-color: var(--type-2); }
.records { display: grid; gap: 16px; }
.record {
  padding: 32px 40px 40px 43px; border: 1px solid #555;
  background: linear-gradient(170deg, rgba(40,40,40,.85), rgba(22,22,22,.85));
  box-shadow: inset -20px -20px 40px rgba(0,0,0,.35);
}
.record .title { margin-bottom: 30px; }
.record li { display: flex; justify-content: space-between; gap: 20px; font-size: 16px; line-height: 1.15; }
.record li + li { margin-top: 20px; }
.record em { font-style: normal; color: var(--muted); }
.record em.small { font-size: 12px; }
.record time { flex: none; text-align: right; white-space: nowrap; }

/* the orange gradient, bottom-left, as in the design */
.glow-clip { position: absolute; left: 0; right: 0; bottom: 0; height: 1000px; overflow: hidden; z-index: 0; pointer-events: none; }
.glow { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; filter: blur(18px) saturate(1.2); }
.glow.soft { filter: none; } /* blurred inside the canvas instead (much cheaper) */
.the-end {
  position: absolute; right: var(--pad); bottom: 40px; z-index: 2;
  font: 400 64px/1 var(--script); color: var(--bg-2);
  filter: url(#boil); /* hand-drawn "line boil", like jackiehu.design */
}

/* text that the bright gradient passes behind switches to dark (toggled from main.js) */
.about .heading, .bio p, .record .title, .record li > span, .record li > time, .record em, .bio a { transition: color .6s var(--ease), text-decoration-color .6s var(--ease); }
.on-light { color: var(--type-1) !important; }
.on-light em { color: rgba(27, 27, 27, .62) !important; }
.bio p.on-light a { text-decoration-color: rgba(27, 27, 27, .4); }

/* ================= STICKY CV + TO TOP ================= */
.dock { position: fixed; right: 26px; bottom: 32px; z-index: 40; display: flex; gap: 12px; align-items: center; }
.glass-btn {
  --fg: var(--type-1); --tint: rgba(255,255,255,.35); --rim: rgba(255,255,255,.9);
  position: relative; display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 22px;
  border-radius: 999px; color: var(--fg); background: var(--tint);
  backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 1px 0 var(--rim), inset 0 -1px 0 rgba(0,0,0,.12);
  font: 500 14px/1 var(--mono); text-transform: uppercase; letter-spacing: .02em;
  transition: color .4s, background .4s, transform .3s var(--ease);
}
.glass-btn::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, var(--rim), transparent 35%, transparent 65%, var(--rim));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: .8;
}
.glass-btn:hover { transform: translateY(-2px); }
.glass-btn.round { width: 46px; padding: 0; font-size: 20px; }
/* switches with whatever is behind it so the text always has contrast */
.dock[data-tone="dark"] .glass-btn { --fg: #f1f0ec; --tint: rgba(40,34,44,.45); --rim: rgba(255,255,255,.4); }
.dock.is-hidden { opacity: 0; pointer-events: none; }
.dock { transition: opacity .3s; }

/* ================= PROJECT VIEWER ================= */
.viewer { position: fixed; inset: 0; z-index: 50; background: var(--bg-3); color: var(--light); }
.viewer[hidden] { display: none; }
.viewer-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.viewer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: var(--pad); padding-right: 200px; max-width: 1280px; }
.viewer-meta { margin: 16px 0 24px; }
.viewer-tags { margin-bottom: 24px; }
.viewer-close { position: fixed; top: var(--pad); right: var(--pad); z-index: 3; cursor: pointer; background: var(--bg-3); flex: none; }
.viewer-body { max-width: 1200px; margin: 0 auto; padding: 0 var(--pad) var(--pad); display: grid; gap: 24px; }
.viewer-body .block { display: grid; }
.viewer-body img { width: 100%; height: auto; background: #222; }
.viewer-next { display: flex; justify-content: center; padding: 40px var(--pad) 80px; }

@media (max-width: 759px) {
  .collages { display: none; }
  .collage-inline { display: block; }
}
@media (max-width: 1099px) {
  /* narrower desktops: tiles keep a readable width, the mockups take the rest */
  .work-body { grid-template-columns: minmax(380px, 2fr) 3fr; }
  .cards { grid-column: 1 / 2; }
  .collage-area { grid-column: 2 / 3; }
}
@media (max-width: 900px) {
  .about-body { grid-template-columns: 1fr; }
  .bio, .records { grid-column: 1 / -1; }
  .glass { width: 100%; }
}
@media (max-width: 759px) {
  .work-body { grid-template-columns: 1fr; }
  .cards { grid-column: 1 / -1; }
  .collage-area { display: none; } /* otherwise it reserves an empty column beside the tiles */
}
@media (max-width: 720px) {
  :root { --pad: 16px; --gap: 40px; }
  .recent { padding: var(--gap) 16px 32px; }
  .glass { padding: 28px 20px; }
  .glass-head { flex-direction: column; }
  .card { padding: 18px 20px 28px; }
  .card .title, .body, .record li { font-size: 14px; }
  .record { padding: 26px 20px 30px; }
  /* phones: the date sits on its own line under each title */
  .record li { flex-direction: column; gap: 6px; }
  .record time { text-align: left; font-size: 12px; color: var(--muted); }
  .record li > time.on-light { color: rgba(27, 27, 27, .62) !important; }
  .the-end { font-size: 52px; }
  .dock { right: 16px; bottom: 16px; }
  .glass-btn { height: 42px; padding: 0 18px; font-size: 12px; }
  .glass-btn.round { width: 42px; }
  .viewer-head { padding-top: 80px; padding-right: var(--pad); }
  .viewer-close { top: 16px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .particles { display: none; }
}
