/* Upside Over — shared studio styles */
:root {
  --ink: #2a1845;
  --ink-soft: rgba(42, 24, 69, 0.72);
  --paper: #fff8fb;
  --magenta: #ff2d95;
  --cyan: #2de2e6;
  --yellow: #ffd84d;
  --violet: #7b3fe4;
  --lime: #7dffb3;
  --coral: #ff6b6b;
  --nav-h: 72px;
  --font-display: "Baloo 2", "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", "Fredoka", system-ui, sans-serif;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(123, 63, 228, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.5;
  background:
    radial-gradient(ellipse 900px 520px at 12% -10%, rgba(255, 45, 149, 0.22), transparent 55%),
    radial-gradient(ellipse 800px 480px at 88% 8%, rgba(45, 226, 230, 0.28), transparent 50%),
    radial-gradient(ellipse 700px 500px at 50% 100%, rgba(255, 216, 77, 0.25), transparent 55%),
    linear-gradient(165deg, #fff4fb 0%, #eafbff 42%, #fff8e8 100%);
  overflow-x: hidden;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: white;
  padding: 10px 14px;
  z-index: 1000;
}
.skip-link:focus { left: 12px; top: 12px; }

/* —— Nav —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--nav-h);
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(255, 248, 251, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid rgba(255, 45, 149, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--magenta), 0 8px 18px rgba(255, 45, 149, 0.35);
}

.brand-mark {
  background: linear-gradient(110deg, var(--magenta), var(--violet) 45%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-weight: 800;
  font-size: 0.98rem;
  opacity: 0.78;
  transition: opacity 160ms ease, transform 160ms ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  opacity: 1;
  transform: translateY(-1px);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--magenta), #ff6bcb 40%, var(--violet));
  color: white !important;
  opacity: 1 !important;
  box-shadow: 0 10px 24px rgba(255, 45, 149, 0.35);
}

/* —— Layout —— */
.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.page {
  position: relative;
  z-index: 1;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn:active { transform: translateY(0) scale(0.99); }

.btn-primary {
  color: white;
  background: linear-gradient(120deg, var(--magenta), #ff6bcb 40%, var(--violet));
  box-shadow: 0 14px 32px rgba(255, 45, 149, 0.35);
}

.btn-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(45, 226, 230, 0.65);
  box-shadow: 0 10px 24px rgba(45, 226, 230, 0.2);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* —— Home hero —— */
.home-hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 56px) 16px 48px;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 45, 149, 0.18), transparent 35%),
    radial-gradient(circle at 80% 25%, rgba(45, 226, 230, 0.2), transparent 32%),
    radial-gradient(circle at 50% 80%, rgba(255, 216, 77, 0.22), transparent 40%);
  animation: wash 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes wash {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.05); }
}

.hero-stage {
  position: relative;
  z-index: 30;
  width: min(720px, 100%);
  text-align: center;
  pointer-events: none;
}

.hero-stage .cta-row,
.hero-stage a {
  pointer-events: auto;
}

.hero-logo {
  width: min(420px, 78vw);
  height: auto;
  margin: 0 auto 18px;
  border-radius: 50%;
  animation: logo-float 5s ease-in-out infinite;
  filter: drop-shadow(0 24px 40px rgba(123, 63, 228, 0.28));
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.01em;
  background: linear-gradient(110deg, var(--magenta) 0%, var(--violet) 40%, var(--cyan) 75%, var(--yellow) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin: 14px auto 22px;
  max-width: 34ch;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--ink-soft);
}

.fly-hint {
  margin: 20px auto 0;
  max-width: 36ch;
  font-size: 0.95rem;
  color: var(--ink-soft);
  opacity: 0;
  animation: hint-in 600ms ease 1.2s forwards;
}

@keyframes hint-in {
  to { opacity: 1; }
}

.fly-hint kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(42, 24, 69, 0.12);
  font-family: var(--font-body);
  font-size: 0.85em;
}

/* —— Flying characters —— */
#sky {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  overflow: hidden;
}

.flyer {
  position: absolute;
  width: 72px;
  height: 72px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(42, 24, 69, 0.16);
  cursor: grab;
  pointer-events: auto;
  font-size: 2.2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 160ms ease, background 160ms ease;
  will-change: transform;
  touch-action: none;
}

.flyer:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 30px rgba(255, 45, 149, 0.28);
}

.flyer.is-active {
  background: white;
  box-shadow:
    0 0 0 4px var(--cyan),
    0 0 0 8px rgba(255, 45, 149, 0.35),
    0 16px 36px rgba(123, 63, 228, 0.3);
  z-index: 2;
  cursor: grabbing;
}

.flyer .sprite {
  display: block;
  width: 1.15em;
  height: 1.15em;
  transform-origin: center;
  animation: bob 2.8s ease-in-out infinite;
}

.flyer.is-active .sprite { animation-duration: 1.2s; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-4px) rotate(4deg); }
}

.flyer-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 8px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.flyer.is-active .flyer-label,
.flyer:focus-visible .flyer-label { opacity: 1; }

/* —— Sections —— */
.section {
  padding: clamp(40px, 8vw, 88px) 0;
}

.section-head {
  text-align: center;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
}

.section-head p {
  margin: 0 auto;
  max-width: 42ch;
  color: var(--ink-soft);
}

.ribbon {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--violet);
  background: rgba(123, 63, 228, 0.1);
}

/* —— Game gallery —— */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.game-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.game-tile:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: 0 22px 48px rgba(255, 45, 149, 0.2);
}

.game-tile:nth-child(even):hover {
  transform: translateY(-4px) rotate(0.4deg);
}

.game-tile img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background:
    linear-gradient(135deg, rgba(255, 45, 149, 0.15), rgba(45, 226, 230, 0.18));
}

.game-tile-body {
  display: grid;
  gap: 8px;
  padding: 16px 16px 18px;
  flex: 1;
}

.game-tile h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.game-tile p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.game-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(42, 24, 69, 0.14);
}

.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(45, 226, 230, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.stat-value {
  color: var(--violet);
  font-variant-numeric: tabular-nums;
}

.stat.is-pending .stat-value {
  color: var(--magenta);
  letter-spacing: 0.08em;
}

.play-chip {
  margin-top: auto;
  align-self: start;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--magenta);
}

/* —— About —— */
.about-hero {
  padding: clamp(36px, 7vw, 72px) 0 12px;
  text-align: center;
}

.about-hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
}

.about-hero .lede {
  margin: 0 auto;
  max-width: 40ch;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 5vw, 48px);
  align-items: start;
  padding: 28px 0 64px;
}

@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
}

.story {
  display: grid;
  gap: 16px;
}

.story h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
}

.story p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.portrait {
  position: relative;
  padding: 28px;
  border-radius: 32px;
  background:
    linear-gradient(160deg, rgba(255, 45, 149, 0.14), rgba(45, 226, 230, 0.16) 50%, rgba(255, 216, 77, 0.18));
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.55), transparent 40%);
  pointer-events: none;
}

.portrait-art {
  position: relative;
  z-index: 1;
  width: min(220px, 70%);
  margin: 0 auto;
  filter: drop-shadow(0 12px 18px rgba(42, 24, 69, 0.18));
  animation: logo-float 6s ease-in-out infinite;
}

.portrait h3 {
  position: relative;
  z-index: 1;
  margin: 12px 0 4px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
}

.portrait .role {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink-soft);
  font-weight: 800;
}

.quote {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.98rem;
  color: var(--ink);
}

.quote::before {
  content: "“";
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--magenta);
  margin-right: 2px;
}

/* —— Games page banner —— */
.page-banner {
  padding: clamp(36px, 7vw, 64px) 0 8px;
  text-align: center;
}

.page-banner h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 800;
}

.page-banner p {
  margin: 0 auto;
  max-width: 42ch;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

/* —— Footer —— */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding: 28px 16px 36px;
  text-align: center;
  border-top: 2px solid rgba(255, 45, 149, 0.1);
  background: rgba(255, 255, 255, 0.35);
}

.site-footer .brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
}

.site-footer p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.footer-flip {
  display: inline-block;
  transform: rotate(180deg);
  opacity: 0.55;
  margin-left: 6px;
}

@media (max-width: 640px) {
  .brand span { display: none; }
  .nav-links { gap: 10px; }
  .nav-links a:not(.nav-cta) { font-size: 0.9rem; }
  .flyer { width: 60px; height: 60px; font-size: 1.85rem; }
}
