@font-face { font-family: "Averia Serif Libre"; src: url("../fonts/AveriaSerifLibre-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Averia Serif Libre"; src: url("../fonts/AveriaSerifLibre-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Averia Serif Libre"; src: url("../fonts/AveriaSerifLibre-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Averia Serif Libre"; src: url("../fonts/AveriaSerifLibre-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --sage: #A8B89F;
  --olive: #6F7F5F;
  --ivory: #FFFDF7;
  --terracotta: #C98262;
  --brown: #6B4F3A;
  --display: "Averia Serif Libre", Georgia, serif;
  --body: "Lato", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.65, 0, .35, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(20px, 5vw, 72px);
  --header: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  overflow-x: clip;
  margin: 0; background: var(--ivory); color: var(--brown);
  font-family: var(--body); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.is-intro { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; }

/* ---------- Intro ---------- */
#intro { position: fixed; inset: 0; z-index: 100; background: var(--ivory); display: grid; place-items: center; overflow: hidden; }
.stack { --w: min(360px, 78vw); --h: calc(var(--w) * 0.68); --step: calc(var(--h) * 0.3); position: relative; width: var(--w); height: calc(var(--h) + var(--step) * 2); }
.folder { position: absolute; left: 0; width: var(--w); height: var(--h); padding: 0; border: 0; background: none; perspective: 1400px; text-align: left; transition: transform .6s var(--ease-out); }
.f1 { top: 0; transform: rotate(-1.6deg); z-index: 1; }
.f2 { top: var(--step); transform: rotate(0.8deg); z-index: 2; }
.f3 { top: calc(var(--step) * 2); transform: rotate(-0.8deg); z-index: 3; }
#open-folder:hover:not(.busy) { transform: translateY(-14px) rotate(0deg); }
#open-folder:focus-visible { outline: 2px solid var(--brown); outline-offset: 8px; border-radius: 14px; }
.f-back, .f-front, .f-paper { position: absolute; }
.f-back { inset: 0; background: var(--tone); border: 2px solid var(--brown); border-radius: 6px 16px 16px 16px; }
.f-back::before {
  content: ""; position: absolute; top: -24px; height: 26px; width: 38%; left: var(--tab-x, 0);
  background: var(--tone); border: 2px solid var(--brown); border-bottom: 0; border-radius: 10px 14px 0 0; margin-left: -2px;
}
.f-paper { left: 5%; right: 5%; top: 7%; height: 88%; background: var(--ivory); border: 2px solid var(--brown); border-radius: 6px; }
.f-front {
  left: 0; right: 0; bottom: 0; height: 88%; background: var(--tone); border: 2px solid var(--brown);
  border-radius: 8px 8px 16px 16px; transform-origin: 50% 100%; backface-visibility: hidden;
}
.f-front span { position: absolute; left: 20px; top: 12px; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--tone-ink); }
[data-tone="sage"] { --tone: var(--sage); --tone-ink: var(--brown); }
[data-tone="terracotta"] { --tone: var(--terracotta); --tone-ink: var(--ivory); }
[data-tone="olive"] { --tone: var(--olive); --tone-ink: var(--ivory); }
.f1 { --tab-x: 4%; } .f2 { --tab-x: 31%; } .f3 { --tab-x: 58%; }
#intro .sheet { position: fixed; background: var(--ivory); border: 2px solid var(--brown); border-radius: 6px; pointer-events: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: var(--header);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter); background: var(--ivory);
  opacity: 0; transform: translateY(-14px);
  transition: opacity .8s var(--ease-out) .1s, transform .8s var(--ease-out) .1s;
}
body.ready .site-header { opacity: 1; transform: none; }
.logo { font-family: var(--display); font-weight: 700; font-size: 36px; line-height: 1; text-decoration: none; justify-self: start; }
.nav { display: flex; gap: clamp(10px, 2.4vw, 34px); }
.nav-end { justify-self: end; }
.nav a { font-family: var(--display); font-size: 19px; text-decoration: none; padding: 6px 14px; }
.nav a.active { font-weight: 700; }

/* hand drawn circle */
.scribble { position: relative; }
.scribble svg.ring {
  position: absolute; left: -14%; top: -22%; width: 128%; height: 144%;
  pointer-events: none; overflow: visible;
}
.ring path {
  fill: none; stroke: var(--terracotta); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; opacity: 0;
  transition: stroke-dashoffset .55s var(--ease), stroke-width .25s, opacity 0s .55s;
}
.scribble:hover .ring path, .scribble:focus-visible .ring path { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset .55s var(--ease), stroke-width .25s, opacity 0s; }
.nav a.active .ring path { stroke-dashoffset: 0; stroke-width: 4.5; opacity: 1; transition: stroke-dashoffset .55s var(--ease), stroke-width .25s, opacity 0s; }
.scribble:focus-visible { outline: none; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .08s; }
.hero .reveal:nth-child(3) { transition-delay: .16s; }
body:not(.ready) .hero .reveal { opacity: 0; transform: translateY(26px); }

/* ---------- Buttons ---------- */
.btn { display: inline-block; text-decoration: none; font-weight: 700; font-size: 15px; padding: 13px 24px; border-radius: 10px; border: 2px solid var(--brown); transition: transform .4s var(--ease-out), background .3s, color .3s; }
.btn:hover { transform: translateY(-2px); }
.btn-fill { background: var(--brown); color: var(--ivory); }
.btn-fill:hover { background: var(--olive); border-color: var(--olive); }
.btn-line { background: transparent; }
.btn-line:hover { background: var(--sage); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; padding: calc(var(--header) + 40px) var(--gutter) 60px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 5vw, 80px); align-items: center;
}
.hello { margin: 0 0 18px; font-family: var(--display); font-style: italic; font-size: clamp(22px, 2.2vw, 30px); color: var(--olive); }
.hero h1 { font-size: clamp(34px, 4vw, 60px); line-height: 1.08; max-width: 14em; }
.lede { max-width: 28em; font-size: clamp(18px, 1.5vw, 21px); margin: 28px 0 36px; font-weight: 300; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.deck { position: relative; width: 100%; aspect-ratio: 1.15 / 1; max-width: 720px; justify-self: end; }
.deck-inner { position: absolute; inset: 0; }
.dcard {
  position: absolute; left: 12%; top: 10%; width: 76%; aspect-ratio: 4 / 3; overflow: hidden; pointer-events: none;
  border: 3px solid var(--brown); border-radius: 20px; background: var(--sage);
}
.dcard img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.dcard:nth-child(1) { transform: translate(14%, -8%) rotate(7deg); z-index: 1; background: var(--olive); }
.dcard:nth-child(2) { transform: translate(-6%, 8%) rotate(-5deg); z-index: 2; background: var(--terracotta); }
.dcard:nth-child(3) { transform: translate(8%, 18%) rotate(1.5deg); z-index: 3; background: var(--sage); }

/* ---------- Pinned folder scroll ---------- */
.work { --n: 4; position: relative; height: calc(100vh + (var(--n) - 1) * 180vh + 80vh); }
.work-pin { position: sticky; top: 0; height: 100vh; overflow: hidden; padding: calc(var(--header) + 44px) var(--gutter) 32px; }
.stage { position: relative; height: 100%; }
.file {
  --tabw: 210px;
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--i) * 9px);
  background: var(--bg); color: var(--fg);
  border: 2px solid var(--brown); border-radius: 0 20px 20px 20px;
  will-change: transform;
}
.file[style*="--i:0"] { border-top-left-radius: 0; }
.file-tab {
  position: absolute; top: -44px; height: 46px; width: var(--tabw);
  left: calc(var(--i) * (100% - var(--tabw)) / (var(--n) - 1) - 2px);
  background: var(--bg); color: var(--fg);
  border: 2px solid var(--brown); border-bottom: 0; border-radius: 14px 14px 0 0;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  font-family: var(--display); font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden;
}
.file-tab small { font-family: var(--body); font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.file-body { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(24px, 4vw, 64px); padding: clamp(22px, 3vw, 44px); align-items: center; }
.file-copy { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.file-copy > * { flex-shrink: 0; }
.file-copy .num { font-size: 13px; letter-spacing: .14em; font-weight: 700; margin: 0 0 14px; }
.file-copy h3 { font-size: clamp(30px, min(4.6vw, 8vh), 68px); }
.file-copy .cat { margin: 14px 0 0; font-family: var(--display); font-style: italic; font-size: 18px; }
.file-copy .desc { margin: 16px 0 20px; font-weight: 300; font-size: 16.5px; max-width: 32em; flex-shrink: 1; min-height: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; }
.chips { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 5px 14px; border: 1.5px solid var(--fg); border-radius: 999px; font-size: 13px; font-weight: 700; }
.file-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.file .btn { border-color: var(--fg); background: transparent; color: var(--fg); }
.file .btn.primary { background: var(--fg); color: var(--bg); }
.file .btn:hover { transform: translateY(-2px); background: var(--ivory); color: var(--bg); border-color: var(--ivory); }

.shot {
  position: relative; display: block; padding: 0; width: 100%; aspect-ratio: 16 / 10; max-height: 100%;
  border: 2px solid var(--fg); border-radius: 16px; overflow: hidden; background: var(--ivory);
}
.shot img, .shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform 1.1s var(--ease-out), opacity .5s; }
.shot video { opacity: 0; background: var(--brown); }
.shot.playing video { opacity: 1; }

.shot.empty { background: var(--ivory); }

/* ---------- Laptop section ---------- */
.bench { position: relative; height: 340vh; }
.bench-pin { position: sticky; top: 0; height: 100vh; padding: calc(var(--header) + 24px) var(--gutter) 0; display: flex; flex-direction: column; overflow: hidden; }
.bench-title { font-size: clamp(34px, 4.6vw, 62px); max-width: 14ch; }
.bench-stage { position: relative; flex: 1; margin: 0 calc(var(--gutter) * -1); }
.ground { position: absolute; left: 0; right: 0; bottom: 7vh; height: 3px; background: var(--brown); z-index: 1; }
.laptop { position: absolute; left: 50%; bottom: calc(7vh - 3px); width: min(440px, 80vw); transform: translateX(-50%); z-index: 3; }
.screen {
  position: absolute; z-index: 2; width: 270px; padding: 0; text-align: left; overflow: hidden;
  background: var(--bg); color: var(--fg); border: 2.5px solid var(--brown); border-radius: 14px;
  animation: bob 6s ease-in-out infinite; transition: scale .6s var(--ease-out), rotate .6s var(--ease-out);
  will-change: transform, opacity;
}
.screen:hover { animation-play-state: paused; scale: 1.05; rotate: -1.5deg; }
.screen:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 5px; }
.chrome { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 2.5px solid var(--brown); background: var(--ivory); }
.chrome i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--brown); }
.screen-body { display: block; padding: 16px 16px 18px; }
.screen-body strong { display: block; font-family: var(--display); font-size: 25px; margin-bottom: 14px; }
.slot { display: block; height: 86px; border: 1.5px dashed var(--fg); border-radius: 8px; }
.s1 { --bg: var(--sage); --fg: var(--brown); left: 7%; top: 14%; }
.s2 { --bg: var(--terracotta); --fg: var(--ivory); right: 7%; top: 30%; animation-delay: -2s; }
.s3 { --bg: var(--olive); --fg: var(--ivory); left: 50%; top: clamp(14px, 4vh, 40px); margin-left: calc(var(--sw) / -2); animation-delay: -4s; }
.s3:hover { rotate: 1.5deg; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* ---------- Contact ---------- */
.contact { padding: clamp(80px, 12vw, 150px) var(--gutter) clamp(80px, 10vw, 130px); }
.contact-inner { display: flex; align-items: center; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.contact h2 { font-size: clamp(34px, 5vw, 64px); max-width: 18ch; margin-bottom: 28px; }
.mail { display: inline-block; font-family: var(--display); font-weight: 700; font-size: clamp(16px, 1.9vw, 26px); text-decoration: none; border-bottom: 2px solid var(--terracotta); padding-bottom: 4px; transition: color .3s; }
.mail:hover { color: var(--terracotta); }

/* ---------- Contact icons ---------- */
.socials { display: flex; gap: 26px; }
.dock-btn { position: relative; width: clamp(68px, 7vw, 92px); height: clamp(68px, 7vw, 92px); border-radius: 50%; border: 2.5px solid var(--brown); display: grid; place-items: center; transition: transform .4s var(--ease-out); }
.dock-btn:hover { transform: translateY(-3px); }
.dock-btn svg:not(.ring) { width: 42%; height: 42%; fill: var(--brown); stroke: var(--brown); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.dock-btn svg:not(.ring) rect, .dock-btn svg:not(.ring) path[d^="M3.5"] { fill: none; }
.dock-btn.c-sage { background: var(--sage); }
.dock-btn.c-olive { background: var(--olive); }
.dock-btn.c-olive svg:not(.ring) { fill: var(--ivory); stroke: var(--ivory); }
.dock-btn.c-terracotta { background: var(--terracotta); }
.dock-btn.c-terracotta svg:not(.ring) { fill: var(--ivory); stroke: none; }
.dock-btn.c-brown { background: var(--brown); }
.dock-btn.c-brown svg:not(.ring) { fill: none; stroke: var(--ivory); }
.dock-btn .ring { left: -30%; top: -30%; width: 160%; height: 160%; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 200; visibility: hidden; pointer-events: none; }
.overlay.open { visibility: visible; pointer-events: auto; }
.overlay-backdrop { position: absolute; inset: 0; background: var(--ivory); opacity: 0; transition: opacity .5s; }
.overlay.open .overlay-backdrop { opacity: .94; }
.overlay-panel {
  position: absolute; left: 50%; top: 50%; max-height: calc(100svh - 32px); overflow: auto;
  background: var(--ivory); border: 2.5px solid var(--brown); border-radius: 22px;
  transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .7s var(--ease-out), opacity .5s;
}
.overlay.open .overlay-panel { transform: translate(-50%, -50%); opacity: 1; }
.modal-panel { width: min(1180px, calc(100vw - 32px)); padding: clamp(14px, 2vw, 24px); display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(20px, 3vw, 44px); }
.modal-media { position: relative; aspect-ratio: 16 / 10; border: 2px solid var(--brown); border-radius: 14px; overflow: hidden; background: var(--sage); align-self: start; }
.modal-media img, .modal-media video { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.modal-info { display: flex; flex-direction: column; padding: 8px 4px 4px; }
.eyebrow { margin: 0 0 14px; font-family: var(--display); font-style: italic; font-size: 18px; color: var(--olive); }
.modal-info h3 { font-size: clamp(32px, 3.6vw, 50px); margin-bottom: 18px; }
.m-desc { margin: 0 0 24px; font-weight: 300; }
.meta { margin: 0 0 24px; display: grid; gap: 12px; }
.meta div { border-top: 2px solid var(--brown); padding-top: 10px; display: grid; grid-template-columns: 80px 1fr; gap: 12px; }
.meta dt { font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--olive); padding-top: 3px; }
.meta dd { margin: 0; }
.m-links { display: flex; gap: 10px; flex-wrap: wrap; }
.m-nav { margin-top: auto; padding-top: 28px; display: flex; justify-content: space-between; }
.text-btn { background: none; border: 0; border-bottom: 2px solid transparent; padding: 4px 0; font-weight: 700; font-size: 14px; transition: border-color .3s; }
.text-btn:hover { border-color: var(--terracotta); }
.m-close { position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; padding: 6px; background: none; border: 0; color: var(--brown); z-index: 3; transition: transform .5s var(--ease-out); }
.m-close svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; }
.m-close path { stroke-dasharray: 1; }
.m-close:hover { transform: rotate(90deg) scale(1.08); }

.info-wrap {
  position: absolute; left: 50%; top: 50%; width: min(900px, calc(100vw - 32px));
  transform: translate(-50%, -50%) rotate(-.7deg);
  background: none; color: var(--fg);
}
.info-panel {
  background: var(--bg); border: 2.5px solid var(--brown); border-radius: 6px 22px 22px 22px;
  max-height: calc(100svh - 80px); overflow: auto; padding: clamp(32px, 4vw, 52px) clamp(24px, 4vw, 48px) clamp(24px, 4vw, 44px);
}
.overlay.closing .overlay-backdrop { opacity: 0; }
.info-wrap .m-close { color: var(--fg); top: 18px; right: 18px; }
.clip { position: absolute; z-index: 4; top: -42px; left: 9%; width: 56px; height: 96px; overflow: visible; transform-origin: 50% 80%; }
.clip path { fill: none; stroke: var(--clip, var(--brown)); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.info-panel h3 { font-size: clamp(32px, 4vw, 50px); margin-bottom: 26px; padding-right: 60px; }
.info-panel h4 { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; font-family: var(--body); color: var(--fg); margin: 28px 0 8px; }
.info-panel p { margin: 0 0 14px; font-weight: 300; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-top: 2px solid var(--fg); }
.rows li:last-child { border-bottom: 2px solid var(--fg); }
.rows .row { display: block; padding: 16px 0; text-decoration: none; }
a.row:hover strong { text-decoration: underline; text-decoration-thickness: 2px; }
.rows strong { font-family: var(--display); font-size: 21px; transition: color .3s; }
.rows span { display: block; font-size: 15px; font-weight: 300; }
.rows .chips { margin: 10px 0 0; }
.rows .chips li { border: 1.5px solid var(--fg); border-radius: 999px; }
.rows .chips li:last-child { border-bottom: 1.5px solid var(--fg); }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { padding: 5px 14px; border: 1.5px solid var(--fg); border-radius: 999px; font-size: 14px; }
.resume-frame { width: 100%; height: min(68vh, 760px); border: 2px solid var(--fg); border-radius: 10px; background: var(--ivory); }
.resume-frame.empty { border-style: dashed; }
.resume-actions { margin-top: 18px; display: flex; gap: 12px; }
.info-panel .btn { border-color: var(--fg); color: var(--fg); background: transparent; }
.info-panel .btn.primary { background: var(--fg); color: var(--bg); }
.art { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.art figure { margin: 0; }
.art img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 2px solid var(--fg); border-radius: 12px; }
.art figcaption { margin-top: 8px; }
.art figcaption strong { display: block; font-family: var(--display); font-size: 18px; }
.art figcaption span { font-size: 14px; font-weight: 300; }
.art .ph { aspect-ratio: 3 / 4; border: 2px dashed var(--fg); border-radius: 12px; }
.row-links { display: flex; gap: 10px; margin-top: 14px; }
.row-links .btn { padding: 9px 18px; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .deck { justify-self: center; max-width: 560px; }
  .file-body { grid-template-columns: 1fr; align-content: start; gap: 18px; }
  .file-copy .desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .shot { order: -1; aspect-ratio: 16 / 8; }
  .file { --tabw: 150px; }
  .modal-panel { grid-template-columns: 1fr; }
  .bench { height: auto; }
  .bench-pin { position: static; height: auto; padding-bottom: 80px; overflow: visible; }
  .bench-stage { flex: none; margin: 0; padding: 30px 0 0; display: grid; gap: 18px; }
  .screen, .s1, .s2, .s3 { position: static; width: 100%; margin: 0; animation: none; opacity: 1 !important; transform: none !important; pointer-events: auto !important; }
  .laptop { position: relative; left: auto; bottom: auto; transform: none; margin: 24px auto 0; order: 5; }
  .ground { position: static; order: 6; margin: -4px calc(var(--gutter) * -1) 0; }
}
@media (max-width: 640px) {
  :root { --header: 64px; }
  .site-header { grid-template-columns: auto 1fr auto; gap: 8px; }
  .nav { justify-self: center; gap: 0; }
  .nav a { font-size: 16px; padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- Case study screen ---------- */
.case {
  position: fixed; inset: 0; z-index: 150; background: var(--ivory); color: var(--brown);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  visibility: hidden; opacity: 0; transform: translateY(5%); pointer-events: none;
  transition: opacity .6s var(--ease-out), transform .8s var(--ease-out), visibility 0s .8s;
}
.case.open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: opacity .6s var(--ease-out), transform .8s var(--ease-out); }
.case-text { overflow-y: auto; padding: clamp(28px, 5vw, 72px) clamp(24px, 4.5vw, 72px) 80px; }
.case-back { margin-bottom: 40px; }
.case-text h2 { font-size: clamp(40px, 5vw, 72px); margin-bottom: 12px; }
.case-tag { margin: 0 0 6px; font-family: var(--display); font-style: italic; font-size: clamp(20px, 2vw, 26px); }
.case-meta { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--olive); }
.case-lead { margin: 26px 0 8px; font-family: var(--display); font-size: clamp(20px, 1.9vw, 26px); line-height: 1.4; }
.case-block { margin-top: 30px; }
.case-block h3 { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; font-family: var(--body); font-weight: 700; color: var(--olive); margin-bottom: 12px; }
.case-block p { margin: 0 0 16px; font-weight: 300; font-size: 17px; max-width: 38em; }
.case-items { list-style: none; counter-reset: item; margin: 0; padding: 0; }
.case-items li { counter-increment: item; border-top: 2px solid var(--brown); padding: 16px 0 6px 44px; position: relative; max-width: 40em; }
.case-items li::before { content: counter(item); position: absolute; left: 0; top: 14px; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--terracotta); }
.case-items strong { font-family: var(--display); font-size: 20px; display: block; margin-bottom: 6px; }
.case-items p { margin-bottom: 10px; }
.case-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 40px; }
.case-links .btn { border-color: var(--brown); }
.case-links .btn:hover { background: var(--brown); color: var(--ivory); }
.case-media { background: var(--bg); display: grid; place-items: center; padding: clamp(24px, 4vw, 64px); border-left: 2.5px solid var(--brown); }
.case-media video, .case-media img { width: 100%; max-height: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border: 2px solid var(--fg); border-radius: 16px; background: var(--brown); }
.case .m-close { color: var(--fg); top: 16px; right: 16px; }
@media (max-width: 980px) {
  .case { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; align-content: start; }
  .case-media { order: -1; border-left: 0; border-bottom: 2.5px solid var(--brown); padding: 64px 20px 20px; }
  .case-text { overflow: visible; }
}

.case-back { font-family: var(--display); font-size: 20px; background: none; border: 0; padding: 6px 18px; margin: 0 0 34px -18px; color: var(--brown); }
.case-back .ring { left: -6%; top: -18%; width: 112%; height: 136%; }

@media (max-height: 820px) {
  .file-copy .num { margin-bottom: 8px; }
  .file-copy .desc { -webkit-line-clamp: 5; font-size: 15.5px; margin: 12px 0 16px; }
  .file-copy .cat { margin-top: 8px; font-size: 16px; }
  .chips { margin-bottom: 16px; }
  .file .btn { padding: 10px 20px; }
}
@media (max-height: 640px) {
  .file-copy .num { display: none; }
  .file-copy .desc { -webkit-line-clamp: 3; }
  .chips { display: none; }
  .file-body { padding: 18px 24px; }
}

/* ---------- Laptop scene scales with the window height ---------- */
.bench-pin { --lh: clamp(120px, 29vh, 270px); }
.bench-title { font-size: clamp(26px, min(4.6vw, 7vh), 62px); }
@media (max-height: 700px) and (min-width: 981px) { .bench-title { max-width: 26ch; } }
.laptop { height: var(--lh); width: calc(var(--lh) * 1.63); max-width: 80vw; }
.screen { --sw: clamp(170px, 19vw, 270px); width: var(--sw); }
.screen-body { padding: clamp(10px, 2vh, 16px) 14px clamp(10px, 2vh, 18px); }
.screen-body strong { font-size: clamp(17px, 3vh, 25px); margin-bottom: clamp(6px, 1.4vh, 14px); }
.slot { height: clamp(28px, 7vh, 86px); }
.chrome { padding: clamp(6px, 1.2vh, 10px) 12px; }
.ground { bottom: 6vh; }
.laptop { bottom: calc(6vh - 3px); }

@media (max-width: 640px) {
  .nav-home { display: none; }
  .site-header { grid-template-columns: auto 1fr auto; }
  .nav { gap: 2px; }
  .nav a { font-size: 15px; padding: 4px 7px; }
  .file { --tabw: 84px; border-radius: 0 16px 16px 16px; }
  .file-tab { font-size: 13px; padding: 0 10px; gap: 6px; height: 42px; top: -40px; }
  .file-tab small { font-size: 11px; }
  .file-body { padding: 16px; gap: 14px; }
  .file-copy .num { display: none; }
  .file-copy h3 { font-size: 30px; }
  .file-copy .desc { -webkit-line-clamp: 4; font-size: 15px; }
  .chips li { font-size: 12px; padding: 3px 10px; }
  .work-pin { padding-top: calc(var(--header) + 40px); }
  .socials { gap: 12px; }
  .dock-btn { width: 62px; height: 62px; }
  .contact-inner { gap: 32px; }
  .hero { padding-top: calc(var(--header) + 24px); }
  .info-wrap .m-close { top: 10px; right: 10px; }
  .clip { left: 12%; }
  .case-text { padding-bottom: 60px; }
}

.laptop { padding: 0; border: 0; background: none; display: block; cursor: pointer; }
.laptop-svg { display: block; width: 100%; height: 100%; transition: transform .6s var(--ease-out); }
.laptop:hover .laptop-svg { transform: translateY(-5px); }
.laptop:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 6px; border-radius: 12px; }
.tagline { font-family: var(--display); font-style: italic; font-size: 20px; margin: -10px 0 22px; }

/* ---------- Small screen and safe-area hardening ---------- */
.mail, .file-copy h3, .case-text h2, .modal-info h3 { overflow-wrap: anywhere; }
.file-copy, .modal-info, .contact-copy, .hero-copy, .case-text { min-width: 0; }
.row-links { flex-wrap: wrap; }
.tab-short { display: none; }

.site-header { height: calc(var(--header) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.hero { padding-top: calc(var(--header) + env(safe-area-inset-top) + 40px); }
.work-pin, .bench-pin { padding-top: calc(var(--header) + env(safe-area-inset-top) + 24px); }
.work-pin { padding-top: calc(var(--header) + env(safe-area-inset-top) + 44px); }
.case { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.overlay-panel, .info-wrap { max-width: calc(100vw - 32px); }

/* roomy touch targets */
.nav a { display: inline-flex; align-items: center; min-height: 44px; }
.logo { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.text-btn, .case-back { min-height: 44px; }

/* dynamic viewport units so mobile browser bars do not clip the pinned scenes */
@supports (height: 100dvh) {
  .work { height: calc(100dvh + (var(--n) - 1) * 180dvh + 80dvh); }
  .work-pin, .bench-pin { height: 100dvh; }
  .case { height: 100dvh; }
}

@media (max-width: 640px) {
  .socials { width: 100%; justify-content: space-between; gap: 8px; }
  .dock-btn { width: min(62px, 21vw); height: min(62px, 21vw); }
  .site-header .ring { left: -6%; width: 112%; }
  .nav a { min-height: 44px; }
  .case-back { padding-left: 14px; }
}
@media (max-width: 420px) {
  .art { grid-template-columns: 1fr; }
  .site-header { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); gap: 4px; }
  .nav a { font-size: 14px; padding: 4px 5px; }
  .logo { font-size: 26px; }
}
@media (max-width: 640px) {
  .file-tab .tab-full { display: none; }
  .file-tab .tab-short { display: inline; }
  .file { --tabw: 88px; }
}
@media (max-width: 380px) {
  .file-tab .tab-short { display: none; }
  .file { --tabw: 52px; }
}
@media (max-width: 640px) {
  .nav a.nav-home { display: none; }
}

/* cross buttons: no outline box, keyboard focus thickens the stroke instead */
.m-close { outline: none; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
.m-close:focus-visible svg { stroke-width: 5; }
.case, .info-wrap, .overlay-panel { outline: none; }

/* ---------- Stacked laptop scene on tablets and phones (must come last) ---------- */
@media (max-width: 980px) {
  .bench { height: auto; }
  .bench-pin { position: static; height: auto; overflow: visible; padding-bottom: 72px; }
  .bench-stage { flex: none; height: auto; margin: 0; padding: 28px 0 0; display: grid; gap: 18px; }
  .screen, .s1, .s2, .s3 { position: static; width: 100%; margin: 0; top: auto; left: auto; right: auto; animation: none; }
  .laptop { position: relative; left: auto; bottom: auto; transform: none; margin: 22px auto 0; width: min(78vw, 340px); height: auto; aspect-ratio: 440 / 270; order: 5; }
  .ground { position: static; bottom: auto; order: 6; margin: -4px calc(var(--gutter) * -1) 0; }
}
