/* ==========================================================================
   Match 3 Battles — Site Stylesheet
   Tokens derived from the live game app (battles.match3.co) build CSS.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Brand palette — matches in-game Tailwind tokens */
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;

  --orange-600: #ea580c;
  --orange-500: #f97316;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-300: #fcd34d;

  --bg: rgba(2, 6, 23, 0.8);
  --panel: rgba(30, 41, 59, 0.8);
  --panel-solid: var(--slate-900);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.24);

  --text-primary: var(--slate-100);
  --text-secondary: var(--slate-300);
  --text-muted: var(--slate-400);

  --accent-gradient: linear-gradient(135deg, var(--amber-400), var(--orange-600));

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, monospace;

  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-pill: 999px;

  --container: 1180px;
  --shadow-panel: 0 10px 40px -12px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px -10px rgba(249, 115, 22, 0.35);
}

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

html {
  scroll-behavior: smooth;
  background: url(/assets/img/bg_shapes.png) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

@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;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(249, 115, 22, 0.08), 0.8),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(245, 158, 11, 0.06), 0.8);
  background-attachment: fixed;
  color: var(--text-secondary);
  font-family: var(--font-display);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

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

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--amber-400);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  font-size: 1rem;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.brand__title {
  text-transform: uppercase;
  line-height: 1.05;
}

.brand__title small {
  display: block;
  font-size: 0.62em;
  color: var(--amber-400);
  font-weight: 600;
  letter-spacing: 0.14em;
}

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

.main-nav a {
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  transition: color 0.15s ease, background 0.15s ease;
}

.main-nav a:hover {
  color: var(--text-primary);
  background: var(--panel);
}

.main-nav a.is-active {
  color: var(--amber-400);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* ---------------------------------- Buttons --------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--slate-950);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  background: var(--panel);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: rgba(148, 163, 184, 0.12);
}

.btn-block {
  width: 100%;
}

/* ---------------------------------- Panels / Cards --------------------------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(6px);
}

.card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
}

.card__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(249, 115, 22, 0.12);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.card h3 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------------------------------- Hero --------------------------------- */

.hero {
  padding-block: 64px 40px;
}

.hero__panel {
  padding: 48px;
  text-align: center;
  max-width: 900px;
  margin-inline: auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber-400);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 .accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lede {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin-inline: auto 24px;
  margin-bottom: 28px;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.hero__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------------------------------- Sections --------------------------------- */

.section {
  padding-block: 56px;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  text-transform: uppercase;
}

.section-head p {
  color: var(--text-muted);
  margin: 0;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 860px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------- Screenshot gallery --------------------------------- */

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

.gallery img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  aspect-ratio: 16/10;
  object-fit: cover;
  width: 100%;
}

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

/* ---------------------------------- Mode tabs (visual echo of game UI) --------------------------------- */

.mode-tabs {
  display: flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px;
  max-width: 640px;
  margin: 0 auto 32px;
}

.mode-tabs a {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.mode-tabs a.is-active {
  background: var(--accent-gradient);
  color: var(--slate-950);
}

/* ---------------------------------- FAQ --------------------------------- */

.faq-item {
  border-bottom: 1px solid var(--border);
  padding-block: 18px;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.faq-item p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

/* ---------------------------------- Content / articles --------------------------------- */

.prose {
  max-width: 760px;
  margin-inline: auto;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 1.8em;
  text-transform: uppercase;
}

.prose h3 {
  font-size: 1.15rem;
  margin-top: 1.5em;
  color: var(--amber-300);
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose a {
  color: var(--amber-400);
  text-decoration: underline;
  text-decoration-color: rgba(251, 191, 36, 0.4);
}

.prose blockquote {
  border-left: 3px solid var(--orange-500);
  padding-left: 18px;
  margin: 1.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

.prose code {
  font-family: var(--font-mono);
  background: rgba(148, 163, 184, 0.12);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.article-meta {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 40px;
}

.article-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  text-transform: none;
}

/* ---------------------------------- Guide index cards --------------------------------- */

.guide-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.guide-card__tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber-400);
  margin-bottom: 10px;
}

.guide-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  text-transform: none;
}

.guide-card p {
  color: var(--text-muted);
  font-size: 0.93rem;
  flex: 1;
}

.guide-card__link {
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--amber-400);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 40px 28px;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}

.footer-grid h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li {
  margin-bottom: 8px;
}

.footer-grid a:hover {
  color: var(--amber-400);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ---------------------------------- Breadcrumbs --------------------------------- */

.breadcrumbs {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.breadcrumbs a:hover {
  color: var(--amber-400);
}

.breadcrumbs .sep {
  margin-inline: 6px;
  opacity: 0.5;
}

/* ---------------------------------- Mobile nav --------------------------------- */

@media (max-width: 780px) {
  .main-nav {
    position: fixed;
    inset: 60px 12px auto 12px;
    background: var(--slate-900);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    box-shadow: var(--shadow-panel);
    display: none;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    text-align: left;
    padding: 12px 14px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header-cta .btn-primary span.long {
    display: none;
  }

  .hero__panel {
    padding: 28px 20px;
  }

  .footer-bottom {
    flex-direction: column;
  }
}
