/* Samuel Chu portfolio. Built from the Figma file "Portfolio Home with Exposure Strip".
   Grid: 1440 design width, 24px margins, 12 columns, 24px gutters.
   Type: Inter in four styles (Display, Body, Label, Small). Colors: ink, muted, hairline, white. */

:root {
  --ink: #111111;
  --muted: #8a8a86;
  --hair: #e8e8e4;
  --bg: #ffffff;
  --m: 24px;
  --g: 24px;
  --eio: cubic-bezier(0.42, 0, 0.58, 1);
  --eo: cubic-bezier(0, 0, 0.58, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* measures the screen height without mobile browser bars (100svh) */
.vh-probe { position: fixed; left: 0; top: 0; width: 0; height: 100vh; height: 100svh; visibility: hidden; pointer-events: none; }
body {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 23px;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: none; }
a { color: inherit; }
p, h1, h2, h3, figure, ul { margin: 0; padding: 0; }
h1, h2, h3 { font-weight: inherit; font-size: inherit; line-height: inherit; }

/* Type styles (Figma text styles) */
.t-display { font-size: 40px; line-height: 47px; letter-spacing: -0.02em; font-weight: 400; }
.t-body    { font-size: 16px; line-height: 23px; letter-spacing: -0.005em; font-weight: 400; }
.t-label   { font-size: 16px; line-height: 23px; letter-spacing: -0.005em; font-weight: 500; }
.t-small   { font-size: 13px; line-height: 18px; letter-spacing: 0; font-weight: 400; }
.muted { color: var(--muted); }
.u { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a.plain { text-decoration: none; }

/* Header */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px; height: 81px; position: relative; z-index: 5;
}
.site-title {
  display: flex; align-items: center; justify-content: flex-start;
  width: 33px; height: 33px; padding: 5px 7.28px; background: var(--bg);
  color: var(--ink); text-decoration: none;
}
.site-title svg { width: 18.45px; height: 23px; display: block; }
.site-title, .nav a { position: relative; }
.site-title::after, .nav a::after { content: ''; position: absolute; left: -3px; right: -3px; top: -6px; bottom: -6px; }
.nav { display: flex; gap: 6px; }
.nav a {
  display: block; padding: 5px 10px; background: var(--bg); text-decoration: none;
  font-size: 16px; line-height: 23px; letter-spacing: -0.005em; font-weight: 500;
}
.nav a.current { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* V11 home header: no chips, white with difference blend so it reads on white and on the black ring */
.site-header.v11 { position: absolute; top: 0; left: 0; right: 0; mix-blend-mode: difference; color: #fff; z-index: 6; }
.site-header.v11 .site-title, .site-header.v11 .nav a { background: transparent; color: #fff; }

/* Footer */
.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 96px 24px 24px;
}
.site-footer .links { display: flex; gap: 24px; }
.site-footer a { text-decoration: none; color: var(--muted); }
/* small text links get a larger invisible tap area */
.site-footer a, .jump a { position: relative; }
.site-footer a::after, .jump a::after { content: ''; position: absolute; left: -6px; right: -6px; top: -10px; bottom: -10px; }

/* Page content */
.content { display: flex; flex-direction: column; gap: 64px; padding: 56px 24px 0; }
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.c1-4 { grid-column: 1 / span 4; }
.c5-12 { grid-column: 5 / span 8; }
.c5-10 { grid-column: 5 / span 6; }

/* Work page */
.jump { display: flex; gap: 24px; flex-wrap: wrap; }
.work-index { display: flex; flex-direction: column; gap: 72px; }
.w-section { padding-top: 16px; border-top: 1px solid var(--ink); align-items: start; scroll-margin-top: 24px; }
.w-label { display: flex; flex-direction: column; gap: 4px; }
.w-rows { display: flex; flex-direction: column; }
.w-row {
  display: flex; gap: 24px; justify-content: space-between; align-items: flex-start;
  padding: 14px 0; border-top: 1px solid var(--hair); text-decoration: none;
}
.w-row:first-child { padding-top: 0; border-top: 0; }
.w-row .meta { text-align: right; white-space: nowrap; color: var(--muted); }
@media (hover: hover) { .w-row:hover .title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; } }

/* About page */
.about { grid-template-rows: auto 1fr; }
.about-h { grid-column: 5 / span 8; grid-row: 1; }
.about-portrait { grid-column: 1 / span 4; grid-row: 1 / span 2; align-self: start; width: 100%; aspect-ratio: 448 / 560; background: var(--hair); }
.about-info { grid-column: 5 / span 8; grid-row: 2; align-self: start; margin-top: 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; }
.about-info > div { display: flex; flex-direction: column; gap: 8px; }

/* Contact page */
.contact-links { row-gap: 24px; }
.contact-links > div { grid-column: span 3; display: flex; flex-direction: column; gap: 8px; }

/* Project pages */
.p-intro { align-items: start; }
.p-title { display: flex; flex-direction: column; gap: 28px; }
.p-details { display: flex; flex-direction: column; gap: 14px; }
.p-details > div { display: flex; flex-direction: column; gap: 2px; }
.images { display: flex; flex-direction: column; gap: 24px; }
.img-row { display: flex; gap: 24px; align-items: flex-start; }
.img-row figure { flex: var(--a) 1 0%; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.img-row figure img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; object-position: 50% 50%; background: var(--hair); }
.img-row figure.hug figcaption { align-self: flex-start; }
/* YouTube player, 16:9 like the videos */
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.early { display: flex; flex-direction: column; gap: 12px; padding-top: 40px; }
.p-nav {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-top: 14px; border-top: 1px solid var(--ink);
}

/* 100 Iterations: full strip, scroll or drag sideways */
.strip {
  height: 400px; background: #000; overflow-x: auto; overflow-y: hidden;
  cursor: grab; scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-user-select: none; user-select: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip, .sw-img, .zine .hot { -webkit-tap-highlight-color: transparent; }
.strip.dragging { cursor: grabbing; }
.strip .track { display: flex; height: 100%; width: max-content; }
.strip .track img { height: 100%; width: auto; aspect-ratio: auto; max-width: none; flex: none; object-fit: fill; background: none; pointer-events: none; }

/* Zine viewer: click the right page to turn forward, the left page to go back */
.zine { position: relative; width: 100%; }
.zine .spread { position: relative; width: 100%; aspect-ratio: 1392 / 901; }
.zine .page { position: absolute; top: 0; width: 50%; height: 100%; object-fit: fill; will-change: transform; }
.zine .page.l { left: 0; transform-origin: 100% 50%; }
.zine .page.r { left: 50%; transform-origin: 0% 50%; }
.zine .hot { position: absolute; top: 0; width: 50%; height: 100%; cursor: pointer; background: transparent; border: 0; padding: 0; }
.zine .hot.prev { left: 0; }
.zine .hot.next { left: 50%; }
.zine .hot[hidden] { display: none; }
.zine .indicator { margin: 14px 0 8px; white-space: pre-wrap; }
.zine .spread { touch-action: pan-y; }
.zine.single .spread { aspect-ratio: 612 / 792; }
.zine.single .page { left: 0; width: 100%; transform: none !important; opacity: 0; transition: opacity 0.25s var(--eo); }
.zine.single .page.on { opacity: 1; }

/* ===== V11 home ===== */
html:has(body.home), body.home { overflow-anchor: none; }
.hero-track { position: relative; overflow-anchor: none; }
.stage { position: sticky; top: 0; min-height: 100vh; min-height: 100svh; background: var(--bg); } /* white backdrop so the difference-blend header shows */
.anim { position: absolute; left: 0; top: 0; width: 100%; height: 100vh; height: 100svh; overflow: hidden; pointer-events: none; }
.anim svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.anim .lbl {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-family: 'Arimo', Arial, sans-serif; font-size: 12px; line-height: 14px; color: #8a8a8a;
  letter-spacing: 0; will-change: transform, opacity;
}
.anim .band {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-family: 'Arimo', Arial, sans-serif; font-size: 14px; line-height: 16px; letter-spacing: 0;
  will-change: transform, opacity;
}
.anim .band.b { font-weight: 700; color: #111111; }
.anim .band.k { color: #111111; }
.anim .band.g { color: #8a8a8a; }
.anim.narrow .band { font-size: 13px; }
.after { position: relative; z-index: 2; padding-top: 81px; opacity: 0; pointer-events: none; }
.after.live { pointer-events: auto; }
.track-spacer { height: 325vh; } /* steps 2 to 9 follow the scroll, see PLAN in home.js */
/* after the animation: the hero track collapses so the page starts at Selected work */
body.past-intro .track-spacer, body.past-intro .anim { display: none; }
body.past-intro .stage { position: relative; }

/* Selected work: 2 by 2 grid that opens one project across eight columns */
.sw { position: relative; border-top: 1px solid var(--ink); transition: height 0.5s var(--eio); }
.sw-label { position: absolute; left: 0; top: 16px; display: flex; flex-direction: column; gap: 24px; }
.sw-label .grp { display: flex; flex-direction: column; gap: 4px; }
.sw-links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sw-back { opacity: 0; visibility: hidden; transition: opacity 0.5s var(--eio), visibility 0s linear 0.5s; }
.sw.is-open .sw-back { opacity: 1; visibility: visible; transition: opacity 0.5s var(--eio), visibility 0s; }
.sw-card {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; gap: 12px;
  transition: left 0.5s var(--eio), top 0.5s var(--eio), width 0.5s var(--eio);
  cursor: pointer;
}
.sw-img { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--hair); }
.sw-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s var(--eo); }
.sw-img img.on { opacity: 1; }
.sw-img .chip {
  position: absolute; right: 12px; bottom: 12px; background: #fff; padding: 4px 8px;
  font-size: 13px; line-height: 18px; color: var(--ink); white-space: nowrap;
  opacity: 0; transition: opacity 0.5s var(--eio); pointer-events: none;
}
.sw-card.open .chip { opacity: 1; }
.sw-cap { display: flex; justify-content: space-between; text-decoration: none; }
@media (hover: hover) { .sw-card.open .sw-cap:hover .title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; } }
.sw.no-anim, .sw.no-anim .sw-card { transition: none !important; }
.sw.sw-stack { height: auto !important; display: flex; flex-direction: column; gap: 40px; padding-top: 16px; }
.sw.sw-stack .sw-label, .sw.sw-stack .sw-card { position: static; }
.sw.sw-mid .sw-label { flex-direction: row; justify-content: space-between; align-items: flex-start; }
.sw.sw-mid .sw-links { align-items: flex-end; }
.sw.direct .chip { opacity: 1; }
.sw-card.open .sw-img { cursor: pointer; }

/* Tablets and small windows: fewer, wider columns where four would be too tight */
@media (min-width: 761px) and (max-width: 1099px) {
  .about-info { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .contact-links > div { grid-column: span 6; }
}

/* Narrow screens (phones, upright small tablets): stack the 12 column layouts */
@media (max-width: 760px) {
  .grid12 { display: flex; flex-direction: column; gap: 24px; }
  .w-section { gap: 16px; }
  .w-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .w-row .meta { text-align: left; white-space: normal; font-size: 13px; line-height: 18px; letter-spacing: 0; }
  .img-row { flex-direction: column; }
  .img-row figure { flex: none; width: 100%; }
  .about-portrait { width: min(100%, 400px); }
  .about-info { grid-template-columns: 1fr; row-gap: 24px; margin-top: 16px; }
  .contact-links > div { grid-column: auto; }
  .t-display { font-size: 30px; line-height: 36px; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .strip { height: 280px; }
}

/* Phones */
@media (max-width: 600px) {
  .content { padding-top: 32px; gap: 48px; }
  .work-index { gap: 56px; }
  .p-title { gap: 20px; }
  .site-footer { padding-top: 72px; }
}

/* Phones turned sideways and other short screens */
@media (max-height: 500px) and (min-width: 601px) {
  .strip { height: 240px; }
}
