*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%; overflow: hidden; background: #fff;
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: #000;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  cursor: default;
  transition: background-color 0.8s ease;
}

::selection { background: rgba(0,0,0,0.08); color: #000; }

a { color: inherit; text-decoration: none; transition: opacity 0.2s; cursor: pointer; }
@media (hover: hover) { a:hover { opacity: 0.45; } }
a:active { opacity: 0.45; }
a:focus-visible { outline: 1px solid rgba(0,0,0,0.2); outline-offset: 4px; }

.grain {
  position: fixed; inset: -50%; z-index: 9998;
  pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -15%); }
  40% { transform: translate(-5%, 15%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0); }
  70% { transform: translate(0, 10%); }
  80% { transform: translate(3%, -15%); }
  90% { transform: translate(-10%, 5%); }
}

.page-transition {
  position: fixed; inset: 0; z-index: 9999;
  background: #fff; pointer-events: none;
  opacity: 0; transition: opacity 0.3s ease;
}
html.page-loading .page-transition { opacity: 1; }

.splash {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(240,240,240,0.88);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity 0.8s ease;
}
.splash.out { opacity: 0; pointer-events: none; }

.site-header {
  position: fixed; top: 0; left: 0; right: 0; height: 48px;
  padding: 0 clamp(16px, 4vw, 56px);
  display: flex; align-items: center; justify-content: space-between;
  z-index: 50; pointer-events: none;
}
.site-header a, .site-header span { pointer-events: all; }
.site-nav { display: flex; gap: clamp(14px, 2.5vw, 22px); }
.site-nav [aria-current] { opacity: 0.25; pointer-events: none; }

.mode-toggle {
  pointer-events: all; cursor: pointer; user-select: none;
  font-size: 10px; line-height: 1;
  opacity: 0.35; transition: opacity 0.2s;
  padding: 8px; margin: -8px;
}
@media (hover: hover) { .mode-toggle:hover { opacity: 0.8; } }
.mode-toggle:active { opacity: 0.8; }

.site-footer {
  position: fixed; bottom: 28px; left: 0; right: 0;
  padding: 0 clamp(16px, 4vw, 56px);
  display: flex; justify-content: space-between; align-items: flex-end;
  z-index: 100; pointer-events: none;
}
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { pointer-events: all; }
.footer-count { pointer-events: none; }

.stage {
  position: fixed; inset: 0; overflow: hidden; touch-action: pan-y;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 80px, #000 calc(100% - 80px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 80px, #000 calc(100% - 80px), transparent);
}

.track {
  display: flex; align-items: center; gap: clamp(40px, 12vw, 190px);
  padding: 0 50vw; height: 100%;
  will-change: transform; user-select: none;
}

.frame {
  flex-shrink: 0; opacity: 0; cursor: pointer;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.frame[data-series] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='16'%3E%3Ctext x='20' y='12' text-anchor='middle' font-family='Inter,Helvetica,Arial,sans-serif' font-weight='400' font-size='9' letter-spacing='1.5' fill='%23000'%3EVIEW%3C/text%3E%3C/svg%3E") 20 8, pointer;
}
.frame.in { opacity: 1; }
.frame img {
  display: block; height: clamp(180px, 58vh, 680px); width: auto;
  pointer-events: none; transition: opacity 0.25s ease;
}
@media (hover: hover) { .frame:hover img { opacity: 0.8; } }
.frame:active img { opacity: 0.85; }

.track--top, .track--bot {
  position: absolute; left: 0; height: auto;
  align-items: flex-start; gap: clamp(20px, 4vw, 60px);
  padding-left: clamp(16px, 5vw, 72px);
}
.track--top { top: calc(50% - clamp(80px, 27vh, 320px) - 20px); }
.track--bot { top: calc(50% + 20px); }
.track--top .frame img,
.track--bot .frame img { height: clamp(80px, 27vh, 320px); }

.title-bar {
  position: fixed; bottom: 28px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none; z-index: 20; transition: opacity 0.3s ease;
}
.title-bar.away { opacity: 0; }
.title-slot { position: relative; height: 14px; width: 100%; }
.t-a, .t-b {
  position: absolute; left: 0; right: 0; text-align: center;
  font-size: clamp(8px, 1.1vw, 10px); letter-spacing: 0.09em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 80px; transition: opacity 0.6s ease; opacity: 0;
}
.t-a.on, .t-b.on { opacity: 1; }
.title-count {
  text-align: center; margin-top: 6px;
  font-size: clamp(8px, 1.1vw, 10px); letter-spacing: 0.09em;
  color: rgba(0,0,0,0.3); transition: opacity 0.6s ease;
}

.progress { position: fixed; bottom: 14px; left: 0; right: 0; height: 2px; z-index: 25; }
.progress-fill { height: 100%; width: 48px; background: rgba(0,0,0,0.25); border-radius: 99px; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.lightbox.open { pointer-events: all; }
.lb-bg {
  position: absolute; inset: 0; opacity: 0;
  background: rgba(255,255,255,0.52);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  transition: opacity 0.4s ease; cursor: pointer;
}
.lightbox.open .lb-bg { opacity: 1; }
.lb-img {
  position: relative; z-index: 2;
  max-width: min(70vw, 820px); max-height: 72vh;
  display: block; object-fit: contain;
  opacity: 0; transform: scale(0.93) translateY(14px); transition: none;
  box-shadow: 0 40px 100px rgba(0,0,0,0.12); cursor: pointer;
}
.lightbox.open .lb-img {
  opacity: 1; transform: none;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.lb-close {
  position: fixed; top: 20px; right: 24px; z-index: 3;
  font-size: 9px; letter-spacing: 0.16em;
  color: rgba(0,0,0,0.32); cursor: pointer;
  padding: 8px; opacity: 0;
  transition: opacity 0.3s 0.15s ease, color 0.2s;
}
.lightbox.open .lb-close { opacity: 1; }
@media (hover: hover) { .lb-close:hover { color: #000; } }
.lb-caption {
  position: fixed; bottom: 60px; left: 0; right: 0;
  text-align: center; z-index: 3;
  font-size: 9px; letter-spacing: 0.09em;
  color: rgba(0,0,0,0.5); pointer-events: none;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.3s 0.2s ease, transform 0.3s 0.2s ease;
}
.lightbox.open .lb-caption { opacity: 1; transform: none; }
.lb-prev, .lb-next {
  position: fixed; top: 0; bottom: 0; z-index: 3; width: 80px;
  display: none; align-items: center;
  font-size: 9px; letter-spacing: 0.16em;
  color: rgba(0,0,0,0.32); cursor: pointer;
  opacity: 0; transition: opacity 0.3s 0.15s ease, color 0.2s;
}
.lb-prev { left: 0; padding-left: 32px; }
.lb-next { right: 0; padding-right: 32px; justify-content: flex-end; }
.lightbox.open .lb-prev, .lightbox.open .lb-next { opacity: 1; }
@media (hover: hover) { .lb-prev:hover, .lb-next:hover { color: #000; } }
.lb-counter {
  position: fixed; bottom: 44px; left: 0; right: 0;
  text-align: center; z-index: 3;
  font-size: 9px; letter-spacing: 0.09em;
  color: rgba(0,0,0,0.25); pointer-events: none;
  opacity: 0; transition: opacity 0.3s 0.2s ease; display: none;
}
.lightbox.open .lb-counter { opacity: 1; }

body.is-grid { overflow: hidden; height: 100%; }
.scatter-layout { position: fixed; inset: 0; overflow: hidden; }
.scatter-item { position: absolute; cursor: pointer; transform: translateY(10px); }
.scatter-item[data-series] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='16'%3E%3Ctext x='20' y='12' text-anchor='middle' font-family='Inter,Helvetica,Arial,sans-serif' font-weight='400' font-size='9' letter-spacing='1.5' fill='%23000'%3EVIEW%3C/text%3E%3C/svg%3E") 20 8, pointer;
}
.scatter-item img {
  display: block; width: 100%; height: auto;
  pointer-events: none; transition: opacity 0.25s ease;
}
@media (hover: hover) { .scatter-item:hover img { opacity: 0.8; } }
.scatter-item:active img { opacity: 0.85; }

.frost-bg {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; background: #f0f0f0; pointer-events: none;
}
.frost-bg img {
  position: absolute; height: 50vh; width: auto;
  filter: blur(20px); -webkit-filter: blur(20px); opacity: 0.45;
}
.frost-overlay {
  position: fixed; inset: 0; z-index: 1;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}

.contact-page {
  position: fixed; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 36px;
}
.contact-heading { font-size: 10px; font-weight: 500; letter-spacing: 0.12em; margin-bottom: 8px; }
.contact-item { font-size: 10px; letter-spacing: 0.04em; text-transform: none; color: #000; }

body.is-about { overflow-y: auto; overflow-x: hidden; height: auto; -webkit-overflow-scrolling: touch; }
.about-page {
  position: relative; z-index: 2;
  display: flex; gap: clamp(40px, 15vw, 280px); justify-content: center;
  padding: 230px clamp(24px, 8vw, 120px) 120px;
  min-height: 100vh; align-items: flex-start;
}
.about-col { flex: 1; max-width: 400px; min-width: 0; }
.about-col--bio { max-width: 340px; }
.about-section { margin-bottom: 48px; }
.about-section:last-child { margin-bottom: 0; }
.about-heading { font-size: 10px; font-weight: 500; letter-spacing: 0.12em; margin-bottom: 20px; }
.about-body {
  font-size: 10px; line-height: 1.8; letter-spacing: 0.02em;
  text-transform: none; color: #000; margin-bottom: 14px;
}
.about-body:last-child { margin-bottom: 0; }
.about-body--justified { text-align: justify; }
.about-entry { display: flex; gap: 16px; margin-bottom: 14px; }
.about-entry:last-child { margin-bottom: 0; }
.about-year { flex-shrink: 0; width: 36px; font-size: 10px; color: #000; text-transform: none; }
.about-detail { font-size: 10px; line-height: 1.7; letter-spacing: 0.02em; text-transform: none; color: #000; }
.about-detail a { color: #000; text-decoration: underline; text-underline-offset: 2px; }
.about-email { margin-top: 32px; }
.about-email a { text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) { .about-detail a:hover { opacity: 0.5; } }

/* dark mode */

html.dark body { background: #0a0a0a; color: #e8e8e8; }
html.dark a { color: #e8e8e8; }
html.dark ::selection { background: rgba(255,255,255,0.1); color: #fff; }
html.dark .grain { opacity: 0.04; }
html.dark .splash { background: rgba(20,20,20,0.88); }
html.dark .splash-text { color: #e8e8e8; }
html.dark .page-transition { background: #0a0a0a; }
html.dark .progress-fill { background: rgba(255,255,255,0.2); }
html.dark .t-a, html.dark .t-b { color: #e8e8e8; }
html.dark .title-count { color: rgba(255,255,255,0.25); }

/* responsive */

@media (max-width: 768px) {
  .stage {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  }
  .lb-img { max-width: 85vw; max-height: 70vh; }
  .lb-close { top: 18px; right: 20px; }
  .lb-caption { bottom: 40px; }
  .about-page { padding: 140px 32px 80px; gap: 48px; }
}

@media (max-width: 600px) {
  html { zoom: 0.9; }
  html, body { font-size: 12px; }
  .mode-toggle { display: none; }
  .site-header { height: 42px; padding: 0 16px; }
  .site-nav { gap: 14px; }
  .site-nav a, .site-nav .mode-toggle { padding: 12px 6px; margin: -12px -6px; }
  .site-footer { bottom: 20px; padding: 0 16px; }
  .footer-links { gap: 4px; }
  .footer-links a { padding: 10px 8px; margin: -10px -8px; }
  .title-bar { bottom: 20px; }
  .t-a, .t-b { padding: 0 50px; }
  .progress { bottom: 8px; }
  .stage {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  }
  .frame img { height: clamp(120px, 32vh, 300px); max-width: 75vw; object-fit: contain; }
  .track--top .frame img, .track--bot .frame img { height: clamp(55px, 16vh, 150px); max-width: 45vw; object-fit: contain; }
  .lb-img { max-width: 88vw; max-height: 55vh; box-shadow: 0 20px 60px rgba(0,0,0,0.1); }
  .lb-close { top: 14px; right: 16px; }
  .lb-caption { bottom: 32px; font-size: 11px; }
  .lb-prev { width: 48px; padding-left: 16px; top: auto; bottom: 70px; height: 44px; }
  .lb-next { width: 48px; padding-right: 16px; top: auto; bottom: 70px; height: 44px; }
  .lb-counter { bottom: 20px; font-size: 11px; }
  .contact-page { gap: 28px; padding: 0 20px; }
  .about-page { flex-direction: column; padding: 80px 20px 100px; gap: 40px; }
  .about-col, .about-col--bio { max-width: 100%; }
  .about-body--justified { text-align: left; }
  .frost-bg img { height: 30vh; }
  .grain { animation: none; opacity: 0.02; }
}

@media (max-width: 380px) {
  .frame img { height: clamp(100px, 28vh, 260px); }
  .track--top .frame img, .track--bot .frame img { height: clamp(45px, 14vh, 130px); }
  .t-a, .t-b { padding: 0 40px; font-size: 11px; }
}

@media (max-width: 320px) {
  .site-header, .site-footer { padding: 0 12px; }
  .site-nav { gap: 10px; }
  .frame img { height: clamp(80px, 24vh, 220px); }
  .contact-page { gap: 24px; padding: 0 16px; }
  .about-page { padding: 70px 16px 60px; gap: 32px; }
}

@media print {
  .site-header, .site-footer, .title-bar, .progress,
  .lightbox, .grain, .page-transition, .frost-bg,
  .frost-overlay, .splash { display: none !important; }
  html, body { overflow: visible; height: auto; background: #fff; color: #000; }
  .about-page { padding: 40px; }
  .about-body, .about-detail, .about-detail a,
  .about-year, .about-heading { color: #000; }
  .contact-page { position: static; padding: 40px; }
  .contact-heading, .contact-item { color: #000; }
}
