/* Glippin Toys — design system
 * Static-site styles, mobile-first, no JS, no framework.
 * Single shared stylesheet across the hub + all app pages.
 */

:root {
  --color-bg: #FAFAF9;
  --color-bg-elev: #FFFFFF;
  --color-surface: #F4F4F2;
  --color-text: #1F2937;
  --color-text-muted: #6B7280;
  --color-border: #E5E7EB;
  --color-primary: #4F46E5;
  --color-primary-hover: #4338CA;
  --color-accent: #F59E0B;
  --color-success: #059669;
  --color-warn: #D97706;
  --color-danger: #DC2626;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --max-content: 1140px;
  --max-prose: 680px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0F172A;
    --color-bg-elev: #1E293B;
    --color-surface: #1E293B;
    --color-text: #F1F5F9;
    --color-text-muted: #94A3B8;
    --color-border: #334155;
    --color-primary: #818CF8;
    --color-primary-hover: #A5B4FC;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 120ms ease;
}
a:hover { color: var(--color-primary-hover); }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); margin-top: 0; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

code, pre {
  font-family: var(--font-mono);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}
code { padding: 0.1em 0.35em; font-size: 0.92em; }
pre { padding: 1rem; overflow-x: auto; }
pre code { padding: 0; background: transparent; }

/* ── Layout ───────────────────────────────────────────────────────────── */

.container {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.prose {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

section { padding: var(--space-2xl) 0; }
section.tight { padding: var(--space-xl) 0; }

/* ── Navigation ───────────────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 249, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}
@media (prefers-color-scheme: dark) {
  .site-nav { background: rgba(15, 23, 42, 0.85); }
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--color-text); }
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
}

.nav-links {
  display: none;
  gap: 1.5rem;
  font-size: 0.95rem;
}
.nav-links a {
  color: var(--color-text-muted);
  font-weight: 500;
}
.nav-links a:hover { color: var(--color-text); }
@media (min-width: 640px) {
  .nav-links { display: flex; }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  text-align: center;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-md);
}
.hero h1 {
  margin-bottom: var(--space-md);
  background: linear-gradient(120deg, var(--color-text) 30%, var(--color-primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  max-width: 620px;
  margin: 0 auto var(--space-lg);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 120ms ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-surface);
  color: var(--color-text);
}
.btn-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Feature cards ────────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
@media (min-width: 720px)  { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards.cards-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card .icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--color-text-muted); font-size: 0.95rem; }

/* ── App grid (used on hub) ───────────────────────────────────────────── */

.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
@media (min-width: 640px)  { .app-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .app-grid { grid-template-columns: repeat(3, 1fr); } }

.app-card {
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
  color: var(--color-text);
}
.app-card .app-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}
.app-card .app-name {
  font-weight: 700;
  font-size: 1.1rem;
}
.app-card .app-tagline {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.app-card .app-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  width: max-content;
}
.app-card .app-badge.live {
  background: color-mix(in srgb, var(--color-success) 14%, transparent);
  color: var(--color-success);
}
.app-card .app-badge.preview {
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
  color: var(--color-warn);
}

/* ── App page hero ───────────────────────────────────────────────────── */

.app-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
  padding: var(--space-2xl) 0 var(--space-xl);
}
@media (min-width: 800px) {
  .app-hero { grid-template-columns: 120px 1fr; gap: var(--space-lg); text-align: left; }
}
.app-hero .big-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 3rem;
  letter-spacing: -0.04em;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 800px) { .app-hero .big-icon { margin: 0; } }
.app-hero h1 { margin-bottom: var(--space-sm); }
.app-hero p.lead {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

/* ── Pricing tiers ────────────────────────────────────────────────────── */

.pricing {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
@media (min-width: 720px)  { .pricing { grid-template-columns: repeat(3, 1fr); } }

.tier {
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}
.tier.featured {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
.tier h3 { margin-bottom: 0.5rem; }
.tier .price {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: var(--space-sm) 0;
}
.tier .price .period {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
}
.tier ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}
.tier ul li {
  padding: 0.35rem 0;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.tier ul li::before {
  content: "✓";
  color: var(--color-success);
  font-weight: 700;
}

/* ── Store badges ─────────────────────────────────────────────────────── */

.store-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  background: #1F2937;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease;
}
.store-badge:hover {
  background: #111827;
  color: white;
  transform: translateY(-1px);
}
.store-badge .small {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}
.store-badge .big {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
}
.store-badge.disabled {
  background: var(--color-surface);
  color: var(--color-text-muted);
  pointer-events: none;
}

/* ── Section heading ──────────────────────────────────────────────────── */

.section-head {
  text-align: center;
  margin-bottom: var(--space-md);
}
.section-head .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.section-head h2 { margin-bottom: 0.5rem; }
.section-head p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2xl);
  padding: var(--space-lg) 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  text-align: center;
}
@media (min-width: 720px) {
  .site-footer .container { flex-direction: row; justify-content: space-between; text-align: left; }
}
.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a { color: var(--color-text-muted); }
.footer-links a:hover { color: var(--color-text); }

/* ── Prose pages (privacy / terms) ────────────────────────────────────── */

.prose-page {
  padding: var(--space-xl) 0 var(--space-2xl);
}
.prose-page h1 { margin-bottom: var(--space-md); }
.prose-page h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
}
.prose-page h3 {
  margin-top: var(--space-lg);
  margin-bottom: 0.5rem;
}
.prose-page p, .prose-page li {
  color: var(--color-text);
  font-size: 1rem;
}
.prose-page table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: 0.95rem;
}
.prose-page th, .prose-page td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.prose-page th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.meta-line {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-lg);
}

/* ── Utility ──────────────────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-lg) 0;
  border: none;
}
