/* ============================================
   AI Route Planner 3D — Full Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;500;600&display=swap');

:root {
  --bg:      #07060f;
  --bg2:     #0e0c1c;
  --bg3:     #151330;
  --bg4:     #1a1836;
  --border:  rgba(120,100,255,0.18);
  --border2: rgba(120,100,255,0.35);
  --purple:  #7c6ff7;
  --purple2: #a78bfa;
  --teal:    #34d399;
  --amber:   #fbbf24;
  --pink:    #f472b6;
  --text:    #e8e6ff;
  --muted:   #8b87b8;
  --font-h:  'Orbitron', monospace;
  --font-b:  'Rajdhani', sans-serif;
  --r:       10px;
  --r2:      16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

/* ---- BG particle canvas ---- */
#bgCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ---- Header ---- */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(7,6,15,0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
header.scrolled { box-shadow: 0 4px 40px rgba(124,111,247,0.12); }
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-h);
  font-size: 18px;
  color: var(--text);
  letter-spacing: 2px;
}
.logo-icon { color: var(--purple2); margin-right: 6px; }
.logo-dot  { color: var(--teal); }
nav { display: flex; gap: 2rem; }
nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 1px;
  font-family: var(--font-h);
  font-size: 11px;
  transition: color 0.2s;
}
nav a:hover { color: var(--purple2); }

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }

/* ---- Hero ---- */
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
#threeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-overlay {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  pointer-events: none;
}
.hero-content { max-width: 600px; }
.hero-badge {
  display: inline-block;
  border: 1px solid var(--border2);
  background: rgba(124,111,247,0.1);
  color: var(--purple2);
  font-family: var(--font-h);
  font-size: 10px;
  letter-spacing: 2px;
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 1.5rem;
}
.hero-content h1 {
  font-family: var(--font-h);
  font-size: clamp(32px, 5vw, 62px);
  line-height: 1.1;
  font-weight: 900;
  margin-bottom: 1.25rem;
  text-shadow: 0 0 40px rgba(124,111,247,0.4);
}
.hero-content .accent { color: var(--purple2); }
.hero-content p { font-size: 18px; color: var(--muted); margin-bottom: 2rem; font-weight: 300; }
.hero-btns {
  display: flex;
  gap: 1rem;
  pointer-events: all;
  flex-wrap: wrap;
}
.btn-primary {
  padding: 13px 30px;
  background: var(--purple);
  color: white;
  border-radius: var(--r);
  text-decoration: none;
  font-family: var(--font-h);
  font-size: 12px;
  letter-spacing: 1px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 20px rgba(124,111,247,0.3);
}
.btn-primary:hover {
  background: #6b5ef0;
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(124,111,247,0.5);
}
.btn-ghost {
  padding: 13px 30px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  text-decoration: none;
  font-family: var(--font-h);
  font-size: 12px;
  letter-spacing: 1px;
  transition: background 0.2s, transform 0.15s;
}
.btn-ghost:hover { background: rgba(124,111,247,0.1); transform: translateY(-2px); }
.hero-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  pointer-events: none;
}
.stat { display: flex; flex-direction: column; }
.stat-n { font-family: var(--font-h); font-size: 22px; color: var(--teal); }
.stat span:last-child { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.stat-div { width: 1px; height: 40px; background: var(--border2); }
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-h);
  letter-spacing: 1px;
  animation: bounce 2s infinite;
  z-index: 2;
}
@keyframes bounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(6px)} }

/* ---- Sections ---- */
.section { padding: 7rem 0; position: relative; z-index: 1; }
.section-dark { background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 3rem; }
.section-tag {
  font-family: var(--font-h);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--purple2);
  margin-bottom: 0.5rem;
}
.section-head h2 {
  font-family: var(--font-h);
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 700;
  color: var(--text);
}
.section-sub { font-size: 15px; color: var(--muted); margin-top: 0.5rem; font-weight: 300; }

/* ---- Two col ---- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 3rem; }
.reveal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}
.reveal-card:hover { border-color: var(--border2); transform: translateY(-3px); }
.card-num {
  font-family: var(--font-h);
  font-size: 48px;
  color: rgba(124,111,247,0.1);
  font-weight: 900;
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  line-height: 1;
}
.reveal-card h3 {
  font-family: var(--font-h);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--purple2);
  margin-bottom: 1rem;
}
.reveal-card p { font-size: 15px; color: var(--muted); font-weight: 300; }
.reveal-card strong { color: var(--text); }
.icon-list { list-style: none; }
.icon-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--muted);
  padding: 6px 0;
  font-weight: 300;
}
.li-icon { color: #f87171; font-size: 13px; }

/* Methodology */
.methodology {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 2rem;
}
.meth-title {
  font-family: var(--font-h);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.meth-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.meth-step {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 18px;
  font-size: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.2s, transform 0.2s;
}
.meth-step:hover { border-color: var(--purple); transform: translateY(-2px); }
.ms-num { font-family: var(--font-h); font-size: 9px; color: var(--purple2); letter-spacing: 1px; }
.meth-arrow { color: var(--purple); font-size: 16px; opacity: 0.6; }

/* ---- Algo cards ---- */
.algo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
}
.algo-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
  animation: fadeUp 0.5s ease both;
  animation-delay: var(--delay, 0s);
}
.algo-card:hover { border-color: var(--border2); transform: translateY(-4px); }
.algo-glow {
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  opacity: 0.15;
  filter: blur(30px);
}
.bfs-glow    { background: #7c6ff7; }
.dfs-glow    { background: #34d399; }
.ucs-glow    { background: #38bdf8; }
.astar-glow  { background: #fbbf24; }
.greedy-glow { background: #f472b6; }
.algo-header { margin-bottom: 10px; }
.algo-tag {
  font-family: var(--font-h);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
  font-weight: 700;
}
.algo-tag.bfs    { background: rgba(124,111,247,0.15); color: #a78bfa; border: 1px solid rgba(124,111,247,0.3); }
.algo-tag.dfs    { background: rgba(52,211,153,0.15);  color: #6ee7b7; border: 1px solid rgba(52,211,153,0.3); }
.algo-tag.ucs    { background: rgba(56,189,248,0.15);  color: #7dd3fc; border: 1px solid rgba(56,189,248,0.3); }
.algo-tag.astar  { background: rgba(251,191,36,0.15);  color: #fcd34d; border: 1px solid rgba(251,191,36,0.3); }
.algo-tag.greedy { background: rgba(244,114,182,0.15); color: #f9a8d4; border: 1px solid rgba(244,114,182,0.3); }
.algo-tag.sm { font-size: 9px; padding: 3px 8px; }
.algo-name {
  font-family: var(--font-h);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text);
  margin: 10px 0 8px;
}
.algo-card p { font-size: 13px; color: var(--muted); line-height: 1.65; margin-bottom: 12px; font-weight: 300; }
.algo-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.met {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  border: 1px solid var(--border);
  font-family: var(--font-h);
  letter-spacing: 0.3px;
}
.met.yes  { color: #6ee7b7; border-color: rgba(52,211,153,0.3); }
.met.ok   { color: #7dd3fc; border-color: rgba(56,189,248,0.3); }
.met.warn { color: #fcd34d; border-color: rgba(251,191,36,0.3); }

/* ---- 3D Demo ---- */
.demo3d-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}
#canvas3d {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  display: block;
  cursor: grab;
  background: var(--bg3);
}
#canvas3d:active { cursor: grabbing; }

/* ---- Controls shared ---- */
.demo3d-controls, .demo2d-controls {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.ctrl-group { display: flex; flex-direction: column; gap: 6px; }
.ctrl-group label {
  font-family: var(--font-h);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
}
.ctrl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
select, input[type="range"] {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-b);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  width: 100%;
}
select:focus, select:hover { border-color: var(--purple); }
input[type="range"] { padding: 4px 0; cursor: pointer; accent-color: var(--purple); }
.algo-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  font-family: var(--font-h);
  font-size: 9px;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg4);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.pill:hover, .pill.active { background: rgba(124,111,247,0.2); border-color: var(--purple); color: var(--purple2); }
.btn-animate, .btn-run {
  background: var(--purple);
  color: white;
  border: none;
  border-radius: var(--r);
  padding: 11px;
  font-family: var(--font-h);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 16px rgba(124,111,247,0.3);
}
.btn-animate:hover, .btn-run:hover {
  background: #6b5ef0;
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(124,111,247,0.5);
}
.btn-reset {
  background: var(--bg4);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px;
  font-family: var(--font-h);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-reset:hover { border-color: var(--border2); color: var(--text); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result3d, .result2d {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  font-size: 13px;
  min-height: 70px;
  line-height: 1.7;
}
.rph { color: var(--muted); font-style: italic; font-size: 12px; }
.legend3d { display: flex; flex-direction: column; gap: 6px; }
.leg { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ldot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ---- 2D Demo ---- */
.demo2d-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}
#canvas2d {
  width: 100%;
  aspect-ratio: 16/7;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  display: block;
  background: var(--bg3);
}

/* ---- Performance Table ---- */
.perf-wrap { overflow-x: auto; }
.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.perf-table th {
  font-family: var(--font-h);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.perf-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(120,100,255,0.08);
  color: var(--muted);
  font-size: 13px;
}
.perf-table td:first-child { color: var(--text); }
.perf-table tr:hover td { background: rgba(124,111,247,0.04); }
.perf-table tr.highlight-row td { background: rgba(251,191,36,0.04); }
.perf-table td.yes { color: var(--teal); }
.perf-table td.no  { color: #f87171; }
.table-note { font-size: 12px; color: var(--muted); margin-top: 10px; font-style: italic; }

/* ---- Apps ---- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.app-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 1.5rem;
  transition: border-color 0.3s, transform 0.3s;
  animation: fadeUp 0.5s ease both;
  animation-delay: var(--delay, 0s);
}
.app-card:hover { border-color: rgba(52,211,153,0.4); transform: translateY(-3px); }
.app-icon { font-size: 28px; margin-bottom: 10px; }
.app-card strong { font-size: 14px; color: var(--text); display: block; margin-bottom: 5px; font-family: var(--font-h); letter-spacing: 0.5px; }
.app-card p { font-size: 13px; color: var(--muted); font-weight: 300; }
.impact-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.impact-card {
  background: rgba(52,211,153,0.06);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--r2);
  padding: 2rem;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.5px;
  transition: transform 0.3s;
  animation: fadeUp 0.5s ease both;
  animation-delay: var(--delay, 0s);
}
.impact-card:hover { transform: translateY(-3px); }
.impact-n { font-family: var(--font-h); font-size: 32px; color: var(--teal); margin-bottom: 6px; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  position: relative;
  z-index: 1;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeUp 0.7s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.25s; }
.delay-3 { animation-delay: 0.4s; }

.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-up.visible { opacity: 1; transform: translateY(0); }
.reveal-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s;
}
.reveal-card.visible { opacity: 1; transform: translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .two-col, .demo3d-wrap, .demo2d-wrap { grid-template-columns: 1fr; }
  .apps-grid, .impact-row { grid-template-columns: 1fr 1fr; }
  #canvas3d { aspect-ratio: 4/3; }
}
@media (max-width: 600px) {
  nav { display: none; }
  .apps-grid, .impact-row { grid-template-columns: 1fr; }
  .meth-flow { flex-direction: column; align-items: flex-start; }
  .meth-arrow { transform: rotate(90deg); }
  .hero-stats { flex-wrap: wrap; }
}
