/* ==========================================================================
   STELLAR JOY CREATIONS — global stylesheet
   Dark, game-first: one big wordmark, game artwork, contact form.
   ========================================================================== */

:root {
  --ink: #0B0C0E;
  --paper: #F5F3EE;
  --white: #ffffff;
  --accent: #FF5A1F;
  --accent-deep: #D9420C;
  --muted: #5D6068;
  --line: rgba(11, 12, 14, .10);
  --line-strong: rgba(11, 12, 14, .16);
  --line-dark: rgba(255, 255, 255, .12);
  --max: 1200px;
  --r-lg: 26px;
  --r-md: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ff-display: "Bricolage Grotesque", "Helvetica Neue", Helvetica, sans-serif;
  --ff-body: "DM Sans", "Helvetica Neue", Helvetica, sans-serif;
}

/* --------------------------------------------------------------------------
   Fonts — self-hosted, latin subset, variable weight. Two files (45 KB) replace
   the 5 woff2 files (171 KB) + an extra origin that fonts.google.com used to
   cost on first paint. Regenerate with pyftsubset if the copy changes.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.wrap {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
}

section { scroll-margin-top: 88px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 72px;
  display: flex;
  align-items: center;
  /* solid black bar, same colour as the footer: the first screen is pale now, so
     a translucent bar would leave white links on a mid-tone */
  background: #07080A;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  transition: background .35s var(--ease), border-color .35s var(--ease);
}

.site-header.is-scrolled {
  background: #07080A;
  border-bottom-color: rgba(255, 255, 255, .1);
  box-shadow: 0 12px 40px -24px rgba(0, 0, 0, .9);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-family: var(--ff-display);
  /* the legal name is long — keep it small enough to leave the nav breathing
     room, still heavy enough to read as a wordmark rather than a label */
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .012em;
  text-transform: uppercase;
  white-space: nowrap;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 90, 31, .16);
  flex: none;
}

/* the header wordmark reads as the full name in one voice — "STELLAR JOY
   CREATIONS" — instead of a muted trailing label */
.logo-name {
  font-family: var(--ff-display);
  font-size: 1em;
  font-weight: 700;
  letter-spacing: inherit;
  color: inherit;
  white-space: nowrap;
}

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

.nav a {
  position: relative;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .66);
  padding: 6px 0;
  transition: color .25s var(--ease);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}

.nav a:hover { color: #fff; }
.nav a:hover::after { transform: scaleX(1); }

/* --------------------------------------------------------------------------
   Hero — the company name is the whole first screen
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  /* full viewport: any less and a strip of the next section's paper shows
     under the artwork. svh keeps mobile browsers from leaving a gap while the
     address bar is expanded. */
  min-height: 100vh;
  min-height: 100svh;
  background: #E9F1FA;
  overflow: hidden;
  isolation: isolate;
}

/* -- key art --------------------------------------------------------------
   The first screen is nothing but the artwork: no scrim, no colour grade, no
   type on top. The wordmark moved to the header, so nothing here needs a
   readable backdrop. */

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-art {
  width: 100%;
  height: 100%;
  display: block;
}

/* --------------------------------------------------------------------------
   Games — artwork left, game identity + store buttons on the right
   -------------------------------------------------------------------------- */

.games {
  background: var(--paper);
  padding: 96px 0 116px;
}

.section-title {
  margin: 0 0 44px;
  font-family: var(--ff-display);
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 34px;
  align-items: stretch;
  padding: 20px;
  background: var(--white);
  border: 1px solid rgba(11, 12, 14, .07);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 2px rgba(11, 12, 14, .04), 0 30px 60px -40px rgba(11, 12, 14, .35);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: rgba(11, 12, 14, .12);
  box-shadow: 0 1px 2px rgba(11, 12, 14, .05), 0 42px 80px -44px rgba(11, 12, 14, .45);
}

.card-art {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #2E1409;
}

.card-art svg {
  width: 100%;
  height: 100%;
  transition: transform .7s var(--ease);
}

.game-card:hover .card-art svg { transform: scale(1.035); }

.card-body {
  display: flex;
  flex-direction: column;
  padding: 14px 18px 10px 2px;
  min-width: 0;
  text-align: left;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-icon {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid rgba(11, 12, 14, .1);
  box-shadow: 0 6px 16px -8px rgba(11, 12, 14, .5);
}

.card-icon svg { width: 100%; height: 100%; }

.card-top h3 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.card-desc {
  margin: 16px 0 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  transition: transform .3s var(--ease), background .3s var(--ease);
}

.badge:hover {
  background: #1D2027;
  transform: translateY(-2px);
}

.badge svg { width: 20px; height: 20px; flex: none; }

.badge span { display: flex; flex-direction: column; line-height: 1.15; }
.badge i {
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
}
.badge b { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }

/* --- toast: store links are live-but-empty until our games ship --------- */
/* --- "coming soon": a translucent bar across the middle of the screen ---- */
.soon {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 10, 12, .26);
  opacity: 0;
  visibility: hidden;
  transition: opacity .26s var(--ease), visibility .26s;
}

.soon.is-visible {
  opacity: 1;
  visibility: visible;
}

.soon-bar {
  margin: 0;
  padding: 15px 30px;
  border-radius: 14px;
  background: rgba(12, 13, 17, .68);
  border: 1px solid rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.005em;
  text-align: center;
  max-width: min(90vw, 620px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .65);
  transform: translateY(10px);
  transition: transform .32s var(--ease);
}

.soon.is-visible .soon-bar { transform: none; }

@media (max-width: 640px) {
  .soon-bar { padding: 13px 20px; font-size: 13px; border-radius: 12px; }
}

/* --------------------------------------------------------------------------
   Contact — a slim, centred strip (about a third of the screen)
   -------------------------------------------------------------------------- */

.contact {
  padding: 96px 0 104px;
  background: var(--paper);
  color: var(--ink);
}

.contact-inner {
  max-width: 720px;
  text-align: center;
}

.contact-title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.contact-lead {
  margin: 18px 0 40px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---- form: full-width fields, generous hit areas, no decoration ---------- */
.contact-form {
  display: grid;
  gap: 18px;
  text-align: left;
}

.field input,
.field textarea {
  width: 100%;
  padding: 20px 22px;
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(11, 12, 14, .12);
  border-radius: 12px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.field textarea {
  min-height: 172px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(11, 12, 14, .42);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, .16);
}

.contact-submit {
  width: 100%;
  margin-top: 4px;
  padding: 20px 24px;
  font-family: var(--ff-body);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(11, 12, 14, .12);
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .12s var(--ease);
}

.contact-submit:hover { background: rgba(11, 12, 14, .04); }
.contact-submit:active { transform: translateY(1px); }

.contact-submit[disabled] {
  cursor: default;
  opacity: .6;
}

/* honeypot — invisible to people, irresistible to bots */
.cf-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-note {
  min-height: 22px;
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
}

.contact-note.is-ok { color: #1F7A45; }
.contact-note.is-error { color: #B3210F; }

.contact-mail {
  margin: 34px 0 0;
  font-size: 16px;
  color: var(--muted);
}

.contact-mail a {
  color: var(--accent-deep);
  border-bottom: 1px solid rgba(217, 66, 12, .3);
  padding-bottom: 2px;
  transition: border-color .25s var(--ease);
}

.contact-mail a:hover { border-bottom-color: var(--accent-deep); }

/* visually hidden but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: #07080A;
  color: rgba(255, 255, 255, .5);
  padding: 30px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .45);
}

.footer-bottom a { color: rgba(255, 255, 255, .55); transition: color .25s var(--ease); }
.footer-bottom a:hover { color: #fff; }

/* --------------------------------------------------------------------------
   Legal pages (privacy / terms)
   -------------------------------------------------------------------------- */

.legal-hero {
  background:
    radial-gradient(700px 420px at 82% 0%, rgba(255, 90, 31, .2), transparent 62%),
    var(--ink);
  color: #fff;
  padding: 168px 0 72px;
}

.legal-hero h1 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.03em;
}

.legal-hero p {
  margin: 16px 0 0;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
}

.legal {
  background: var(--paper);
  padding: 72px 0 104px;
}

.legal .wrap { max-width: 860px; }

.legal-intro {
  margin: 0 0 36px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

.prose h2 {
  margin: 44px 0 14px;
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 15.5px;
  font-weight: 700;
}

.prose p, .prose li {
  font-size: 15px;
  line-height: 1.75;
  color: #3C3F45;
}

.prose p { margin: 0 0 14px; }

.prose ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.prose li { margin-bottom: 8px; }

.prose a {
  color: var(--accent-deep);
  border-bottom: 1px solid rgba(217, 66, 12, .3);
}

.prose a:hover { border-bottom-color: var(--accent-deep); }

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}

.legal-back:hover { border-bottom-color: var(--ink); }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 900px) {
  /* nav stays flat — it only gets tighter, never collapses */
  .nav { gap: 22px; }
  .nav a { font-size: 10.5px; letter-spacing: .1em; }
  .logo-suffix { display: none; }
  .site-header .wrap { gap: 16px; }

  .game-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .card-body { padding: 4px 6px 6px; }

  .games { padding-top: 76px; padding-bottom: 84px; }
}

@media (max-width: 700px) {
  .nav { gap: 15px; }
  .nav a { font-size: 9.5px; letter-spacing: .06em; }
  /* the two legal links move out of the header on very narrow screens —
     they are still reachable from the footer */
  .nav a:nth-child(n+3) { display: none; }
  .logo { font-size: 11.5px; letter-spacing: .004em; gap: 7px; }
  .logo-dot { width: 8px; height: 8px; box-shadow: 0 0 0 3px rgba(255, 90, 31, .16); }
}

@media (max-width: 640px) {
  .wrap { width: min(100% - 32px, var(--max)); }

  .hero { min-height: 100vh; min-height: 100svh; }

  .section-title { margin-bottom: 30px; }

  .game-card { padding: 12px; border-radius: 20px; }
  .card-art { border-radius: 14px; }
  .card-icon { width: 46px; height: 46px; border-radius: 12px; }
  .card-top h3 { font-size: 18px; }
  .card-desc { font-size: 14px; }
  .badge { height: 44px; padding: 0 13px; }

  .contact { padding: 64px 0 72px; }
  .contact-lead { margin: 14px 0 28px; font-size: 15px; }
  .field input, .field textarea { padding: 17px 18px; }
  .contact-submit { padding: 17px 20px; }

  .legal-hero { padding: 132px 0 52px; }
  .legal { padding: 48px 0 72px; }
  .legal-intro { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Real artwork
   main.js renders <img> instead of the SVG placeholders when HERO_IMAGE /
   game.shot / game.icon are set. These rules make the images cover exactly
   the same boxes the placeholders did.
   -------------------------------------------------------------------------- */
/* <picture> only wraps the img — keep it out of the layout box maths */
.hero-media picture,
.card-art picture,
.card-icon picture {
  display: block;
  width: 100%;
  height: 100%;
}

img.hero-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
