/* Henry Wang portfolio. Hand-written, no framework. Modern minimal: white and near-black, one accent reserved for focus. */

:root {
  --bg: #ffffff;
  --surface: #f4f4f4;
  --ink: #0e0e0e;
  --ink-2: #4b4b4b;
  --muted: #8a8a8a;
  --line: #e4e4e4;
  --line-strong: #c9c9c9;
  --accent: #2457c5;
  --gutter: clamp(20px, 4vw, 64px);
  --max: 1520px;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --surface: #181818;
  --ink: #f2f2f2;
  --ink-2: #b3b3b3;
  --muted: #777777;
  --line: #262626;
  --line-strong: #3a3a3a;
  --accent: #8fb0ff;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e;
    --surface: #181818;
    --ink: #f2f2f2;
    --ink-2: #b3b3b3;
    --muted: #777777;
    --line: #262626;
    --line-strong: #3a3a3a;
    --accent: #8fb0ff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  font-feature-settings: "cv11" 1, "ss01" 1, "tnum" 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color .35s var(--ease), color .35s var(--ease);
  overflow-x: hidden;
}
body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

/* Text link with underline that draws in */
.u { position: relative; display: inline-block; }
.u::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease-out); }
.u:hover::after, .u[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); transition: background-color .35s var(--ease); }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); transform: scaleX(0); transition: transform .5s var(--ease-out); }
.site-header.is-scrolled::after { transform: scaleX(1); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { font-weight: 500; letter-spacing: -.01em; font-size: 15px; white-space: nowrap; }
.brand small { font-weight: 400; color: var(--muted); font-size: 15px; margin-left: 8px; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 15px; }
.nav-link { color: var(--ink-2); transition: color .25s var(--ease); }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); transition: color .25s; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 14px; height: 14px; transition: transform .6s var(--ease-out); }
.theme-toggle:hover svg { transform: rotate(-30deg); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
@media (max-width: 520px) { .brand small { display: none; } .nav { gap: 16px; } }

/* Progress line */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 50; transform-origin: left; transform: scaleX(0); background: var(--ink); pointer-events: none; }

/* One page-load sequence */
.rise > * { opacity: 0; transform: translateY(14px); animation: rise .9s var(--ease-out) forwards; }
.rise > *:nth-child(1) { animation-delay: .05s; }
.rise > *:nth-child(2) { animation-delay: .14s; }
.rise > *:nth-child(3) { animation-delay: .23s; }
.rise > *:nth-child(4) { animation-delay: .32s; }
.rise > *:nth-child(5) { animation-delay: .41s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Icon buttons (carousel, lightbox) */
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); color: var(--ink); background: var(--bg); transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Home hero */
.hero { padding: clamp(56px, 11vh, 150px) 0 clamp(40px, 8vh, 110px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 32px 64px; align-items: end; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { margin: 0; font-size: clamp(36px, 6vw, 96px); line-height: .98; letter-spacing: -.045em; font-weight: 500; max-width: 14ch; text-wrap: balance; }
.hero .lede { font-size: clamp(16px, 1.25vw, 19px); line-height: 1.5; color: var(--ink-2); margin: 0 0 20px; max-width: 42ch; }
.hero-meta { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }

/* Work index */
.index-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 0 12px; border-bottom: 1px solid var(--ink); gap: 16px; font-size: 14px; }
.index-head h2 { margin: 0; font-size: 14px; font-weight: 500; }
.index-head span { color: var(--muted); }
.index { list-style: none; margin: 0 0 clamp(40px, 8vh, 110px); padding: 0; position: relative; }
.index li { border-bottom: 1px solid var(--line); }
.index-link { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 20px 0 24px; position: relative; transition: color .35s var(--ease); }
.index-title { font-size: clamp(26px, 4.2vw, 58px); line-height: 1.02; letter-spacing: -.04em; font-weight: 500; display: inline-flex; align-items: baseline; gap: .35em; transition: transform .55s var(--ease-out); }
.index-title .arrow { width: .5em; height: .5em; flex: none; opacity: 0; transform: translate(-8px, 2px); transition: opacity .35s var(--ease), transform .55s var(--ease-out); }
.index-meta { color: var(--muted); font-size: 14px; line-height: 1.4; }
.index-meta b { font-weight: 400; color: var(--ink-2); }
.index-short { color: var(--ink-2); font-size: 15px; max-width: 56ch; margin: 0; }
.index-thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-top: 6px; }
@media (max-width: 760px) {
  .index-meta b::after { content: ", "; }
  .index-meta { order: 3; } .index-short { order: 2; } .index-thumb { order: 1; } .index-title { order: 0; }
}
@media (min-width: 761px) {
  .index-link { grid-template-columns: minmax(0, 1fr) 240px; gap: 10px 40px; padding: clamp(16px, 2.2vw, 28px) 0; align-items: baseline; }
  .index-meta { text-align: right; white-space: nowrap; }
  .index-meta b { display: block; }
  .index-thumb { display: none; }
  .index-short { grid-column: 1 / -1; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s var(--ease-out), opacity .4s var(--ease), margin .4s var(--ease); }
}
@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .index.is-hovering .index-link { color: var(--muted); }
  .index.is-hovering .index-link:hover { color: var(--ink); }
  .index-link:hover .index-title { transform: translateX(14px); }
  .index-link:hover .arrow { opacity: 1; transform: translate(0, 2px); }
  .index-link:hover .index-short { max-height: 60px; opacity: 1; margin-top: 2px; }
}
@media (min-width: 761px) and (hover: none) { .index-short { max-height: none; opacity: 1; } }

/* Professional and academic work side by side */
.index-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 clamp(36px, 4.5vw, 80px); align-items: start; }
@media (min-width: 1000px) { .index-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.index-cols .index-head { flex-wrap: wrap; row-gap: 2px; }
.index.compact .index-title { font-size: clamp(24px, 2.35vw, 36px); line-height: 1.06; letter-spacing: -.035em; }
@media (min-width: 761px) {
  .index.compact .index-link { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: clamp(14px, 1.6vw, 22px) 0; }
  .index.compact .index-meta { text-align: left; white-space: normal; }
  .index.compact .index-meta b { display: inline; }
  .index.compact .index-meta b::after { content: ", "; }
  .index.compact .index-short { grid-column: auto; }
}
@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .index.compact .index-link:hover .index-title { transform: translateX(10px); }
}

.index-meta.no-term b::after { content: none !important; }

/* Floating preview, pinned beside the hovered list */
.preview { position: fixed; top: 0; left: 0; width: min(30vw, 420px); aspect-ratio: 4 / 3; z-index: 30; pointer-events: none; opacity: 0; overflow: hidden; background: var(--surface); outline: 1px solid var(--line); transform: translate(-50%, -50%) scale(.96); transition: opacity .3s var(--ease); will-change: transform; }
.preview.is-on { opacity: 1; }
.preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s var(--ease); }
.preview img.is-current { opacity: 1; }
.preview-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; font-size: 13px; color: var(--ink); background: var(--bg); border-top: 1px solid var(--line); z-index: 2; }
@media (hover: none), (max-width: 760px) { .preview { display: none; } }

/* Sections and prose */
.section { padding: clamp(36px, 7vh, 96px) 0; }
.section-title { font-size: clamp(22px, 2.4vw, 32px); letter-spacing: -.03em; font-weight: 500; margin: 0 0 24px; line-height: 1.1; }
.prose { max-width: 66ch; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.6; color: var(--ink); }
.prose p { margin: 0 0 1.2em; }
.prose a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: text-decoration-color .3s; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose h3 { font-size: clamp(20px, 1.6vw, 24px); letter-spacing: -.025em; font-weight: 500; margin: 2.4em 0 .7em; line-height: 1.15; }
.project-body { max-width: none; }
.project-body > p, .project-body > h3 { max-width: 66ch; }
.project-body > h3:first-child { margin-top: 0; }
.project-body > .figs + p, .project-body > .carousel + p, .project-body > .video-figure + p { margin-top: 1.8em; }

/* Project page */
.project-head { padding: clamp(40px, 8vh, 110px) 0 clamp(20px, 3vh, 36px); }
.project-head .crumbs { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 30px; transition: color .25s; }
.project-head .crumbs:hover { color: var(--ink); }
.project-head .crumbs svg { width: 14px; height: 14px; transition: transform .4s var(--ease-out); }
.project-head .crumbs:hover svg { transform: translateX(-4px); }
.project-head h1 { margin: 0 0 16px; font-size: clamp(36px, 6.2vw, 92px); line-height: .96; letter-spacing: -.045em; font-weight: 500; max-width: 15ch; text-wrap: balance; }
.project-head .short { font-size: clamp(17px, 1.5vw, 22px); color: var(--ink-2); max-width: 50ch; margin: 0; line-height: 1.45; }
.award { margin: 14px 0 0; font-size: 14px; color: var(--ink); display: inline-flex; align-items: center; gap: 10px; }
.award::before { content: ""; width: 8px; height: 8px; background: var(--ink); flex: none; }
.hero-media { margin: clamp(16px, 3vh, 36px) 0 0; background: var(--surface); overflow: hidden; }
.hero-media img { width: 100%; height: auto; max-height: 84vh; object-fit: cover; }
.hero-media.natural { background: var(--bg); }
.hero-media.natural img { object-fit: contain; }
.hero-media.compact img { max-height: 64vh; }

.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 32px; margin: 0 0 clamp(36px, 6vh, 80px); padding: 14px 0 0; border-top: 1px solid var(--ink); font-size: 14px; }
.meta div { display: grid; gap: 4px; align-content: start; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; color: var(--ink); line-height: 1.45; }
.meta a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.meta a:hover { text-decoration-color: var(--ink); }
.meta.n5, .meta.n6 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .meta.n5, .meta.n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .meta, .meta.n5, .meta.n6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.project-intro { margin-bottom: clamp(32px, 5vh, 72px); }
.project-intro .prose { font-size: clamp(17px, 1.35vw, 21px); line-height: 1.5; max-width: 62ch; }

/* Figures */
.figs { display: grid; gap: clamp(12px, 1.6vw, 24px); margin: 0 0 clamp(16px, 2.2vw, 32px); }
.figs.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figs.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.figs.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .figs.cols-2, .figs.cols-3, .figs.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .figs.cols-3 > :nth-child(3n) { grid-column: 1 / -1; } }
@media (max-width: 520px) { .figs.cols-2:not(.tight), .figs.cols-3:not(.tight) { grid-template-columns: 1fr; } }
.fig { margin: 0; display: grid; gap: 8px; align-content: start; }
.fig .frame { position: relative; overflow: hidden; background: var(--surface); }
.fig .frame img { width: 100%; height: auto; transition: transform .9s var(--ease-out), opacity .6s var(--ease); }
.fig .frame.fit img { height: 100%; object-fit: contain; }
.fig .frame.fit { width: 100%; }
.fig.video-fig .frame video { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.figs.tall .fig { max-width: 62%; margin-inline: auto; }
@media (max-width: 760px) { .figs.tall .fig { max-width: 100%; } }
.fig.reveal .frame img { opacity: 0; transform: translateY(10px); }
.fig.reveal.is-in .frame img { opacity: 1; transform: none; }
.fig figcaption { font-size: 13px; color: var(--muted); line-height: 1.4; }
.fig[data-lightbox] .frame { cursor: zoom-in; }
@media (hover: hover) { .fig[data-lightbox]:hover .frame img { transform: scale(1.012); } }

.video-figure { margin: 0 0 clamp(16px, 2.2vw, 32px); display: grid; gap: 8px; }
.video-figure .frame { overflow: hidden; background: #000; }
.video-figure video { width: 100%; height: auto; max-height: 80vh; margin-inline: auto; }
.video-figure.portrait .frame { max-width: 420px; }
.video-figure figcaption { font-size: 13px; color: var(--muted); }

/* Carousel */
.carousel { position: relative; margin: 0 0 clamp(16px, 2.2vw, 32px); }
.carousel-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 4px; scrollbar-width: none; cursor: grab; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.carousel-track .fig { flex: 0 0 min(92%, 1240px); scroll-snap-align: start; }
.carousel-track .fig .frame { aspect-ratio: 16 / 10; }
.carousel.ratio-4-3 .carousel-track .fig .frame { aspect-ratio: 4 / 3; }
.carousel.cols-3 .carousel-track .fig { flex: 0 0 calc((100% - 32px) / 3); }
@media (max-width: 760px) { .carousel.cols-3 .carousel-track .fig { flex: 0 0 min(80%, 480px); } }
.carousel-track .fig .frame img { width: 100%; height: 100%; object-fit: contain; }
.carousel-ui { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.carousel-count { font-size: 13px; color: var(--muted); min-width: 56px; }
.carousel-bar { flex: 1; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.carousel-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 20%; background: var(--ink); transition: transform .3s var(--ease-out), width .3s; }
.carousel-btns { display: flex; gap: -1px; }
.carousel-btns .icon-btn + .icon-btn { margin-left: -1px; }

/* Text buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); position: relative; padding-bottom: 2px; }
.btn::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform-origin: left; transition: transform .45s var(--ease-out); }
.btn:hover::after { transform: scaleX(0); transform-origin: right; }
.btn svg { width: 14px; height: 14px; transition: transform .45s var(--ease-out); }
.btn:hover svg { transform: translate(2px, -2px); }

/* Data table, citation, actions inside project pages */
.data { width: 100%; max-width: 66ch; border-collapse: collapse; font-size: 15px; margin: 0 0 clamp(16px, 2.2vw, 32px); }
.data caption { text-align: left; color: var(--muted); font-size: 13px; padding: 0 0 8px; }
.data th { text-align: left; font-weight: 500; padding: 8px 16px 8px 0; border-bottom: 1px solid var(--ink); }
.data td { padding: 9px 16px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.data td:first-child { color: var(--ink); }
.cite { max-width: 66ch; color: var(--ink-2); font-size: 15px; padding-left: 16px; border-left: 1px solid var(--ink); margin: 0 0 1.4em; }
.actions { margin: 0 0 2em; }

/* Prev / next */
.pager { border-top: 1px solid var(--ink); margin-top: clamp(40px, 7vh, 96px); display: grid; grid-template-columns: 1fr 1fr; }
.pager a { display: grid; gap: 8px; padding: 28px 0 8px; color: var(--ink-2); transition: color .3s var(--ease); }
.pager a:hover { color: var(--ink); }
.pager a + a { text-align: right; }
.pager small { color: var(--muted); font-size: 13px; }
.pager strong { font-weight: 500; font-size: clamp(18px, 2.2vw, 30px); letter-spacing: -.03em; line-height: 1.1; display: inline-flex; align-items: center; gap: 10px; }
.pager a + a strong { justify-content: flex-end; }
.pager svg { width: .6em; height: .6em; transition: transform .45s var(--ease-out); }
.pager a:first-child:hover svg { transform: translateX(-5px); }
.pager a + a:hover svg { transform: translateX(5px); }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } .pager a + a { text-align: left; border-top: 1px solid var(--line); } .pager a + a strong { justify-content: flex-start; } }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px 80px; align-items: start; padding-top: clamp(40px, 8vh, 110px); }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid h1 { margin: 0 0 22px; font-size: clamp(34px, 5vw, 72px); line-height: .98; letter-spacing: -.045em; font-weight: 500; max-width: 14ch; }
.about-grid .lede { font-size: clamp(18px, 1.6vw, 24px); line-height: 1.4; letter-spacing: -.01em; color: var(--ink); max-width: 44ch; margin: 0 0 18px; }
.about-grid .now { color: var(--ink-2); max-width: 50ch; margin: 0 0 30px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.photos .frame { overflow: hidden; background: var(--surface); }
.photos .frame:first-child { grid-column: 1 / -1; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos .frame.tall, .photos .frame.video { aspect-ratio: 3 / 4; }
.photos .frame.wide { aspect-ratio: 4 / 3; }
.photos .frame.video video { width: 100%; height: 100%; object-fit: cover; }

.cv { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px 56px; padding: 26px 0; border-top: 1px solid var(--ink); }
@media (max-width: 760px) { .cv { grid-template-columns: 1fr; gap: 10px; } }
.cv h2 { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.cv-list { list-style: none; margin: 0; padding: 0; }
.cv-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; padding: 14px 0; border-top: 1px solid var(--line); }
.cv-list li:first-child { border-top: 0; padding-top: 0; }
.cv-list .org { font-weight: 500; }
.cv-list .role { color: var(--ink-2); }
.cv-list .when { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; }
.cv-list .desc { grid-column: 1 / -1; color: var(--ink-2); font-size: 15px; max-width: 64ch; line-height: 1.55; }
.cv-list.plain li { grid-template-columns: 1fr; }
.cv-list .skill-k { color: var(--muted); font-size: 13px; }
.cv-list .pub-title { font-weight: 500; }
.cv-list .pub-authors, .cv-list .pub-venue, .cv-list .pub-link { grid-column: 1 / -1; }
.cv-list .pub-authors { color: var(--ink-2); }
.cv-list .pub-venue { color: var(--muted); font-size: 14px; max-width: 70ch; }
.cv-list .pub-link { font-size: 14px; justify-self: start; margin-top: 4px; }
@media (max-width: 520px) { .cv-list li { grid-template-columns: 1fr; } .cv-list .when { text-align: left; } }

.films { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; margin-top: 20px; }
@media (max-width: 760px) { .films { grid-template-columns: 1fr; } }
.films .frame { overflow: hidden; background: #000; }
.films video { width: 100%; height: auto; }

/* Footer: large contact */
.site-footer { border-top: 1px solid var(--ink); margin-top: clamp(40px, 8vh, 110px); padding: 36px 0 36px; }
.site-footer .top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: end; margin-bottom: 40px; }
@media (max-width: 760px) { .site-footer .top { grid-template-columns: 1fr; } }
.site-footer .big { font-size: clamp(26px, 4.4vw, 64px); letter-spacing: -.04em; font-weight: 500; line-height: 1; word-break: break-all; }
.site-footer .big .u::after { height: 2px; bottom: 0; }
.site-footer .small { color: var(--muted); font-size: 14px; display: grid; gap: 4px; text-align: right; }
@media (max-width: 760px) { .site-footer .small { text-align: left; } }
.site-footer .bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; gap: 22px; }
.site-footer nav a { color: var(--ink-2); }

.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 35; width: 40px; height: 40px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); display: grid; place-items: center; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .3s, transform .4s var(--ease-out), background-color .3s, color .3s; }
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 15px; height: 15px; }
.to-top:hover { background: var(--ink); color: var(--bg); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter); font-size: 14px; color: var(--muted); }
.lightbox-stage { position: relative; display: grid; place-items: center; padding: 0 var(--gutter); overflow: hidden; }
.lightbox-stage img { max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto; object-fit: contain; transform: scale(.98); opacity: 0; transition: transform .45s var(--ease-out), opacity .3s; }
.lightbox.is-open .lightbox-stage img.is-ready { transform: none; opacity: 1; }
.lightbox-caption { padding: 12px var(--gutter) 18px; font-size: 14px; color: var(--ink-2); text-align: center; min-height: 44px; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: var(--gutter); }
.lightbox-nav.next { right: var(--gutter); }
@media (max-width: 600px) { .lightbox-nav { display: none; } }

/* Custom cursor */
.cursor { position: fixed; top: 0; left: 0; z-index: 70; pointer-events: none; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); transition: width .25s var(--ease), height .25s var(--ease), opacity .3s; mix-blend-mode: difference; opacity: 0; }
.cursor.is-on { opacity: 1; }
.cursor.is-link { width: 32px; height: 32px; }
.cursor.is-zoom { width: 44px; height: 44px; }
.cursor.is-hidden { opacity: 0; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

.draft-note { font-size: 13px; color: var(--muted); border-left: 2px solid var(--line-strong); padding-left: 10px; margin: 0 0 18px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .rise > * { opacity: 1; transform: none; }
  .fig.reveal .frame img { opacity: 1; transform: none; }
}
::selection { background: var(--ink); color: var(--bg); }

/* Image protection: no drag, selection or iOS save callout; encrypted images fade in once decrypted */
img, video { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.frame, .hero-media, .preview, .lightbox-stage, .photos, .films { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
img.enc { transition: opacity .45s ease; }
img.enc:not(.is-dec) { opacity: 0 !important; }
@media print { img, video, .frame, .hero-media { visibility: hidden !important; } }

.hero-media.is-video video { display: block; width: 100%; height: auto; max-height: 84vh; object-fit: contain; background: var(--bg); }

/* Password-protected professional work */
.index-name .nw { white-space: nowrap; }
.index-name .lock { display: inline-block; width: .36em; height: .36em; vertical-align: .12em; color: var(--muted); }
.index-note { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.index-note svg { width: 14px; height: 14px; flex: none; }
.index-note a { color: var(--ink-2); }
:root.pro-ok .index-title .lock, :root.pro-ok .index-note { display: none; }
:root:not(.pro-ok) .index-link[data-locked] .index-thumb { display: none; }
.gate { max-width: 680px; padding-block: clamp(72px, 14vh, 160px); }
.gate-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.gate-kicker svg { width: 14px; height: 14px; }
.gate .prose { color: var(--ink-2); }
.gate-form { margin-top: 32px; }
.gate-label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.gate-row { display: flex; gap: 0; border-bottom: 1px solid var(--ink); }
.gate-row input { flex: 1; min-width: 0; padding: 12px 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: clamp(18px, 1.6vw, 22px); letter-spacing: .02em; }
.gate-row input:focus { outline: none; }
.gate-row:focus-within { box-shadow: 0 1px 0 0 var(--ink); }
.gate-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 0 12px 16px; font-size: 15px; color: var(--ink); transition: gap .35s var(--ease-out); }
.gate-btn svg { width: 16px; height: 16px; }
.gate-btn:hover { gap: 14px; }
.gate-btn:disabled { color: var(--muted); }
.gate-error { margin: 12px 0 0; font-size: 14px; color: #c23b22; }
:root[data-theme="dark"] .gate-error { color: #ff8a73; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gate-error { color: #ff8a73; } }
.gate-alt { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 40px; font-size: 14px; color: var(--ink-2); }
