/* ============================================================
   Living Cover Edition — edition-living-cover.css
   ============================================================ */

/* ── Reset & base ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --c1: #c8a020;
  --c2: #5dbe3a;
  --c3: #091a00;
  --cover-img: none;
  --font-head: 'Oswald', 'Impact', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'IBM Plex Mono', 'Courier New', monospace;
  --font-sans: system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #0a0a0a;
  color: #e8e8e8;
  font-family: var(--font-sans);
  overflow-x: hidden;
}

/* ── Cover section ───────────────────────────────────────── */
#cover {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Animated gradient background */
#cover-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      ellipse 120% 80% at 30% 40%,
      var(--c1) 0%,
      transparent 60%
    ),
    diagonal-gradient(
      135deg,
      var(--c2) 0%,
      transparent 70%
    ),
    var(--c3);
  background: radial-gradient(
      ellipse 120% 80% at 30% 40%,
      var(--c1) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 100% 100% at 80% 70%,
      var(--c2) 0%,
      transparent 50%
    ),
    linear-gradient(135deg, var(--c3) 0%, color-mix(in srgb, var(--c3) 70%, black) 100%);
  z-index: 0;
  transition: none;
}

/* Cover background image */
#cover-bg-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.8s ease;
}

/* Dark vignette overlay */
#cover-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 90% at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.75) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0.6) 100%);
  z-index: 2;
}

/* Content wrapper */
#cover-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 2rem;
  max-width: 800px;
  width: 100%;
}

/* Masthead */
#masthead {
  opacity: 0;
  transform: scale(0.97);
}

#masthead-title {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

/* Animated rule */
#cover-rule {
  width: 60%;
  max-width: 400px;
  height: 2px;
  background: var(--c1);
  margin: 1rem auto;
  box-shadow: 0 0 12px var(--c1);
  animation: rule-pulse 2s ease-in-out infinite;
}

@keyframes rule-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--c1); }
  50% { opacity: 0.6; box-shadow: 0 0 24px var(--c1); }
}

/* Issue line */
#cover-issue {
  font-family: var(--font-body);
  font-size: clamp(0.65rem, 1.5vw, 0.8rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
}

/* Latest headlines */
#cover-latest {
  list-style: none;
  margin: 0 auto 2rem;
  max-width: 600px;
}

#cover-latest li {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-family: var(--font-body);
  font-size: clamp(0.65rem, 1.4vw, 0.78rem);
  letter-spacing: 0.04em;
}

.latest-label {
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.6rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.latest-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c1);
  flex-shrink: 0;
  margin-top: 2px;
}

.latest-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.15s;
}

.latest-link:hover {
  color: var(--c1);
  text-decoration: underline;
}

/* Scroll prompt */
#scroll-prompt {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  user-select: none;
  animation: scroll-bob 2.5s ease-in-out infinite;
  text-decoration: none;
  transition: color 0.2s;
}

#scroll-prompt:hover {
  color: rgba(255, 255, 255, 0.9);
}

@keyframes scroll-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* Currently cycling site name */
#cycling-site-name {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Contents grid (below fold) ──────────────────────────── */
#contents {
  padding: 4rem 1.5rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
}

#contents-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#contents-header h2 {
  font-family: var(--font-head);
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

/* Grid layout */
#sites-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

@media (max-width: 1100px) {
  #sites-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  #sites-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Site card */
.site-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 10px 10px 0;
  border-left: 4px solid var(--card-primary, #555);
  padding-left: 10px;
  background: rgba(255, 255, 255, 0.03);
  min-height: 120px;
  cursor: pointer;
  transition: border-left-width 0.15s ease, background 0.15s ease;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.site-card:hover {
  border-left-width: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.site-card:hover .card-name {
  color: var(--card-primary, #aaa);
}

/* Thumbnail */
.card-thumb {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.05);
}

.card-thumb-placeholder {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  background: var(--card-primary, #333);
  opacity: 0.3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* Card content */
.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-name {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

.card-name:hover {
  color: var(--card-primary, #fff);
}

/* Category badge */
.card-badge {
  display: inline-block;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 2px;
  font-family: var(--font-body);
  font-weight: 700;
  width: fit-content;
}

.card-badge--franchise {
  background: #1a4a8a;
  color: #90c4ff;
}

.card-badge--studio {
  background: #2a2a2a;
  color: #aaa;
}

.card-badge--composer {
  background: #5a1a2a;
  color: #f4a0b0;
}

/* Sub-links (pages) */
.card-pages {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.card-page-link {
  font-family: var(--font-body);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.12s;
}

.card-page-link:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* Loading state */
#grid-loading {
  grid-column: 1 / -1;
  padding: 3rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
}

/* ── Footer ──────────────────────────────────────────────── */
#cover-footer {
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#cover-footer a {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.25);
  text-decoration: none;
  margin: 0 1rem;
  transition: color 0.15s;
}

#cover-footer a:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #cover-rule {
    animation: none;
  }

  #scroll-prompt {
    animation: none;
    transform: translateX(-50%);
  }

  .site-card {
    transition: none;
  }

  .site-card:hover {
    border-left-width: 8px;
  }

  .card-name,
  .card-page-link,
  .latest-link {
    transition: none;
  }
}
