/* ═══════════════════════════════════════════════════════════
   CARRIER TOKENS — Shared design system for carrierfile.ai

   Linked by both index.html (landing/generator) and tuner.html.
   Change a value here → both pages update.
   ═══════════════════════════════════════════════════════════ */

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

/* ---- TRANSITION ---- */
:root { --transition: 0.3s ease; }

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef0f4;
  --text-primary: #1a1d23;
  --text-secondary: #5a5f6b;
  --text-tertiary: #8b909c;
  --border: #e2e4ea;
  --border-subtle: #eef0f4;
  --accent: #4a6cf7;
  --accent-soft: #eef1fe;
  --accent-text: #3654d4;
  --accent-hover: #3b5ce6;
  --code-bg: #f0f2f6;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  --success: #2d8a4e;
  --success-bg: #ecfdf5;
  --nav-bg: rgba(247,248,250,0.85);
  --toggle-bg: #e2e4ea;
  --toggle-knob: #ffffff;
  --glow: transparent;
  --dot-color: rgba(0,0,0,0.07);
  --pupil: #1a1d23;
  /* Slider tokens (used by tuner) */
  --slider-track: #e2e4ea;
  --slider-fill: #4a6cf7;
  --slider-thumb: #ffffff;
  --slider-thumb-border: #4a6cf7;
  --slider-thumb-shadow: 0 1px 4px rgba(74,108,247,0.3);
}

/* ── DARK THEME ── */
[data-theme="dark"] {
  --bg: #0f1319;
  --bg-elevated: #181d27;
  --bg-subtle: #1e2433;
  --text-primary: #e4e7ed;
  --text-secondary: #9ba1b0;
  --text-tertiary: #6b7185;
  --border: #2a3142;
  --border-subtle: #1e2433;
  --accent: #6b8aff;
  --accent-soft: rgba(107,138,255,0.1);
  --accent-text: #8ca4ff;
  --accent-hover: #5a7aef;
  --code-bg: #1e2433;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.15);
  --success: #4ade80;
  --success-bg: rgba(74,222,128,0.1);
  --nav-bg: rgba(15,19,25,0.85);
  --toggle-bg: #2a3142;
  --toggle-knob: #e4e7ed;
  --glow: rgba(107,138,255,0.03);
  --dot-color: rgba(255,255,255,0.05);
  --pupil: #1a1d23;
  /* Slider tokens (used by tuner) */
  --slider-track: #2a3142;
  --slider-fill: #6b8aff;
  --slider-thumb: #181d27;
  --slider-thumb-border: #6b8aff;
  --slider-thumb-shadow: 0 1px 4px rgba(107,138,255,0.3);
}

/* ── TYPOGRAPHY ── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle, var(--dot-color) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* ── NAV — unified header for all pages ── */
nav,
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 40px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
}

.nav-logo {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.035em;
  transition: color var(--transition);
}

.nav-logo .nav-accent {
  color: var(--accent);
  font-weight: 800;
}

.nav-separator {
  color: var(--text-tertiary);
  font-weight: 300;
  font-size: 1.3rem;
  margin: 0 0.15rem;
}

.nav-page {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
}

.nav-right,
.header-right {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a,
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.nav-cta:hover { opacity: 0.9; color: #fff; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 44px;
  height: 24px;
  background: var(--toggle-bg);
  border-radius: 12px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--toggle-knob);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(20px);
}

.theme-toggle-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  line-height: 1;
  transition: opacity var(--transition);
}

.sun-icon { left: 5px; opacity: 1; }
.moon-icon { right: 5px; opacity: 0.5; }
[data-theme="dark"] .sun-icon { opacity: 0.5; }
[data-theme="dark"] .moon-icon { opacity: 1; }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  padding: 13px 28px;
  border-radius: 10px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-ghost,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--text-secondary);
  padding: 13px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover,
.btn-secondary:hover {
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

/* Gradient CTA variant */
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-gradient {
  background: linear-gradient(90deg, var(--accent), #6d8dfa, #1e3a8a, var(--accent));
  background-size: 300% 100%;
  animation: gradient-shift 6s ease-in-out infinite;
  color: #fff;
  border: none;
}

/* ── CARDS ── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: var(--card-shadow);
  transition: background var(--transition), border-color var(--transition);
}

.card-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  transition: color var(--transition);
}

/* ── SECTION LABELS ── */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  transition: color var(--transition);
}

/* ── CODE / MONOSPACE ── */
code,
.code-inline {
  background: var(--code-bg);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  color: var(--accent-text);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

/* ── LOGO ICON ── */
.logo-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 8px;
}

.logo-icon svg {
  width: 28px;
  height: 28px;
}

/* ── FOOTER ── */
footer,
.site-footer {
  text-align: center;
  padding: 32px 40px;
  border-top: 3px solid var(--border);
  transition: border-color var(--transition);
}

footer p,
.site-footer p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  transition: color var(--transition);
}

footer a,
.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

/* ── MODAL (shared pattern) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.modal input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-subtle);
  margin-bottom: 1rem;
}

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

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ── TOOL SWITCHER — shared between Builder and Tuner ── */
.tool-switcher {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--transition);
}
.tool-switcher a,
.tool-switcher span {
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.4;
  white-space: nowrap;
}
.tool-switcher .tool-active {
  background: var(--accent);
  color: #fff;
}
.tool-switcher .tool-inactive {
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.tool-switcher .tool-inactive:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── TOOL FOOTER — shared action bar for Builder and Tuner ── */
.tool-footer-bar {
  display: flex;
  align-items: center;
  border-top: 3px solid var(--border);
  background: var(--bg);
  z-index: 10;
  transition: background var(--transition), border-color var(--transition);
}

/* ── RESPONSIVE — shared breakpoints ── */
@media (max-width: 600px) {
  nav,
  .site-header { padding: 14px 20px; }
  footer,
  .site-footer { padding: 28px 20px; }
  .tool-switcher a,
  .tool-switcher span { padding: 0.25rem 0.5rem; font-size: 0.7rem; }
}
