:root {
  color-scheme: dark;
  --ink: #12110f;
  --ink-2: #1b1a17;
  --paper: #eee7d7;
  --paper-soft: #d8d0bf;
  --muted: #9f9787;
  --line: rgba(238, 231, 215, 0.15);
  --accent: #b8ff5c;
  --accent-2: #ff5f6d;
  --accent-3: #60a8ff;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
  --radius: 8px;
  --side: minmax(280px, 370px);
  --sans: "Bahnschrift", "DIN Alternate", "Aptos", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--paper);
  font-family: var(--sans);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, rgba(184, 255, 92, 0.07), transparent 36vh),
    var(--ink);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100vh;
}

.side-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 28px;
  padding: clamp(24px, 4vw, 46px);
  border-right: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(255, 95, 109, 0.11), transparent 45%),
    linear-gradient(20deg, rgba(96, 168, 255, 0.10), transparent 42%),
    rgba(18, 17, 15, 0.82);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: var(--paper);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--paper);
  border-radius: 50%;
  color: var(--ink);
  background: var(--accent);
  font-weight: 800;
}

.brand-text,
.kicker,
.section-heading span,
.hero-caption span,
.lightbox-meta span,
.deploy-note span,
.media-tag {
  text-transform: uppercase;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.12em;
}

.brand-text {
  color: var(--paper-soft);
}

.panel-copy {
  align-self: center;
}

.panel-copy h1 {
  max-width: 8.2em;
  margin: 18px 0 20px;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 500;
  line-height: 0.9;
}

.panel-copy p {
  max-width: 28em;
  margin: 0;
  color: var(--paper-soft);
  line-height: 1.78;
}

.kicker {
  color: var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}

.stats div {
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.stats dt {
  margin: 0 0 4px;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1;
}

.stats dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.deploy-note {
  padding: 16px;
  border-left: 3px solid var(--accent);
  background: rgba(184, 255, 92, 0.08);
}

.deploy-note strong {
  display: block;
  margin-top: 8px;
  color: var(--paper-soft);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.main-stage {
  min-width: 0;
  padding: clamp(18px, 3vw, 42px);
}

.toolbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0 22px;
  background: linear-gradient(180deg, var(--ink), rgba(18, 17, 15, 0.85) 72%, transparent);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button,
.search-box input,
.select-box select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
}

.filter-button {
  min-width: 68px;
  padding: 0 15px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.filter-button:hover,
.filter-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(184, 255, 92, 0.65);
}

.filter-button.is-active {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
}

.search-box input,
.select-box select {
  width: 100%;
  padding: 0 14px;
}

.search-box input::placeholder {
  color: rgba(238, 231, 215, 0.45);
}

.select-box select {
  width: 128px;
  color: var(--paper-soft);
}

.hero-strip {
  position: relative;
  display: grid;
  min-height: clamp(330px, 55vw, 620px);
  margin-bottom: clamp(30px, 6vw, 76px);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ink-2);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(18, 17, 15, 0.76), rgba(18, 17, 15, 0.14) 44%, rgba(18, 17, 15, 0.68)),
    linear-gradient(0deg, rgba(18, 17, 15, 0.78), transparent 42%);
  pointer-events: none;
}

.hero-media,
.hero-media img,
.hero-media video {
  width: 100%;
  height: 100%;
}

.hero-media img,
.hero-media video {
  object-fit: cover;
}

.hero-caption {
  position: absolute;
  z-index: 2;
  left: clamp(22px, 5vw, 68px);
  bottom: clamp(22px, 5vw, 58px);
  max-width: min(560px, 82vw);
}

.hero-caption span {
  display: inline-flex;
  padding: 9px 12px;
  border: 1px solid rgba(238, 231, 215, 0.24);
  color: var(--accent);
  background: rgba(18, 17, 15, 0.62);
}

.hero-caption h2 {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 8vw, 7rem);
  font-weight: 500;
  line-height: 0.92;
  overflow-wrap: anywhere;
}

.gallery-wrap {
  padding-bottom: 80px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading span {
  color: var(--accent-2);
}

.section-heading h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 4.8rem);
  font-weight: 500;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 14px;
}

.media-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(238, 231, 215, 0.13);
  border-radius: var(--radius);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.media-card:hover,
.media-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(184, 255, 92, 0.58);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.36);
  outline: none;
}

.thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #0b0b0a;
}

.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(18, 17, 15, 0.82), transparent 48%);
}

.play-badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(238, 231, 215, 0.35);
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
  font-size: 1.05rem;
  line-height: 1;
}

.card-meta {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 7px;
  padding: 16px;
  text-align: left;
}

.media-tag {
  width: fit-content;
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--accent);
  font-weight: 700;
}

.media-card[data-type="image"] .media-tag {
  background: var(--accent-3);
}

.card-title {
  margin: 0;
  color: var(--paper);
  font-size: 1.02rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.card-detail {
  margin: 0;
  color: rgba(238, 231, 215, 0.72);
  font-size: 0.78rem;
  line-height: 1.35;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.lightbox {
  width: min(1180px, calc(100vw - 30px));
  max-width: none;
  max-height: calc(100vh - 30px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(238, 231, 215, 0.22);
  border-radius: var(--radius);
  color: var(--paper);
  background: rgba(18, 17, 15, 0.96);
  box-shadow: var(--shadow);
}

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

.lightbox-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  min-height: min(760px, 82vh);
}

.lightbox-media {
  display: grid;
  place-items: center;
  min-width: 0;
  background: #090908;
}

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

.lightbox-meta {
  display: grid;
  align-content: end;
  gap: 12px;
  padding: clamp(24px, 4vw, 42px);
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(184, 255, 92, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.025);
}

.lightbox-meta span {
  color: var(--accent);
}

.lightbox-meta h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 4.2rem);
  font-weight: 500;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.lightbox-meta p {
  margin: 0;
  color: var(--paper-soft);
  line-height: 1.65;
}

.icon-button {
  position: absolute;
  z-index: 10;
  display: grid;
  place-items: center;
  border: 1px solid rgba(238, 231, 215, 0.28);
  border-radius: 50%;
  color: var(--paper);
  background: rgba(18, 17, 15, 0.74);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: scale(1.05);
  background: rgba(18, 17, 15, 0.92);
  outline: none;
}

.close-button {
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  font-size: 1.7rem;
}

.nav-button {
  top: 50%;
  width: 46px;
  height: 46px;
  font-size: 2.5rem;
  transform: translateY(-50%);
}

.nav-button:hover,
.nav-button:focus-visible {
  transform: translateY(-50%) scale(1.05);
}

.prev-button {
  left: 16px;
}

.next-button {
  right: 16px;
}

@media (max-width: 980px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: relative;
    height: auto;
    grid-template-rows: auto;
    gap: 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .panel-copy {
    align-self: start;
  }

  .panel-copy h1 {
    max-width: 12em;
  }

  .toolbar {
    top: 0;
  }

  .lightbox-body {
    grid-template-columns: 1fr;
  }

  .lightbox-meta {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .main-stage {
    padding: 14px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .filter-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .filter-button,
  .select-box select {
    width: 100%;
  }

  .hero-strip {
    min-height: 420px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .lightbox {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .lightbox-media img,
  .lightbox-media video {
    max-height: 64vh;
  }

  .prev-button,
  .next-button {
    top: auto;
    bottom: 18px;
  }
}
