/* ===========================================================
   Ayush Singh — Personal Site
   Design: dark, aurora-accented, glass cards, data-flavored
   =========================================================== */

:root {
  --bg: #05070d;
  --bg-2: #0a0f1c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e6ebf5;
  --muted: #8a93a6;
  --dim: #5b6478;
  --accent: #5eead4;        /* teal */
  --accent-2: #a78bfa;      /* purple */
  --accent-3: #38bdf8;      /* sky */
  --warn: #fbbf24;
  --danger: #f87171;
  --ok: #34d399;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Aurora background */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(94, 234, 212, 0.10), transparent 60%),
    radial-gradient(700px 500px at 85% 20%, rgba(167, 139, 250, 0.10), transparent 60%),
    radial-gradient(800px 500px at 50% 100%, rgba(56, 189, 248, 0.08), transparent 60%);
  z-index: -2;
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  z-index: -1;
  pointer-events: none;
}

/* Layout */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; position: relative; }
.section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--accent);
  display: inline-block;
}
.section-heading {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 48px;
  letter-spacing: -0.02em;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(5, 7, 13, 0.6);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: #05070d;
  font-weight: 800;
  font-family: var(--sans);
  font-size: 13px;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
  font-family: var(--mono);
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.nav-cta {
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}
.nav-links a.nav-cta:hover {
  background: var(--accent);
  color: #05070d;
}
@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* Hero */
.hero {
  padding: 120px 0 80px;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.hero-title {
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 20px;
  background: linear-gradient(120deg, #fff 0%, #fff 40%, var(--accent) 65%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 36px;
}
.hero-sub strong { color: var(--text); font-weight: 500; }
.hero-cta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-bottom: 60px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 500;
}
.btn-primary {
  background: var(--accent);
  color: #05070d;
}
.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(94, 234, 212, 0.3);
}
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.stat {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s;
}
.stat:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.stat-num {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}
.card:hover { border-color: var(--border-strong); background: var(--surface-strong); }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.skill-card h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-family: var(--mono);
  margin: 0 0 16px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.22);
  color: var(--accent);
  transition: all 0.2s;
}
.chip:hover { background: rgba(94, 234, 212, 0.18); transform: translateY(-1px); }
.chip.purple { background: rgba(167, 139, 250, 0.08); border-color: rgba(167, 139, 250, 0.22); color: var(--accent-2); }
.chip.sky { background: rgba(56, 189, 248, 0.08); border-color: rgba(56, 189, 248, 0.22); color: var(--accent-3); }

/* Experience timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 10px; bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), transparent);
}
.exp-item { position: relative; margin-bottom: 40px; }
.exp-item::before {
  content: "";
  position: absolute;
  left: -28px; top: 8px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.5);
}
.exp-role {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}
.exp-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.exp-meta .dot { color: var(--dim); }
.exp-co { color: var(--accent); }
.exp-item ul { margin: 0; padding-left: 18px; }
.exp-item li { margin-bottom: 8px; color: var(--muted); }
.exp-item li strong { color: var(--text); font-weight: 500; }

/* Tools section */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.tool-card {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(94, 234, 212, 0.04));
  opacity: 0;
  transition: opacity 0.3s;
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.tool-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.18), rgba(167, 139, 250, 0.18));
  border: 1px solid var(--border);
  display: grid; place-items: center;
  margin-bottom: 20px;
  font-size: 22px;
}
.tool-card h3 { margin: 0 0 8px; font-size: 19px; font-weight: 600; }
.tool-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-tags span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}
.tool-arrow {
  position: absolute;
  top: 28px; right: 28px;
  color: var(--dim);
  transition: all 0.2s;
}
.tool-card:hover .tool-arrow { color: var(--accent); transform: translate(3px, -3px); }

/* Awards + Education */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.award-item, .edu-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.award-item:last-child, .edu-item:last-child { border-bottom: none; }
.award-item h4, .edu-item h4 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.award-item p, .edu-item p { margin: 0; color: var(--muted); font-size: 14px; font-family: var(--mono); }

/* Contact */
.contact-card { text-align: center; padding: 56px 28px; }
.contact-card h2 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; letter-spacing: -0.02em; }
.contact-card p { color: var(--muted); margin: 0 0 28px; font-size: 17px; }
.contact-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* Footer */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--dim);
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
}

/* ------------- Tool pages ------------- */
.tool-page { padding-top: 40px; }
.tool-header {
  margin-bottom: 36px;
}
.back-link {
  font-family: var(--mono);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }
.tool-header h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.tool-header p { color: var(--muted); margin: 0; max-width: 680px; }

.panel {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}
@media (max-width: 900px) { .panel { grid-template-columns: 1fr; } }

.control-group { margin-bottom: 22px; }
.control-group:last-child { margin-bottom: 0; }
.control-group label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.control-group label .value {
  float: right;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
}
input[type="range"] {
  width: 100%;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(94, 234, 212, 0.5);
  transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}
input[type="number"], input[type="text"], select, textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  transition: border-color 0.2s;
}
input[type="number"]:focus, input[type="text"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 100px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.metric {
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.metric-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.metric-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.metric-value.warn { color: var(--warn); }
.metric-value.ok { color: var(--ok); }
.metric-value.danger { color: var(--danger); }

.chart-wrap {
  position: relative;
  height: 420px;
  margin-top: 10px;
}

.result-banner {
  padding: 16px 20px;
  border-radius: 10px;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 14px;
  border: 1px solid;
}
.result-banner.success {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--ok);
}
.result-banner.warn {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--warn);
}
.result-banner.danger {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--danger);
}

.tool-notes {
  margin-top: 32px;
  padding: 20px;
  background: rgba(167, 139, 250, 0.04);
  border-left: 2px solid var(--accent-2);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  color: var(--muted);
}
.tool-notes strong { color: var(--text); }
.tool-notes code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(255,255,255,0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* canvas click feedback */
#kmeans-canvas { cursor: crosshair; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); width: 100%; display: block; }

.legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
