/* ==========================================================================
   PlaySafe Website - Design System & Styles
   Based on theme.dart (Theme.purple)
   ========================================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --color-primary: #A243A4;
  --color-primary-dark: #7B2E7D;
  --color-on-primary: rgba(255, 255, 255, 0.92);
  --color-surface: #EEE6F8;
  --color-on-surface: rgba(29, 11, 29, 0.8);
  --color-on-surface-muted: rgba(29, 11, 29, 0.48);
  --color-surface-container: #FFFBF5;
  --color-shadow: rgba(168, 0, 170, 0.08);
  --color-error: #C30C21;

  --font-family: 'Figtree', sans-serif;

  --radius-card: 24px;
  --radius-button: 32px;
  --radius-input: 20px;

  --shadow-card: 0 4px 16px 6px rgba(168, 0, 170, 0.12);
  --shadow-hover: 0 8px 28px 6px rgba(168, 0, 170, 0.2);
  --shadow-nav: 0 3px 16px rgba(168, 0, 170, 0.18);

  --max-width: 1200px;
  --max-width-narrow: 800px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-on-surface);
  background-color: var(--color-surface);
  min-height: 100vh;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary-dark);
}

ul, ol {
  padding-left: 1.5em;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-on-surface);
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  font-size: 2.5rem;
  font-weight: 900;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p + p {
  margin-top: 1em;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

.container-narrow {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 64px 0;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #c1aadf;
  box-shadow: var(--shadow-nav);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-on-surface);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(162, 67, 164, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  padding: 0;
}

.nav-links a {
  color: var(--color-on-surface);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-on-surface);
}

.nav-toggle svg {
  width: 28px;
  height: 28px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface-container);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 32px;
  transition: box-shadow 0.3s, transform 0.3s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--radius-button);
  padding: 16px 32px;
  box-shadow: 0 4px 20px rgba(162, 67, 164, 0.4);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-on-primary);
  box-shadow: 0 6px 28px rgba(162, 67, 164, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-surface-container);
  color: var(--color-on-surface);
  border-radius: var(--radius-button);
  padding: 16px 32px;
  border: 2px solid rgba(162, 67, 164, 0.2);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-store {
  background: #000;
  color: #fff;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 0.95rem;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.btn-store:hover {
  background: #222;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

.btn-store svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.btn-store .btn-store-label {
  text-align: left;
  line-height: 1.2;
}

.btn-store .btn-store-label small {
  font-size: 0.7rem;
  font-weight: 400;
  display: block;
}

.btn-store .btn-store-label span {
  font-size: 1.05rem;
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 80px 0 64px;
}

.hero-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 32px;
  border-radius: 28px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.hero h1 {
  margin-bottom: 16px;
  font-size: 3rem;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--color-on-surface-muted);
  font-weight: 500;
  margin-bottom: 12px;
}

.hero .description {
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Features Grid ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.feature-card {
  text-align: center;
  padding: 40px 24px;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--color-on-surface-muted);
  line-height: 1.6;
}

/* ---------- How It Works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 40px;
  counter-reset: step;
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 1.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(162, 67, 164, 0.4);
}

.step h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.step p {
  font-size: 0.95rem;
  color: var(--color-on-surface-muted);
}

/* ---------- CTA Section ---------- */
.cta-section {
  text-align: center;
  background: var(--color-surface-container);
  border-radius: var(--radius-card);
  padding: 64px 32px;
  margin: 0 32px;
  box-shadow: var(--shadow-card);
}

.cta-section h2 {
  margin-bottom: 16px;
}

.cta-section p {
  color: var(--color-on-surface-muted);
  margin-bottom: 32px;
  font-size: 1.1rem;
}

/* ---------- Blog Cards ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.blog-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.blog-card:hover {
  color: inherit;
}

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

.blog-card-with-image {
  padding: 0;
  overflow: hidden;
}

.blog-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.blog-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-emoji {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.blog-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.blog-card p {
  color: var(--color-on-surface-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

.blog-card .read-more {
  margin-top: 16px;
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.95rem;
}

/* ---------- Article / Legal Content ---------- */
.page-header {
  text-align: center;
  padding: 48px 0 0px;
}

.page-header h1 {
  margin-bottom: 8px;
}

.page-header .subtitle {
  color: var(--color-on-surface-muted);
  font-size: 0.95rem;
}

.article-content {
  background: var(--color-surface-container);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 0;
  margin-bottom: 64px;
  overflow: hidden;
}

.article-content-body {
  padding: 48px;
}

.article-content h2 {
  font-size: 1.5rem;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(168, 0, 170, 0.08);
}

.article-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.article-content h3 {
  font-size: 1.2rem;
  margin-top: 28px;
  margin-bottom: 12px;
}

.article-content p {
  margin-bottom: 16px;
  line-height: 1.75;
}

.article-content ul,
.article-content ol {
  margin-bottom: 16px;
  line-height: 1.75;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content strong {
  font-weight: 700;
}

.article-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-meta {
  display: flex;
  gap: 16px;
  color: var(--color-on-surface-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.article-hero {
  width: 100%;
  object-fit: cover;
  max-height: 400px;
  display: block;
}

.toc {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}

.toc h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.toc ol {
  padding-left: 1.25em;
}

.toc li {
  margin-bottom: 4px;
}

.toc a {
  color: var(--color-on-surface);
  font-size: 0.95rem;
}

.toc a:hover {
  color: var(--color-primary);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--color-surface-container);
  padding: 48px 0 32px;
  margin-top: 64px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand .nav-logo {
  font-size: 1.25rem;
}

.footer-brand p {
  color: var(--color-on-surface-muted);
  font-size: 0.9rem;
  max-width: 300px;
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-on-surface-muted);
  margin-bottom: 16px;
}

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

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--color-on-surface);
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid rgba(168, 0, 170, 0.08);
  color: var(--color-on-surface-muted);
  font-size: 0.85rem;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ---------- Article CTA Banner ---------- */
.article-cta {
  text-align: center;
  background: var(--color-surface);
  border: 2px solid rgba(162, 67, 164, 0.15);
  border-radius: var(--radius-card);
  padding: 48px 32px;
  margin-top: 40px;
}

.article-cta h3 {
  color: var(--color-on-surface);
  margin-bottom: 12px;
}

.article-cta p {
  color: var(--color-on-surface-muted);
  margin-bottom: 24px;
}

.article-cta .hero-buttons {
  justify-content: center;
}

/* ---------- Info callout ---------- */
.callout {
  background: var(--color-surface);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
  margin: 24px 0;
  font-size: 0.95rem;
}

.callout-warning {
  border-left-color: var(--color-error);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero h1 {
    font-size: 2.25rem;
    margin-bottom: 6px;
  }

  .hero {
    padding: 24px 0 40px;
  }

  .hero-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    margin-bottom: 24px;
  }

  .section {
    padding: 40px 0;
  }

  .container,
  .container-narrow {
    padding-left: 20px;
    padding-right: 20px;
  }

  .nav-inner {
    padding: 0 20px;
  }

  /* Mobile nav */
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--color-surface-container);
    flex-direction: column;
    padding: 16px 20px 24px;
    gap: 0;
    box-shadow: var(--shadow-card);
    border-bottom-left-radius: var(--radius-card);
    border-bottom-right-radius: var(--radius-card);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 12px 0;
    font-size: 1.05rem;
  }

  .nav-toggle {
    display: block;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .article-content-body {
    padding: 28px 20px;
  }

  .cta-section {
    margin: 0 20px;
    padding: 40px 20px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .hero-buttons {
    align-items: center;
  }
}
