:root {
  --navy-deep: #0b1026;
  --navy: #121938;
  --navy-card: #1a244f;
  --navy-border: #334587;
  --sky-blue: #326ad9;
  --sky-light: #62a9f5;
  --sunset-peach: #f08f5a;
  --gold: #ffbe2e;
  --gold-hi: #ffe270;
  --gold-dark: #d98218;
  --cream: #fff8e6;
  --cream-dim: #cfd8f2;
  --grass: #72cf44;
  --grass-dark: #438f2c;
  --earth: #7b4a31;
  --pixel-red: #ef4b4b;
  --pixel-blue: #4690ff;
  --pixel-green: #54d154;

  --font-pixel: "Press Start 2P", "Silkscreen", "Courier New", monospace;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;

  --max-w: 1160px;
  --px-shadow: 5px 5px 0 #070a18;
  --px-shadow-sm: 3px 3px 0 #070a18;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--navy-deep);
  color: var(--cream);
  font-family: var(--font-body);
  line-height: 1.65;
}

body {
  margin: 0;
  background-color: var(--navy-deep);
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold-hi);
  outline-offset: 3px;
}

.container {
  width: min(var(--max-w), calc(100% - 36px));
  margin: 0 auto;
}

/* Pixel Panels & Stepped Frames */
.px-box {
  background: var(--navy-card);
  border: 4px solid var(--cream);
  box-shadow:
    inset 0 0 0 4px var(--navy),
    var(--px-shadow);
  position: relative;
}

.px-box-navy {
  background: rgba(18, 25, 56, 0.94);
  border: 4px solid var(--gold);
  box-shadow:
    inset 0 0 0 3px var(--navy-deep),
    var(--px-shadow);
}

.px-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--navy);
  border: 3px solid var(--gold);
  box-shadow: var(--px-shadow-sm);
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--gold-hi);
  text-transform: uppercase;
}

/* Pixel Buttons */
.px-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  font-weight: 800;
  font-size: 15px;
  border: 3px solid var(--navy-deep);
  box-shadow: var(--px-shadow-sm);
  transition: transform 0.08s steps(2), box-shadow 0.08s steps(2), background-color 0.12s;
  user-select: none;
}

.px-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #070a18;
}

.px-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #070a18;
}

.px-btn-gold {
  background: var(--gold);
  color: var(--navy-deep);
  border-color: var(--cream);
}

.px-btn-gold:hover {
  background: var(--gold-hi);
}

.px-btn-sky {
  background: var(--sky-blue);
  color: var(--cream);
  border-color: var(--cream);
}

.px-btn-sky:hover {
  background: #427cf0;
}

.px-btn-grass {
  background: var(--grass);
  color: var(--navy-deep);
  border-color: var(--cream);
}

.px-btn-grass:hover {
  background: #88e259;
}

.px-btn-dark {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy-border);
}

.px-btn-dark:hover {
  border-color: var(--gold);
  color: var(--gold-hi);
}

.px-btn[disabled],
.px-btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--px-shadow-sm);
}

/* Top Pixel Header */
.studio-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 16, 38, 0.94);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 4px 0 #070a18;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.studio-brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--cream);
  box-shadow: 2px 2px 0 #070a18;
  object-fit: cover;
  flex-shrink: 0;
}

.studio-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.studio-brand-name {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--gold-hi);
  letter-spacing: 0.03em;
}

.studio-brand-domain {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--sky-light);
  margin-top: 4px;
}

.studio-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.studio-nav a {
  font-weight: 700;
  font-size: 14px;
  color: var(--cream-dim);
  padding: 6px 8px;
  border-bottom: 3px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}

.studio-nav a:hover {
  color: var(--gold-hi);
  border-bottom-color: var(--gold);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--navy-card);
  border: 3px solid var(--navy-border);
  box-shadow: 2px 2px 0 #070a18;
}

.lang-box select {
  background: transparent;
  border: none;
  color: var(--cream);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.lang-box select option {
  background: var(--navy);
  color: var(--cream);
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--navy-card);
  border: 3px solid var(--cream);
  font-family: var(--font-pixel);
  font-size: 16px;
}

/* Sunset Retreat Hero */
.studio-hero {
  position: relative;
  overflow: hidden;
  padding: 68px 0 76px;
  border-bottom: 6px solid var(--grass);
  box-shadow: inset 0 -6px 0 var(--grass-dark);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background: url("assets/studio/sunset-retreat.jpg") center 58% / cover no-repeat;
  transform: scale(1.02);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 16, 38, 0.9) 0%, rgba(11, 16, 38, 0.72) 48%, rgba(11, 16, 38, 0.34) 100%),
    linear-gradient(180deg, rgba(11, 16, 38, 0.35) 0%, rgba(11, 16, 38, 0.15) 55%, rgba(11, 16, 38, 0.85) 100%);
}

#pixelSkyCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.8fr);
  gap: 36px;
  align-items: center;
}

.hero-title {
  margin: 16px 0 10px;
  font-family: var(--font-pixel);
  font-size: clamp(24px, 3.8vw, 42px);
  line-height: 1.3;
  color: var(--gold-hi);
  text-shadow: 4px 4px 0 #070a18;
}

.hero-sub {
  margin: 0 0 12px;
  font-size: clamp(19px, 2.3vw, 25px);
  font-weight: 800;
  color: var(--cream);
  text-shadow: 2px 2px 0 #070a18;
}

.hero-lead {
  margin: 0 0 24px;
  max-width: 600px;
  font-size: 16px;
  color: var(--cream-dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
}

.stat-tile {
  background: rgba(18, 25, 56, 0.9);
  border: 3px solid var(--navy-border);
  box-shadow: var(--px-shadow-sm);
  padding: 12px 14px;
}

.stat-tile strong {
  display: block;
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--gold-hi);
  margin-bottom: 4px;
}

.stat-tile span {
  font-size: 12px;
  color: var(--cream-dim);
  font-weight: 600;
}

/* Studio Badge Showcase Card */
.badge-card {
  padding: 24px;
  text-align: center;
  background: rgba(18, 25, 56, 0.92);
  border: 4px solid var(--cream);
  box-shadow:
    inset 0 0 0 4px var(--sky-blue),
    8px 8px 0 #070a18;
}

.badge-frame {
  position: relative;
  display: inline-block;
  padding: 10px;
  background: var(--navy-deep);
  border: 4px solid var(--gold);
  box-shadow: var(--px-shadow);
  animation: pixelFloat 4s steps(4) infinite;
}

.badge-frame img {
  width: min(260px, 64vw);
  height: auto;
  border-radius: 50%;
}

.abxy-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.abxy-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--navy-deep);
  box-shadow: 2px 2px 0 #070a18;
}

.abxy-dot.r { background: var(--pixel-red); }
.abxy-dot.b { background: var(--pixel-blue); }
.abxy-dot.g { background: var(--pixel-green); }
.abxy-dot.y { background: var(--gold); }

.badge-domain-pill {
  display: inline-block;
  margin-top: 14px;
  padding: 7px 14px;
  background: var(--navy-deep);
  border: 3px solid var(--grass);
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--grass);
  letter-spacing: 0.05em;
}

/* Marquee Ticker */
.px-ticker {
  background: var(--earth);
  border-bottom: 4px solid #070a18;
  overflow: hidden;
  padding: 10px 0;
}

.px-ticker-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  gap: 48px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--gold-hi);
  animation: tickerScroll 28s linear infinite;
}

.px-ticker:hover .px-ticker-track {
  animation-play-state: paused;
}

/* Sections */
.studio-section {
  padding: 72px 0;
}

.section-header {
  margin-bottom: 34px;
}

.section-header h2 {
  margin: 14px 0 10px;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 900;
  color: var(--gold-hi);
  text-shadow: 3px 3px 0 #070a18;
}

.section-header p {
  margin: 0;
  max-width: 720px;
  color: var(--cream-dim);
}

/* Game Cartridge Shelf */
.shelf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-pill {
  padding: 8px 16px;
  background: var(--navy-card);
  border: 3px solid var(--navy-border);
  box-shadow: 3px 3px 0 #070a18;
  font-weight: 700;
  font-size: 14px;
  color: var(--cream-dim);
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--gold);
  color: var(--navy-deep);
  border-color: var(--cream);
}

.cartridge-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px;
  padding: 26px;
  margin-bottom: 26px;
  background: linear-gradient(135deg, #1b2552 0%, #141b3d 100%);
  border: 4px solid var(--gold);
  box-shadow:
    inset 0 0 0 4px var(--navy-deep),
    8px 8px 0 #070a18;
}

.cartridge-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cartridge-screen {
  position: relative;
  border: 4px solid var(--cream);
  box-shadow: var(--px-shadow);
  background: #070a18;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.cartridge-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  background: var(--grass);
  color: var(--navy-deep);
  border: 2px solid var(--navy-deep);
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
}

.shot-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.shot-thumb {
  padding: 0;
  border: 3px solid var(--navy-border);
  background: #070a18;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.shot-thumb.active,
.shot-thumb:hover {
  border-color: var(--gold-hi);
}

.shot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cartridge-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.game-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.game-icon {
  width: 64px;
  height: 64px;
  border: 3px solid var(--cream);
  box-shadow: var(--px-shadow-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.game-title {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  color: var(--cream);
}

.game-subtitle {
  margin: 3px 0 0;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--gold);
}

.game-desc {
  margin: 0;
  color: var(--cream-dim);
  font-size: 15px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.px-tag {
  padding: 4px 10px;
  background: var(--navy-deep);
  border: 2px solid var(--sky-light);
  color: var(--sky-light);
  font-size: 12px;
  font-weight: 700;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mini-metric {
  background: var(--navy-deep);
  border: 2px solid var(--navy-border);
  padding: 8px;
  text-align: center;
}

.mini-metric strong {
  display: block;
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--gold-hi);
}

.mini-metric span {
  font-size: 11px;
  color: var(--cream-dim);
}

.cartridge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Upcoming Slots Grid */
.upcoming-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.upcoming-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  background: rgba(20, 29, 66, 0.85);
  border: 4px dashed var(--navy-border);
  box-shadow: var(--px-shadow);
}

.slot-code {
  display: inline-block;
  padding: 4px 10px;
  background: var(--navy-deep);
  border: 2px solid var(--sunset-peach);
  color: var(--sunset-peach);
  font-family: var(--font-pixel);
  font-size: 10px;
}

.upcoming-card h3 {
  margin: 8px 0 6px;
  font-size: 19px;
  color: var(--cream);
}

.upcoming-card p {
  margin: 0;
  color: var(--cream-dim);
  font-size: 14px;
}

/* Studio Philosophy Grid */
.craft-section {
  background: rgba(18, 25, 56, 0.7);
  border-top: 4px solid var(--navy-border);
  border-bottom: 4px solid var(--navy-border);
}

.craft-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.craft-card {
  padding: 24px;
  background: var(--navy-card);
  border: 4px solid var(--cream);
  box-shadow:
    inset 0 0 0 3px var(--navy-deep),
    var(--px-shadow);
}

.craft-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--navy-deep);
  border: 3px solid var(--gold);
  margin-bottom: 16px;
}

.craft-icon svg {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.craft-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  color: var(--gold-hi);
}

.craft-card p {
  margin: 0;
  color: var(--cream-dim);
  font-size: 14px;
}

/* Sunset Retreat Lounge */
.retreat-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 26px;
  padding: 26px;
  align-items: center;
}

.retreat-art {
  border: 4px solid var(--gold);
  box-shadow: var(--px-shadow);
  overflow: hidden;
  position: relative;
}

.retreat-art img {
  width: 100%;
  height: auto;
}

.dialogue-box {
  background: var(--navy-deep);
  border: 4px solid var(--cream);
  box-shadow: inset 0 0 0 3px var(--sky-blue), var(--px-shadow-sm);
  padding: 18px;
  min-height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 18px 0;
}

.dialogue-speaker {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--gold);
  margin-bottom: 6px;
}

.dialogue-text {
  margin: 0;
  font-size: 15px;
  color: var(--cream);
}

.retreat-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.pet-counter {
  padding: 8px 12px;
  background: var(--navy-deep);
  border: 3px solid var(--grass);
  font-size: 13px;
  font-weight: 700;
  color: var(--grass);
}

/* Contact Card */
.contact-box {
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.contact-copy {
  max-width: 600px;
}

.contact-copy h2 {
  margin: 12px 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--gold-hi);
}

.contact-copy p {
  margin: 0;
  color: var(--cream-dim);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Footer */
.studio-footer {
  background: #070b1a;
  border-top: 6px solid var(--grass);
  box-shadow: inset 0 6px 0 var(--grass-dark);
  padding: 36px 0;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-left img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--gold);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cream-dim);
}

.footer-links a:hover {
  color: var(--gold-hi);
}

.hidden {
  display: none !important;
}

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

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 920px) {
  .hero-grid,
  .cartridge-featured,
  .retreat-panel,
  .craft-grid {
    grid-template-columns: 1fr;
  }

  .studio-nav {
    display: none;
    position: absolute;
    top: 74px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 16px;
    background: var(--navy);
    border: 4px solid var(--gold);
    box-shadow: var(--px-shadow);
  }

  .studio-nav.open {
    display: flex;
  }

  .menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .hero-stats,
  .upcoming-grid,
  .mini-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .hero-stats .stat-tile:last-child {
    grid-column: span 2;
  }

  .upcoming-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge-frame,
  .px-ticker-track {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
