/* Geography - Flag Quiz Master landing site
   Palette derived from app icon: bright globe blue + flag-chip red/yellow/green */

:root {
  --blue: #1273e6;
  --blue-deep: #0b4fa8;
  --blue-ink: #0a2e5c;
  --red: #d63430;
  --yellow: #f5b82e;
  --green: #14904f;
  --bg: #f7fafd;
  --surface: #ffffff;
  --text: #1c2b3a;
  --text-soft: #48586b;
  --line: #d9e4f0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 79, 168, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #4a9bf5;
    --blue-deep: #2f7fe0;
    --blue-ink: #dce9f9;
    --bg: #0d1622;
    --surface: #16232f;
    --text: #e6edf5;
    --text-soft: #a4b4c6;
    --line: #2a3b4e;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --yellow: #f8c65a;
    --green: #2fb56f;
    --red: #ef6560;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1.0625rem;
}

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

a { color: var(--blue-deep); }
a:hover { color: var(--blue); }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue-deep);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav-links {
  display: flex;
  gap: 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--blue); }
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 1.15rem;
  color: var(--text);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.8rem 1.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-store {
  background: var(--blue-ink);
  color: #fff;
  line-height: 1.2;
}
@media (prefers-color-scheme: dark) {
  .btn-store { background: #08192e; border: 1px solid var(--line); }
}
.btn-store:hover { color: #fff; box-shadow: var(--shadow); }
.btn-store .small { display: block; font-size: 0.68rem; font-weight: 500; opacity: 0.85; }
.btn-store .big { display: block; font-size: 1.05rem; }
.btn-ghost {
  border: 2px solid var(--blue);
  color: var(--blue-deep);
}

/* Hero */
.hero {
  padding: 3.5rem 0 3rem;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(18, 115, 230, 0.18), transparent 60%),
    radial-gradient(600px 320px at 0% 110%, rgba(245, 184, 46, 0.14), transparent 60%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-deep);
  background: rgba(18, 115, 230, 0.12);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
h1 .accent { color: var(--blue); }
.hero p.lede {
  font-size: 1.15rem;
  color: var(--text-soft);
  margin: 0 0 1.6rem;
  max-width: 34rem;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }
.hero-note { font-size: 0.85rem; color: var(--text-soft); margin-top: 0.9rem; }

/* Hero screenshot (real App Store screenshot) */
.hero-shot {
  margin: 0 auto;
  max-width: 300px;
}
.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  background: #0d1116;
}
.hero-shot figcaption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 0.9rem;
}

/* Screenshot strip: scrolls on mobile, becomes a row on wider screens */
.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 240px);
  gap: 1.2rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.9rem;
  -webkit-overflow-scrolling: touch;
}
.shots:focus-visible { outline-offset: 6px; }
.shot {
  margin: 0;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0d1116;
}
.shot figcaption { margin-top: 0.85rem; }
.shot figcaption strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-deep);
  margin-bottom: 0.3rem;
}
.shot figcaption span {
  display: block;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.5;
}
@media (min-width: 861px) {
  .shots {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-columns: auto;
    overflow-x: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
  }
}

/* Sections */
section { padding: 3.5rem 0; }
section h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}
.section-intro { color: var(--text-soft); max-width: 40rem; margin: 0 0 2rem; }
.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.alt .card { background: var(--bg); }
.card h3 { margin: 0.4rem 0 0.5rem; font-size: 1.1rem; }
.card p { margin: 0; color: var(--text-soft); font-size: 0.97rem; }
.chip {
  display: inline-block;
  width: 34px; height: 24px;
  border-radius: 6px;
}
.chip-red { background: var(--red); }
.chip-yellow { background: var(--yellow); }
.chip-green { background: var(--green); }
.chip-blue { background: var(--blue); }

/* Problem / solution */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.split ul { padding-left: 1.2rem; color: var(--text-soft); }
.split li { margin-bottom: 0.55rem; }
.split li strong { color: var(--text); }

/* Stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
  margin-top: 2rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 0.6rem;
}
.stat .num { font-size: 1.6rem; font-weight: 800; color: var(--blue-deep); display: block; }
.stat .lbl { font-size: 0.82rem; color: var(--text-soft); }

/* FAQ accordion */
.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 0.8rem;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  padding: 1rem 1.2rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-q .icon { color: var(--blue); font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.faq-a { padding: 0 1.2rem 1.1rem; color: var(--text-soft); margin: 0; }
.faq-item[data-open="false"] .faq-a { display: none; }
.no-js .faq-a { display: block !important; }

/* Guides list */
.guide-card h3 a { text-decoration: none; color: var(--text); }
.guide-card h3 a:hover { color: var(--blue); }
.read-more { font-weight: 700; font-size: 0.9rem; text-decoration: none; }

/* Footer */
.site-footer {
  background: var(--blue-ink);
  color: #cddcf0;
  padding: 2.5rem 0 2rem;
  margin-top: 2rem;
}
@media (prefers-color-scheme: dark) {
  .site-footer { background: #08131f; border-top: 1px solid var(--line); }
}
.site-footer a { color: #ffffff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 0.7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; font-size: 0.93rem; }
.footer-meta {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 1.2rem;
  font-size: 0.85rem;
  color: #9db4d1;
}

/* Guide article pages */
.breadcrumb {
  font-size: 0.88rem;
  color: var(--text-soft);
  padding: 1.1rem 0 0;
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 0.4rem; color: var(--text-soft); }
article.guide { max-width: 760px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
article.guide h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
article.guide h2 { font-size: 1.45rem; margin-top: 2.2rem; }
article.guide h3 { font-size: 1.15rem; margin-top: 1.6rem; }
article.guide p, article.guide li { color: var(--text); }
article.guide .meta { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 1.5rem; }
article.guide blockquote {
  border-left: 4px solid var(--yellow);
  margin: 1.5rem 0;
  padding: 0.6rem 1.2rem;
  background: var(--surface);
  border-radius: 0 10px 10px 0;
  color: var(--text-soft);
}
.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  margin: 2rem 0;
}
.callout h2, .callout h3 { margin-top: 0.2rem; }
.related { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1.5rem; }
.related ul { padding-left: 1.2rem; }

table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: 0.95rem; }
th, td { border: 1px solid var(--line); padding: 0.55rem 0.75rem; text-align: left; }
th { background: var(--surface); }

/* Responsive */
@media (max-width: 860px) {
  .hero-grid, .split, .footer-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero-shot { margin-top: 1.6rem; max-width: 260px; }
}

@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 1.25rem 1.2rem;
    gap: 0.9rem;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
}
