/* ═══════════════════════════════════════════════════
   Digestible History — Main Stylesheet
   ═══════════════════════════════════════════════════ */

:root {
  --bg:           #F5EDD8;
  --bg-card:      #FBF7EF;
  --bg-dark:      #1A0E05;
  --text-dark:    #1A0E05;
  --text-mid:     #5C4A35;
  --text-light:   #8C7B6A;
  --amber:        #B5651D;
  --amber-light:  #D4924A;
  --border:       rgba(26,14,5,0.12);
  --shadow:       0 4px 24px rgba(26,14,5,0.10);
  --shadow-lg:    0 12px 48px rgba(26,14,5,0.16);
  --radius:       14px;
  --nav-h:        68px;
  --max:          1160px;

  /* Section accent colors */
  --c-presidents:    #1B2A4A;
  --c-states:        #1B4A2A;
  --c-timeline:      #4A1B1B;
  --c-frontpage:     #1B3A4A;
  --c-landmarks:     #3A2A10;
  --c-furthered:     #2A1B4A;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ── Typography ───────────────────────────────────── */
h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2rem,5vw,3.25rem); line-height: 1.15; font-weight: 700; }
h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.5rem,3vw,2.25rem); line-height: 1.2; font-weight: 700; }
h3 { font-family: Georgia, 'Times New Roman', serif; font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 600; }
p  { color: var(--text-mid); }

/* ── Utility ─────────────────────────────────────── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 20px;
  background: rgba(181,101,29,.12); color: var(--amber); margin-bottom: 12px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; border-radius: 100px; font-weight: 600;
  font-size: 15px; cursor: pointer; transition: all .2s;
}
.btn-dark {
  background: var(--bg-dark); color: #fff;
}
.btn-dark:hover { background: #2C1810; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-amber {
  background: var(--amber); color: #fff;
}
.btn-amber:hover { background: var(--amber-light); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline {
  border: 2px solid var(--bg-dark); color: var(--bg-dark);
}
.btn-outline:hover { background: var(--bg-dark); color: #fff; }

/* ── App Store Badge ──────────────────────────────── */
.app-store-badge img { height: 48px; width: auto; border-radius: 8px; transition: transform .2s, opacity .2s; }
.app-store-badge:hover img { transform: translateY(-2px); opacity: .9; }

/* ── Navigation ─────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-dark);
  height: var(--nav-h);
  display: flex; align-items: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.nav .container { display: flex; align-items: center; gap: 32px; width: 100%; }
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-family: Georgia, serif; font-size: 17px; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}
.nav-logo img {
  width: 34px; height: 34px; border-radius: 8px;
}
.nav-logo .placeholder-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--amber); display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.nav-menu {
  display: flex; align-items: center; gap: 4px; list-style: none; flex: 1;
}
.nav-menu a {
  color: rgba(255,255,255,.75); font-size: 13.5px; font-weight: 500;
  padding: 7px 11px; border-radius: 7px; transition: all .2s; white-space: nowrap;
}
.nav-menu a:hover, .nav-menu a.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-cta { margin-left: auto; flex-shrink: 0; }
.nav-cta a {
  background: var(--amber); color: #fff; font-size: 13px; font-weight: 600;
  padding: 8px 18px; border-radius: 100px; transition: all .2s;
}
.nav-cta a:hover { background: var(--amber-light); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  background: none; border: none; padding: 4px; margin-left: auto;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: all .3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Image Placeholders ──────────────────────────── */
.img-placeholder {
  background: #EDE5D4; border: 2px dashed #C4B49A;
  border-radius: var(--radius); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  padding: 32px 20px; text-align: center; color: var(--text-light); min-height: 200px;
}
.img-placeholder .ph-icon { font-size: 36px; }
.img-placeholder strong { color: var(--text-mid); font-size: 13px; }
.img-placeholder span { font-size: 11px; font-family: monospace; background: rgba(0,0,0,.06); padding: 2px 8px; border-radius: 4px; }

.phone-frame {
  width: 260px; flex-shrink: 0;
  background: var(--bg-dark); border-radius: 38px;
  padding: 12px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.05);
  position: relative; overflow: hidden;
}
.phone-frame::before {
  content: ''; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 80px; height: 10px; background: #0A0602; border-radius: 100px; z-index: 2;
}
.phone-screen {
  background: var(--bg); border-radius: 26px; overflow: hidden;
  width: 100%; height: 512px; position: relative;
}
.phone-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone-screen .img-placeholder { border-radius: 26px; height: 100%; min-height: 0; font-size: 12px; }

/* ── Hero (Home) ─────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  background: linear-gradient(135deg, #F5EDD8 0%, #EDE0C4 100%);
}
.hero .container { display: flex; align-items: center; gap: 60px; }
.hero-text { flex: 1; }
.hero-text h1 { margin-bottom: 16px; }
.hero-text .subtitle {
  font-size: 1.1rem; color: var(--text-mid); margin-bottom: 32px; max-width: 480px; line-height: 1.7;
}
.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-phone { flex-shrink: 0; }

/* ── Section Hero ────────────────────────────────── */
.section-hero {
  padding: 72px 0 60px; color: #fff;
}
.section-hero h1 { color: #fff; }
.section-hero p { color: rgba(255,255,255,.8); font-size: 1.1rem; max-width: 560px; margin-top: 12px; }
.section-hero .container { display: flex; align-items: center; gap: 48px; }
.section-hero-text { flex: 1; }
.section-hero-phone { flex-shrink: 0; }

/* ── Feature Strip ───────────────────────────────── */
.features-strip { padding: 72px 0; }
.features-strip h2 { text-align: center; margin-bottom: 12px; }
.features-strip .intro { text-align: center; max-width: 560px; margin: 0 auto 48px; color: var(--text-mid); }
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.feature-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow);
  border: 1px solid var(--border); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column; gap: 10px;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-card .card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 4px;
}
.feature-card h3 { margin: 0; }
.feature-card p { font-size: 14px; flex: 1; }
.feature-card a { font-size: 13px; font-weight: 600; color: var(--amber); margin-top: 4px; }
.feature-card a:hover { text-decoration: underline; }

/* ── Screenshots Section ─────────────────────────── */
.screenshots { padding: 72px 0; background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.screenshots h2 { text-align: center; margin-bottom: 40px; }
.screenshots-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 200px;
  justify-content: center;
  gap: 24px;
}
.screenshots-row > .phone-frame {
  width: 200px;
}
.screenshots-row > .phone-frame > .phone-screen {
  aspect-ratio: unset;
  height: 380px;
}

/* ── Feature List ────────────────────────────────── */
.feature-list { padding: 72px 0; }
.feature-list .container { display: flex; gap: 60px; align-items: flex-start; }
.feature-list-text { flex: 1; }
.feature-list-text h2 { margin-bottom: 24px; }
.feature-list-items { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.feature-item { display: flex; gap: 14px; }
.feature-item .fi-icon {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px;
  background: rgba(181,101,29,.12); display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.feature-item strong { display: block; margin-bottom: 2px; }
.feature-item p { font-size: 14px; }
.feature-list-visual { flex-shrink: 0; }

/* ── Stats Bar ───────────────────────────────────── */
.stats-bar { background: var(--bg-dark); padding: 48px 0; color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; text-align: center; }
.stat-item .stat-num {
  font-family: Georgia, serif; font-size: 2.5rem; font-weight: 700; color: var(--amber-light); line-height: 1;
}
.stat-item .stat-label { font-size: 13px; color: rgba(255,255,255,.65); margin-top: 6px; }

/* ── CTA Section ─────────────────────────────────── */
.cta-section {
  padding: 80px 0; text-align: center;
  background: linear-gradient(135deg, var(--bg) 0%, #EDE0C4 100%);
}
.cta-section h2 { margin-bottom: 12px; }
.cta-section p { color: var(--text-mid); margin-bottom: 32px; font-size: 1.05rem; }
.cta-section .cta-actions { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* ── Section Nav Cards (home) ────────────────────── */
.section-nav { padding: 72px 0; }
.section-nav h2 { text-align: center; margin-bottom: 8px; }
.section-nav .intro { text-align: center; color: var(--text-mid); margin-bottom: 40px; }
.section-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.section-card {
  border-radius: var(--radius); padding: 28px 22px; color: #fff;
  display: flex; flex-direction: column; gap: 8px; min-height: 160px;
  position: relative; overflow: hidden; cursor: pointer; transition: transform .2s;
  text-decoration: none;
}
.section-card:hover { transform: translateY(-3px); }
.section-card::after {
  content: '→'; position: absolute; bottom: 20px; right: 20px;
  font-size: 20px; opacity: .6; transition: all .2s;
}
.section-card:hover::after { opacity: 1; right: 16px; }
.section-card .sc-icon { font-size: 28px; margin-bottom: 4px; }
.section-card h3 { color: #fff; font-size: 1.1rem; }
.section-card p { color: rgba(255,255,255,.75); font-size: 13px; }
.section-card.presidents { background: var(--c-presidents); }
.section-card.states     { background: var(--c-states); }
.section-card.timeline   { background: var(--c-timeline); }
.section-card.frontpage  { background: var(--c-frontpage); }
.section-card.landmarks  { background: var(--c-landmarks); }
.section-card.furthered  { background: var(--c-furthered); }

/* ── Privacy / Support Pages ─────────────────────── */
.text-page { padding: 64px 0; max-width: 720px; margin: 0 auto; }
.text-page h1 { margin-bottom: 32px; }
.text-page h2 { font-size: 1.2rem; margin: 32px 0 10px; }
.text-page p, .text-page li { color: var(--text-mid); margin-bottom: 10px; }
.text-page ul { padding-left: 20px; }
.text-page a { color: var(--amber); }
.support-email {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg-dark); color: #fff; padding: 14px 28px;
  border-radius: 100px; font-weight: 600; margin: 16px 0; font-size: 15px;
  transition: background .2s;
}
.support-email:hover { background: #2C1810; }
.faq-item { background: var(--bg-card); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 12px; border: 1px solid var(--border); }
.faq-item strong { display: block; margin-bottom: 6px; }

/* ── Footer ──────────────────────────────────────── */
footer {
  background: var(--bg-dark); color: rgba(255,255,255,.65);
  padding: 52px 0 32px;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3,1fr); gap: 32px; margin-bottom: 40px; }
.footer-brand .nav-logo { margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.6; max-width: 240px; }
.footer-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul a { color: rgba(255,255,255,.55); font-size: 13.5px; transition: color .2s; }
.footer-col ul a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { font-size: 12.5px; }
.footer-bottom .app-store-badge img { height: 36px; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2,1fr); }
  .section-cards { grid-template-columns: repeat(2,1fr); }
  .stats-grid { grid-template-columns: repeat(2,2fr); gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .feature-list .container { flex-direction: column; }
}
@media (max-width: 700px) {
  .nav-menu, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav-menu.open {
    display: flex; flex-direction: column; align-items: flex-start;
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: #0F0804; padding: 16px 24px 24px; gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
  }
  .nav-menu.open + .nav-cta { display: none; }

  .hero .container { flex-direction: column; text-align: center; }
  .hero-phone { display: none; }
  .hero-actions { justify-content: center; }

  .section-hero .container { flex-direction: column; }
  .section-hero-phone { display: none; }

  .features-grid { grid-template-columns: 1fr; }
  .section-cards { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .screenshots-row { grid-auto-flow: row; grid-auto-columns: unset; grid-template-columns: repeat(2, 150px); gap: 12px; }
  .screenshots-row > .phone-frame { width: 150px; }
  .screenshots-row > .phone-frame > .phone-screen { height: 285px; }
}
