/* ==========================================================================
   PEBBLE — SITE DESIGN SYSTEM
   Shares the PPMB house layout with nownote.ppmb.org; the palette is Pebble's
   own, taken from DESIGN.md §2 so the page and the app read as one thing.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Light — paper & ink (DESIGN.md §2) */
  --bg-page: #fbfbfa;   /* paper   */
  --bg-card: #ffffff;   /* card    */
  --bg-subtle: #f2f1ec;

  --text-main: #1e1e1e;  /* ink   */
  --text-muted: #5c5c58; /* ink2  */
  --text-faint: #8e8e88; /* ink3  */

  --border: rgba(30, 30, 30, 0.10);        /* rule       */
  --border-hover: rgba(30, 30, 30, 0.20);  /* ruleStrong */

  --accent: #e06d53;      /* terracotta — today, and the one primary action */
  --accent-text: #ffffff;
  
  --shadow-preview: 0 20px 50px -15px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.03);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  /* Serif carries names — the wordmark and headlines — exactly as in the app. */
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, ui-serif, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  /* Dark — the same tokens, dark column */
  --bg-page: #14151a;   /* paper dark */
  --bg-card: #1b1d22;   /* card dark  */
  --bg-subtle: #24262c;

  --text-main: #ecebe7;  /* ink dark  */
  --text-muted: #a3a29c; /* ink2 dark */
  --text-faint: #77776f; /* ink3 dark */

  --border: rgba(255, 255, 255, 0.10);
  --border-hover: rgba(255, 255, 255, 0.18);

  --accent: #e8836b;      /* terracotta dark */
  --accent-text: #14151a;
  
  --shadow-preview: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.15);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.2);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Layout Container */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  padding: 1.75rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-icon {
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.nav-links a {
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-main);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  color: var(--text-main);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
:root:not([data-theme="dark"]) .sun-icon { display: none; }
:root:not([data-theme="dark"]) .moon-icon { display: block; }

/* Main Hero */
.main-content {
  flex: 1;
}

.hero {
  text-align: center;
  padding: 4rem 1.5rem 2rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.55;
  margin-bottom: 2.25rem;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  justify-content: center;
  margin-bottom: 3.5rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition), opacity var(--transition);
}

.btn-download:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-download:active {
  transform: translateY(0);
}

/* Hero Preview Mockup */
.hero-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 4.5rem;
}

.preview-img {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-preview);
}

/* 3 Pillars Grid */
.pillars {
  padding: 1rem 1.5rem 4.5rem;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition);
}

.pillar-card:hover {
  border-color: var(--border-hover);
}

.pillar-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.6rem;
}

.pillar-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Footer */
.site-footer {
  padding: 2.5rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-separator {
  color: var(--text-faint);
  opacity: 0.5;
}

.copyright {
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* Legal & Support Subpages */
.legal-page {
  padding: 3rem 0 5rem;
  flex: 1;
}

.legal-header {
  margin-bottom: 2.5rem;
}

.legal-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.legal-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legal-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.legal-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.legal-content ul,
.legal-content ol {
  margin-left: 1.25rem;
  margin-bottom: 1.25rem;
}

.legal-content li {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.4rem;
}

.legal-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-subtle);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-card);
}

.contact-card h2 {
  margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .pillar-grid {
    grid-template-columns: 1fr;
  }
  
  .hero {
    padding-top: 2.5rem;
  }
  
  .preview-img {
    max-width: 280px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}


/* --------------------------------------------------------------------------
   Pebble additions — the app's voice: serif for names, mono for measures.
   -------------------------------------------------------------------------- */
.brand-name,
.hero-title,
.pillar-card h3,
.legal-title { font-family: var(--font-serif); letter-spacing: -0.01em; }

.brand-name { letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.95rem; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.1rem;
}

/* Not a link: Pebble is not on the App Store yet, and a dead button is worse
   than an honest sentence. */
.cta-pending {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  padding: 0.7rem 1.4rem;
}
