:root {
  --bg: #070313;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --text: #ffffff;
  --muted: #b8a7c9;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #b800ff;
  --secondary: #00d4c8;
  --accent: #ffb41e;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-strong: #f1f5f9;
  --text: #111827;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.12);
  --primary: #015a54;
  --secondary: #1fd3c6;
  --accent: #fe656e;
  --shadow: 0 20px 70px rgba(15, 23, 42, 0.1);
}

[data-theme="arcade"] {
  --bg: #05010d;
  --surface: rgba(184, 0, 255, 0.08);
  --surface-strong: rgba(0, 242, 255, 0.1);
  --text: #f7fdff;
  --muted: #9cecff;
  --line: rgba(0, 242, 255, 0.22);
  --primary: #ff00ea;
  --secondary: #00f2ff;
  --accent: #fff600;
  --shadow: 0 0 60px rgba(184, 0, 255, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--primary) 22%, transparent), transparent 34%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--secondary) 18%, transparent), transparent 28%),
    var(--bg);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand,
.nav-actions,
.status-row,
.panel-heading {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.85rem;
}

.brand-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 1rem;
  background: var(--primary);
  color: white;
  font-weight: 900;
  box-shadow: var(--shadow);
}

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

.brand small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.ghost-button,
.primary-button {
  min-height: 2.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.ghost-button {
  background: var(--surface);
  color: var(--text);
}

.primary-button {
  border-color: transparent;
  background: var(--secondary);
  color: #061015;
}

main {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 4rem;
}

.hero {
  max-width: 960px;
  padding: clamp(2rem, 7vw, 5rem) 0 2rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--secondary);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  max-width: 880px;
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(3.2rem, 10vw, 7rem);
  line-height: 0.92;
}

.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.controls,
.status-row,
.workspace {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.controls {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.letters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2.75rem, 1fr));
  gap: 0.5rem;
}

.letter-button {
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.letter-button.active {
  border-color: transparent;
  background: var(--primary);
  color: white;
}

.search-box {
  display: grid;
  gap: 0.4rem;
}

.search-box span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0 1rem;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  color: var(--text);
  font: inherit;
}

.status-row {
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
}

.status-row strong,
.status-row span {
  display: block;
}

.status-row span,
.panel-heading small {
  color: var(--muted);
  font-size: 0.84rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  min-height: 620px;
  overflow: hidden;
}

.album-panel,
.image-panel {
  min-width: 0;
}

.album-panel {
  border-right: 1px solid var(--line);
}

.panel-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  justify-content: space-between;
  min-height: 4rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(14px);
  font-weight: 900;
}

.album-list {
  max-height: 680px;
  overflow: auto;
  padding: 0.65rem;
}

.album-button {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 1rem;
  margin-bottom: 0.45rem;
  padding: 0.85rem;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.album-button:hover,
.album-button.active {
  border-color: var(--line);
  background: var(--surface-strong);
}

.album-button strong {
  display: block;
}

.album-button span {
  color: var(--muted);
  font-size: 0.78rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
  padding: 1rem;
}

.image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: var(--surface-strong);
}

.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg);
}

.image-card span {
  display: block;
  padding: 0.65rem;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  color: var(--muted);
}

@media (max-width: 820px) {
  .topbar,
  .status-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .album-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
