/* ══════════════════════════════════════════════════════════
   Arrow Maze — web design tokens.
   Mirrors the app's light board palette in
   Arrows Puzzle Escape/lib/app/theme/palette.dart
   (BoardPalette.light). Keep the two in sync.
   ══════════════════════════════════════════════════════════ */

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

:root {
  /* Board palette */
  --cream: #F4F1EA;      /* background */
  --paper: #FBF9F4;      /* boardFill */
  --dot: #D6CFC2;        /* gridDot */
  --ink: #1E2833;        /* arrow */
  --teal: #128C7E;       /* hint */
  --teal-light: #DDEFEB;
  --red: #D1453B;        /* blocked */
  --amber: #E29A2D;      /* blocker */

  /* Text */
  --text: #1E2833;
  --text-secondary: #4E5966;
  --text-light: #5F6975;

  /* Borders */
  --border: #E2DCD1;
  --border-light: #ECE8DF;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-xxl: 24px;

  --shadow-sm: 0 1px 2px rgba(30, 40, 51, 0.08);
  --shadow-md: 0 2px 8px rgba(30, 40, 51, 0.10);
  --shadow-lg: 0 6px 18px rgba(30, 40, 51, 0.14);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Navbar — the app's calm cream top bar with its hairline ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(244, 241, 234, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.navbar-brand img {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.navbar-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.navbar-links a:hover {
  color: var(--ink);
}

.navbar-links a.active {
  color: var(--ink);
  border-bottom-color: var(--teal);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: 0.3s;
  border-radius: var(--r-sm);
}

/* ── Language switch ── */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(30, 40, 51, 0.25);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.lang-switch a {
  padding: 5px 12px;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.lang-switch a.active {
  background: var(--ink);
  color: var(--cream);
}

.lang-switch a:not(.active):hover {
  background: rgba(30, 40, 51, 0.08);
  color: var(--ink);
}

/* ── Hero — the home screen on a dotted board ── */
.hero {
  padding: 128px 2rem 72px;
  text-align: center;
  background-color: var(--cream);
  background-image: radial-gradient(circle, rgba(214, 207, 194, 0.75) 1.5px, transparent 1.8px);
  background-size: 28px 28px;
  border-bottom: 1px solid var(--border);
}

.hero-content {
  max-width: 760px;
  margin: 0 auto;
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  color: var(--ink);
}

.hero .hero-kicker {
  margin: 0.35rem auto 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
}

.hero .hero-tagline {
  margin: 1.25rem auto 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.hero p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── "Coming soon" pill — styled like the app's Continue button ── */
.store-soon {
  margin-top: 2.25rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--cream);
  padding: 14px 28px;
  border-radius: var(--r-xxl);
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* ── Screenshots ── */
.screens {
  padding: 72px 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.screens-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.screen {
  text-align: center;
}

.screen img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 780 / 1688;
  border: 6px solid var(--ink);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.screen figcaption {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ── How to play — the three tutorial lessons ── */
.how {
  background: var(--paper);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.how-inner {
  padding: 72px 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  counter-reset: step;
}

.step {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
}

/* Fixed 132×84 board; the dots sit on a 24px grid like the app's cells */
.step-board {
  width: 132px;
  height: 84px;
  margin-bottom: 1.25rem;
  background-image: radial-gradient(circle, var(--dot) 1.8px, transparent 2.2px);
  background-size: 24px 24px;
  background-position: 6px 6px;
}

.step-board svg {
  display: block;
  width: 132px;
  height: 84px;
}

.step h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.step h3::before {
  counter-increment: step;
  content: counter(step) ". ";
  color: var(--teal);
}

.step p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.65;
}

/* ── Features ── */
.features {
  padding: 72px 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-size: 1rem;
}

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

.feature-card {
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--teal-light);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.65;
}

/* ── Page Header (sub-pages) — the app's dark ink button colour ── */
.page-header {
  padding: 112px 2rem 48px;
  text-align: center;
  background: var(--ink);
  color: var(--cream);
}

.page-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: rgba(244, 241, 234, 0.75);
  font-size: 1rem;
}

/* ── Content Section ── */
.content-section {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.content-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 2.25rem 0 0.75rem;
}

.content-section h2:first-child {
  margin-top: 0;
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.content-section strong {
  color: var(--text);
}

.content-section ul {
  color: var(--text-secondary);
  margin: 0.5rem 0 1rem 1.5rem;
  line-height: 1.8;
}

.content-section ul li {
  margin-bottom: 0.4rem;
}

/* Teal is too light to carry body-size link text on cream —
   ink text, teal underline. */
.content-section a {
  color: var(--text);
  font-weight: 500;
  border-bottom: 2px solid var(--teal);
  transition: background 0.2s;
}

.content-section a:hover {
  background: var(--teal-light);
}

/* "Summary" box at the top of the privacy policy */
.summary-box {
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem 0.5rem;
  margin-bottom: 1rem;
}

.last-updated {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-light);
}

/* ── Contact Card ── */
.contact-card {
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  max-width: 480px;
  margin: 2.5rem auto;
}

.contact-card .contact-icon {
  width: 60px;
  height: 60px;
  background: var(--teal-light);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.625rem;
  margin: 0 auto 1.25rem;
}

.contact-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.contact-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--cream) !important;
  padding: 12px 24px;
  border-radius: var(--r-xxl);
  font-weight: 600;
  font-size: 0.9375rem;
  border-bottom: none !important;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, transform 0.2s;
}

.contact-email:hover {
  background: var(--teal) !important;
  transform: translateY(-2px);
}

/* ── Footer ── */
.footer {
  background: var(--ink);
  color: rgba(244, 241, 234, 0.6);
  text-align: center;
  padding: 2.5rem 2rem;
  font-size: 0.8125rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(244, 241, 234, 0.75);
  font-size: 0.8125rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #3FD0BD;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .screens-row {
    grid-template-columns: repeat(2, 1fr);
    max-width: 520px;
    margin: 0 auto;
  }

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

@media (max-width: 768px) {
  .navbar {
    padding: 0 1.25rem;
  }

  .navbar-right {
    gap: 0.75rem;
  }

  .navbar-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem 1.25rem 1rem;
    gap: 0;
    box-shadow: var(--shadow-lg);
  }

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

  .navbar-links a {
    display: block;
    padding: 12px 0;
    border-bottom: none;
  }

  .navbar-links a.active {
    color: var(--teal);
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    padding: 108px 1.25rem 56px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .hero-tagline {
    font-size: 1.125rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
  }

  .screens,
  .how-inner,
  .features {
    padding: 48px 1.25rem;
  }

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

  .section-title {
    font-size: 1.5rem;
  }

  .page-header {
    padding: 100px 1.25rem 40px;
  }

  .page-header h1 {
    font-size: 1.625rem;
  }

  .content-section {
    padding: 2rem 1.25rem 3rem;
  }

  .contact-card {
    margin: 2rem 0;
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 420px) {
  .screens-row {
    gap: 1rem;
  }

  .screen img {
    border-width: 4px;
    border-radius: 22px;
  }
}
