/* DraftX — Shared Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,300;1,9..144,400&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* ── CSS Variables — Light (default) ───────────────── */
:root {
  --bg:          #f7f5f0;
  --bg-2:        #f0ede6;
  --bg-card:     #ffffff;
  --border:      rgba(0,0,0,0.08);
  --border-glow: rgba(180,140,0,0.22);

  --accent:      #c49a00;       /* warm gold, darkened for light bg */
  --accent-dim:  rgba(196,154,0,0.10);
  --accent-glow: rgba(196,154,0,0.25);

  --text:        #1a1814;
  --text-muted:  #8a8478;
  --text-mid:    #4a4640;

  --nav-bg:      rgba(247,245,240,0.80);

  --font-display: 'Fraunces', Georgia, serif;
  --font-mono:    'DM Mono', 'Fira Code', monospace;

  --radius:      14px;
  --radius-lg:   22px;
  --transition:  0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Dark mode — via system preference ─────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0c0c0f;
    --bg-2:        #111116;
    --bg-card:     #16161d;
    --border:      rgba(255,255,255,0.07);
    --border-glow: rgba(255,220,120,0.18);

    --accent:      #f5c842;
    --accent-dim:  rgba(245,200,66,0.12);
    --accent-glow: rgba(245,200,66,0.28);

    --text:        #f0ede6;
    --text-muted:  #7a7870;
    --text-mid:    #b0ab9e;

    --nav-bg:      rgba(12,12,15,0.80);
  }
}

/* ── Dark mode — forced via data-theme="dark" ───────── */
[data-theme="dark"] {
  --bg:          #0c0c0f;
  --bg-2:        #111116;
  --bg-card:     #16161d;
  --border:      rgba(255,255,255,0.07);
  --border-glow: rgba(255,220,120,0.18);

  --accent:      #f5c842;
  --accent-dim:  rgba(245,200,66,0.12);
  --accent-glow: rgba(245,200,66,0.28);

  --text:        #f0ede6;
  --text-muted:  #7a7870;
  --text-mid:    #b0ab9e;

  --nav-bg:      rgba(12,12,15,0.80);
}

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

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Grain Overlay ──────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 180px;
  opacity: 0.028;
  mix-blend-mode: overlay;
}

/* ── Page fade-in ───────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeUp 0.7s ease both; }
.fade-in-1 { animation: fadeUp 0.7s 0.05s ease both; }
.fade-in-2 { animation: fadeUp 0.7s 0.15s ease both; }
.fade-in-3 { animation: fadeUp 0.7s 0.25s ease both; }
.fade-in-4 { animation: fadeUp 0.7s 0.38s ease both; }
.fade-in-5 { animation: fadeUp 0.7s 0.52s ease both; }

/* ── Navigation ─────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--transition);
}

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

/* ── Footer ─────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-logo span { color: var(--accent); }

.footer-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--accent); }

.footer-copy {
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.5;
  width: 100%;
}

/* ── Prose Pages (privacy, terms) ───────────────────── */
.prose-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 8rem 2rem 5rem;
}

.prose-page h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.prose-page .subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  margin-bottom: 3rem;
}

.prose-page h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
  margin: 2.5rem 0 0.8rem;
}

.prose-page p {
  color: var(--text-mid);
  font-size: 0.92rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}

.prose-page ul {
  margin: 0.5rem 0 1rem 1.2rem;
}

.prose-page li {
  color: var(--text-mid);
  font-size: 0.92rem;
  line-height: 1.85;
  margin-bottom: 0.3rem;
}

/* ── App Store Button ───────────────────────────────── */
.btn-appstore {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent);
  color: #0c0c0f;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.75rem 1.6rem;
  border-radius: 50px;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: 0 0 0 0 var(--accent-glow);
}

.btn-appstore:hover {
  background: #f7d460;
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-2px);
}

/* ── Card ───────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: border-color var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
}

/* ── Divider ─────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ── Responsive nav ─────────────────────────────────── */
@media (max-width: 640px) {
  .nav { padding: 1rem 1.25rem; }
  .nav-links { gap: 1.2rem; }
  .footer { padding: 2rem 1.25rem; }
  .prose-page { padding: 7rem 1.25rem 4rem; }
}

/* Smooth theme transition */
body, .nav, .card, .btn-appstore {
  transition-property: background-color, border-color, color;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}
