:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: rgba(18, 21, 28, 0.82);
  --panel-strong: rgba(27, 30, 39, 0.94);
  --line: rgba(255, 255, 255, 0.13);
  --text: #f5f0e8;
  --muted: #a8b0bb;
  --mint: #20f4c7;
  --amber: #ffb000;
  --pink: #ff4f8b;
  --green: #8cff5a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(32, 244, 199, 0.08), transparent 28%),
    linear-gradient(250deg, rgba(255, 79, 139, 0.08), transparent 32%),
    var(--bg);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), transparent 82%);
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

#archive-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}

.site-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 14px 60px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 14px;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(32, 244, 199, 0.62);
  border-radius: 8px;
  background: rgba(32, 244, 199, 0.12);
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.icon-button::after,
.primary-action::after,
.cat-card::after,
.photo-tile::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-130%);
  transition: transform 0.58s ease;
}

.icon-button:hover::after,
.primary-action:hover::after,
.cat-card:hover::after,
.photo-tile:hover::after {
  transform: translateX(130%);
}

.icon-dice {
  position: absolute;
  inset: 12px;
  border: 2px solid var(--text);
  border-radius: 5px;
  transform: rotate(10deg);
}

.icon-dice::before {
  position: absolute;
  inset: 4px;
  content: "";
  background:
    radial-gradient(circle at 20% 20%, var(--text) 0 2px, transparent 2.5px),
    radial-gradient(circle at 50% 50%, var(--text) 0 2px, transparent 2.5px),
    radial-gradient(circle at 80% 80%, var(--text) 0 2px, transparent 2.5px);
}

.hero-section,
.control-section,
.active-profile,
.timeline-section,
.gallery-section {
  position: relative;
  margin-top: 16px;
}

.hero-section {
  min-height: calc(100svh - 92px);
  display: grid;
  align-content: end;
  gap: 16px;
  padding: 0 0 18px;
}

.hero-visual {
  position: absolute;
  inset: 0;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15171d;
  box-shadow: var(--shadow);
}

.hero-visual::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(to top, rgba(8, 9, 13, 0.96), rgba(8, 9, 13, 0.55) 52%, rgba(8, 9, 13, 0.1)),
    linear-gradient(90deg, rgba(32, 244, 199, 0.22), transparent 42%, rgba(255, 176, 0, 0.16));
}

.hero-visual img {
  width: 100%;
  height: 100%;
  min-height: calc(100svh - 92px);
  object-fit: cover;
  filter: saturate(1.08) contrast(1.05);
  transform: scale(1.02);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

.scanline {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.22;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.25) 0 1px, transparent 1px 7px);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.hero-copy,
.hero-stats {
  position: relative;
  z-index: 3;
}

.hero-copy {
  padding: 22px 18px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(42px, 14vw, 84px);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(32, 244, 199, 0.28);
}

h2 {
  margin-bottom: 0;
  font-size: 25px;
  letter-spacing: 0;
}

.hero-text {
  max-width: 670px;
  margin-bottom: 18px;
  color: rgba(245, 240, 232, 0.86);
  font-size: 15px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-action,
.ghost-action,
.load-more {
  position: relative;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  overflow: hidden;
  font-weight: 800;
}

.primary-action {
  background: var(--mint);
  color: #07100d;
}

.ghost-action,
.load-more {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px;
}

.stat-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(8, 9, 13, 0.66);
  backdrop-filter: blur(16px);
}

.stat-chip strong {
  display: block;
  color: var(--text);
  font-size: 22px;
}

.stat-chip span {
  color: var(--muted);
  font-size: 12px;
}

.control-section,
.timeline-section,
.gallery-section {
  padding: 30px 0 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
}

.search-box span {
  color: var(--muted);
  font-size: 12px;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: 12px -14px 0;
  padding: 0 14px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar,
.cat-rail::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.filter-chip.active {
  border-color: rgba(32, 244, 199, 0.58);
  background: rgba(32, 244, 199, 0.14);
  color: var(--mint);
}

.cat-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 12px;
  margin: 16px -14px 0;
  padding: 0 14px 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.cat-card {
  position: relative;
  min-height: 216px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  scroll-snap-align: start;
  text-align: left;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
}

.cat-card.active {
  border-color: var(--cat-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cat-accent), transparent 55%), 0 22px 70px rgba(0, 0, 0, 0.44);
}

.cat-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.cat-card-body {
  padding: 12px;
}

.cat-card h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.cat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(245, 240, 232, 0.82);
  font-size: 11px;
}

.active-profile {
  display: grid;
  gap: 14px;
  padding-top: 28px;
}

.profile-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-strong);
}

.profile-hero img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
}

.profile-copy {
  padding: 16px;
}

.profile-copy h2 {
  margin-bottom: 4px;
  color: var(--cat-accent);
  font-size: 34px;
}

.profile-subtitle {
  margin-bottom: 14px;
  color: var(--muted);
}

.profile-bio {
  color: rgba(245, 240, 232, 0.84);
  line-height: 1.75;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.profile-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.profile-stat strong {
  display: block;
  font-size: 18px;
}

.profile-stat span {
  color: var(--muted);
  font-size: 12px;
}

.note-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.note-panel h3 {
  margin-bottom: 12px;
  color: var(--amber);
}

.note-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(245, 240, 232, 0.8);
  line-height: 1.55;
}

.note-list li {
  border-left: 2px solid var(--cat-accent);
  padding-left: 10px;
}

.year-bars {
  display: grid;
  gap: 10px;
}

.year-bar {
  display: grid;
  grid-template-columns: 58px 1fr 42px;
  align-items: center;
  gap: 10px;
}

.year-bar-track {
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.year-bar-fill {
  height: 100%;
  width: var(--level);
  background: linear-gradient(90deg, var(--mint), var(--amber), var(--pink));
  animation: barPulse 2.4s ease-in-out infinite alternate;
}

.year-bar span {
  color: var(--muted);
  font-size: 12px;
}

.gallery-meta {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.photo-tile {
  position: relative;
  min-height: 186px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  background: #15171d;
}

.photo-tile:nth-child(3n + 1) {
  grid-row: span 2;
  min-height: 286px;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s ease, filter 0.65s ease;
}

.photo-tile:active img,
.photo-tile:hover img {
  transform: scale(1.05);
  filter: saturate(1.13);
}

.photo-label {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 7px;
  background: rgba(8, 9, 13, 0.72);
  color: rgba(245, 240, 232, 0.9);
  font-size: 11px;
  backdrop-filter: blur(12px);
}

.load-more {
  width: 100%;
  margin-top: 14px;
}

.lightbox {
  width: min(980px, calc(100% - 18px));
  max-width: none;
  max-height: calc(100% - 18px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: rgba(8, 9, 13, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.lightbox figure {
  margin: 0;
}

.lightbox img {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

.lightbox figcaption {
  padding: 13px 16px 16px;
  color: var(--muted);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 9, 13, 0.78);
  backdrop-filter: blur(10px);
}

.lightbox-close {
  top: 10px;
  right: 10px;
}

.lightbox-close::before,
.lightbox-close::after {
  position: absolute;
  top: 19px;
  left: 10px;
  width: 20px;
  height: 2px;
  content: "";
  background: var(--text);
}

.lightbox-close::before {
  transform: rotate(45deg);
}

.lightbox-close::after {
  transform: rotate(-45deg);
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav::before {
  position: absolute;
  top: 13px;
  width: 14px;
  height: 14px;
  content: "";
  border-top: 2px solid var(--text);
  border-left: 2px solid var(--text);
}

.lightbox-nav.prev {
  left: 10px;
}

.lightbox-nav.prev::before {
  left: 15px;
  transform: rotate(-45deg);
}

.lightbox-nav.next {
  right: 10px;
}

.lightbox-nav.next::before {
  right: 15px;
  transform: rotate(135deg);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes heroDrift {
  from {
    transform: scale(1.02) translate3d(-1%, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(1%, -1%, 0);
  }
}

@keyframes barPulse {
  from {
    filter: saturate(0.9);
  }
  to {
    filter: saturate(1.45) brightness(1.08);
  }
}

@media (min-width: 760px) {
  .site-shell {
    padding-inline: 28px;
  }

  .hero-section {
    min-height: 680px;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: end;
  }

  .hero-copy {
    padding: 40px;
  }

  .hero-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 40px 34px;
  }

  .cat-rail {
    grid-auto-columns: 31%;
    margin-inline: 0;
    padding-inline: 0;
  }

  .active-profile {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .profile-hero {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
  }

  .profile-hero img {
    height: 100%;
    max-height: none;
  }

  .note-panel {
    align-self: stretch;
  }

  .photo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
