/* Times Tables Expert – site stylesheet
   Replaces Bootstrap (TTE-0044 Phase 2a). Dark identity, no framework. */

:root {
  --bg: #121820;
  --bg-raised: #1a2230;
  --bg-card: #1c2534;
  --border: #2b3648;
  --text: #e8edf4;
  --text-muted: #9fadc0;
  --accent: #4da3ff;
  --accent-strong: #1f7ae0;
  --green: #4caf93;
  --orange: #e8963c;
  --radius: 14px;
  --maxw: 960px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

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

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

/* ---------- Header / Nav ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(18, 24, 32, 0.92);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding: 64px 0 48px;
}

.hero .app-icon {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  margin: 24px 0 8px;
  letter-spacing: -0.01em;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 28px;
}

.store-badge img { height: 54px; width: auto; }

.hero .platform-note {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Sections ---------- */

section { padding: 40px 0; }

section h2 {
  font-size: 1.6rem;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

section .lead { color: var(--text-muted); max-width: 700px; }

/* Trust cards */

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.trust-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.trust-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.trust-card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* Feature rows (screenshot + text) */

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
  padding: 28px 0;
}

.feature-row.reverse .feature-media { order: 2; }

.feature-media { text-align: center; }

.feature-media img {
  max-height: 480px;
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
}

.feature-copy h2, .feature-copy h3 { margin-top: 0; }
.feature-copy p { color: var(--text-muted); }

@media (max-width: 720px) {
  .feature-row { grid-template-columns: 1fr; }
  .feature-row.reverse .feature-media { order: 0; }
  .feature-media img { max-height: 420px; }
}

/* Generic card / panel */

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin: 18px 0;
}

/* ---------- Legal pages ---------- */

.legal { padding: 48px 0 64px; }
.legal h1 { font-size: 1.7rem; line-height: 1.3; }
.legal h2 { font-size: 1.2rem; margin-top: 32px; }
.legal h3 { font-size: 1.05rem; margin-top: 24px; }
.legal p, .legal li { color: var(--text-muted); }
.legal strong { color: var(--text); }
.legal .last-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.legal address { font-style: normal; color: var(--text-muted); }

/* ---------- Press ---------- */

.press-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 24px;
  margin: 0;
}
.press-facts div { padding: 6px 0; border-bottom: 1px solid var(--border); }
.press-facts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.press-facts dd { margin: 2px 0 0; color: var(--text); }

.deck-frame {
  width: 100%;
  height: 70vh;
  min-height: 480px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.asset-grid figure { margin: 0; text-align: center; }
.asset-grid img {
  border-radius: 12px;
  border: 1px solid var(--border);
  max-height: 300px;
  width: auto;
}
.asset-grid figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }

.btn {
  display: inline-block;
  background: var(--accent-strong);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
}
.btn:hover { background: var(--accent); text-decoration: none; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg-card); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 28px 0 40px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- Utilities ---------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
