:root {
  --bg: #090909;
  --panel: rgba(255, 255, 255, 0.02);
  --panel-strong: rgba(255, 255, 255, 0.04);
  --text: #d9d9d4;
  --muted: #8d8f90;
  --line: rgba(255, 255, 255, 0.13);
  --shadow: rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.04em;
}

body {
  min-height: 100vh;
  background: var(--bg);
}

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

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

.site-shell {
  position: relative;
  min-height: 100vh;
  padding: 26px 24px 20px;
}

.topbar {
  position: relative;
  z-index: 2;
}

.brand {
  position: absolute;
  top: 12px;
  left: 0;
  display: inline-block;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--muted);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.home-page .brand {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.home-page .site-nav {
  position: absolute;
  right: 0;
  bottom: 18px;
  display: flex;
  gap: 18px;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--muted);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.home-page .site-shell {
  display: flex;
  flex-direction: column;
}

.home-page.revealed .brand,
.home-page.revealed .site-nav {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 68px);
  padding: 36px 0 48px;
}

.content-shell {
  width: min(58vw, 420px);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.content-card {
  width: 100%;
  max-width: 420px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.content-shell.has-content .content-card {
  opacity: 1;
  transform: translateY(0);
}

.meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.content-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.15;
}

.content-card p,
.content-card .link {
  margin: 0;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.7;
}

.image-card .image-frame {
  width: 100%;
  margin: 0;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  overflow: hidden;
}

.image-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: none;
  display: block;
  border: none;
  outline: none;
  box-shadow: none;
}

.link-card {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: lowercase;
}

.random-button {
  min-width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 0.58rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 2;
  margin-top: 18px;
  align-self: center;
  padding: 0 10px;
}

.random-button:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.random-button:focus,
.random-button:focus-visible {
  outline: none;
  border: none;
  box-shadow: none;
}

.page-main {
  max-width: 100%;
  margin: 0 auto;
  padding-top: 112px;
}

.archive-main {
  width: min(100%, 1480px);
  padding-left: 18px;
  padding-right: 18px;
}

.archive-index {
  margin-bottom: 18px;
}

.archive-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: lowercase;
}

.archive-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: var(--muted);
}

.archive-nav a {
  position: relative;
  color: var(--muted);
  opacity: 0.85;
}

.archive-nav a.active {
  color: var(--text);
  opacity: 1;
}

.archive-nav a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
}

.archive-gallery {
  column-count: 5;
  column-gap: 18px;
  width: 100%;
  padding-top: 10px;
}

.archive-gallery-item {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  break-inside: avoid;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  opacity: 0.96;
}

.archive-gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  outline: none;
  box-shadow: none;
  object-fit: contain;
  background: transparent;
}

.archive-gallery-item {
  cursor: pointer;
}

.archive-viewer {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  z-index: 30;
}

.archive-viewer.open {
  display: flex;
}

.archive-viewer-frame {
  position: relative;
  width: min(78vw, 980px);
  max-height: 84vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.archive-viewer-image {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  display: block;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
}

.archive-viewer-close,
.archive-viewer-shuffle {
  position: absolute;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  line-height: 1;
  outline: none;
  box-shadow: none;
}

.archive-viewer-close:hover,
.archive-viewer-shuffle:hover {
  color: var(--text);
}

.archive-viewer-close:focus,
.archive-viewer-close:focus-visible,
.archive-viewer-shuffle:focus,
.archive-viewer-shuffle:focus-visible {
  outline: none;
  border: none;
  box-shadow: none;
}

.archive-viewer-close {
  top: 20px;
  right: 22px;
  font-size: 22px;
}

.archive-viewer-shuffle {
  top: 22px;
  left: 22px;
  font-size: 22px;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.7;
}

.archive-viewer-shuffle.is-on {
  color: var(--text);
  opacity: 1;
}

.archive-viewer-meta {
  display: none;
}

.archive-gallery,
.archive-panel {
  display: none;
}

.archive-gallery.active,
.archive-panel.active {
  display: block;
}

.archive-panel {
  max-width: 720px;
  padding-top: 8px;
}

.archive-entry {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.archive-entry:first-child {
  border-top: none;
}

.archive-entry-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
}

.archive-entry h3 {
  margin: 0 0 8px;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.3;
}

.archive-entry p {
  margin: 0;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.8;
}

.archive-entry-link-action {
  display: inline-block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
}

@media (max-width: 640px) {
  .site-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .brand,
  .site-nav {
    position: static;
  }

  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
  }

  .site-nav {
    gap: 14px;
  }

  .home-main {
    min-height: 68vh;
    padding: 18px 0 28px;
  }

  .content-shell {
    width: min(84vw, 420px);
  }

  .random-button {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    display: block;
    margin: 18px auto 0;
    width: 40px;
    height: 40px;
  }

  .content-shell.has-content + .random-button {
    transform: none;
    top: auto;
  }

  .page-main {
    padding-top: 40px;
  }

  .archive-gallery {
    column-count: 2;
    column-gap: 16px;
  }

  .archive-gallery-item {
    margin-bottom: 16px;
  }
}
