@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=IBM+Plex+Mono:wght@300;400;500&display=swap');

:root {
  --bg: #0a0a0b;
  --ink: #e8e6e1;
  --mute: #8f8d88;
  --line: #232327;
  --lime: #d4ff3a;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --pad: 24px;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--bg); }
.mono { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }

/* ---------- header ---------- */
.hdr { position: absolute; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 30px var(--pad); pointer-events: none; }
.hdr > * { pointer-events: auto; }
.logo { display: block; width: 64px; height: 23px; background-color: rgba(236,233,226,.72); -webkit-mask: url(sig.png) left center / contain no-repeat; mask: url(sig.png) left center / contain no-repeat; transition: background-color .25s ease; }
.logo:hover { background-color: var(--lime); }
.home-personal .hdr .logo { visibility: hidden; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav > div { position: relative; }
.nav .top { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); cursor: pointer; padding: 6px 0; background: none; border: 0; }
.nav .top:hover, .nav > div:focus-within .top { color: var(--lime); }
.dd { position: absolute; right: 0; top: 100%; min-width: 240px; padding: 14px 0; background: rgba(10,10,11,.96); border: 1px solid var(--line); opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s ease; }
.nav > div:hover .dd, .nav > div:focus-within .dd { opacity: 1; visibility: visible; transform: none; }
.dd a { display: block; padding: 7px 18px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.dd a:hover, .dd a.on { color: var(--ink); }
.dd a.all { color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 6px; padding-bottom: 11px; }
.menu-btn { display: none; }

/* ---------- landing hero ---------- */
.hero { position: relative; height: 92vh; min-height: 560px; overflow: hidden; background: #000; }
.hero > .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero > .bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(10,10,11,.55) 0%, rgba(10,10,11,0) 22%, rgba(10,10,11,.05) 50%, rgba(10,10,11,.75) 82%, #0a0a0b 100%); }
.hero .intro { position: absolute; left: var(--pad); bottom: 44px; z-index: 2; }
.hero .intro .sig { width: 150px; height: 52px; margin-bottom: 14px; background-color: rgba(236,233,226,.92); -webkit-mask: url(sig.png) left center / contain no-repeat; mask: url(sig.png) left center / contain no-repeat; }
.hero .intro p { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; line-height: 1.8; }
.hero .intro a:hover { color: var(--lime); }

/* switch corner */
.switch { position: absolute; right: 0; bottom: 0; z-index: 3; width: 120px; height: 120px; display: block; }
.switch .tri { position: absolute; inset: 0; background: rgba(232,230,225,.16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); clip-path: polygon(100% 0, 100% 100%, 0 100%); animation: idleGlitch 6s steps(1) infinite; transition: opacity .3s; }
.switch .lbl { position: absolute; right: 12px; bottom: 12px; text-align: right; font-family: var(--mono); font-size: 8px; line-height: 1.5; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); white-space: pre; transition: opacity .2s; }
@keyframes idleGlitch { 0%,92%,100% { transform: none; } 93% { transform: translate(-2px,1px); clip-path: polygon(100% 4%, 100% 100%, 6% 100%); } 95% { transform: translate(1px,-1px); } }
.switch .slice { position: fixed; pointer-events: none; }
.hero .peek { position: absolute; top: 0; bottom: 0; right: 0; width: 34vw; z-index: 2; background-size: cover; background-position: center; clip-path: inset(0 0 0 100%); transition: clip-path .55s cubic-bezier(.7,0,.2,1); pointer-events: none; }
.hero .peek::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--lime); box-shadow: 0 0 18px 3px rgba(212,255,58,.6); }
.hero .peek .peek-lbl { position: absolute; left: 26px; bottom: 44px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); opacity: 0; transition: opacity .3s .25s; }
.hero.peeking .peek { clip-path: inset(0 0 0 0); animation: tear .5s steps(2) 1; }
.hero.peeking .peek .peek-lbl { opacity: 1; }
.hero.peeking .switch .tri, .hero.peeking .switch .lbl { opacity: 0; }
@keyframes tear { 0% { transform: translateX(6px); filter: hue-rotate(40deg); } 40% { transform: translateX(-4px); } 100% { transform: none; filter: none; } }

.section-label { padding: 30px var(--pad) 18px; color: var(--mute); }

/* ---------- landing grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; padding: 0 var(--pad) var(--pad); grid-auto-flow: dense; }
.tile { display: block; }
.tile .ph { position: relative; aspect-ratio: 2 / 1; overflow: hidden; background: #111; }
.tile.wide { grid-column: 1 / -1; }
.tile.wide .ph { aspect-ratio: 13 / 5; }
.tile .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .4s; filter: brightness(.92); }
.tile:hover .ph img { transform: scale(1.025); filter: brightness(1); }
.tile .cap { display: flex; justify-content: space-between; padding: 8px 0 0; font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; }
.tile .cap span:last-child { color: var(--mute); transition: color .2s; }
.tile:hover .cap span:last-child { color: var(--lime); }

/* ---------- project page ---------- */
.proj { padding-top: 0; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; gap: 8px; }
.row figure, .row .sp { margin: 0; flex: calc(var(--ar) * 100) 1 0; min-width: 0; cursor: zoom-in; position: relative; background: #0e0e10; }
.row .sp { visibility: hidden; }
.row figure img { width: 100%; height: auto; aspect-ratio: var(--ar); }
.row.small { margin-top: 18px; padding: 0 4px; }
.row.small figure img { aspect-ratio: auto; height: 260px; object-fit: cover; }
figure.frame { height: 100vh; overflow: hidden; }
figure.frame img { width: 151%; max-width: none; aspect-ratio: auto; margin-top: -16vw; }
.pager { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 60px; padding: 34px var(--pad); }
.pager a { display: flex; align-items: center; gap: 22px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--mute); }
.pager a:hover { color: var(--ink); }
.pager a .ar { font-size: 18px; color: var(--ink); }
.totop { display: block; width: max-content; margin: 70px auto 40px; font-family: var(--mono); font-size: 9px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink); opacity: .5; }
.totop:hover { opacity: 1; color: var(--lime); }

/* ---------- contact ---------- */
.contact { min-height: 80vh; display: flex; align-items: flex-end; padding: 140px var(--pad) 60px; }
.contact p { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; line-height: 2; margin: 0; }
.contact a:hover { color: var(--lime); }

/* ---------- lightbox / zoom viewer ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: #050506; display: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.lb.open { display: block; }
.lb .stage { position: absolute; inset: 0; overflow: hidden; cursor: zoom-in; }
.lb.zoomed .stage { cursor: grab; }
.lb.dragging .stage { cursor: grabbing; }
.lb img.view { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; will-change: transform; }
.lb .ui { position: absolute; z-index: 2; font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); }
.lb .count { left: 22px; top: 22px; opacity: .6; }
.lb .hint { left: 50%; bottom: 18px; transform: translateX(-50%); opacity: .45; transition: opacity .6s; pointer-events: none; }
.lb .res { right: 22px; bottom: 18px; opacity: .45; pointer-events: none; }
.lb button { background: none; border: 0; color: var(--ink); cursor: pointer; padding: 14px; opacity: .7; }
.lb button:hover { opacity: 1; color: var(--lime); }
.lb .close { right: 8px; top: 8px; font-size: 22px; line-height: 1; }
.lb .prev, .lb .next { top: 50%; transform: translateY(-50%); font-size: 26px; }
.lb .prev { left: 4px; } .lb .next { right: 4px; }
.lb .spin { position: absolute; right: 22px; top: 26px; width: 10px; height: 10px; border: 1px solid var(--ink); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; opacity: 0; }
.lb.loading .spin { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- mobile ---------- */
@media (max-width: 767px) {
  :root { --pad: 14px; }
  .hdr { padding: 20px var(--pad); }
  .nav { display: none; }
  .menu-btn { display: block; background: none; border: 0; color: var(--ink); font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; padding: 6px 0; }
  .nav.open { display: flex; position: fixed; inset: 0; z-index: 40; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px; padding: 80px 22px 40px; background: rgba(10,10,11,.98); overflow-y: auto; }
  .nav.open .dd { position: static; opacity: 1; visibility: visible; transform: none; border: 0; background: none; padding: 4px 0 18px; }
  .nav.open .dd a { padding: 6px 0; }
  .nav.open .close-menu { position: absolute; right: 18px; top: 18px; }
  .logo { width: 56px; height: 20px; }
  .hero { height: 78vh; min-height: 420px; }
  .hero .intro { bottom: 30px; }
  .hero .intro .sig { width: 120px; height: 42px; }
  .switch { width: 58px; height: 22vh; bottom: 30px; }
  .switch .tri { clip-path: none; animation: none; }
  .switch .lbl { right: 64px; bottom: 0; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 9px; }
  .hero .peek { display: none; }
  .grid { grid-template-columns: 1fr; gap: 18px; }
  .tile .ph, .tile.wide .ph { aspect-ratio: 2 / 1; }
  .row { flex-wrap: nowrap; gap: 4px; }
  .row.small figure img { height: 110px; }
  figure.frame { height: 70vh; }
  .pager { padding: 26px var(--pad); }
  .pager a { gap: 10px; font-size: 10px; }
}
