/*
 * home.css — theme for the studio homepage.
 *
 * Look: dark "deep space" gallery feel to match the black-and-white
 * space-turtle logo. Monochrome with one mint accent, big editorial
 * typography (Comfortaa), and the starfield canvas behind everything.
 */

:root {
  --bg: #0b0d12;
  --text: #f2f2ef;
  --muted: #9aa0a8;
  --accent: #7ef0c8;
  /* Detail colour: the Sunset gradient, reused for the games band background,
     the hero tagline, header link hover, card arrows and the contact button. */
  --detail-gradient: linear-gradient(120deg, #ffd9a0, #ffb0a0 45%, #ff9ec4);
  --card-bg: rgba(255, 255, 255, 0.05);
  --font-body: "Comfortaa", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Comfortaa", "Helvetica Neue", Arial, sans-serif;
}

/* The starfield canvas sits fixed behind all content. */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none; /* clicks pass through to the page */
}

/* Keep content above the canvas. */
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/*
 * Homepage header (header-reveal.js): hidden while the visitor is at the top,
 * so the hero (logo + starfield) is uncluttered. Once they scroll past the
 * threshold, header-reveal.js adds `is-visible` and the header slides down and
 * pins as a translucent bar. This behaviour is homepage-only (home.css); the
 * app subpages keep their normal static headers.
 */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(4, 5, 8, 0.95); /* darker bar */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.site-header.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}

/* Nav + language grouped and pushed to the right (brand stays left). */
.header-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Subtle language selector: locale code + a small chevron, no box. */
.site-header #lang-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 0.2rem 1.15rem 0.2rem 0.2rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0a8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 0.7rem;
}

.site-header #lang-select:hover {
  color: #fff;
}

/*
 * Logo treatment from design-lab/homepage/v01.html: the ORIGINAL artwork,
 * NOT inverted. Round-cropped into a clean disc with a soft glow, so it reads
 * as a sticker / moon hanging in the dark sky — respecting the logo's own
 * colours rather than reversing them.
 */
.hero-logo {
  width: min(300px, 60vw);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.25);
  animation: float 7s ease-in-out infinite;
}

/* The small header logo is already round (base.css); keep it un-inverted too
   so both instances show the same original artwork. */

/* Gentle floating so the disc drifts in space. */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
}

.hero h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Gradient "detail" text helper: paints text with the sunset gradient. */
.hero .tagline,
.site-header nav a:hover,
.game-card h3::after {
  background: var(--detail-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Raised interpunct (·) between tagline phrases — sits optically above
   the baseline, like editorial brand separators. */
.hero .tagline-sep {
  display: inline-block;
  width: 0.28em;
  height: 0.28em;
  margin: 0 0.7em;
  border-radius: 50%;
  background: var(--detail-gradient);
  vertical-align: 0.22em;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}

.site-header nav a:hover {
  opacity: 1;
}


/* Splash: the first section fills ~85% of the viewport (dynamic screen
   height), and the starfield behind it is what you land on. Scrolling then
   reveals the games band and contact. */
.hero {
  min-height: 85vh;
  min-height: 85svh; /* small-viewport height: avoids the mobile address-bar jump */
}

/* Chosen from design-lab/homepage/v01.html ("Tilted Tape") — the oversized
   rotated band below can bleed past the viewport edges; clip at the root so
   mobile browsers (especially iOS Safari) never get a horizontal swipe. */
html,
body {
  overflow-x: clip;
  max-width: 100%;
}

main {
  overflow-x: clip;
  max-width: 100%;
}

/* --------------------------------------------------------- Solid bands */

/*
 * The games overview sits on an oversized "tape" strip, bled off both edges
 * and floating over the starfield: space (hero) → games strip → space (contact).
 * The strip is tilted and its section is counter-rotated so content stays level.
 * Source sketch: design-lab/homepage/v01.html.
 */
.band {
  position: relative;
  z-index: 1;
  color: #16181d;
  width: 112vw;
  margin: 5rem -6vw;
  padding: 6rem 6vw; /* generous vertical padding — breathing room */
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.band > section {
  max-width: 1000px;
  margin: 0 auto;
  /* Vertical rhythm + a horizontal inset so the cards never touch the screen
     edges on tablet/phone. The coloured band itself still bleeds off the edges;
     only the content is inset. */
  padding: 5rem clamp(1.5rem, 6vw, 3rem);
}

/* Games band: the Sunset gradient (our detail colour, --detail-gradient), tilted left. */
.band-games {
  background: var(--detail-gradient);
  transform: rotate(-2.5deg);
}
.band-games > section {
  transform: rotate(2.5deg);
}

.band h2 {
  color: #16181d;
}

/* Anchor targets offset so the fixed header doesn't cover the section title. */
#games,
#contact {
  scroll-margin-top: 6rem;
}

@media (max-width: 700px) {
  /* Tilt exposes the starfield at the corners unless the band bleeds past the
     viewport; root overflow-x: clip (above) hides the extra width. */
  .band {
    width: 128vw;
    margin: 3rem -14vw;
    padding: 3.2rem 14vw;
    transform-origin: center center;
  }
  .band > section { padding: 3rem clamp(1.25rem, 5vw, 2.5rem); }
  .band-games { transform: rotate(-1.2deg); }
  .band-games > section { transform: rotate(1.2deg); }
}

/* --------------------------------------------------------- Game cards */

/*
 * S3 "reveal on hover" (design-lab/homepage/card-iterations.html): the game's
 * icon/logo fills the card, the title sits over a bottom gradient, and the
 * blurb + arrow reveal on hover. The whole card is the link — no white footer.
 */
.game-grid {
  display: grid;
  /* min(300px, 100%) so a card never forces horizontal overflow on narrow phones */
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 2rem;
}

.game-card {
  position: relative;
  display: block;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  text-decoration: none;
  color: #fff;
  /* Soft shadow (like the hero logo's glow, but dark for the light band) so the
     feature graphics lift off the gradient background. */
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.game-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Dark gradient at the bottom so the title stays readable over any art. */
.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.84));
}

.game-card .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.2rem 1.4rem;
}

.game-card h3 {
  font-size: 1.6rem;
  color: #fff;
  margin: 0;
}

.game-card h3::after {
  content: " →";
  /* colour comes from the gradient-text helper above */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card:hover h3::after {
  opacity: 1;
}

/* Blurb hidden at rest, slides open on hover. */
.game-card p {
  margin: 0.25rem 0 0;
  color: rgba(255, 255, 255, 0.92);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.game-card:hover p {
  max-height: 5em;
  opacity: 1;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  /* Without hover motion, always show the blurb so nothing is hidden. */
  .game-card p { max-height: 5em; opacity: 1; }
}

/* Contact section: centered, calm — extra vertical space for breathing room. */
#contact {
  text-align: center;
  padding-top: 9rem;
  padding-bottom: 9rem;
}

#contact p {
  max-width: 38em;
  margin: 0 auto 1.5rem;
  color: var(--muted);
}

.btn-primary {
  background: var(--detail-gradient);
  color: #0b0d12;
}

/* ------------------------------------------------------- Scroll reveal */

/* Subtle fade + lift as promo bands and contact scroll into view
   (js/scroll-reveal.js toggles .is-visible). */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.7s ease-out,
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-on-scroll--delay {
  transition-delay: 0.12s;
}
.reveal-on-scroll--delay-2 {
  transition-delay: 0.22s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ------------------------------------------------------- Responsive */

@media (max-width: 600px) {
  /*
   * Mobile header: a single compact row (override base.css, which wraps +
   * centres the header below 600px — wrong for our fixed slim bar). On phones
   * we drop the nav links entirely and keep just the studio name + language
   * picker; the page is a short one-pager, so scrolling reaches everything.
   */
  .site-header {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 5vw;
  }
  .site-header nav {
    display: none;
  }
  .brand {
    font-size: 1rem;
    gap: 0.5rem;
    min-width: 0;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }

  #contact {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

/* ===================== Per-app promo bands (chosen: A) ===================== */

/* Official store badges (same technique as the app pages) */
.badges { display: flex; gap: 0.85rem; flex-wrap: wrap; align-items: center; }
.store-badge {
  display: block;
  flex: none;
  height: 44px;
  background: center / contain no-repeat;
  transition: transform 0.15s ease;
}
.store-badge:hover { transform: translateY(-2px); }
.store-badge--apple {
  width: calc(44px * 119.66407 / 40);
  background-image: url("../assets/badges/Download_on_the_App_Store_Badge_US-UK_RGB_blk_092917.svg");
}
.store-badge--google {
  width: calc(44px * 238.96 / 70.87);
  background-image: url("../assets/badges/GetItOnGooglePlay_Badge_Web_color_English.svg");
}

/* "More info" on its own row under the store badges */
.promo-more { margin-top: 1.2rem; }

/* "More info" ghost pill: outlined, arrow nudges on hover */
.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.more-btn::after {
  content: "→";
  transition: transform 0.15s ease;
}
.more-btn:hover {
  background: #fff;
  color: #16181d;
  transform: translateY(-2px);
}
.more-btn:hover::after { transform: translateX(3px); }

/* Shared promo band layout (same tilted-tape shape; both bands tilt the same
   way so they sit parallel under each other). Vertical padding gives the fan
   room to breathe without relying on shot size alone. */
.promo { color: #fff; padding-top: 3rem; padding-bottom: 3rem; }
.promo > section { padding-top: 1.85rem; padding-bottom: 1.85rem; }
.promo.tilt-l { transform: rotate(-2.5deg); transform-origin: center center; }
.promo.tilt-l > section { transform: rotate(2.5deg); transform-origin: center center; }
.promo h2 {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  color: inherit;
  margin-bottom: 0.5rem;
}
.promo .promo-blurb {
  opacity: 0.92;
  max-width: 34em;
  margin-bottom: 1.6rem;
}
.promo-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(1.8rem, 5vw, 3.5rem);
  align-items: center;
}

/* Turtle Hurdle is mirrored: screenshots left, copy right */
.promo-flip .promo-copy { order: 2; }
.promo-flip .promo-art { order: 1; }

/* App gradients */
.promo-a.promo-th { background: linear-gradient(120deg, #00c7a2 10%, #06c7b5 20%, #ffcda0 72%, #ffb59e 90%); }
.promo-a.promo-ws { background: linear-gradient(120deg, #63d0be 0%, #6a8fd8 48%, #d96a6a 100%); }

/* Screenshot fan (chosen: W4, extended to four shots): big shots, loose
   hand-jittered offsets/rotations with slight size variation, an overall
   drift from bottom-left to top-right, and gentle overlap. The art block
   bleeds toward the outer edge of the band; the art column is the wider one. */
.promo-shots {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px 0;
}
.promo-shots img {
  width: 30%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.promo-shots img + img { margin-left: -7.5%; }
.promo-shots .shot-1 { transform: translateY(32px) rotate(-8.5deg) scale(0.97); z-index: 1; }
.promo-shots .shot-2 { transform: translateY(10px) rotate(-3deg) scale(1.03);   z-index: 3; }
.promo-shots .shot-3 { transform: translateY(-10px) rotate(2deg);               z-index: 4; }
.promo-shots .shot-4 { transform: translateY(-30px) rotate(7.5deg) scale(0.99); z-index: 2; }

/* Both game bands share the same vertical rhythm so Turtle Hurdle and
   WordStress read as equal-height strips (TH needed extra padding for
   wider screenshots; WS gets the same band treatment for parity). */
.promo-th,
.promo-ws {
  padding-top: 3.63rem;
  padding-bottom: 3.63rem;
}
.promo-th > section,
.promo-ws > section {
  padding-top: calc((1.85rem + 1.35rem) * 1.21);
  padding-bottom: calc((1.85rem + 1.35rem) * 1.21);
}
.promo-th .promo-shots,
.promo-ws .promo-shots {
  padding: 51px 0;
}

/* Bleed toward the outer edge (TH shots sit left, WS shots sit right) */
.promo-flip .promo-shots { margin-left: -17%; }
.promo:not(.promo-flip) .promo-shots { margin-right: -17%; }
/* The second band starts directly after the first (margins collapse to a
   2px overlap so no starfield sliver peeks between the parallel edges). */
.promo + .promo { margin-top: calc(-5rem - 2px); }

/* Give the art column more room than the copy */
.promo-grid { grid-template-columns: 1fr 1.3fr; }
.promo-flip .promo-grid { grid-template-columns: 1.3fr 1fr; }

/* Responsive: stack (copy first), gentler tilt, clip the screenshot fan */
@media (max-width: 760px) {
  .promo-grid, .promo-flip .promo-grid { grid-template-columns: 1fr; }
  .promo-th > section,
  .promo-ws > section {
    padding-top: calc((1.85rem + 0.75rem) * 1.21);
    padding-bottom: calc((1.85rem + 0.75rem) * 1.21);
  }
  .promo-th .promo-shots,
  .promo-ws .promo-shots {
    padding: 51px 0;
    overflow-x: clip;
    max-width: 100%;
  }
  .promo-flip .promo-shots, .promo:not(.promo-flip) .promo-shots { margin-left: 0; margin-right: 0; }
  .promo + .promo { margin-top: calc(-3rem - 2px); } /* band margins are 3rem on phones */
  .promo-flip .promo-copy { order: 0; }
  .promo-flip .promo-art { order: 1; }
  .promo.tilt-l { transform: rotate(-1.2deg); transform-origin: center center; }
  .promo.tilt-l > section { transform: rotate(1.2deg); transform-origin: center center; }
  /* Softer fan angles so rotated shot corners stay inside the band */
  .promo-shots .shot-1 { transform: translateY(24px) rotate(-5deg) scale(0.97); }
  .promo-shots .shot-2 { transform: translateY(8px) rotate(-2deg) scale(1.02); }
  .promo-shots .shot-3 { transform: translateY(-8px) rotate(2deg); }
  .promo-shots .shot-4 { transform: translateY(-22px) rotate(5deg) scale(0.99); }
}
/* ===================== /Per-app promo bands ===================== */
