/* ===========================================================
   DESIGN TOKENS
   =========================================================== */
:root {
  --bg:            #06090F;
  --bg-alt:        #0B1019;
  --surface:       #0D131C;
  --hairline:      #1B2330;
  --text:          #E7ECF3;
  --text-muted:    #8792A3;
  --text-faint:    #4C5567;

  --accent:            #FFB020; /* signal amber — brand + security */
  --accent-security:   #FFB020;
  --accent-networking: #4FC3F5;
  --accent-database:   #9D7BFF;
  --accent-hardware:   #4CD97B;
  --accent-research:   #FF7597;

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --max-width: 860px;
  --radius: 3px;
}

/* ===========================================================
   RESET / BASE
   =========================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text);
}

h2 { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--text-muted); max-width: 68ch; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

ul { padding-left: 1.1em; color: var(--text-muted); }
li { margin-bottom: 0.4em; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #06090F; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ===========================================================
   HEADER / NAV
   =========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(6, 9, 15, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.wordmark {
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  color: var(--text); letter-spacing: 0.02em;
}
.wordmark:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; gap: 28px; align-items: center; }
.site-nav a {
  color: var(--text-muted); font-size: 0.94rem; font-weight: 500;
  position: relative; padding: 4px 0;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px;
  background: var(--accent); transition: right 0.2s ease;
}
.site-nav a:hover::after { right: 0; }
.nav-cta { color: var(--accent) !important; }

.nav-toggle {
  display: none; flex-direction: column;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--text); display: block; margin-top: 4px; }
.nav-toggle span:first-child { margin-top: 0; }

/* ===========================================================
   HERO
   =========================================================== */
.hero { padding: 72px 0 56px; }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}
.hero-kicker {
  font-size: 0.85rem; color: var(--text-faint); margin-bottom: 14px; max-width: none;
}
.hero h1 {
  font-size: clamp(2.1rem, 1.5rem + 3vw, 3.2rem);
  margin-bottom: 18px;
}
.hero-lede { font-size: 1.08rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 12px 20px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; text-decoration: none !important;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #101418; }
.btn-primary:hover { background: #ffc250; }
.btn-ghost { border-color: var(--hairline); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Terminal */
.terminal {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 6px; overflow: hidden; box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: #0F1621; border-bottom: 1px solid var(--hairline);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #FF5F57; } .dot-y { background: #FEBC2E; } .dot-g { background: #28C840; }
.terminal-title { margin-left: 8px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); }
.terminal-body {
  font-family: var(--font-mono); font-size: 0.82rem; padding: 20px;
  min-height: 240px; color: #C7D0DC;
}
.term-line { white-space: pre-wrap; word-break: break-word; min-height: 1.4em; }
.term-line.cmd { color: #7FD9FF; }
.term-line.warn { color: #FF8A65; }
.term-line.ok { color: #4CD97B; }
.term-line.hit { color: #FF5F57; }
.term-line.safe { color: #4CD97B; }
.term-cursor { display: inline-block; color: var(--accent); animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ===========================================================
   SECTIONS (general)
   =========================================================== */
.section { padding: 64px 0; }
.alt-bg { background: var(--bg-alt); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 28px;
}
.section-sub { color: var(--text-faint); font-size: 0.92rem; margin: 0; }

/* Skills */
.skill-groups {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; margin-top: 28px;
}
.skill-group h3 { color: var(--accent); font-size: 0.95rem; margin-bottom: 6px; }
.skill-group p { font-size: 0.95rem; margin: 0; }

/* ===========================================================
   PROJECT LIST
   =========================================================== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.filter-bar button {
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 500;
  background: transparent; color: var(--text-muted); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: all 0.15s ease;
}
.filter-bar button:hover { border-color: var(--accent); color: var(--text); }
.filter-bar button.is-active { background: var(--accent); border-color: var(--accent); color: #101418; }

.project-list { border-top: 1px solid var(--hairline); margin-top: 16px; }
.project-row { border-bottom: 1px solid var(--hairline); }

.project-summary {
  width: 100%; display: flex; align-items: center; gap: 16px;
  background: none; border: 0; text-align: left; cursor: pointer;
  padding: 22px 0; color: var(--text); font-family: var(--font-body);
}
.project-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 6px;
}
.project-heading { flex: 1 1 auto; min-width: 0; }
.project-title {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem; color: var(--text); margin-bottom: 4px;
}
.project-oneliner { display: block; font-size: 0.92rem; color: var(--text-muted); }

.project-meta {
  flex: none; display: flex; align-items: center; gap: 16px;
  font-size: 0.82rem; color: var(--text-faint);
}
.project-cat { min-width: 82px; }
.project-date { font-variant-numeric: tabular-nums; }
.chevron { font-size: 1.1rem; color: var(--text-faint); transition: transform 0.2s ease; }
.project-row.is-open .chevron { transform: rotate(45deg); color: var(--accent); }

.project-detail { padding: 0 0 26px 25px; }
.project-detail .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.project-detail .tag {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted);
  border: 1px solid var(--hairline); border-radius: 4px; padding: 3px 8px;
}
.project-detail ul { margin: 0 0 14px; max-width: 66ch; }
.project-detail li { font-size: 0.94rem; }
.project-links { display: flex; gap: 18px; }
.project-link { font-weight: 600; font-size: 0.9rem; }

/* Publications */
.pub-row { max-width: 66ch; }
.pub-heading { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.pub-heading .project-title { font-size: 1.1rem; }
.pub-date { font-size: 0.82rem; color: var(--text-faint); font-family: var(--font-mono); }

/* Experience timeline */
.timeline-row { display: grid; grid-template-columns: 180px 1fr; gap: 24px; }
.timeline-loc { font-size: 0.9rem; color: var(--text-faint); margin-bottom: 12px; }
.timeline-what ul { max-width: 62ch; }
.timeline-what li { font-size: 0.95rem; }

/* Education / certs two-col */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.edu-row { margin-bottom: 20px; }
.cert-list { list-style: none; padding: 0; margin-top: 22px; }
.cert-list li { margin-bottom: 10px; font-size: 0.94rem; }
.cert-list a { color: var(--text); }
.cert-list a:hover { color: var(--accent); }

/* Contact */
.contact-section { text-align: left; }
.contact-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline); padding: 28px 0 40px;
}
.site-footer p { margin: 0 0 4px; font-size: 0.85rem; color: var(--text-faint); }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
  .skill-groups { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .timeline-row { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--hairline);
    flex-direction: column; align-items: flex-start; gap: 0;
    max-height: 0; overflow: hidden; transition: max-height 0.2s ease;
  }
  .site-nav.is-open { max-height: 260px; }
  .site-nav a { width: 100%; padding: 14px 24px; }
  .site-nav a::after { display: none; }

  .project-summary { align-items: flex-start; gap: 12px; }
  .project-meta { flex-direction: column; align-items: flex-end; gap: 4px; }
  .project-cat { min-width: 0; }
  .project-detail { padding-left: 21px; }
}
