/* Shared dark cinematic theme.
 *
 * Opt-in per page via <body class="theme-dark"> + linking this file after
 * /site.css. site.css is built on CSS custom properties, so re-theming is
 * mostly a matter of overriding those variables here — the shared nav,
 * .panel, and .card pick up the new palette automatically.
 *
 * Currently applied to /music/, /games/, and /about/. This is the first step
 * of the site-wide dark migration; pages without the theme-dark class keep the
 * light warm-paper system from site.css untouched. Music-specific
 * (.release, .album-grid) and games-specific (.game-grid, .game) component
 * styles both live here so the dark layer stays in one place.
 */

body.theme-dark {
  color-scheme: dark;
  /* Cold naval / CRT palette: deep water blacks, phosphor-cyan glow. */
  --paper: #07090d;
  --paper-deep: #04050a;
  --panel: rgba(14, 20, 28, 0.72);
  --ink: #e8eef2;
  --muted: #8da2ad;
  --line: rgba(122, 160, 170, 0.22);
  --accent: #5fd2c8;
  --accent-strong: #8fe9df;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --glow: 0 0 24px rgba(95, 210, 200, 0.28);

  color: var(--ink);
  background:
    radial-gradient(circle at 22% -10%, rgba(95, 210, 200, 0.10), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(64, 120, 150, 0.10), transparent 46%),
    linear-gradient(180deg, #090d13 0%, var(--paper) 55%, #04060a 100%);
}

/* --- Atmosphere: drifting fog + faint CRT scanlines ----------------------
 * Both overlays sit above the page background but ignore pointer events,
 * so embeds and links underneath stay fully interactive.
 */
body.theme-dark::before,
body.theme-dark::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Soft fog / dark-water haze */
body.theme-dark::before {
  background:
    radial-gradient(ellipse at 30% 80%, rgba(120, 160, 175, 0.06), transparent 60%),
    radial-gradient(ellipse at 75% 30%, rgba(95, 210, 200, 0.05), transparent 55%);
}

/* CRT scanlines — extremely subtle so text stays legible */
body.theme-dark::after {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0px,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.5;
}

@media (prefers-reduced-motion: no-preference) {
  body.theme-dark::after {
    animation: crt-flicker 6s steps(60) infinite;
  }
}

@keyframes crt-flicker {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.42; }
}

/* Keep the real content above the atmosphere overlays. */
body.theme-dark .shell {
  position: relative;
  z-index: 1;
}

/* --- Nav tweaks for dark ground ----------------------------------------- */
body.theme-dark .site-nav a {
  background: rgba(20, 28, 36, 0.6);
  /* site.css colors nav links with --muted, which is dim on dark ground.
     Brighten the inactive links so they read clearly. */
  color: #c5d3db;
}

body.theme-dark .site-nav a[aria-current="page"] {
  /* Re-assert the accent fill: the rule above (body.theme-dark .site-nav a)
     is more specific than site.css's active-state rule, so without this the
     active pill keeps the dark fill and its near-black text disappears. */
  background: var(--accent);
  border-color: var(--accent);
  color: #04060a;
  box-shadow: var(--glow);
}

/* --- Hero ---------------------------------------------------------------- */
body.theme-dark .hero {
  position: relative;
  overflow: hidden;
}

body.theme-dark .hero h1 {
  max-width: 16ch;
  text-shadow: 0 0 30px rgba(95, 210, 200, 0.18);
}

body.theme-dark .eyebrow {
  color: var(--accent);
}

/* Shared cards and rule lists on dark ground. */
body.theme-dark .card,
body.theme-dark .link-list li {
  background: rgba(12, 18, 26, 0.7);
  border-color: var(--line);
}

body.theme-dark .card {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}

body.theme-dark .card:hover,
body.theme-dark .link-list li:hover {
  border-color: rgba(95, 210, 200, 0.4);
}

body.theme-dark .link-list strong {
  color: var(--ink);
}

body.theme-dark .card .cta,
body.theme-dark .link-list a,
body.theme-dark .inline-link {
  color: var(--accent-strong);
}

body.theme-dark .card .cta:hover,
body.theme-dark .card .cta:focus-visible,
body.theme-dark .link-list a:hover,
body.theme-dark .link-list a:focus-visible,
body.theme-dark .inline-link:hover,
body.theme-dark .inline-link:focus-visible {
  color: var(--accent);
}

/* site.css hardcodes these to a dark brown (#342d27) rather than a variable,
   so they don't follow the dark palette and render nearly invisible on the
   dark ground. Re-color body copy to a light slate for both /music/ and
   /games/. */
body.theme-dark .lede,
body.theme-dark .section-intro,
body.theme-dark .card p,
body.theme-dark .note,
body.theme-dark li {
  color: #d2dce2;
}

/* --- About --------------------------------------------------------------- */
.about-copy {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.about-copy p {
  max-width: 68ch;
  margin: 0;
  color: #d2dce2;
}

.closing-line {
  font-size: 1.08rem;
}

/* --- Release cards ------------------------------------------------------- */
.release-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 22px;
}

.release {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 24px;
  padding: 24px;
  border-radius: var(--radius-sm);
  background: rgba(12, 18, 26, 0.7);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.release:hover {
  border-color: rgba(95, 210, 200, 0.4);
}

.release .release-body h3 {
  font-size: 1.5rem;
}

.release .release-meta {
  margin: 4px 0 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.release p {
  color: #cdd8df;
}

/* Album-art frame; src filled in once art exists. */
.release .art {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(45deg, rgba(95,210,200,0.05) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, #0c141c, #060a0f);
}

/* --- Embeds -------------------------------------------------------------- */
.embed {
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

/* YouTube / video: 16:9 responsive */
.embed-video {
  position: relative;
  aspect-ratio: 16 / 9;
}
.embed-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Spotify: fixed-height player */
.embed-audio iframe {
  display: block;
  width: 100%;
  border: 0;
}

/* Placeholder shown until a real embed URL is dropped in. */
.embed-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 152px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  background:
    repeating-linear-gradient(45deg, rgba(95,210,200,0.04) 0 16px, transparent 16px 32px),
    rgba(8, 12, 18, 0.6);
}

/* --- Album / experiments grid ------------------------------------------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.album {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.album .album-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.singles-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Platform buttons ---------------------------------------------------- */
.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 30, 38, 0.7);
  color: var(--ink);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: var(--glow);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #04060a;
}

.btn-accent:hover,
.btn-accent:focus-visible {
  color: #04060a;
  box-shadow: var(--glow);
}

/* Disabled platform button while a real URL is still pending. */
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

/* --- Full-platform footer row ------------------------------------------- */
.platform-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

/* --- Games grid ---------------------------------------------------------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.game {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(12, 18, 26, 0.7);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.game:hover {
  border-color: rgba(95, 210, 200, 0.4);
}

/* Cover art sits flush at the top of the card, wrapped in a link to itch. */
.game .cover-link {
  display: block;
  line-height: 0;
  overflow: hidden;
}

.game .cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, #0c141c, #060a0f);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Subtle zoom/brighten so the cover reads as clickable. */
.game .cover-link:hover .cover,
.game .cover-link:focus-visible .cover {
  transform: scale(1.03);
  opacity: 0.92;
}

.game .game-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 22px;
}

.game .game-body h3 {
  font-size: 1.3rem;
}

.game .tagline {
  margin: 0;
  color: var(--accent-strong);
  font-style: italic;
}

.game .game-meta {
  margin: 2px 0 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.game p {
  margin: 0;
  color: #cdd8df;
  font-size: 0.98rem;
}

/* Push the action row to the bottom so uneven descriptions stay aligned. */
.game .platforms {
  margin-top: auto;
  padding-top: 6px;
}

@media (max-width: 780px) {
  .release {
    grid-template-columns: 1fr;
  }
  .release .release-art {
    order: -1;
    max-width: 320px;
  }
}

/* --- Homepage: status badge --------------------------------------------- */
/* Inline "In Development" pill, sized to sit beside .game-meta text. */
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  background: rgba(95, 210, 200, 0.08);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

/* --- Homepage: featured category cards ---------------------------------- */
/* Games + Music lead the category grid, so give them a brighter edge. */
.card-feature {
  background: rgba(16, 24, 33, 0.82);
  border-color: rgba(95, 210, 200, 0.34);
}

/* --- Homepage: footer ---------------------------------------------------- */
.site-footer {
  margin-top: 28px;
  padding: 26px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-footer .footer-tag {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.site-footer .platform-strip {
  margin-top: 0;
}

/* --- Apps page: featured app card --------------------------------------- *
 * Reuses the dark .game palette but lays the app out icon-beside-headings
 * instead of cover-on-top, since an app icon is square, not a 16:10 cover.
 */
.app {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 22px;
  padding: 22px 24px 24px;
  border-radius: var(--radius-sm);
  background: rgba(12, 18, 26, 0.7);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.app:hover {
  border-color: rgba(95, 210, 200, 0.4);
}

.app .app-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.app .app-icon {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  background: #fff;
}

.app .app-headings {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app .app-headings h3 {
  margin: 0;
  font-size: 1.4rem;
}

.app .app-headings .tagline {
  margin: 0;
  color: var(--accent-strong);
  font-style: italic;
}

.app .app-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app .app-body p {
  margin: 0;
  color: #cdd8df;
  font-size: 0.98rem;
}

/* App Store screenshots: phone frames in a responsive row, capped so two
 * portrait shots sit side by side on desktop and stack on mobile. */
.app .app-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.app .app-shots img {
  flex: 1 1 200px;
  max-width: 240px;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* Closing line that ties the category back to the rest of the hub. */
.closing-line {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: 1.02rem;
}

@media (max-width: 520px) {
  .app .app-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
