/* ==========================================================================
   csdad.us — core stylesheet
   Dark neon / terminal aesthetic. Palette is locked: only use the tokens below.
   ========================================================================== */

:root {
  --bg-dark: #0A192F;
  --bg-raised: #0F2240;
  --bg-panel: rgba(15, 34, 64, 0.72);
  --text-dark: #E0F7FA;
  --text-muted: #8FA9C2;
  --accent: #64FFDA;
  --glow: #A7FFEB;
  --line: rgba(100, 255, 218, 0.18);
  --line-strong: rgba(100, 255, 218, 0.4);

  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  --sans: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --content-max: 960px;
  --nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg-dark);
  color: var(--text-dark);
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--glow); }

::selection { background: rgba(100, 255, 218, 0.25); }

/* Themed thin scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 255, 218, 0.25); border-radius: 3px; }
::-webkit-scrollbar-button { width: 0; height: 0; }
html { scrollbar-width: thin; scrollbar-color: rgba(100, 255, 218, 0.25) transparent; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 2000;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--bg-dark);
  font-family: var(--mono);
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Background canvas ---------- */

canvas#particles {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Custom cursor (fine pointers only, toggled by JS) ---------- */

#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--glow);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, width 0.2s ease, height 0.2s ease;
  opacity: 0;
}

body.has-custom-cursor,
body.has-custom-cursor * { cursor: none; }
body.has-custom-cursor a,
body.has-custom-cursor button { cursor: pointer; }

/* ---------- Nav ---------- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

.site-nav.scrolled {
  background: rgba(10, 25, 47, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.nav-inner {
  width: 100%;
  max-width: calc(var(--content-max) + 160px);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
  letter-spacing: 0.02em;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a .num { color: var(--accent); margin-right: 4px; }
.nav-links a:hover,
.nav-links a.active { color: var(--accent); background: rgba(100, 255, 218, 0.06); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 6px 10px;
}

/* ---------- Layout ---------- */

main {
  position: relative;
  z-index: 2;
}

.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 96px 24px 32px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 32px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dark);
}
.section-title .num { color: var(--accent); font-weight: 400; }

.lead { color: var(--text-muted); max-width: 680px; margin: -12px 0 32px; }

/* ---------- Hero ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
  padding-bottom: 48px;
}

.hero-kicker {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.95rem;
  margin: 0 0 16px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.08;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.hero h2 {
  font-size: clamp(1.4rem, 3.6vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 28px;
  color: var(--text-muted);
  font-weight: 600;
}

.prompt {
  font-family: var(--mono);
  font-size: clamp(0.9rem, 2.2vw, 1.1rem);
  color: var(--text-dark);
  min-height: 1.8em;
  margin: 0 0 28px;
}
.prompt .ps1 { color: var(--accent); }
.prompt .caret {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-summary {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 36px;
}
.hero-summary strong { color: var(--text-dark); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg-dark);
  transition: transform 0.2s, box-shadow 0.3s, background 0.2s, color 0.2s;
}
.btn:hover {
  color: var(--bg-dark);
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(167, 255, 235, 0.45);
}
.btn.outline { background: transparent; color: var(--accent); }
.btn.outline:hover { background: rgba(100, 255, 218, 0.08); color: var(--accent); }

.scroll-hint {
  margin-top: 64px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------- Panels ---------- */

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}
.about-text p { margin: 0 0 16px; color: var(--text-muted); }
.about-text strong { color: var(--text-dark); font-weight: 600; }

.terminal { overflow: hidden; font-family: var(--mono); font-size: 0.85rem; }
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.75rem;
}
.terminal-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.terminal-bar span { margin-left: 8px; }
.terminal-body { padding: 16px; line-height: 1.8; }
.terminal-body .k { color: var(--accent); }
.terminal-body .c { color: var(--text-muted); }
.terminal-body dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; }
.terminal-body dt { color: var(--accent); }
.terminal-body dd { margin: 0; color: var(--text-dark); }

/* ---------- Experience ---------- */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line-strong);
}

.job { position: relative; padding-left: 36px; margin-bottom: 28px; }
.job::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 22px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 2px solid var(--accent);
}
.job.current::before { background: var(--accent); box-shadow: 0 0 10px var(--glow); }

.job .panel { padding: 20px 22px; }
.job-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 4px;
}
.job h3 { margin: 0; font-size: 1.1rem; }
.job h3 .at { color: var(--accent); }
.job .meta { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); }
.job ul { margin: 12px 0 14px; padding-left: 18px; color: var(--text-muted); }
.job li { margin-bottom: 6px; }
.job li::marker { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid var(--line);
  background: rgba(100, 255, 218, 0.05);
  padding: 3px 8px;
  border-radius: 3px;
}

.also { font-size: 0.9rem; color: var(--text-muted); padding-left: 36px; margin: 0; }
.also b { color: var(--text-dark); font-weight: 600; }

/* ---------- Projects ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 22px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.project:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.project.featured { grid-column: 1 / -1; }

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.project-top .links { display: flex; gap: 12px; letter-spacing: 0.04em; text-transform: none; }
.project-top .private { color: var(--text-muted); }

.project h3 { margin: 0 0 8px; font-size: 1.2rem; }
.project p { margin: 0 0 14px; color: var(--text-muted); font-size: 0.95rem; }
.project .chips { margin-top: auto; }

.project details {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.project summary {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  list-style: none;
}
.project summary::-webkit-details-marker { display: none; }
.project summary::before { content: '+ '; }
.project details[open] summary::before { content: '- '; }
.project details ul { margin: 10px 0 0; padding-left: 18px; }
.project details li { margin-bottom: 6px; }
.project details li::marker { color: var(--accent); }

/* ---------- Skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.skill-group { padding: 20px; }
.skill-group h3 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.skill-group ul { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; color: var(--text-muted); }
.skill-group li { padding: 3px 0; }
.skill-group li::before { content: '▹ '; color: var(--accent); }

/* ---------- Education ---------- */

.edu { padding: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.edu h3 { margin: 0 0 4px; font-size: 1.1rem; }
.edu p { margin: 0; color: var(--text-muted); }
.edu .meta { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Contact ---------- */

.contact { text-align: center; padding-bottom: 96px; }
.contact .section-title { display: inline-flex; }
.contact h3 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 12px; }
.contact p { color: var(--text-muted); max-width: 520px; margin: 0 auto 32px; }
.contact .actions { justify-content: center; }

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px 16px 32px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--line);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Scroll reveal ---------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 404 ---------- */

.not-found {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
}
.not-found h1 { font-family: var(--mono); font-size: clamp(4rem, 16vw, 7rem); color: var(--accent); margin: 0; }
.not-found p { color: var(--text-muted); font-family: var(--mono); margin: 0 0 32px; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 8px; font-size: 0.9rem; }
  .site-nav.menu-open { background: var(--bg-dark); border-bottom-color: var(--line); }

  .nav-inner { padding: 0 16px; }
  .section { padding: 72px 16px 24px; }
  .projects-grid,
  .skills-grid { grid-template-columns: 1fr; }
  .job { padding-left: 28px; }
  .also { padding-left: 28px; }
  .job .panel, .project, .skill-group, .edu { padding: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .prompt .caret { animation: none; }
  .btn, .project { transition: none; }
}
