/* ─────────────────────────────────────────────────────────────────────
   S. Bouknight — Portfolio
   Theme: Dark technical, Anduril-inspired
   Accent: #DFF140 chartreuse on pure black
   Fonts: IBM Plex Mono (mono) + IBM Plex Sans (body)
───────────────────────────────────────────────────────────────────── */

/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #000000;
  --bg-surface: #080808;
  --bg-raised:  #111111;
  --border:     rgba(255,255,255,0.07);
  --border-mid: rgba(255,255,255,0.14);

  --text-primary:   #ffffff;
  --text-secondary: #8a9099;
  --text-muted:     #4a5260;

  --accent:         #52a85a;   /* military green — primary */
  --accent-dim:     rgba(82,168,90,0.12);
  --accent-glow:    rgba(82,168,90,0.06);

  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --nav-h: 60px;
  --section-pad: 100px;
  --container-w: 1080px;
  --radius: 4px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Light theme ───────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:         #f5f6f8;
  --bg-surface: #eef0f3;
  --bg-raised:  #e2e5ea;
  --border:     rgba(0,0,0,0.08);
  --border-mid: rgba(0,0,0,0.14);

  --text-primary:   #1a1c1f;
  --text-secondary: #4a5260;
  --text-muted:     #8a9099;

  --accent:      #2a6630;   /* dark forest green — readable on white */
  --accent-dim:  rgba(42,102,48,0.12);
  --accent-glow: rgba(42,102,48,0.06);
}

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

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s, color 0.2s;
}

/* ── Theme toggle button ───────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
/* Show sun in dark mode, moon in light mode */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

/* ── Container ────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #050c18;
  font-weight: 500;
}
.btn-primary:hover {
  background: #6aadff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ── Nav ──────────────────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}

#nav.scrolled {
  background: rgba(10,11,13,0.92);
  border-bottom-color: var(--border);
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: lowercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.nav-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-secondary);
  transition: all 0.2s;
}

/* ── Section shared ───────────────────────────────────────────────── */
section {
  padding: var(--section-pad) 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 56px;
}

.section-num {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.section-header h2 {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Hero ─────────────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 30%, transparent 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-top: 40px;
  padding-bottom: 40px;
}

.hero-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 20px;
  opacity: 0;
  animation: fade-up 0.6s var(--ease-out) 0.1s forwards;
}

#hero h1 {
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 24px;
  opacity: 0;
  animation: fade-up 0.6s var(--ease-out) 0.2s forwards;
}

.hero-sub {
  font-size: 17px;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.65;
  margin-bottom: 40px;
  opacity: 0;
  animation: fade-up 0.6s var(--ease-out) 0.3s forwards;
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin-bottom: 56px;
  opacity: 0;
  animation: fade-up 0.6s var(--ease-out) 0.4s forwards;
}

.hero-meta {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fade-up 0.6s var(--ease-out) 0.5s forwards;
}

.hero-meta .sep { color: var(--border-mid); }

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fade-in 0.6s var(--ease-out) 1s forwards;
}

.scroll-indicator span {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--border-mid), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

/* ── About ────────────────────────────────────────────────────────── */
#about { background: var(--bg-surface); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 80px;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 16px;
}
.about-text p:last-child { margin-bottom: 0; }

.about-aside {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.skill-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg-raised);
}

.skill-block h3 {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
}

.skill-block ul li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.skill-block ul li:last-child { border-bottom: none; }

/* ── Resume ───────────────────────────────────────────────────────── */
#resume { background: var(--bg); }

.resume-group { margin-bottom: 60px; }
.resume-group:last-of-type { margin-bottom: 40px; }

.resume-group-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 32px;
  font-weight: 400;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--border);
  padding-left: 32px;
  margin-left: 4px;
}

.timeline-entry {
  position: relative;
  padding-bottom: 40px;
}
.timeline-entry:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -37px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.timeline-role {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.timeline-org {
  font-size: 13px;
  color: var(--text-secondary);
}

.timeline-date {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding-top: 2px;
}

.timeline-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-bullets li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.timeline-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}

.resume-cta {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* ── Projects ─────────────────────────────────────────────────────── */
#projects { background: var(--bg-surface); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.project-card {
  background: var(--bg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: background 0.2s;
  position: relative;
}

.project-card:hover { background: var(--bg-raised); }

.project-card--placeholder {
  opacity: 0.4;
  pointer-events: none;
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(78,155,255,0.2);
  padding: 3px 8px;
  border-radius: 2px;
}

.project-link-icon {
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.project-card:hover .project-link-icon {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.project-card h3 {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.project-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
}

.project-read-more {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  transition: color 0.2s;
  margin-top: auto;
}
.project-card:hover .project-read-more { color: var(--accent); }

/* ── Contact ──────────────────────────────────────────────────────── */
#contact { background: var(--bg); }

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 80px;
  align-items: start;
}

.contact-text p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 24px;
}

.contact-email a {
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}
.contact-email a:hover { opacity: 0.7; }

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
}
.contact-link:last-child { border-bottom: none; }
.contact-link:hover {
  background: var(--bg-raised);
  color: var(--accent);
}

.contact-link span {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 24px;
}

.contact-link svg {
  margin-left: auto;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}
.contact-link:hover svg {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* ── Footer ───────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy,
.footer-build {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ── Animations ───────────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 0.8; transform: scaleY(1.1); }
}

/* Intersection observer reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --section-pad: 72px; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 640px) {
  :root { --section-pad: 56px; }

  .container { padding: 0 20px; }
  .nav-inner { padding: 0 20px; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 24px 20px;
    gap: 20px;
  }
  .nav-links.open a { font-size: 16px; }

  .nav-menu-toggle { display: flex; }

  #hero h1 { font-size: 44px; }
  .hero-cta { flex-direction: column; align-items: flex-start; }

  .section-header h2 { font-size: 22px; }

  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
