@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600&display=swap&font-display=swap');

/* ── Direction J — Better Draft. ─────────────────────────
   Paper:  cream galley-proof (#FAF6EC)
   Ink:    warm near-black (#141412)
   Accent: editor's red (#C8362E)
   Display: Newsreader  |  Body: Courier Prime  |  UI: Inter
   ─────────────────────────────────────────────────────── */

/* ── Light mode (default) ──────────────────────────────── */
:root {
  --bg-deep:       #FAF6EC;
  --bg-primary:    #FAF6EC;
  --bg-elevated:   #FFFBF0;
  --bg-surface:    #F1ECE0;
  --bg-hover:      #EDE8DB;
  --border:        #E6DDC8;
  --border-light:  #CFC3A8;
  --border-strong: #CFC3A8;
  --text-primary:  #141412;
  --text-secondary:#3D3A34;
  --text-tertiary: #7A7267;
  --text-muted:    #ACA497;
  --accent:        #C8362E;
  --accent-light:  #D4564E;
  --accent-hover:  #A82820;
  --accent-dim:    rgba(200, 54, 46, 0.15);
  --accent-glow:   rgba(200, 54, 46, 0.08);
  --accent-soft:   rgba(200, 54, 46, 0.08);
  --page-bg:       #FFFBF0;
  --page-shadow:   0 1px 3px rgba(20,20,18,0.03), 0 1px 8px rgba(20,20,18,0.04);
  --red:           #C8362E;
  --green:         #27AE60;
  --font-display:  'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-body:     'Courier Prime', 'Courier New', monospace;
  --font-ui:       'Inter', system-ui, sans-serif;
  --font-script:   'Courier Prime', 'Courier New', monospace;
  --font-mono:     'Courier Prime', 'Courier New', monospace;
  --radius:        3px;
  --radius-lg:     4px;
  --shadow:        0 1px 3px rgba(20,20,18,0.03), 0 1px 8px rgba(20,20,18,0.04);
  --transition:    0.15s ease;
}

/* ── Dark mode ─────────────────────────────────────────── */
html.dark {
  --bg-deep:       #14120E;
  --bg-primary:    #14120E;
  --bg-elevated:   #1C1915;
  --bg-surface:    #0E0C09;
  --bg-hover:      #252218;
  --border:        #2A2720;
  --border-light:  #433D32;
  --border-strong: #433D32;
  --text-primary:  #F3EEDF;
  --text-secondary:#C8C0AE;
  --text-tertiary: #928973;
  --text-muted:    #5A5443;
  --accent:        #E85F57;
  --accent-light:  #F17B74;
  --accent-hover:  #F17B74;
  --accent-dim:    rgba(232, 95, 87, 0.2);
  --accent-glow:   rgba(232, 95, 87, 0.14);
  --accent-soft:   rgba(232, 95, 87, 0.14);
  --page-bg:       #1C1915;
  --page-shadow:   0 2px 16px rgba(0,0,0,0.5);
  --red:           #E85F57;
  --green:         #5CB87A;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
}

*, *::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-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  letter-spacing: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Typography */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.08;
  color: var(--text-primary);
  font-optical-sizing: auto;
}
h1 { font-size: 2.5rem; }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.3rem); }
h1 em, h2 em { font-style: italic; color: var(--accent); font-weight: 500; }

a { color: var(--text-primary); text-decoration: none; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* UI chrome uses Inter */
nav, button, input, select, textarea, label, .btn, .chip, .tag {
  font-family: var(--font-ui);
}

/* Buttons — sharp-cornered like letterpress blocks */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  outline: none;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-elevated);
  border: 1px solid var(--text-primary);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-elevated);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong, var(--border));
}
.btn-ghost:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid transparent;
}
.btn-danger:hover {
  background: rgba(192, 57, 43, 0.1);
  border-color: var(--red);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong, var(--border));
}
.btn-secondary:hover {
  border-color: var(--text-primary);
}
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* ── Direction J: Wordmark ───────────────────────────────── */
.logo {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  font-size: 1.35rem !important;
  letter-spacing: -0.015em !important;
  color: var(--text-primary) !important;
  white-space: nowrap;
  display: inline-block;
  line-height: 1;
  text-decoration: none !important;
}
.logo .bd-dot, .bd-dot { color: var(--accent) !important; font-weight: 500; margin-left: 1px; }
.logo span:not(.bd-dot) { color: var(--text-primary); }

/* ── Direction J: Nav ────────────────────────────────────── */
.landing-nav, .pricing-nav, .support-nav, nav[class*="-nav"], .legal-nav {
  border-bottom: 1px solid var(--border) !important;
  background: var(--bg-deep) !important;
  backdrop-filter: none !important;
}
.nav-links, .nav-link-item { font-family: var(--font-ui) !important; }
.nav-links { gap: 1.75rem !important; }
.nav-links a, .nav-link-item {
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
}
.nav-links a:hover, .nav-link-item:hover { color: var(--accent) !important; }

/* ── Direction J: Hero ───────────────────────────────────── */
.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.6rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.025em !important;
  font-weight: 500 !important;
}
.hero-tag {
  font-family: var(--font-ui) !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase;
  color: var(--text-tertiary, var(--text-muted)) !important;
  background: transparent !important;
  border: none !important;
  padding: 0 0 8px 0 !important;
  border-radius: 0 !important;
}
.hero-sub {
  font-family: var(--font-body) !important;
  font-size: clamp(0.95rem, 1.35vw, 1.05rem) !important;
  line-height: 1.7 !important;
  max-width: 58ch;
  color: var(--text-secondary) !important;
  position: relative;
  padding-left: 18px;
  text-align: left;
}
.hero-sub::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--accent);
  opacity: 0.85;
}

/* ── Direction J: Cards ──────────────────────────────────── */
.auth-card, .pricing-card, .feature-card, .step, .card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(20,20,18,0.03), 0 1px 3px rgba(20,20,18,0.03);
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent) !important;
  box-shadow: 0 4px 16px rgba(20,20,18,0.08) !important;
}

/* ── Direction J: Raw inputs (not .input class) ──────────── */
input, textarea, select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-primary);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft, var(--accent-glow));
}

/* ── Direction J: Footer ─────────────────────────────────── */
footer, .site-footer { border-top: 1px solid var(--border); }

/* ── Direction J: Eyebrow / small labels ─────────────────── */
.eyebrow, .label-small, .section-label, [class*="eyebrow"] {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary, var(--text-muted));
}

/* Inputs */
.input, .textarea, .select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft, var(--accent-glow));
}
.input::placeholder, .textarea::placeholder {
  color: var(--text-muted);
}
.textarea { resize: vertical; min-height: 80px; }

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge-accent {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  max-width: 380px;
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Utility */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }

/* Context badges */
.context-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.context-badge {
  font-size: 0.72rem; padding: 3px 8px;
  border-radius: 12px; font-weight: 500;
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid var(--accent-dim);
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow);
}
.modal h3 { margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
