/* ==========================================
   EDITORRA — Global Design System
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Color tokens */
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-tertiary: #18181b;
  --bg-card: #141416;
  --bg-elevated: #1c1c1f;
  --bg-hover: #222226;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-muted: #52525b;

  --accent: #d4ff3b;
  --accent-hover: #c5f02d;
  --accent-dim: rgba(212, 255, 59, 0.15);
  --accent-glow: rgba(212, 255, 59, 0.4);

  --success: #4ade80;
  --warning: #facc15;
  --error: #f87171;
  --info: #60a5fa;

  /* Gradients */
  --gradient-mesh: radial-gradient(at 20% 30%, rgba(212, 255, 59, 0.08) 0px, transparent 50%),
                   radial-gradient(at 80% 20%, rgba(96, 165, 250, 0.06) 0px, transparent 50%),
                   radial-gradient(at 60% 80%, rgba(212, 255, 59, 0.04) 0px, transparent 50%);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Typography */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', Monaco, monospace;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px rgba(212, 255, 59, 0.15);

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --max-width: 1280px;
}

/* ==========================================
   Reset & Base
   ========================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background atmosphere */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  z-index: 0;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* ==========================================
   Typography
   ========================================== */

.font-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.font-mono {
  font-family: var(--font-mono);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* ==========================================
   Layout
   ========================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .container { padding: 0 var(--space-md); }
}

/* ==========================================
   Navigation
   ========================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 10, 11, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s var(--ease-smooth);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.logo-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), transparent);
}

.logo-mark svg {
  position: relative;
  z-index: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease-smooth);
  position: relative;
}

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

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.mobile-menu-toggle span {
  width: 22px;
  height: 1.5px;
  background: var(--text-primary);
  transition: all 0.3s;
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .mobile-menu-toggle { display: flex; }
  .nav-inner { padding: 1rem; }
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s var(--ease-smooth);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0b;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

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

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

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-lg {
  padding: 1rem 1.75rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
}

/* ==========================================
   Cards
   ========================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all 0.2s var(--ease-smooth);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  transform: translateY(-2px);
}

.card-selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(212, 255, 59, 0.05), transparent);
}

/* ==========================================
   Forms
   ========================================== */

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all 0.2s var(--ease-smooth);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
}

.input::placeholder {
  color: var(--text-muted);
}

.label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  transition: 0.3s var(--ease-smooth);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-secondary);
  border-radius: 50%;
  transition: 0.3s var(--ease-smooth);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translate(18px, -50%);
  background: #0a0a0b;
}

/* ==========================================
   Utility Classes
   ========================================== */

.text-muted { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.hidden { display: none !important; }

/* ==========================================
   Animations
   ========================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 12px transparent; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fade-in { animation: fadeIn 0.5s var(--ease-out); }
.fade-in-up { animation: fadeInUp 0.6s var(--ease-out); }
.scale-in { animation: scaleIn 0.4s var(--ease-out); }

/* Stagger delays */
.delay-1 { animation-delay: 0.05s; animation-fill-mode: backwards; }
.delay-2 { animation-delay: 0.1s; animation-fill-mode: backwards; }
.delay-3 { animation-delay: 0.15s; animation-fill-mode: backwards; }
.delay-4 { animation-delay: 0.2s; animation-fill-mode: backwards; }
.delay-5 { animation-delay: 0.25s; animation-fill-mode: backwards; }
.delay-6 { animation-delay: 0.3s; animation-fill-mode: backwards; }

/* ==========================================
   Toast notifications
   ========================================== */

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  animation: scaleIn 0.3s var(--ease-spring);
}

.toast-success { border-color: rgba(74, 222, 128, 0.3); }
.toast-error { border-color: rgba(248, 113, 113, 0.3); }
.toast-info { border-color: rgba(96, 165, 250, 0.3); }

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-info .toast-icon { color: var(--info); }

/* ==========================================
   Modal
   ========================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s var(--ease-out);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.3s var(--ease-spring);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ==========================================
   Loading states
   ========================================== */

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* ==========================================
   Footer
   ========================================== */

.footer {
  margin-top: 6rem;
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

.footer-brand {
  max-width: 320px;
}

.footer-brand p {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-top: 1rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-col a {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer-bottom .font-mono {
  font-size: 0.75rem;
}

@media (max-width: 600px) {
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* ==========================================
   Scrollbar
   ========================================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover);
}

/* Selection */
::selection {
  background: var(--accent);
  color: #0a0a0b;
}

/* ==========================================
   FORM ALIASES & ADDITIONAL UTILITIES
   ========================================== */

/* form-input/label aliases match .input/.label */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.2s var(--ease-smooth);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
}

.form-input::placeholder { color: var(--text-muted); }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.form-group { margin-bottom: 1.25rem; }

/* eyebrow alias for section-eyebrow */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* CTA helpers used inside .cta-section across pages */
.cta-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.cta-title em {
  font-style: italic;
  color: var(--accent);
}

.cta-subtitle {
  position: relative;
  z-index: 1;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  margin: 1rem auto 2rem;
  max-width: 540px;
}

.cta-buttons {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
