:root {
  --bg: #0a0a0a;
  --panel: #121212;
  --panel-soft: #171717;
  --text: #f4f4f4;
  --muted: #9f9f9f;
  --line: #2a2a2a;
  --accent: #ffffff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

body[data-theme="light"] {
  --bg: #f2f2ee;
  --panel: #ffffff;
  --panel-soft: #f8f8f4;
  --text: #121212;
  --muted: #5f5f5f;
  --line: #d8d8d2;
  --accent: #111111;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

a {
  color: inherit;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden,
[hidden] {
  display: none !important;
}

.visually-hidden {
  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 {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

body[data-theme="light"] .topbar {
  background: rgba(242, 242, 238, 0.9);
}

.brand-block {
  min-width: 160px;
}

.brand-link {
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.brand-meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.nav-btn,
.tool-btn,
.action-link,
.camera-filter select {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0.62rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.nav-btn:hover,
.tool-btn:hover,
.action-link:hover,
.camera-filter select:hover,
.nav-btn.active {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.camera-filter select {
  min-width: 165px;
  appearance: none;
}

.main-content {
  width: min(1400px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.hero-block,
.status-bar,
.panel,
.card,
.list-item,
.timeline-group,
.sha-box,
.verify-item,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  border-radius: 24px;
  padding: 1.3rem 1.4rem;
}

.hero-block h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.hero-block p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  max-width: 72ch;
}

.hero-stats {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: right;
}

.panel-inline {
  margin-top: 1rem;
  border-radius: 24px;
  padding: 1rem;
}

.status-bar {
  margin-top: 1rem;
  border-radius: 18px;
  padding: 0.8rem 1rem;
  color: var(--muted);
}

.view-root {
  margin-top: 1rem;
}

.timeline-layout {
  display: grid;
  gap: 1rem;
}

.timeline-legend {
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.timeline-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.timeline-chip {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
}

.timeline-chip.active {
  border-color: var(--accent);
}

.timeline-group {
  border-radius: 24px;
  padding: 1rem;
}

.timeline-group h2,
.timeline-group h3 {
  margin: 0 0 0.65rem;
}

.timeline-entries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  border-radius: 24px;
  overflow: hidden;
}

.card-thumb {
  aspect-ratio: 3 / 2;
  background: #0d0d0d;
  overflow: hidden;
}

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

.card-body {
  padding: 1rem;
}

.card-title {
  margin: 0;
  font-size: 1rem;
}

.card-meta,
.muted {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.list-layout {
  display: grid;
  gap: 0.75rem;
}

.list-item {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 1rem;
  align-items: center;
  border-radius: 24px;
  overflow: hidden;
}

.list-thumb {
  aspect-ratio: 3 / 2;
  height: 100%;
}

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

.list-copy {
  padding: 1rem 0;
}

.list-actions {
  display: flex;
  gap: 0.5rem;
  padding-right: 1rem;
}

.carousel-stage {
  display: grid;
  gap: 1rem;
}

.carousel-box {
  position: relative;
  min-height: min(75vh, 760px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.carousel-box img {
  width: 100%;
  height: min(75vh, 760px);
  object-fit: contain;
  background: #050505;
}

.carousel-overlay {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.78));
}

.carousel-overlay h2,
.carousel-overlay p {
  margin: 0;
}

.carousel-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.sha-box,
.verify-item,
.empty-state {
  border-radius: 24px;
  padding: 1rem;
}

.sha-toolbar,
.verify-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sha-pre,
.verify-output {
  margin: 0;
  padding: 1rem;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.verify-list {
  display: grid;
  gap: 0.75rem;
}

.verify-item {
  display: grid;
  gap: 0.5rem;
}

.verify-status.ok {
  color: #5ad16d;
}

.verify-status.fail {
  color: #ff7c7c;
}

.verify-status.skip {
  color: #f3c46b;
}

.photo-dialog {
  width: min(1120px, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
}

.photo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
}

.dialog-close,
.action-button {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  padding: 0.62rem 0.9rem;
  border-radius: 999px;
}

.dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 1rem;
  padding: 1rem;
}

.dialog-image-wrap {
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: #050505;
}

.dialog-image-wrap img {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
}

.dialog-info {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-grid {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-soft);
}

.meta-grid p {
  margin: 0;
}

.verify-box {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-soft);
}

.empty-state {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .primary-nav {
    justify-content: flex-start;
  }

  .hero-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-stats {
    text-align: left;
  }

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

@media (max-width: 780px) {
  .main-content {
    width: min(100vw - 1rem, 1400px);
  }

  .list-item {
    grid-template-columns: 1fr;
  }

  .list-copy,
  .list-actions {
    padding: 0 1rem 1rem;
  }

  .list-actions {
    padding-top: 0;
    flex-wrap: wrap;
  }

  .carousel-overlay {
    position: static;
    background: transparent;
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
}


.toolbar {
  align-items: center;
}

.camera-filter select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.timeline-month-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.1rem 0 0.75rem;
}

.timeline-month-header h3 {
  margin: 0;
}

.timeline-month-count {
  color: var(--muted);
  font-size: 0.92rem;
}


.brand-meta-link { color: inherit; text-decoration: none; }
.brand-meta-link:hover { text-decoration: underline; }
.hero-block { display: none; }
.timeline-stream { display: grid; gap: 1.25rem; }
.timeline-photo { margin: 0; }
.timeline-photo-button { display: block; width: 100%; border: 1px solid var(--line); border-radius: 28px; padding: 0; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); transition: transform 0.18s ease, border-color 0.18s ease; }
.timeline-photo-button:hover { transform: translateY(-1px); border-color: var(--accent); }
.timeline-photo-button img { width: 100%; height: auto; object-fit: contain; background: #000; }
.timeline-month-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.2rem; padding: 0.25rem 0.2rem 0; }
.timeline-month-header h2 { margin: 0; font-size: clamp(1rem, 2vw, 1.2rem); letter-spacing: 0.02em; color: var(--muted); }
.timeline-layout, .timeline-group, .timeline-entries { display: block; }
.photo-dialog { width: min(1320px, calc(100vw - 2rem)); max-width: calc(100vw - 2rem); max-height: calc(100vh - 2rem); overflow: hidden; }
.dialog-body { max-height: calc(100vh - 8rem); overflow: auto; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr); }
.dialog-info { min-width: 0; }
.meta-card, .verify-box { min-width: 0; }
.meta-card span, .verify-box span, .verify-box code, .verify-box pre { display: block; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 1200px) { .dialog-body { grid-template-columns: 1fr; } }
