/* ==========================================================================
   Dayeon Choi — Portfolio
   Fonts: Test Die Grotesk B (trial) lives in /fonts. The trial only contains
   letters, digits and basic punctuation, so symbols like @ & ’ © fall back to Inter Tight.
   ========================================================================== */

@font-face { font-family: "Die Grotesk B"; src: url("../fonts/TestDieGroteskB-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Die Grotesk B"; src: url("../fonts/TestDieGroteskB-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Die Grotesk B"; src: url("../fonts/TestDieGroteskB-MediumItalic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
/* Die Grotesk C (logo + small numbers) is only used if installed locally; otherwise B is used. */
@font-face { font-family: "Die Grotesk C"; src: local("Test Die Grotesk C Regular"), local("TestDieGroteskC-Regular"); font-weight: 400; }
@font-face { font-family: "Die Grotesk C"; src: local("Test Die Grotesk C Medium"), local("TestDieGroteskC-Medium"); font-weight: 500; }

:root {
  --font: "Die Grotesk B", "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-c: "Die Grotesk C", "Die Grotesk B", "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sf: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Segoe UI", Roboto, sans-serif;
  --ink: #000;
  --ink-50: rgba(0, 0, 0, .5);
  --ink-40: rgba(0, 0, 0, .4);
  --ink-30: rgba(0, 0, 0, .3);
  --dark: #1a1a1a;
  --chip: #f6f6f6;
  --foot: #89a1c6;
  --foot-link: #5d7aa8;
  --inset: 20px;          /* gap between window edge and the sky card */
  --pad: 12px;            /* padding inside the sky card */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2, h3, ul { margin: 0; padding: 0; font-weight: 400; }
ul { list-style: none; }
:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; border-radius: 6px; }
.m-br { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- The sky card: fixed size, content scrolls inside it ---------- */
.card {
  position: fixed;
  inset: var(--inset);
  border-radius: 16px;
  overflow: hidden;
  background: #d7e3f5 url("../images/bg.webp") center / cover no-repeat;
  isolation: isolate;
}
.scroller {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}
.scroller::-webkit-scrollbar { display: none; }
/* faint pixel dust that trails the cursor over the sky (main.js); content with its own background covers it */
.bg-pixels { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bg-fluid { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: blur(18px); }   /* soft liquid sheen under the dust */
main { flex: 1 0 auto; display: flex; flex-direction: column; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: var(--pad);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 6px 6px 16px;
  background: #fff;
  border-radius: 8px;
  line-height: 1;
  white-space: nowrap;
}
.nav__logo { display: flex; align-items: center; }
/* logo: a text-selection box around "dy.c" (box + two handles + text, layered), so the selection can recolour on scroll */
.logo { position: relative; display: block; height: 26px; aspect-ratio: 1548 / 930; }
.logo img { position: absolute; display: block; transition: opacity .45s var(--ease-out); }
.logo__hl { left: 0.000%; top: 0.000%; width: 10.465%; height: 85.269%; }
.logo__hr { left: 89.535%; top: 14.839%; width: 10.465%; height: 85.161%; }
.logo__box { left: 6.848%; top: 17.419%; width: 86.434%; height: 65.161%; }
.logo__text { left: 13.178%; top: 23.978%; width: 73.514%; height: 66.774%; }
.logo__hl { transform-origin: 50% 10%; }
.logo__hr { transform-origin: 50% 90%; }
.logo__box { transform-origin: 50% 50%; }
/* scrolled (glass nav): the selection crossfades to white — white handles, white box at 50% — black text stays */
.logo--w { opacity: 0; }
.topbar.is-glass .logo img:not(.logo--w):not(.logo__text) { opacity: 0; }
.topbar.is-glass .logo__hl.logo--w, .topbar.is-glass .logo__hr.logo--w { opacity: 1; }
.topbar.is-glass .logo__box.logo--w { opacity: .5; }
.nav__items { display: flex; gap: 4px; }
.nav__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color .2s;
}
.nav__item small { font-family: var(--font-c); font-size: 8px; letter-spacing: -0.01em; }
.nav__item:hover { background: var(--chip); }
/* rolling labels (nav items + Contact Me): each letter slides up as its copy rolls in from below, staggered */
.roll { position: relative; display: inline-flex; overflow: hidden; line-height: 1.25; padding-block: .05em; }
.roll__a, .roll__b { display: inline-flex; }
.roll__b { position: absolute; left: 0; top: 100%; }
.roll span span { display: inline-block; transition: transform .5s var(--ease-out); transition-delay: calc(var(--i) * 22ms); }
.nav__item:hover .roll span span, a.pill--dark:hover .roll span span, .nav__item:focus-visible .roll span span, a.pill--dark:focus-visible .roll span span { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { .roll span span { transition: none; } }
.nav__item[aria-current="page"] { background: var(--chip); }

.actions { display: flex; gap: 12px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 6px 14px;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition: transform .25s var(--ease-out), background-color .2s, opacity .2s;
}
.pill--dark { background: var(--dark); color: #fff; gap: 8px; padding-right: 12px; }
.pill--dark svg { width: 16px; height: 16px; flex: none; transition: transform .3s var(--ease-out); }
a.pill--dark:hover { background: #000; }
a.pill--dark:hover svg { transform: translate(1px, -1px); }
.pill--dark.is-static { opacity: .5; padding-right: 14px; cursor: default; }
.pill--scroll { gap: 6px; }
.pill--scroll:hover svg { transform: translateY(2px); }

/* Liquid-glass top bar once the page scrolls */
.nav, .topbar .pill { transition: background-color .35s var(--ease-out), box-shadow .35s var(--ease-out), -webkit-backdrop-filter .35s, backdrop-filter .35s; }
.topbar.is-glass .nav, .topbar.is-glass .pill:not(.pill--dark) {
  background: rgba(255, 255, 255, .38);
  -webkit-backdrop-filter: blur(14px) saturate(180%) brightness(1.06);
  backdrop-filter: blur(14px) saturate(180%) brightness(1.06);
  box-shadow: 0 6px 20px -8px rgba(16, 54, 99, .25);
}
.topbar.is-glass .nav__item[aria-current="page"], .topbar.is-glass .nav__item:hover { background: rgba(255, 255, 255, .55); }
/* Compact nav: when the nav doesn't fit across the screen (main.js measures), its items fold into a menu button */
.nav { position: relative; }
.nav__burger { display: none; width: 34px; height: 34px; margin-left: auto; border: 0; border-radius: 4px; background: transparent; cursor: pointer; position: relative; }
.nav__burger:hover { background: var(--chip); }
.nav__burger span { position: absolute; left: 10px; right: 10px; height: 1.5px; border-radius: 1px; background: var(--ink); transition: transform .35s var(--ease-out); }
.nav__burger span:first-child { top: 13px; }
.nav__burger span:last-child { top: 19.5px; }
.nav.is-open .nav__burger span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav.is-open .nav__burger span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
.topbar.is-compact { justify-content: stretch; }
.topbar.is-compact .nav { flex: 1; }
.topbar.is-compact .nav__burger { display: block; }
.topbar.is-compact .nav__items {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  flex-direction: column; gap: 2px; padding: 6px;
  background: #fff; border-radius: 8px; box-shadow: 0 10px 30px -12px rgba(16, 54, 99, .3);
  opacity: 0; translate: 0 -6px; visibility: hidden; transition: opacity .25s var(--ease-out), translate .3s var(--ease-out), visibility 0s .3s;
}
.topbar.is-compact .nav.is-open .nav__items { opacity: 1; translate: 0 0; visibility: visible; transition: opacity .25s var(--ease-out), translate .3s var(--ease-out); }
.topbar.is-compact .nav__item { padding: 10px 10px; font-size: 15px; }
.topbar.is-compact.is-glass .nav__items { background: rgba(255, 255, 255, .94); }
/* Contact Me stays solid black */
.topbar .pill--dark { background: var(--dark); -webkit-backdrop-filter: none; backdrop-filter: none; }
.topbar.is-glass .pill--dark { box-shadow: 0 6px 20px -8px rgba(16, 54, 99, .25); }

/* pulsing "open to new roles" dot */
.dot { position: relative; width: 10px; height: 10px; flex: none; }
.dot::before, .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #00b664; }
.dot::before { box-shadow: 0 0 0 2px rgba(122, 240, 152, .35), 0 0 6px 2px rgba(122, 240, 152, .6); }
.dot::after { animation: pulse 2s var(--ease-out) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

/* ---------- Footer: always after content, pinned to bottom when content is short ---------- */
.footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 22px 22px;   /* sides match the bottom */
  font-size: 14px;
  line-height: 1;
}
.footer__copy { color: var(--foot); }
.footer__links { display: flex; gap: 20px; color: var(--foot-link); }
.footer__links a { position: relative; transition: color .2s; }
.footer__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out); }
.footer__links a:hover { color: #2f4f84; }
.footer__links a:hover::after { transform: scaleX(1); }
.footer__status { display: none; }
.footer__status.is-stacked, .footer__links.is-stacked { flex-direction: column; align-items: center; gap: 10px; }   /* main.js: when the row doesn't fit */

/* ---------- Mac-Finder style file selection (logos + resume) ---------- */
.file { display: flex; flex-direction: column; align-items: center; gap: 16px; cursor: default; -webkit-tap-highlight-color: transparent; }
.file__icon { position: relative; border-radius: 10px; transition: transform .35s var(--ease-spring); }
.file__icon::before { content: ""; position: absolute; inset: -5px; border-radius: 12px; background: rgba(0, 0, 0, .1); opacity: 0; transition: opacity .12s; }
.file__icon img { position: relative; width: 70px; height: 70px; border-radius: 10px; object-fit: cover; }
.file__label { padding: 2px 5px; margin: -2px -5px; border-radius: 4px; font-size: 14px; line-height: 1; text-align: center; white-space: nowrap; transition: background-color .12s, color .12s; }
.file:hover .file__icon { transform: translateY(-4px); }
.file.is-selected .file__icon::before { opacity: 1; }
.file.is-selected .file__label { background: #0058d0; color: #fff; }

/* ---------- Floating 3D face with tracking pupils ---------- */
.face { position: relative; }
.face__float { width: 100%; height: 100%; animation: bob 3s ease-in-out infinite; }
.face__tilt { position: relative; width: 100%; height: 100%; transition: rotate .6s var(--ease-out), translate .9s var(--ease-out); }
/* expressions: three warped mouth frames per shape fade in one after another, hold, then relax.
   Loop (no interaction): a smile, then a pout. */
.mouth { position: absolute; pointer-events: none; }
.mouth--mouth { left: 35.9375%; top: 60.6061%; width: 28.1250%; height: 15.7576%; }
.mouth--brow { left: 19.5312%; top: 38.5455%; width: 59.3750%; height: 8.0000%; }
.mouth img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; animation: 8s ease-in-out 2s infinite; }
.smile img:nth-child(1) { animation-name: smile1; } .smile img:nth-child(2) { animation-name: smile2; } .smile img:nth-child(3) { animation-name: smile3; }
.pout img:nth-child(1) { animation-name: pout1; } .pout img:nth-child(2) { animation-name: pout2; } .pout img:nth-child(3) { animation-name: pout3; }
@keyframes smile1 { 0%, 6%, 28.8%, 100% { opacity: 0; } 7.6%, 27.2% { opacity: 1; } }
@keyframes smile2 { 0%, 7.6%, 27.2%, 100% { opacity: 0; } 9.2%, 25.6% { opacity: 1; } }
@keyframes smile3 { 0%, 9.2%, 25.6%, 100% { opacity: 0; } 10.8%, 24% { opacity: 1; } }
@keyframes pout1 { 0%, 54%, 76.8%, 100% { opacity: 0; } 55.6%, 75.2% { opacity: 1; } }
@keyframes pout2 { 0%, 55.6%, 75.2%, 100% { opacity: 0; } 57.2%, 73.6% { opacity: 1; } }
@keyframes pout3 { 0%, 57.2%, 73.6%, 100% { opacity: 0; } 58.8%, 72% { opacity: 1; } }
.face__pixel { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.face__bit { position: absolute; z-index: 2; border-radius: 1px; pointer-events: none; box-shadow: 0 1px 3px rgba(16, 54, 99, .25); }
.face { cursor: pointer; user-select: none; -webkit-user-select: none; }
@media (prefers-reduced-motion: reduce) { .mouth img { animation: none !important; } }
.face__tilt > img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.eye { position: absolute; overflow: hidden; }
.eye > img { position: absolute; display: block; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.eye .iris { height: auto; aspect-ratio: 1; will-change: transform; }
.eye .lid { inset: 0; width: 100%; height: 100%; }
.eye--l { left: 22.1875%; top: 47.0303%; width: 20.3125%; height: 8.0000%; }
.eye--l .iris { left: 33.8462%; top: 9.0909%; width: 41.5385%; }
.eye--r { left: 57.3438%; top: 46.9091%; width: 19.5312%; height: 8.2424%; }
.eye--r .iris { left: 23.2000%; top: 8.8235%; width: 43.2000%; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

/* ==========================================================================
   HOME
   ========================================================================== */
.home main { position: relative; }
.stage { position: absolute; inset: 0; overflow: clip; }   /* the icons start tucked behind the head; nothing may widen the page meanwhile */
.stage__origin { position: absolute; left: 50%; top: calc(50% + 12px); width: 0; height: 0; transform: scale(var(--s, 1)); }
.hero { --hg: 17px; position: absolute; left: 0; top: 0; width: 280px; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: var(--hg); }
/* while loading there's no intro line, so bubble + head sit centred; when it types in, the space opens and they rise */
.hero__intro-wrap { display: grid; grid-template-rows: 0fr; margin-top: calc(-1 * var(--hg)); transition: grid-template-rows .7s var(--ease-out), margin-top .7s var(--ease-out); }
.hero.is-typed .hero__intro-wrap { grid-template-rows: 1fr; margin-top: 0; }
.hero__intro-wrap > .hero__intro { min-height: 0; }   /* no clipping: the characters stay hidden until they're typed, so nothing shows while collapsed */
.hero__intro .ch { visibility: hidden; }
.hero__intro .ch.on { visibility: visible; }
.caret { position: relative; display: inline-block; width: 0; }
.caret::after { content: ""; position: absolute; left: 1px; top: -.95em; width: 1.5px; height: 1.1em; background: currentColor; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.bubble-wrap { --lp: 0; --bub: color-mix(in srgb, #fff calc(var(--lp) * 100%), #5D7AA8); display: flex; flex-direction: column; align-items: center; }
.bubble-wrap .bubble { background: var(--bub); color: #fff; transition: width .45s var(--ease-spring), color .3s ease; }
.bubble-wrap.is-light .bubble { color: var(--ink); }
.bubble-wrap .bubble-tail path { fill: var(--bub); }
.bubble { position: relative; z-index: 1; padding: 14px 18px; border-radius: 20px; background: #fff; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; transition: width .45s var(--ease-spring); }
.bubble__text { display: inline-block; transition: opacity .2s, transform .35s var(--ease-spring); }
.bubble__text.is-swap { opacity: 0; transform: translateY(6px) scale(.9); }
.bubble-tail { width: 19px; height: 14px; margin-top: -3px; transform: translateX(.5px); }
.hero .face { width: 206px; height: 266px; }
.hero__intro { font-size: 16px; line-height: 1; text-align: center; white-space: nowrap; color: #5D7AA8; }
.logos { position: absolute; left: 0; top: 0; }
.logos .file { position: absolute; width: 70px; left: var(--x); top: var(--y); }
/* Quick Look: hovering / selecting a Home icon (or pressing space) pops up a preview card of the work */
.ql { position: absolute; z-index: 8; width: 248px; padding: 8px 8px 12px; border-radius: 14px; pointer-events: none;
      background: rgba(255, 255, 255, .82); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
      box-shadow: 0 18px 40px -16px rgba(16, 54, 99, .35), 0 0 0 .5px rgba(16, 54, 99, .08);
      opacity: 0; scale: .94; transition: opacity .22s var(--ease-out), scale .3s var(--ease-out); }
.ql.is-on { opacity: 1; scale: 1; }
.ql__img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #e8eef7; }
.ql__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 10px 4px 0; font-size: 14px; }
.ql__head span:last-child { color: var(--ink-50, rgba(0,0,0,.5)); font-size: 12px; }
.ql__line { margin: 4px 4px 0; font-size: 12px; color: rgba(0, 0, 0, .6); line-height: 1.35; }
.ql__hint { margin: 8px 4px 0; font-size: 11px; color: #5D7AA8; }
@media (max-width: 760px) { .ql { width: 200px; } }
.logos .file { touch-action: none; user-select: none; -webkit-user-select: none; }
.logos .file.is-dragging { z-index: 5; opacity: .85; cursor: grabbing; }
.logos .file.is-dragging .file__icon { transform: none; }
/* icons scale with the screen: 70px at 1920 wide, 60px at 1440 (the file's 70px slot stays, so positions don't move) */
.logos .file__icon img { --ic: clamp(60px, calc(30px + 2.0833vw), 70px); width: var(--ic); height: var(--ic); border-radius: calc(var(--ic) / 7); }
.logos .file.is-hidden { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(.3) rotate(var(--fr)); pointer-events: none; }
.logos .file.is-in { transition: opacity .35s ease-out, transform .9s var(--ease-spring); transition-delay: var(--d); }

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-flow { --gap: 42px; position: relative; padding-top: var(--ft, 200px); }
.about-face { position: sticky; top: var(--fts, 30%); z-index: 7; width: 166px; height: 214px; margin: 0 auto; }

.about-hero__text { position: relative; z-index: 1; max-width: 680px; margin: var(--gap) auto 0; padding: 0 var(--pad); font-size: 32px; line-height: 1; text-align: center; }
.about-flow > .pill--scroll { position: absolute; z-index: 6; top: calc(var(--vh, 900px) - 58px); left: 50%; transform: translateX(-50%); }
.about-flow > .pill--scroll:hover { transform: translateX(-50%) translateY(-2px); }
.section-label { font-size: 16px; line-height: 1.2; color: var(--ink-50); text-align: center; }
.exp { position: relative; z-index: 1; width: 100%; max-width: 800px; margin: var(--expgap, 300px) auto 0; padding: 0 var(--pad); }
.exp__list { position: relative; margin-top: 50px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
.exp__col { display: flex; flex-direction: column; gap: 70px; }
.exp__col--r { padding-top: 56px; }
.exp__col--l { align-items: flex-end; text-align: right; }
.exp__item { display: flex; flex-direction: column; gap: 6px; font-size: 16px; line-height: 1.2; }
.exp__item span { display: block; white-space: nowrap; will-change: transform; opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.exp__item span:nth-child(2) { opacity: 0; color: var(--ink); }
.exp__item.is-in span:first-child { opacity: 1; }
.exp__item.is-in span:nth-child(2) { opacity: .4; }
.exp__item.is-in span { transform: translate(var(--push, 0px), 0); transition: opacity .6s var(--ease-out); }
.skills { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 50px; padding: 0 var(--pad) 300px; }
.stack { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 10px; background: rgba(255, 255, 255, .4); border: 1px solid #fff; border-radius: 12px; box-shadow: 0 12px 33px -18px rgba(16, 54, 99, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.stack img { width: 45px; height: 44px; border-radius: 8px; transition: transform .35s var(--ease-spring); }
.stack li:nth-child(4) { margin-left: var(--split, 0px); }   /* opens around the head (main.js) */
.stack li:hover img { transform: translateY(-4px) scale(1.06); }
.resume { display: flex; justify-content: center; padding: 24px 0 140px; }
.resume .file { width: 128px; }
.resume .file__icon img { object-fit: contain; border-radius: 0; }
.resume .file__label { color: #5D7AA8; text-decoration: underline; text-underline-offset: 2px; }

/* ==========================================================================
   WORKS
   ========================================================================== */
.page-intro { margin-top: 138px; font-size: 16px; line-height: 1.2; text-align: center; padding: 0 var(--pad); }
.page-intro span { color: var(--ink-50); }
.works-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 12px; padding: 99px var(--pad) 120px; }
.work { display: flex; flex-direction: column; gap: 12px; }
.work__img { position: relative; aspect-ratio: 1348 / 1500;   /* desktop card: 449.33 × 500 */ border-radius: 16px; overflow: hidden; background: #e9edf3; }
.work__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease-out); }
.work:hover .work__img img { transform: scale(1.04); }
.work__title { display: flex; flex-direction: column; gap: 6px; font-size: 16px; line-height: 1.2; }
.work__title span:last-child { opacity: .4; }
.work__arrow { position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--dark); color: #fff; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .4s var(--ease-out); }
.work:hover .work__arrow { opacity: 1; transform: none; }

/* ==========================================================================
   PROJECT DETAIL — content scrolls inside a fixed-ratio browser window
   ========================================================================== */
.project-head { margin-top: 118px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.project-head h1 { font-size: 16px; line-height: 1.2; }
.browser {
  width: var(--bw);
  aspect-ratio: 1280 / 784;
  margin: 0 auto;
  position: sticky; top: var(--stick, 100px); z-index: 2;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 46px -18px rgba(16, 54, 99, .5);
  font-family: var(--font-sf);
}
.chrome { flex: none; height: 79px; position: relative; background: #fff; border-bottom: 1px solid #b6b6b6; }
.chrome__tabs { position: absolute; inset: 0 0 auto; height: 42px; background: #dfe1e5; padding: 8px 0 0 70px; display: flex; border-radius: 15px 15px 0 0; }
.chrome__lights { position: absolute; left: 13px; top: 16px; width: 52px; height: 12px; }
.tab { position: relative; flex: 0 1 256px; min-width: 0; height: 34px; margin-right: -16px; padding: 0 24px 0 19px; display: flex; align-items: center; gap: 11px; color: #3d4043; font-size: 12px; letter-spacing: 0; text-align: left; cursor: pointer; }
.tab::before { content: ""; position: absolute; inset: 0; border-style: solid; border-width: 0 16px; border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='34' viewBox='0 0 256 34'%3E%3Cpath d='M240 0C244.418 0 248 3.58 248 8V26C248 30.42 251.58 34 256 34H0C4.42 34 8 30.42 8 26V8C8 3.58 11.58 0 16 0H240Z' fill='white'/%3E%3C/svg%3E") 0 16 fill / 0 16px / 0 stretch; opacity: 0; transition: opacity .2s; }
.tab::after { content: ""; position: absolute; right: 16px; top: 9px; bottom: 9px; width: 1px; background: #a8abb0; }
.tab:hover::before { opacity: .45; }
/* hover on an inactive tab: same tab shape, shifted so its sides sit on the divider lines */
.tab:not(.is-active)::before { inset: 0 8px 0 -8px; }
.tab.is-active + .tab::before { left: 0; }                      /* next to the selected tab, meet its edge instead */
.tab:has(+ .tab.is-active)::before { right: 0; }
.tab.is-active { z-index: 1; }
.tab.is-active::before { opacity: 1; }
.tab.is-active::after, .tab:has(+ .tab.is-active)::after, .tab:last-child::after { opacity: 0; }
.tab img { position: relative; width: 14px; height: 14px; border-radius: 3px; flex: none; }
.tab span { position: relative; flex: 0 1 177px; min-width: 0; overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.chrome__bar { position: absolute; left: 0; right: 0; top: 42px; height: 37px; display: flex; align-items: center; }
.chrome__nav { display: flex; gap: 19px; padding-left: 15.5px; color: #606367; }
.chrome__nav svg { width: 13px; height: 13px; }
.chrome__nav .is-off { color: #babcbe; }
.chrome__url { position: absolute; left: 108px; right: 44px; top: 4px; height: 28px; border-radius: 14px; background: #f1f3f4; display: flex; align-items: center; gap: 12px; padding-left: 14px; color: #767676; font-size: 14px; letter-spacing: 0; }
.chrome__url svg { width: 8px; height: 10.5px; flex: none; }
.chrome__menu { position: absolute; right: 20.5px; top: 12px; width: 3px; height: 13px; }
/* the page scroll drives the case study: the browser pins under the nav, its content scrolls, then the page moves on */
.browser-track { margin-top: 80px; }
/* desktop: browser and "More works" share one width — 60px in from each side of the background, up to 1760px,
   at the 1280:784 ratio */
.scroller.project { --bgap: 30px; --bw: min(100% - 120px, 1760px); }
.browser__body { flex: 1; min-height: 0; overflow: hidden; font-family: var(--font); }
.doc { display: flex; flex-direction: column; gap: 70px; padding: 70px 7.5%; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 4px; background: var(--chip); line-height: 1; font-size: 12px; align-self: flex-start; }
.tag small { font-family: var(--font-c); font-size: 8px; }
.doc__intro { display: flex; flex-direction: column; gap: 32px; }
.doc__intro .doc__title { max-width: 572px; }
.doc__title { display: flex; flex-direction: column; gap: 12px; }
.doc__intro h2 { font-size: 32px; line-height: 1; }
.doc p { font-size: 15px; line-height: 1.2; color: var(--ink-50); }
.doc p + p { margin-top: 18px; }
.doc em { font-weight: 500; font-style: italic; color: var(--ink-50); }
.doc__intro > p { max-width: 532px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 38px; padding: 6px 0; font-size: 14px; line-height: 1; }
.meta li span { color: var(--ink-30); margin-right: 6px; }
.meta li + li::before { content: "|"; font-size: 10px; color: rgba(0, 0, 0, .2); margin-right: 10px; vertical-align: 1px; }
.doc__row { display: flex; gap: 32px; }
.doc__row > .doc__title { flex: 1 1 0; }
.doc__row h3 { font-size: 24px; line-height: 1; }
.doc__row > .doc__copy { flex: 0 1 531px; }
.media { display: flex; flex-direction: column; gap: 12px; }
.media__row { display: flex; gap: 12px; }
.media figure { margin: 0; position: relative; border-radius: 16px; overflow: hidden; background: #f4f4f4; }
.media .full { aspect-ratio: 1086 / 594; }
.media .half { flex: 1 1 0; aspect-ratio: 537 / 594; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }

/* "More works" Mac window */
.window { position: relative; width: var(--bw, 91.43%); margin: 50px auto 120px; filter: drop-shadow(0 20px 18px rgba(16, 54, 99, .3)); }
.window__frame { display: flex; gap: 12px; padding: 40px 12px 12px; background: #f6f6f6; border: .5px solid rgba(0, 0, 0, .12); border-radius: 10px; overflow: hidden; }
.window__bar { position: absolute; inset: 0 0 auto; height: 28px; border-radius: 10px 10px 0 0; background: #fff; box-shadow: 0 .5px 0 rgba(0, 0, 0, .15); display: grid; place-items: center; font: 700 13px/1 var(--font-sf); letter-spacing: -0.004em; color: #3d3d3d; }
.window__bar img { position: absolute; left: 8px; top: 8px; width: 52px; height: 12px; }
.window .work { flex: 1 1 0; min-width: 0; }
.window .work__img { aspect-ratio: 1232 / 1170; }   /* desktop card: 410.67 × 390 */

/* ==========================================================================
   CONTACT — iMessage thread
   ========================================================================== */
/* centred between nav and footer when there's spare room; on short screens the auto margins collapse to 0
   and the original spacing stays */
.contact-wrap { margin-block: auto; }
.contact-intro { margin-top: 140px; text-align: center; font-size: 16px; line-height: 1.2; }
.contact-intro span { display: block; color: var(--ink-50); }
.thread {
  position: relative;
  width: 402px; max-width: calc(100% - 24px);
  height: 524px;
  margin: 60px auto 140px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 20px;
  box-shadow: 0 12px 33px -18px rgba(16, 54, 99, .3);
  overflow: hidden;
  font-family: var(--font-sf);
  letter-spacing: 0;
}
.thread__head { position: absolute; z-index: 2; inset: 0 0 auto; height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding-top: 3px; border-bottom: 1px solid #e9e9eb; background: rgba(255, 255, 255, .75); -webkit-backdrop-filter: blur(25px); backdrop-filter: blur(25px); }
.thread__head img { width: 44px; height: 56px; object-fit: cover; }
.thread__name { display: flex; align-items: center; gap: 3px; font-size: 11px; line-height: 1.25; }
.thread__name svg { width: 4px; height: 7px; }
.thread__body { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; padding: 122px 12px 82px 16px; display: flex; flex-direction: column; }
.thread__body::-webkit-scrollbar { display: none; }
.thread__time { align-self: center; padding: 10px 0 10px; font-size: 11px; line-height: 1.25; color: #909093; }
.thread__time b { font-weight: 590; }
.msg-group { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 4px; }
.msg-group + .msg-group { margin-top: 12px; }
.msg-group--me { align-items: flex-end; }
.msg {
  position: relative;
  max-width: 300px;
  padding: 7px 12px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.15px;
  background: #e9e9eb;
  color: rgba(0, 0, 0, .9);
  overflow-wrap: anywhere;
  margin-left: 5.5px;
  transform-origin: 0 100%;
}
.msg-group--me .msg { background: #0a84ff; color: #fff; margin-left: 0; margin-right: 5.5px; transform-origin: 100% 100%; }
.msg-group--me .msg.is-failed { background: #eb4d3d; }
/* iMessage tails on the last bubble of a group */
.msg.has-tail::before, .msg.has-tail::after { content: ""; position: absolute; bottom: 0; height: 17px; }
.msg.has-tail::before { left: -6px; width: 18px; background: inherit; border-bottom-right-radius: 14px 12px; }
.msg.has-tail::after { left: -10px; width: 10px; background: #fff; border-bottom-right-radius: 10px; }
.msg-group--me .msg.has-tail::before { left: auto; right: -6px; border-bottom-right-radius: 0; border-bottom-left-radius: 14px 12px; }
.msg-group--me .msg.has-tail::after { left: auto; right: -10px; border-bottom-right-radius: 0; border-bottom-left-radius: 10px; }
.msg-status { align-self: flex-end; margin: 2px 6px 0 0; font-size: 11px; line-height: 1.25; color: #909093; animation: fade .3s ease-out both; }
.msg-status.is-failed { color: #eb4d3d; }
.typing { display: flex; gap: 4px; align-items: center; padding: 12px 13px; width: max-content; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: #8e8e93; animation: typing 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.msg.pop-in { animation: pop .42s var(--ease-spring) both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.composer { position: absolute; z-index: 2; inset: auto 0 0; padding: 18px 16px 18px 12px; display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .75); -webkit-backdrop-filter: blur(25px); backdrop-filter: blur(25px); }
.composer__add { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #f0f0f2; color: #909093; }
.composer__add svg { width: 14px; height: 14px; }
.composer__field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; min-height: 36px; border: 1px solid #e9e9eb; border-radius: 18px; background: rgba(255, 255, 255, .75); }
.composer__field textarea { flex: 1; min-width: 0; max-height: 96px; padding: 7px 40px 7px 12px; border: 0; outline: 0; background: transparent; resize: none; font: 17px/1.25 var(--font-sf); letter-spacing: -0.02em; color: #000; overflow-y: auto; scrollbar-width: none; }
.composer__field textarea::placeholder { color: #c9c9cb; }
.composer__mic, .composer__send { position: absolute; right: 4px; bottom: 3px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; transition: transform .25s var(--ease-spring), opacity .15s; }
.composer__mic { color: #a2a1a3; }
.composer__mic svg { width: 12px; height: 16px; }
.composer__send { background: #0a84ff; color: #fff; transform: scale(0); opacity: 0; }
.composer__send svg { width: 14px; height: 14px; }
.composer.has-text .composer__send { transform: scale(1); opacity: 1; }
.composer.has-text .composer__mic { transform: scale(0); opacity: 0; }

.head-clone { position: fixed; z-index: 90; object-fit: contain; pointer-events: none; will-change: left, top, width, height; }

/* ---------- entrance ---------- */
.reveal { animation: rise .8s var(--ease-out) both; animation-delay: var(--rd, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .scroller.project { --bgap: 20px; --bw: calc(100% - var(--pad) * 2); }
  .browser { aspect-ratio: auto; height: calc(100dvh - var(--inset) * 2 - var(--stick, 100px) - var(--bgap)); }
  .home main { flex: none; min-height: calc(100dvh - var(--inset) * 2 - 58px); }
  .actions .pill--clock { display: none; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .window .work:nth-child(3) { display: none; }
  .doc__row { flex-direction: column; gap: 20px; }
  .doc__row > .doc__copy { flex: none; max-width: 640px; }
  .meta { flex-direction: column; align-items: flex-start; gap: 8px; }
  .meta li + li::before { display: none; }
}

@media (max-width: 760px) {
  :root { --inset: 16px; }
  .topbar { justify-content: center; }
  .nav { gap: 14px; padding-left: 14px; }
  .nav__logo, .nav__item { font-size: 13px; }
  .nav__item { padding: 6px 8px; }
  .topbar .actions { display: none; }
  .footer { flex-direction: column; gap: 16px; padding-bottom: 24px; text-align: center; }
  .footer__status { display: flex; justify-content: center; gap: 12px; margin-bottom: 20px; order: 1; }
  .footer__links { order: 2; }
  .footer__copy { order: 3; }

  .hero .face { width: 174px; height: 224px; }
  .hero { --hg: 8px; }
  .bubble { font-size: 15px; }
  .hero__intro { font-size: 14px; }
  .hero__intro br { display: none; }
  .hero__intro .m-br { display: block; }
  .logos .file { width: 52px; left: var(--mx); top: var(--my); --fx: calc(-1 * var(--mx) - 26px); --fy: calc(-1 * var(--my) - 40px); }
  .file__icon img { width: 52px; height: 52px; border-radius: 10px; }
  .logos .file__icon img { --ic: 52px; border-radius: 10px; }
  .logos .file__label { font-size: 12px; }

  .about-flow { --gap: 32px; }
  .about-face { width: 140px; height: 180px; }
  .about-hero__text { font-size: 24px; max-width: 360px; }
  .exp__list { column-gap: 16px; }
  .exp__col { gap: 64px; }
  .exp__item { font-size: 12px; }
  .exp__item span { white-space: normal; max-width: 84px; }
  .skills { gap: 40px; }
  .stack { max-width: 236px; }
  .resume { padding: 24px 0 120px; }

  .resume .file__icon img { width: 70px; height: 70px; }

  .page-intro { margin-top: 108px; }
  .works-grid { grid-template-columns: 1fr; padding: 80px var(--pad) 80px; gap: 26px; }
  .work__arrow { opacity: 1; transform: none; }

  .project-head { margin-top: 108px; }
  .browser-track { margin-top: 70px; }
  .chrome__tabs { padding-left: 54px; }
  .chrome__lights { left: 10px; transform: scale(.85); transform-origin: left center; }
  .tab { flex: 0 0 48px; padding: 0 12px; margin-right: -4px; }
  .tab span { display: none; }
  .tab.is-active { flex: 1 1 auto; max-width: 150px; padding: 0 20px 0 19px; }
  .tab.is-active span { display: block; }
  .tab::after { right: 4px; }
  .tab:not(.is-active) { padding: 0 4px 0 0; justify-content: center; }   /* favicon centred between the divider lines */
  .tab:not(.is-active)::before { inset: 0 -4px 0 -8px; }
  .tab.is-active + .tab::before { left: -14px; }
  .tab:has(+ .tab.is-active)::before { right: -14px; }
  .chrome__nav { gap: 14px; padding-left: 12px; }
  .chrome__url { left: 84px; right: 30px; font-size: 13px; }
  .chrome__menu { right: 13px; }
  .doc { gap: 40px; padding: 32px 20px 40px; }
  .doc__intro { gap: 24px; }
  .doc__intro h2 { font-size: 24px; }
  .doc__row h3 { font-size: 20px; }
  .doc p { font-size: 14px; }
  .meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .meta li + li::before { display: none; }
  .media, .media__row { gap: 8px; }
  .media figure { border-radius: 10px; }
  .window { margin: 50px auto 80px; }
  .window__frame { flex-direction: column; }
  .window .work:nth-child(3) { display: flex; }

  .contact-intro { margin-top: 110px; }
  .thread { width: 348px; margin-top: 60px; margin-bottom: 110px; }
}

@media (max-width: 380px) {
  .nav { gap: 8px; padding-left: 10px; }
  .nav__item { padding: 6px 5px; gap: 4px; }
  .footer__links { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Lenis (from lenis/dist/lenis.css, adapted for the .scroller wrapper) */
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* 404 */
.notfound { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 120px var(--pad) 140px; }
.notfound__code { font-size: 64px; line-height: 1; color: #5D7AA8; }
.notfound__title { font-size: 24px; font-weight: 500; }
.notfound__text { color: var(--ink-50); margin-bottom: 12px; }
