:root {
  color-scheme: light;
  --surface: #fff8f5;
  --surface-low: #fbf2ed;
  --surface-high: #efe6e2;
  --white: #ffffff;
  --panel-bg: #ffffff;
  --ink: #1f1b18;
  --muted: #42474d;
  --primary: #35607f;
  --primary-dark: #1c4b69;
  --primary-soft: #cae6ff;
  --secondary: #8c4e37;
  --secondary-soft: #ffdbcf;
  --outline: #c2c7ce;
  --shadow: 0 16px 42px rgba(53, 96, 127, 0.12);
  --card-border: rgba(194, 199, 206, 0.6);
  --card-bg: rgba(255, 255, 255, 0.66);
  --topbar-bg: rgba(255, 248, 245, 0.94);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #0d1117;
  --surface-low: #141a22;
  --surface-high: #26303c;
  --panel-bg: #151b23;
  --ink: #f4f7fb;
  --muted: #bac5d1;
  --primary: #8bc8ff;
  --primary-dark: #d7ecff;
  --primary-soft: #b7ddff;
  --secondary: #ffb897;
  --secondary-soft: #492d26;
  --outline: #44505f;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --card-border: rgba(112, 128, 148, 0.5);
  --card-bg: rgba(21, 27, 35, 0.78);
  --topbar-bg: rgba(13, 17, 23, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
}

button,
a {
  font: inherit;
}

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

.page-width,
.topbar-inner {
  width: min(1200px, calc(100% - 48px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--surface-high);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  min-height: 80px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
}

.brand {
  color: var(--primary-dark);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 38px;
}

.main-nav a {
  padding: 8px 0;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
  border-color: var(--primary);
}

.home-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--primary);
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: var(--panel-bg);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.theme-toggle {
  width: 46px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--primary);
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: var(--panel-bg);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.home-button:hover,
.home-button:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.theme-icon {
  width: 20px;
  height: 20px;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ffb42a;
  box-shadow:
    0 -8px 0 -6px #ffb42a,
    0 8px 0 -6px #ffb42a,
    8px 0 0 -6px #ffb42a,
    -8px 0 0 -6px #ffb42a,
    6px 6px 0 -6px #ffb42a,
    -6px -6px 0 -6px #ffb42a,
    6px -6px 0 -6px #ffb42a,
    -6px 6px 0 -6px #ffb42a;
}

:root[data-theme="dark"] .theme-icon {
  width: 22px;
  height: 22px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: rotate(-28deg);
}

:root[data-theme="dark"] .theme-icon::before,
:root[data-theme="dark"] .theme-icon::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

:root[data-theme="dark"] .theme-icon::before {
  inset: 1px 2px 1px 3px;
  background: #ffd76a;
  box-shadow: 0 0 10px rgba(255, 215, 106, 0.42);
}

:root[data-theme="dark"] .theme-icon::after {
  width: 18px;
  height: 20px;
  top: 1px;
  left: 8px;
  background: var(--panel-bg);
}

main {
  padding: 72px 0 112px;
}

.hero {
  min-height: 430px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 48px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.hero > img,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero > img {
  object-fit: cover;
}

.hero-shade {
  background: linear-gradient(90deg, rgba(9, 25, 38, 0.94), rgba(9, 25, 38, 0.68) 44%, rgba(9, 25, 38, 0.08) 78%);
}

.hero-copy {
  max-width: 560px;
  position: relative;
  color: var(--white);
}

.eyebrow,
.section-label,
.game-kicker {
  margin: 0 0 12px;
  color: var(--primary-soft);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Plus Jakarta Sans", sans-serif;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.7rem, 6vw, 4.6rem);
  line-height: 1.06;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 520px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span {
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
}

.updates-section {
  padding-top: 48px;
}

.update-card {
  padding: 28px 32px;
  border: 1px solid var(--surface-high);
  border-radius: 12px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.update-card h2 {
  margin-bottom: 20px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.update-entry {
  max-width: 780px;
}

.update-entry + .update-entry {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--surface-high);
}

.update-entry time {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--secondary);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.update-entry h3 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

.update-entry p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.content-section {
  padding-top: 88px;
}

.section-heading {
  margin-bottom: 32px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-label {
  margin-bottom: 6px;
  color: var(--secondary);
}

.section-label-link {
  width: fit-content;
  display: inline-flex;
  text-decoration: none;
}

.section-label-link:hover,
.section-label-link:focus-visible {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.archive-main {
  min-height: calc(100vh - 190px);
}

.updates-page {
  padding-top: 0;
}

.archive-title {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
}

.archive-intro {
  max-width: 620px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.section-heading h2 {
  margin-bottom: 5px;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.2;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.text-link {
  color: var(--primary);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
}

.music-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.music-card:hover,
.music-card.is-playing {
  border-color: var(--primary);
  background: var(--panel-bg);
  transform: translateY(-4px);
}

.cover-button {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface-high);
  cursor: pointer;
}

.cover-button img,
.cover-button video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.cover-button:hover img,
.cover-button:hover video,
.music-card.is-playing .cover-button img,
.music-card.is-playing .cover-button video {
  transform: scale(1.035);
}

.cover-preview {
  cursor: default;
}

.music-card-upcoming .cover-preview img {
  filter: brightness(0.82) saturate(1.08);
}

.coming-soon-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  color: #ffffff;
  border-radius: 999px;
  background: rgba(31, 27, 24, 0.72);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
}

.play-button {
  display: none;
}

.music-card h3 {
  min-height: 2.7em;
  margin: 16px 0 5px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 1rem;
  line-height: 1.35;
}

.music-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.mini-player {
  width: min(420px, calc(100vw - 32px));
  min-height: 96px;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 44px 14px 14px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-bg) 92%, transparent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.mini-player[hidden] {
  display: none;
}

.mini-player-cover {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-high);
}

.mini-player-info {
  min-width: 0;
}

.mini-player-info p {
  margin: 0 0 4px;
  color: var(--primary);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-player-info h2 {
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-player-info span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-player-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-control,
.mini-player-close {
  display: grid;
  place-items: center;
  border: 1px solid var(--card-border);
  color: var(--text);
  background: var(--card-bg);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.mini-control {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
}

.mini-control-primary {
  color: #ffffff;
  border-color: var(--primary);
  background: var(--primary);
  font-size: 0.82rem;
}

.mini-player-close {
  width: 28px;
  height: 28px;
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 50%;
  font-size: 1rem;
}

.mini-control:hover,
.mini-player-close:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.game-card {
  display: block;
  min-height: 390px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.game-card-link {
  color: inherit;
  text-decoration: none;
}

.game-card-link:focus-visible {
  outline: 3px solid #ffb42a;
  outline-offset: 4px;
}

.game-card > img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
  transition: transform 300ms ease;
}

.game-card:hover > img {
  transform: scale(1.035);
}

.game-overlay {
  max-width: calc(100% - 48px);
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  padding: 24px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 12px;
  background: rgba(31, 27, 24, 0.62);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
}

.game-kicker {
  margin-bottom: 7px;
}

.game-overlay h3 {
  margin-bottom: 7px;
  font-size: 1.75rem;
}

.game-overlay p:not(.game-kicker) {
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.game-overlay button,
.game-overlay .game-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(53, 96, 127, 0.72);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
}

.game-overlay .solar-open-button {
  color: #2f1800;
  border-color: rgba(255, 210, 87, 0.85);
  background: linear-gradient(135deg, #ffd45c 0%, #ff9f1c 55%, #e76f00 100%);
  box-shadow: 0 10px 22px rgba(230, 119, 0, 0.28);
}

.game-overlay .puzzle-open-button {
  color: #ffffff;
  border-color: rgba(142, 205, 255, 0.88);
  background: linear-gradient(135deg, #1d7ed8 0%, #2f9df4 55%, #0f5ca8 100%);
  box-shadow: 0 10px 22px rgba(30, 126, 216, 0.3);
}

footer {
  padding: 42px 0;
  border-top: 1px solid var(--surface-high);
  background: var(--surface-low);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-inner strong {
  color: var(--secondary);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.1rem;
}

.footer-inner p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-inner a {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 1080px) {
  .music-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .page-width,
  .topbar-inner {
    width: min(100% - 32px, 620px);
  }

  .topbar-inner {
    min-height: 68px;
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .home-button span:last-child {
    display: none;
  }

  .theme-toggle {
    width: 42px;
  }

  main {
    padding: 32px 0 72px;
  }

  .hero {
    min-height: 470px;
    align-items: end;
    padding: 28px;
  }

  .hero-shade {
    background: linear-gradient(0deg, rgba(9, 25, 38, 0.95), rgba(9, 25, 38, 0.34) 78%);
  }

  .content-section {
    padding-top: 64px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .music-grid,
  .games-grid {
    grid-template-columns: 1fr;
  }

  .music-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 16px;
    align-items: center;
  }

  .cover-button {
    grid-row: 1 / span 2;
  }

  .music-card h3 {
    align-self: end;
    margin: 0 0 4px;
  }

  .music-card p {
    align-self: start;
  }

  .game-card {
    min-height: 420px;
  }

  .mini-player {
    right: 16px;
    bottom: 16px;
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 12px 40px 12px 12px;
  }

  .mini-player-cover {
    width: 56px;
    height: 56px;
  }

  .mini-player-controls {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .brand {
    font-size: 1.12rem;
  }

  .hero {
    min-height: 430px;
    padding: 22px;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 0.94rem;
  }

  .music-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .game-overlay {
    max-width: none;
    left: 14px;
    right: 14px;
    bottom: 14px;
    padding: 18px;
  }
}
