/* ============================================================================
   AstroMap-web — folha de estilo compartilhada
   Tokens espelhados 1:1 do design system iOS (fonte de verdade):
     Core/DesignSystem/Color+AstroMap.swift
     Core/DesignSystem/Font+AstroMap.swift
   Conversão: hex = round(componente_sRGB * 255). Float-fonte em comentário.
   ============================================================================ */

/* ----------------------------- Design tokens (2.1) ------------------------- */
:root {
  /* Backgrounds */
  --astro-bg:       #0D0D26;  /* Color(0.05, 0.05, 0.15) */
  --astro-surface:  #1A1A38;  /* Color(0.10, 0.10, 0.22) */
  --astro-elevated: #242447;  /* Color(0.14, 0.14, 0.28) */

  /* Brand accents */
  --astro-gold:     #F0C46B;  /* Color(0.94, 0.77, 0.42) */
  --astro-violet:   #8C40D9;  /* Color(0.55, 0.25, 0.85) — Ba Zi */
  --astro-midnight: #1F1A4D;  /* Color(0.12, 0.10, 0.30) */

  /* Text */
  --astro-text:     #FFFFFF;  /* Color.white */
  --astro-text-2:   #A6A6A6;  /* Color(white: 0.65) */
  --astro-text-3:   #737373;  /* Color(white: 0.45) */

  /* Semantic */
  --astro-offline:  #40404D;  /* Color(0.25, 0.25, 0.30) */
  --astro-error:    #E64D4D;  /* Color(0.90, 0.30, 0.30) */
  --astro-success:  #40C780;  /* Color(0.25, 0.78, 0.50) */
  --astro-warning:  #F2A626;  /* Color(0.95, 0.65, 0.15) */

  /* Typography — serif em títulos, sans no corpo (espelha .serif / .default) */
  --font-display: Georgia, "Times New Roman", "Noto Serif", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Type scale 34/24/18/16/15/14/13/12 px -> rem (base 16, preserva zoom) */
  --fs-display:   2.125rem;  /* 34 — astroMapDisplay (bold serif) */
  --fs-title:     1.5rem;    /* 24 — astroMapTitle (bold serif) */
  --fs-headline:  1.125rem;  /* 18 — astroMapHeadline (semibold) */
  --fs-subhead:   0.9375rem; /* 15 — astroMapSubheadline (medium) */
  --fs-body:      1rem;      /* 16 — astroMapBody */
  --fs-body-sm:   0.875rem;  /* 14 — astroMapBodySmall */
  --fs-label:     0.8125rem; /* 13 — astroMapLabel (medium) */
  --fs-caption:   0.75rem;   /* 12 — astroMapCaption */

  /* Layout */
  --space: 1rem;
  --maxw: 1120px;
  --radius: 14px;
  --tap: 44px; /* alvo de toque mínimo (a11y) */
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--astro-bg);
  color: var(--astro-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--astro-text);
}
h1 { font-size: var(--fs-display); }
h2 { font-size: var(--fs-title); }
h3 { font-size: var(--fs-headline); font-family: var(--font-body); }

a { color: var(--astro-gold); }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* Foco visível em todos os elementos interativos (9.1) */
:focus-visible {
  outline: 3px solid var(--astro-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip-link para navegação por teclado (9.1) */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--astro-gold);
  color: var(--astro-bg);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* ----------------------------- Header (2.2) -------------------------------- */
.site-header {
  background: var(--astro-surface);
  border-bottom: 1px solid var(--astro-elevated);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  min-height: var(--tap);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.site-header .brand {
  font-family: var(--font-display);
  font-size: var(--fs-headline);
  font-weight: 700;
  color: var(--astro-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 0.25rem;
  color: var(--astro-text-2);
  text-decoration: none;
  font-size: var(--fs-body-sm);
}
.site-nav a:hover { color: var(--astro-text); text-decoration: underline; }

/* ----------------------------- Footer (2.2) -------------------------------- */
.site-footer {
  background: var(--astro-surface);
  border-top: 1px solid var(--astro-elevated);
  color: var(--astro-text-2);
  font-size: var(--fs-body-sm);
  margin-top: 3rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--astro-gold);
}
.site-footer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

main { padding-top: 2rem; padding-bottom: 2rem; }

/* ----------------------------- Responsivo (2.2, mobile-first 3.3) ---------- */
/* Base = mobile (<=480px). Ajustes progressivos abaixo. */
@media (min-width: 481px) {
  .site-footer .container { flex-wrap: nowrap; }
}
@media (min-width: 768px) {
  :root { --space: 1.5rem; }
  h1 { font-size: 2.5rem; }
}
@media (min-width: 1280px) {
  .container { padding-left: 2rem; padding-right: 2rem; }
}

/* ----------------------------- Buttons ------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--tap);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--astro-elevated);
  background: var(--astro-surface);
  color: var(--astro-text);
  text-decoration: none;
  font-size: var(--fs-body);
  font-weight: 600;
}
.btn:hover { border-color: var(--astro-gold); text-decoration: none; }
.btn-primary {
  background: var(--astro-gold);
  color: var(--astro-bg);
  border-color: var(--astro-gold);
}
.placeholder-tag {
  font-size: var(--fs-caption);
  color: var(--astro-warning);
  font-weight: 400;
}

/* ----------------------------- Hero (3.1) --------------------------------- */
.hero { padding: 2.5rem 0; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--fs-label);
  color: var(--astro-gold);
  margin: 0 0 0.25rem;
}
.lede { font-size: var(--fs-headline); color: var(--astro-text-2); max-width: 56ch; }
.app-icon {
  border-radius: 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  display: block;
}
.hero-art { justify-self: center; }

/* ----------------------------- Features (3.1) ----------------------------- */
.features { padding: 2rem 0; }
.feature-grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.card {
  background: var(--astro-surface);
  border: 1px solid var(--astro-elevated);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card h3 { margin-top: 0; color: var(--astro-gold); }
.note { color: var(--astro-text-2); font-size: var(--fs-body-sm); margin-top: 1.5rem; }

/* ----------------------------- Download + QR (3.2) ------------------------ */
.download { padding: 2rem 0; }
.store-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.store {
  background: var(--astro-surface);
  border: 1px solid var(--astro-elevated);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.store img { background: var(--astro-bg); border-radius: 8px; }
.store-label { font-weight: 600; margin: 0.75rem 0 0.5rem; }
.store .btn { width: 100%; flex-wrap: wrap; }

/* ----------------------------- Responsivo: landing ------------------------ */
@media (min-width: 768px) {
  .hero-grid { grid-template-columns: 1.4fr 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .store-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1280px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
