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

:root {
  --bg: #04070f;
  --surface: #0a0f1e;
  --surface2: #101828;
  --surface3: #161e30;
  --accent: #00e5b0;
  --accent-dim: rgba(0,229,176,0.12);
  --accent2: #f97316;
  --accent3: #818cf8;
  --text: #e2e8f4;
  --muted: #5a6580;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(0,229,176,0.2);
  --glow: 0 0 60px rgba(0,229,176,0.12);
  --radius: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: 0.5;
}

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(4,7,15,0.9);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; letter-spacing: 3px;
  color: var(--accent); text-decoration: none;
}
.nav-logo span { color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: 0.78rem; font-weight: 600;
  padding: 0.45rem 0.85rem; border-radius: 4px;
  transition: all 0.2s; letter-spacing: 0.04em;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--accent); background: var(--accent-dim); }
.nav-back {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--muted); text-decoration: none;
  font-size: 0.78rem; font-weight: 600;
  padding: 0.45rem 0.85rem; border-radius: 4px;
  transition: all 0.2s;
}
.nav-back:hover { color: var(--accent); }
.nav-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; color: var(--accent);
  border: 1px solid rgba(0,229,176,0.25);
  padding: 0.2rem 0.6rem; border-radius: 20px;
  letter-spacing: 0.1em;
}
.nav-settings-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 0.6rem;
}
.nav-settings-btn:hover { color: var(--text); border-color: var(--border-hover); }

/* PAGE WRAPPER */
.page { position: relative; z-index: 1; padding-top: 4.5rem; min-height: 100vh; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: 'Syne', sans-serif; font-weight: 700;
  border: none; border-radius: var(--radius);
  cursor: pointer; transition: all 0.2s; letter-spacing: 0.04em;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: var(--bg);
  padding: 0.75rem 1.75rem; font-size: 0.85rem;
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(0,229,176,0.35); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--text);
  padding: 0.75rem 1.75rem; font-size: 0.85rem;
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--accent); }
.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.78rem; }
.btn-orange { background: var(--accent2); color: #fff; }
.btn-orange:hover { box-shadow: 0 0 30px rgba(249,115,22,0.3); transform: translateY(-1px); }

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s;
}
.card:hover { border-color: var(--border-hover); }

/* INPUTS */
.input-field {
  width: 100%;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  padding: 0.7rem 1rem; font-family: 'Syne', sans-serif;
  font-size: 0.85rem; outline: none; transition: border-color 0.2s;
}
.input-field:focus { border-color: rgba(0,229,176,0.35); background: var(--surface3); }
.input-field::placeholder { color: var(--muted); }
select.input-field option { background: var(--surface2); }
textarea.input-field { resize: vertical; min-height: 90px; }

label.field-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 0.4rem;
}

/* SECTION LABELS */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; color: var(--accent);
  letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 0.6rem;
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.5rem); line-height: 1;
}
.section-sub { color: var(--muted); font-size: 0.9rem; line-height: 1.7; font-weight: 400; margin-top: 0.75rem; }

/* YC SOURCE BADGE */
.yc-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(249,115,22,0.1); border: 1px solid rgba(249,115,22,0.2);
  color: var(--accent2); border-radius: 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
  padding: 0.25rem 0.65rem; letter-spacing: 0.08em;
}

/* SOURCE CITATION */
.source-cite {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.75rem 1rem; margin-top: 0.5rem;
  background: rgba(249,115,22,0.06); border-left: 2px solid var(--accent2);
  border-radius: 0 4px 4px 0; font-size: 0.78rem; color: var(--muted);
  line-height: 1.5;
}
.source-cite strong { color: var(--accent2); }

/* TYPING INDICATOR */
.typing-dots { display: flex; gap: 5px; padding: 0.5rem 0; }
.typing-dots span {
  width: 7px; height: 7px;
  background: var(--accent); border-radius: 50%;
  animation: tdot 1s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tdot { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-7px); opacity: 1; } }

/* ANIMATIONS */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }

.anim-up { animation: fadeUp 0.5s ease both; }
.anim-up-1 { animation: fadeUp 0.5s ease 0.1s both; }
.anim-up-2 { animation: fadeUp 0.5s ease 0.2s both; }
.anim-up-3 { animation: fadeUp 0.5s ease 0.3s both; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }

/* GRID BACKGROUND */
.grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(0,229,176,0.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0,229,176,0.025) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 0%, black 0%, transparent 80%);
}

/* SETTINGS MODAL */
.lm-settings {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  z-index: 2000;
}
.lm-settings.open { display: flex; }
.lm-backdrop {
  position: absolute; inset: 0;
  background: rgba(4,7,15,0.75);
  backdrop-filter: blur(6px);
}
.lm-modal {
  position: relative;
  width: min(520px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lm-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.lm-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem; letter-spacing: 0.06em;
}
.lm-modal-close {
  background: transparent; border: none; color: var(--muted);
  font-size: 1.2rem; cursor: pointer;
}
.lm-modal-close:hover { color: var(--text); }
.lm-modal-body { display: flex; flex-direction: column; gap: 0.5rem; }
.lm-modal-actions {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  margin-top: 1rem;
}
.lm-hint {
  font-size: 0.7rem; color: var(--muted); margin-top: 0.2rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav { padding: 0.9rem 1.2rem; }
  .nav-links { display: none; }
}
