/* ==========================================================================
   Happy Dream Limited — shared stylesheet v3 (soft night-sky theme)
   Design language: "soft night sky & dream" — deep muted navy, gentle aurora
   gradients, Space Grotesk display + Manrope body
   ========================================================================== */

:root {
  --bg: #0b1226;
  --bg-soft: #101a33;
  --card: #131e3a;
  --card-2: #16213f;
  --ink: #e9eefb;
  --ink-dim: #a4aed2;
  --ink-faint: #7985ad;
  --line: rgba(164, 174, 210, 0.16);
  --sky: #38bdf8;
  --indigo: #818cf8;
  --violet: #c084fc;
  --pink: #f472b6;
  --accent: #a5b4fc;
  --aurora: linear-gradient(100deg, #38bdf8 0%, #818cf8 45%, #c084fc 78%, #f9a8d4 100%);
  --glow: 0 8px 30px rgba(99, 120, 240, 0.25);
  --shadow-card: 0 12px 34px rgba(2, 6, 18, 0.45);
  --radius: 18px;
  --maxw: 1180px;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(129, 140, 248, 0.32); }

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

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

.container { width: min(92%, var(--maxw)); margin-inline: auto; }

/* ---------- Type ---------- */
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }

.section { padding: 96px 0; }
.section-head { max-width: 640px; margin-bottom: 56px; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: 16px;
}
.kicker::before {
  content: "";
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--sky));
}

.section-title { font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin-bottom: 16px; }
.section-sub { color: var(--ink-dim); font-size: 1.05rem; max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(120deg, var(--indigo), var(--violet));
  color: #fff;
  box-shadow: var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(129, 140, 248, 0.4); }

.btn-ghost { background: rgba(19, 30, 58, 0.6); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: rgba(164, 174, 210, 0.4); color: #fff; background: rgba(164, 174, 210, 0.1); transform: translateY(-2px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(11, 18, 38, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  padding: 12px 0;
}

.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: 0.01em; color: var(--ink); }
.brand svg { width: 34px; height: 34px; }

.nav-links { display: flex; align-items: center; gap: 34px; list-style: none; }
.nav-links a { font-size: 14.5px; font-weight: 500; color: var(--ink-dim); position: relative; padding: 6px 0; transition: color 0.2s ease; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--aurora);
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: transform 0.25s ease, opacity 0.25s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 160px 0 120px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(11, 18, 38, 0.5) 0%, rgba(11, 18, 38, 0.78) 62%, var(--bg) 100%);
}
.hero-bg {
  position: absolute; inset: 0;
  background-image: url("hero.png?v=2");
  background-size: cover;
  background-position: center 30%;
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1100px 500px at 78% 10%, rgba(129, 140, 248, 0.18), transparent 60%),
    radial-gradient(800px 420px at 10% 88%, rgba(56, 189, 248, 0.12), transparent 60%);
  z-index: -1;
}

.hero-inner { max-width: 760px; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  border: 1px solid rgba(164, 174, 210, 0.24);
  border-radius: 999px;
  background: rgba(19, 30, 58, 0.65);
  backdrop-filter: blur(6px);
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 28px;
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--aurora); box-shadow: 0 0 12px rgba(192, 132, 252, 0.9); }

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  font-weight: 700;
  margin-bottom: 24px;
  background: linear-gradient(100deg, #7dd3fc 0%, #c7d2fe 40%, #e9d5ff 70%, #fbcfe8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  color: var(--ink-dim);
  max-width: 58ch;
  margin-bottom: 40px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-scroll {
  position: absolute;
  left: 50%; bottom: 28px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero-scroll .line {
  width: 1px; height: 44px;
  background: linear-gradient(180deg, rgba(164, 174, 210, 0.5), transparent);
  overflow: hidden;
}
.hero-scroll .line::after {
  content: ""; display: block; width: 100%; height: 50%;
  background: var(--sky);
  animation: scrollDrop 2.2s ease-in-out infinite;
}
@keyframes scrollDrop { 0% { transform: translateY(-100%); } 100% { transform: translateY(200%); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 64px; align-items: center; }
.about-copy p { color: var(--ink-dim); margin-bottom: 18px; font-size: 1.04rem; }
.about-copy p strong { color: var(--ink); font-weight: 600; }

.about-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pill {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: linear-gradient(160deg, var(--card-2), var(--card));
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.pill:hover { transform: translateY(-3px); border-color: rgba(129, 140, 248, 0.4); }
.pill svg { width: 26px; height: 26px; margin-bottom: 12px; }
.pill h3 { font-size: 15.5px; margin-bottom: 4px; }
.pill p { font-size: 13.5px; color: var(--ink-dim); }

/* ---------- Games ---------- */
.games { background: linear-gradient(180deg, var(--bg), #0d1630 20%, var(--bg) 100%); }

.games-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

.game-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex; flex-direction: column;
}
.game-card:hover { transform: translateY(-8px); border-color: rgba(129, 140, 248, 0.45); box-shadow: 0 24px 54px rgba(2, 6, 18, 0.6); }

.game-card .art { position: relative; padding-top: 56.25%; overflow: hidden; }
.game-card .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.game-card:hover .art img { transform: scale(1.05); }
.game-card .art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 62%, rgba(11, 18, 38, 0.7) 100%);
}

.game-card .tag {
  position: absolute; left: 16px; top: 16px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(11, 18, 38, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(164, 174, 210, 0.24);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #dbe6ff;
  z-index: 2;
}

.game-card .body { padding: 22px 24px 26px; flex: 1; display: flex; flex-direction: column; }
.game-card h3 { font-size: 1.28rem; margin-bottom: 8px; }
.game-card p { font-size: 14.5px; color: var(--ink-dim); flex: 1; }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

.service-card {
  position: relative;
  padding: 36px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, var(--card-2), var(--card));
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.service-card:hover { transform: translateY(-6px); border-color: rgba(192, 132, 252, 0.4); }
.service-card::before {
  content: ""; position: absolute; top: -60px; right: -60px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.16), transparent 70%);
  opacity: 0; transition: opacity 0.35s ease;
}
.service-card:hover::before { opacity: 1; }

.service-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(192, 132, 252, 0.16));
  border: 1px solid rgba(164, 174, 210, 0.22);
  margin-bottom: 22px;
}
.service-icon svg { width: 26px; height: 26px; }

.service-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.service-card p { font-size: 14.5px; color: var(--ink-dim); }
.service-card ul { margin-top: 16px; list-style: none; }
.service-card li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.service-card li::before {
  content: "";
  position: absolute; left: 0; top: 8px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #a5b4fc, var(--indigo));
}

/* ---------- Process ---------- */
.process { background: linear-gradient(180deg, var(--bg), #0d1630 22%, var(--bg) 100%); }

.process-steps { max-width: 860px; margin: 0 auto; }

.step { display: grid; grid-template-columns: 96px 56px 1fr; align-items: start; }

.step .num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  justify-self: end;
  padding-top: 6px;
  text-align: right;
}
.step .num em { font-style: normal; color: var(--accent); }

.step .axis { position: relative; height: 100%; min-height: 108px; }
.step .axis .node {
  position: absolute; left: 50%; top: 6px;
  transform: translateX(-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--indigo);
  box-shadow: 0 0 14px rgba(129, 140, 248, 0.6);
  z-index: 1;
}
.step .axis::before {
  content: "";
  position: absolute; left: 50%; top: 26px; bottom: 0;
  transform: translateX(-50%);
  width: 2px;
  background: linear-gradient(180deg, rgba(129, 140, 248, 0.45), rgba(129, 140, 248, 0.08));
}
.step:last-child .axis::before { display: none; }

.step .body { padding: 0 0 44px 8px; }
.step h3 { font-size: 1.22rem; margin-bottom: 6px; }
.step p { font-size: 14.5px; color: var(--ink-dim); max-width: 52ch; }

/* ---------- CTA / Contact ---------- */
.contact { padding: 110px 0; position: relative; overflow: hidden; }
.contact::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(129, 140, 248, 0.14), transparent 65%),
    radial-gradient(700px 380px at 82% 100%, rgba(56, 189, 248, 0.1), transparent 60%);
  pointer-events: none;
}

.contact-panel {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding: 64px 56px;
  border-radius: 26px;
  border: 1px solid rgba(164, 174, 210, 0.2);
  background: linear-gradient(170deg, var(--card-2), var(--card));
  box-shadow: 0 24px 70px rgba(2, 6, 18, 0.55);
}
.contact-panel h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin-bottom: 16px; }
.contact-panel p { color: var(--ink-dim); font-size: 1.05rem; max-width: 52ch; margin: 0 auto 34px; }

.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

.mail-link {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 34px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: #dbe6ff;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px dashed rgba(164, 174, 210, 0.35);
  transition: border-color 0.25s ease, color 0.25s ease;
}
.mail-link:hover { border-color: var(--sky); color: #fff; }
.mail-link svg { width: 18px; height: 18px; color: var(--sky); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 46px 0 40px; background: var(--bg-soft); }
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); }
.footer-brand svg { width: 26px; height: 26px; }
.footer-links { display: flex; gap: 26px; font-size: 13.5px; color: var(--ink-dim); }
.footer-links a { transition: color 0.2s ease; }
.footer-links a:hover { color: var(--ink); }
.footer-copy { margin-top: 26px; font-size: 12.5px; color: var(--ink-faint); letter-spacing: 0.02em; }

/* ---------- Legal pages ---------- */
.legal-hero {
  padding: 150px 0 56px;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.legal-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(800px 360px at 20% 0%, rgba(129, 140, 248, 0.16), transparent 60%);
  pointer-events: none;
}
.legal-hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 10px; }
.legal-hero p { color: var(--ink-dim); }

.legal-body { padding: 64px 0 90px; }
.legal-card {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 52px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, var(--card-2), var(--card));
  box-shadow: var(--shadow-card);
}
.legal-card h2 { font-size: 1.5rem; margin: 34px 0 12px; color: #dbe6ff; }
.legal-card h2:first-child { margin-top: 0; }
.legal-card h3 { font-size: 1.18rem; margin: 26px 0 10px; color: #cfe0ff; }
.legal-card p { color: var(--ink-dim); margin-bottom: 12px; font-size: 0.99rem; }
.legal-card ul { margin: 10px 0 18px; padding-left: 22px; }
.legal-card li { color: var(--ink-dim); margin-bottom: 8px; font-size: 0.99rem; }
.legal-card li strong { color: var(--ink); }
.legal-card .legal-contact { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.legal-card .legal-contact a { color: var(--sky); font-weight: 600; }
.legal-card .legal-contact a:hover { text-decoration: underline; }

/* ---------- Reveal animation (lightweight, not applied to everything) ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .games-grid, .services-grid { grid-template-columns: 1fr; gap: 22px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 72px 0; }
  .step { grid-template-columns: 64px 40px 1fr; }
}

@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100svh;
    width: min(320px, 84vw);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding: 110px 36px 40px;
    background: rgba(13, 20, 40, 0.97);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 99;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; font-size: 18px; padding: 12px 0; }
  .nav-links a::after { display: none; }
  .nav-toggle { display: block; position: relative; z-index: 100; }

  .hero { padding: 130px 0 110px; }
  .hero-scroll { display: none; }

  .contact-panel { padding: 48px 26px; }
  .legal-card { padding: 34px 24px; }
}

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