/* ==========================================================================
   Medani Games — landing page styles
   Modern, dependency-free. Matches the play.medani.games app identity.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
  --brand-purple: #7c3aed;
  --brand-indigo: #4f46e5;
  --brand-gradient: linear-gradient(135deg, #7c3aed, #4f46e5);

  --ink: #111827;
  --muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --line: #e5e7eb;

  /* Category accents (mirrors the play app's badge colours) */
  --cat-memory-bg: #fce7f3;     --cat-memory-fg: #9d174d;
  --cat-knowledge-bg: #fef3c7;  --cat-knowledge-fg: #92400e;
  --cat-puzzle-bg: #d1fae5;     --cat-puzzle-fg: #065f46;
  --cat-number-bg: #dbeafe;     --cat-number-fg: #1e40af;
  --cat-word-bg: #ede9fe;       --cat-word-fg: #5b21b6;
  --cat-arcade-bg: #fee2e2;     --cat-arcade-fg: #991b1b;
  --cat-logic-bg: #cffafe;      --cat-logic-fg: #155e75;
  --cat-board-bg: #ffedd5;      --cat-board-fg: #9a3412;
  --cat-card-bg: #ccfbf1;       --cat-card-fg: #115e59;
  --cat-story-bg: #e2e8f0;      --cat-story-fg: #334155;

  --r: 16px;
  --r-sm: 10px;
  --r-pill: 999px;
  --container: 1140px;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 20px 45px rgba(79, 70, 229, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

/* The header is sticky (72px), so anchor targets need to clear it or every
   in-page nav link lands with its own heading hidden underneath. */
:target, section[id], header[id] { scroll-margin-top: 84px; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

p { margin: 0 0 1rem; }

a { color: var(--brand-indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--soft { background: var(--bg-soft); }

.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(2rem, 5vw, 3rem); }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

.eyebrow {
  display: inline-block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-purple);
  margin-bottom: 0.75rem;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.8rem 1.6rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.btn-primary:hover { box-shadow: 0 24px 55px rgba(79, 70, 229, 0.3); }

.btn-ghost {
  background: #fff;
  color: var(--brand-indigo);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.btn-ghost:hover { border-color: var(--brand-purple); }

.btn-light {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.btn-light:hover { background: rgba(255, 255, 255, 0.26); }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.9rem; }

/* ---- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 72px;
}
.brand { display: flex; align-items: center; }
.brand img { height: 34px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--brand-purple); text-decoration: none; }

.nav-cta { display: flex; align-items: center; gap: 0.75rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-toggle span {
  width: 22px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(124, 58, 237, 0.14), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(79, 70, 229, 0.12), transparent 55%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4rem);
}
.hero h1 .grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 34ch;
  margin-bottom: 1.75rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero-media { position: relative; }
.hero-media img {
  width: auto;
  max-width: 100%;
  max-height: 580px;
  margin-inline: auto;
  border-radius: var(--r);
  filter: drop-shadow(0 30px 50px rgba(79, 70, 229, 0.22));
}

/* ---- Stat band ----------------------------------------------------------- */
.stats {
  background: var(--brand-gradient);
  color: #fff;
}
.stats .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-block: 2.25rem;
  text-align: center;
}
.stat strong {
  display: block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1;
}
.stat span { font-size: 0.95rem; opacity: 0.9; }

/* ---- Categories ---------------------------------------------------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.cat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--r);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); text-decoration: none; }
.cat-icon {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px currentColor;
}
.cat-icon svg { width: 26px; height: 26px; }
.cat-icon img { width: 100%; height: 100%; object-fit: cover; }
.cat-card h3 { font-size: 1.1rem; margin: 0 0 0.15rem; color: var(--ink); }
.cat-card p { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* category tints */
.t-memory   { background: var(--cat-memory-bg); color: var(--cat-memory-fg); }
.t-knowledge{ background: var(--cat-knowledge-bg); color: var(--cat-knowledge-fg); }
.t-puzzle   { background: var(--cat-puzzle-bg); color: var(--cat-puzzle-fg); }
.t-number   { background: var(--cat-number-bg); color: var(--cat-number-fg); }
.t-word     { background: var(--cat-word-bg); color: var(--cat-word-fg); }
.t-arcade   { background: var(--cat-arcade-bg); color: var(--cat-arcade-fg); }
.t-logic    { background: var(--cat-logic-bg); color: var(--cat-logic-fg); }
.t-board    { background: var(--cat-board-bg); color: var(--cat-board-fg); }
.t-card     { background: var(--cat-card-bg); color: var(--cat-card-fg); }
.t-story    { background: var(--cat-story-bg); color: var(--cat-story-fg); }

/* ---- Featured (new games) ------------------------------------------------ */
/* A third band type on purpose. The page alternates white .section /
   .section--soft all the way down, so slotting a fourth section into that
   rhythm would rename every band below it. The brand wash reads as "this one
   is new" and settles into the soft games section directly underneath. */
.section--feature { background: linear-gradient(180deg, #faf5ff, var(--bg-soft)); }

/* One card per row. Two-up made the featured art smaller than the plain grid
   thumbs directly below it, which is the wrong way round for the section that
   is supposed to be selling these two. */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.featured-card {
  display: grid;
  grid-template-columns: 30% 1fr;
  background: #fff;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.featured-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

/* The card is taller than the square art, so the art column drops its 1/1 ratio
   and fills the full height with the art centred in it. The card art carries a
   baked-in purple bezel on a transparent ground, so the column gets a light
   violet field for it to sit on rather than leaving a white gap that reads as a
   loading error. */
.featured-card .game-thumb {
  aspect-ratio: auto;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: linear-gradient(160deg, #f5f3ff, #ede9fe);
}
.featured-card .game-thumb img {
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/* Card height is set by the art column, so centre the copy against it rather
   than letting a short block sit up at the top. */
.featured-card .game-body { padding: 1.5rem 1.75rem; justify-content: center; }
.featured-card .game-body h3 { font-size: 1.35rem; margin: 0 0 0.5rem; }

.featured-kicker {
  display: block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.featured-lede {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
/* Base .game-body p is flex:1 to push the button down on a short grid card.
   Two paragraphs here would each claim a share of it, so opt out and let the
   button sit under the copy instead. */
.featured-card .game-body p { flex: 0 0 auto; }
.featured-card .game-body p:not(.featured-lede):not(.featured-note) { margin: 0 0 0.75rem; }
.featured-card .game-body .btn { margin-top: 0.35rem; }
.featured-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

/* Category .badge owns top-right, so the NEW pill takes top-left. */
.badge-new {
  position: absolute;
  top: 12px; left: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-pill);
  background: var(--brand-gradient);
  color: #fff;
}

/* ---- Games --------------------------------------------------------------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.game-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.game-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.game-thumb { position: relative; aspect-ratio: 1 / 1; }
.game-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-pill);
}
.game-body { padding: 1.1rem 1.1rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.game-body h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.game-body p { font-size: 0.9rem; color: var(--muted); flex: 1; }
.game-body .btn { margin-top: 0.5rem; align-self: flex-start; }

.games-more { text-align: center; margin-top: 2.5rem; }

/* ---- How it works -------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  counter-reset: step;
}
.step {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 2.25rem 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}
.step-num {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  margin-bottom: 1rem;
}
.step h3 { font-size: 1.2rem; }
.step p { margin: 0; color: var(--muted); }

/* ---- Why / features ------------------------------------------------------ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.feature {
  display: flex;
  gap: 1rem;
  padding: 1.4rem;
  border-radius: var(--r);
  background: #fff;
  border: 1px solid var(--line);
}
.feature .ic {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--cat-word-bg);
  color: var(--brand-purple);
}
.feature .ic svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.05rem; margin: 0 0 0.2rem; }
.feature p { margin: 0; font-size: 0.92rem; color: var(--muted); }

/* ---- CTA band ------------------------------------------------------------ */
.cta-band {
  background: var(--brand-gradient);
  color: #fff;
  text-align: center;
  border-radius: clamp(20px, 4vw, 32px);
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.cta-band p { font-size: 1.1rem; opacity: 0.92; max-width: 46ch; margin: 0 auto 1.75rem; }

/* ---- Contact ------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.contact-info h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.contact-info p { color: var(--muted); }
.contact-info a { font-weight: 600; }

.form { display: grid; gap: 1rem; }
.form label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 0.35rem; }
.form input, .form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font: inherit;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form input:focus, .form textarea:focus {
  outline: none;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.form textarea { resize: vertical; min-height: 130px; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.form-status { font-size: 0.92rem; font-weight: 600; min-height: 1.2em; }
.form-status.ok { color: #047857; }
.form-status.err { color: #b91c1c; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  background: #0f1222;
  color: #cbd0dd;
  padding: 3rem 0 1.5rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-brand img { height: 32px; filter: brightness(0) invert(1); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.footer-nav a { color: #cbd0dd; font-weight: 600; font-size: 0.92rem; }
.footer-nav a:hover { color: #fff; text-decoration: none; }
.socials { display: flex; gap: 0.75rem; }
.socials a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background 0.2s;
}
.socials a:hover { background: var(--brand-purple); }
.socials svg { width: 18px; height: 18px; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1.5rem;
  font-size: 0.85rem;
  color: #8b91a3;
}

/* ---- Signup page --------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(124, 58, 237, 0.2), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(79, 70, 229, 0.18), transparent 55%),
    var(--bg-soft);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.75rem, 5vw, 2.5rem);
  text-align: center;
}
.auth-card .brand { justify-content: center; margin-bottom: 1.25rem; }
.auth-card h1 { font-size: 1.6rem; }
.auth-card .lead { color: var(--muted); margin-bottom: 1.5rem; }
.phone-field { display: flex; }
.phone-field .cc {
  display: grid; place-items: center;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--muted);
}
.phone-field input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.25rem 0 0.25rem;
}
.auth-card .btn { width: 100%; justify-content: center; }
.auth-back { margin-top: 1.25rem; font-size: 0.9rem; }

/* ---- Scroll reveal ------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-media { max-width: 480px; margin-inline: auto; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-card { grid-template-columns: 38% 1fr; }
  .steps, .feature-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .stats .container { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

@media (max-width: 760px) {
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: flex; }
  .site-header.open .nav-links {
    display: flex;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 0.5rem 20px 1rem;
  }
  .site-header.open .nav-links li { width: 100%; }
  .site-header.open .nav-links a { display: block; padding: 0.75rem 0; width: 100%; }
}

@media (max-width: 520px) {
  .cat-grid, .game-grid { grid-template-columns: 1fr; }
  .featured-card { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .cat-card:hover, .game-card:hover, .featured-card:hover { transform: none; }
}
