:root {
  color-scheme: dark;
  /* Change these font variables to try other looks quickly. */
  --font-ui: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: Georgia, "Times New Roman", serif;
  --font-news: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  --cream: #fff3e3;
  --muted: #d6d9e9;
  --accent: #f5d2a7;
  --navy: #111d36;
  --panel-bg: rgba(8, 14, 30, 0.52);
  --panel-border: rgba(255, 244, 226, 0.12);
}
* { box-sizing: border-box; }
/* Landing page stays fixed. Only the news list can scroll. */
html { height: 100%; overflow: hidden; scroll-behavior: auto; }
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0f1831;
  color: var(--cream);
  font-family: var(--font-ui);
}
a { color: inherit; }
button,input { font: inherit; }
button { cursor: pointer; }
button:focus-visible,a:focus-visible,input:focus-visible { outline: 3px solid #f7d0a3; outline-offset: 4px; }

.page-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: flex;
  flex-direction: column;
}
.sky {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 15%, rgba(87,111,172,0.08), transparent 38%),
    radial-gradient(circle at 50% 120%, rgba(6,11,25,0.42), transparent 46%),
    url('assets/images/clay-sky-empty.png') center top / cover no-repeat;
}
.snow {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.snowflake {
  position: absolute;
  top: -8%;
  left: 0;
  width: var(--size, 7px);
  height: var(--size, 7px);
  border-radius: 50%;
  background: rgba(255, 250, 245, var(--alpha, 0.7));
  box-shadow: 0 0 6px rgba(255,255,255,0.18);
  filter: blur(var(--blur, 0px));
  will-change: transform, opacity;
  animation: snowFall var(--duration, 12s) linear var(--delay, 0s) infinite;
}
.snowflake::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: rgba(255,255,255,0.48);
}
@keyframes snowFall {
  0% { transform: translate3d(0, -8vh, 0) rotate(0deg); opacity: 0; }
  8% { opacity: var(--alpha, 0.7); }
  20% { transform: translate3d(var(--drift-1, 10px), 18vh, 0) rotate(var(--rot-1, 10deg)); }
  42% { transform: translate3d(var(--drift-2, -14px), 42vh, 0) rotate(var(--rot-2, -14deg)); }
  66% { transform: translate3d(var(--drift-3, 12px), 68vh, 0) rotate(var(--rot-3, 12deg)); }
  84% { transform: translate3d(var(--drift-4, -8px), 88vh, 0) rotate(var(--rot-4, -8deg)); }
  100% { transform: translate3d(var(--drift-5, 6px), 112vh, 0) rotate(var(--rot-5, 6deg)); opacity: 0.05; }
}

.garland {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 2;
  padding-inline: clamp(10px, 2vw, 18px);
}
.garland-top { top: 0; }
.garland-bottom { bottom: 0; transform: scaleY(-1); }
.garland-wire {
  height: 18px;
  border-bottom: 4px solid rgba(49, 37, 23, 0.9);
  border-radius: 0 0 40% 40% / 0 0 100% 100%;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.25));
}
.garland-bulbs {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  align-items: start;
  gap: clamp(8px, 1.1vw, 16px);
  margin-top: -2px;
}
.bulb {
  justify-self: center;
  position: relative;
  width: 14px;
  height: 20px;
  border-radius: 8px 8px 10px 10px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.16) inset, 0 0 12px currentColor;
  animation: bulbGlow 2.9s ease-in-out infinite;
}
.bulb::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 8px;
  height: 7px;
  transform: translateX(-50%);
  background: #5d4a31;
  border-radius: 3px 3px 1px 1px;
}
.bulb:nth-child(odd) { transform: rotate(-6deg); }
.bulb:nth-child(even) { transform: rotate(7deg); }
.bulb:nth-child(3n) { animation-delay: -0.8s; }
.bulb:nth-child(4n) { animation-delay: -1.6s; }
.bulb-red { color: #ff8778; background: #ff6d59; }
.bulb-yellow { color: #ffd777; background: #ffc842; }
.bulb-green { color: #93f6ba; background: #55d98c; }
.bulb-blue { color: #8dcbff; background: #69b4ff; }
@keyframes bulbGlow {
  0%,100% { filter: saturate(0.95) brightness(0.92); opacity: 0.9; }
  50% { filter: saturate(1.15) brightness(1.08); opacity: 1; }
}

.site-header {
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 46px clamp(22px,4vw,74px) 0;
}
.studio-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: clamp(19px,1.9vw,26px);
  letter-spacing: .075em;
  font-weight: 900;
  text-decoration: none;
  text-shadow: 0 2px 9px #000a;
}
.paw-mark { width: 34px; height: 34px; flex: none; fill: currentColor; }
.site-nav { display: flex; gap: 18px; }
.nav-link {
  color: var(--cream);
  background: transparent;
  border: 0;
  padding: 8px 0;
  font-size: 14px;
  text-decoration: none;
  text-shadow: 0 1px 8px #000d;
}
.nav-link:hover { color: #ffd9ab; }

.main-content {
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px clamp(22px,3vw,54px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6dvh, 20px);
}
.hero {
  flex: 0 0 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  text-align: center;
  padding-top: clamp(8px, 2vw, 18px);
}
.game-logo {
  /* The logo shrinks with viewport height, never pushing the blog off-screen. */
  width: auto;
  height: clamp(105px, 26dvh, 310px);
  max-width: 82vw;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px #03081575);
}
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: 0 18px 48px rgba(5, 9, 23, 0.32), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(16px) saturate(118%);
  -webkit-backdrop-filter: blur(16px) saturate(118%);
}
.news-panel {
  /* Stay above the footer; shrink when necessary instead of growing the page. */
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  margin-top: auto;
  width: min(820px, calc(100vw - 48px));
  border-radius: 26px;
  padding: clamp(22px, 2vw, 28px);
}
.panel-heading--centered { flex: 0 0 auto; text-align: center; }
.panel-intro {
  margin: 10px auto 0;
  max-width: 650px;
  color: var(--muted);
  font: 500 15px/1.6 var(--font-body);
}
.eyebrow {
  margin: 0 0 8px;
  color: #f0ce9a;
  letter-spacing: .18em;
  font-size: 11px;
  font-weight: 800;
}
.panel-heading h2 {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 38px);
}
.news-note { display: block; min-height: 1.2em; color: #ffd8a8; margin-top: 10px; font-size: 13px; }
.news-list {
  /* Only this area scrolls. Article expansion cannot change the sky or layout. */
  min-height: 0;
  flex: 0 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(240,199,160,.48) transparent;
  margin-top: 20px;
  padding: 2px 7px 3px 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-content: start;
}
.loading-copy { color: var(--muted); text-align: center; margin: 0; grid-column: 1 / -1; }
.news-article {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}
.news-article.no-image { grid-template-columns: 1fr; }
.news-thumb {
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  align-self: start;
  transform: rotate(var(--tilt, -1.4deg));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 12px 24px rgba(0,0,0,.24);
  background: rgba(255,255,255,.04);
}
.news-article:nth-child(odd) .news-thumb { --tilt: -1.8deg; }
.news-article:nth-child(even) .news-thumb { --tilt: 1.5deg; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-text { min-width: 0; }
.news-meta { margin: 0 0 6px; color: #f0ce9a; font-size: 12px; letter-spacing: .12em; font-weight: 800; }
.news-text h3 {
  margin: 0 0 8px;
  font: 700 24px/1.15 var(--font-body);
}
.news-excerpt, .news-body { color: var(--muted); font-family: var(--font-news); line-height: 1.65; }
.news-excerpt { margin: 0; font-size: 15px; }
.news-body { margin-top: 14px; font-size: 15px; }
.news-body[hidden] { display: none; }
.news-body p:first-child { margin-top: 0; }
.news-body img {
  max-width: min(100%, 280px);
  display: block;
  margin: 14px auto;
  border-radius: 16px;
  transform: rotate(-1.1deg);
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}
.news-body a { color: #ffdeb4; }
.news-more {
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  color: var(--cream);
  font-size: 13px;
  font-weight: 700;
}
.news-more:hover { background: rgba(255,255,255,0.14); }

.music-panel {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: min(330px, calc(100vw - 44px));
  border-radius: 22px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.music-play {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: var(--cream);
  display: grid;
  place-items: center;
  flex: none;
}
.music-play svg { width: 22px; height: 22px; fill: currentColor; }
.pause-shape { display: none; }
.music-panel.is-playing .play-shape { display: none; }
.music-panel.is-playing .pause-shape { display: block; }
.music-details { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; }
#track-name { font-size: 14px; letter-spacing: .02em; }
.music-progress-row { display: flex; align-items: center; }
.music-progress {
  --played: 0%;
  width: 100%;
  appearance: none;
  background: transparent;
  height: 18px;
}
.music-progress::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cream) var(--played), rgba(255,255,255,.18) var(--played));
}
.music-progress::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cream);
  margin-top: -4px;
  box-shadow: 0 0 0 2px rgba(15,24,49,.65);
}
.music-progress::-moz-range-track { height: 3px; border: none; border-radius: 999px; background: rgba(255,255,255,.18); }
.music-progress::-moz-range-progress { height: 3px; border-radius: 999px; background: var(--cream); }
.music-progress::-moz-range-thumb { width: 12px; height: 12px; border: none; border-radius: 50%; background: var(--cream); }
.music-message { min-height: 1.1em; font-size: 12px; color: #ffd8a8; }

.site-footer {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 22px 18px;
}
.footer-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  width: 100%;
}
.social-links { display: flex; justify-content: center; align-items: center; gap: 16px; }
.social-link {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--cream);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 20px rgba(0,0,0,.22);
}
.social-link svg { width: 22px; height: 22px; fill: currentColor; }
.social-link .icon-cutout { fill: #0d1630; }
.social-link:hover { transform: translateY(-2px); background: rgba(255,255,255,0.12); }
.site-footer small { color: rgba(255,243,227,.82); font-size: 12px; letter-spacing: .06em; }

.info-dialog {
  width: min(700px, calc(100vw - 28px));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  padding: 26px 24px 24px;
  background: rgba(13, 22, 48, 0.95);
  color: var(--cream);
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
}
.info-dialog::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
.info-dialog h2 { margin: 0 0 14px; font-family: var(--font-body); font-size: 32px; }
.info-dialog h3 { margin: 18px 0 6px; font-size: 18px; }
.info-dialog p { color: var(--muted); line-height: 1.7; margin: 0; }
.close-dialog {
  position: absolute; right: 14px; top: 10px; border: 0; background: transparent; color: var(--cream); font-size: 28px; line-height: 1; padding: 4px;
}

@media (max-width: 900px) {
  .footer-row { flex-direction: column; gap: 18px; }
  .music-panel {
    position: static;
    transform: none;
    width: min(380px, 100%);
  }
}
@media (max-width: 720px) {
  .site-header { padding-inline: 18px; }
  .studio-logo { font-size: 18px; }
  .main-content {
  position: relative;
  z-index: 1; padding-inline: 18px; }
  .news-panel { width: calc(100vw - 36px); border-radius: 22px; padding: 18px; }
  .news-article { grid-template-columns: 1fr; }
  .news-thumb { max-width: 240px; justify-self: center; }
  .panel-heading h2 { font-size: 30px; }
  .music-panel { width: calc(100vw - 36px); }
  .social-link { width: 46px; height: 46px; }
}

/* Smaller laptop windows: maximize room for the scrollable blog. */
@media (max-height: 780px) {
  .site-header { padding-top: 12px; }
  .hero { padding-top: 0; }
  .game-logo { height: clamp(100px, 23dvh, 220px); }
  .news-panel { padding-top: 15px; padding-bottom: 14px; }
  .news-list { margin-top: 12px; }
  .site-footer {
  position: relative;
  z-index: 3; gap: 7px; padding-top: 9px; padding-bottom: 9px; }
  .footer-row { min-height: 64px; }
}
@media (max-height: 540px) {
  .game-logo { height: max(68px, 18dvh); }
  .panel-intro { display: none; }
  .panel-heading h2 { font-size: 22px; }
  .news-panel { padding-top: 10px; padding-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .snowflake, .bulb { animation: none; }
}

/* Phone layout: preserve a genuinely usable reading area without page scrolling. */
@media (max-width: 720px) {
  .game-logo { height: clamp(94px, 18dvh, 164px); }
  .main-content {
  position: relative;
  z-index: 1; gap: 8px; }
  .panel-intro { font-size: 13px; line-height: 1.4; margin-top: 5px; }
  .panel-heading h2 { font-size: 26px; }
  .news-note { margin-top: 4px; min-height: 0; font-size: 11px; }
  .news-panel { padding: 14px; }
  .news-list { margin-top: 10px; }
  .news-article { grid-template-columns: 80px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .news-thumb { width: 80px; max-width: 100%; aspect-ratio: 3 / 4; }
  .news-meta { font-size: 10px; line-height: 1.3; margin-bottom: 4px; }
  .news-text h3 { font-size: 17px; line-height: 1.2; margin-bottom: 6px; }
  .news-excerpt { font-size: 13px; line-height: 1.5; }
  .news-body { font-size: 13px; line-height: 1.5; }
  .news-more { padding: 7px 10px; font-size: 12px; }
  .footer-row { gap: 9px; min-height: 0; }
  .site-footer {
  position: relative;
  z-index: 3; padding-block: 8px; gap: 7px; }
  .social-link { width: 40px; height: 40px; }
  .music-panel { padding: 9px 12px; min-height: 62px; border-radius: 18px; }
  .music-play { width: 40px; height: 40px; }
  .music-details { gap: 5px; }
}

/* Short landscape windows: keep footer links and player on the same row. */
@media (min-width: 600px) and (max-width: 900px) and (max-height: 560px) {
  .footer-row { flex-direction: row; min-height: 66px; }
  .music-panel {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: min(280px, 35vw);
    margin-top: 0;
  }
  .news-panel { padding-top: 10px; padding-bottom: 10px; }
  .news-list { margin-top: 8px; }
  .panel-heading .eyebrow { margin-bottom: 2px; }
  .news-note { min-height: 0; margin-top: 4px; }
}

@media (max-width: 720px) {
  .garland-wire { height: 14px; border-bottom-width: 3px; }
  .garland-bulbs { grid-template-columns: repeat(10, 1fr); gap: 8px; }
  .bulb { width: 11px; height: 16px; }
  .site-header { padding-top: 38px; }
}
