/* ============================================================
   Zachary Fletcher — portfolio
   Dark theme · Inter body · Space Grotesk display
   Accent: violet → cyan (harmonizes with spacemanreality.com)
   ============================================================ */

:root {
  --bg: #0a0d14;
  --bg-raised: #10141f;
  --panel: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9edf5;
  --muted: #a3adc2;
  --faint: #6d7891;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --accent-grad: linear-gradient(100deg, var(--violet), var(--cyan));
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --radius: 16px;
  --maxw: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.015em; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.muted { color: var(--muted); font-weight: 400; }

::selection { background: rgba(139, 92, 246, 0.45); }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 13, 20, 0.78);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-grad);
  color: #0a0d14;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }

.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--accent-grad);
  color: #0a0d14;
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(96, 165, 250, 0.35); }

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover { border-color: var(--cyan); background: rgba(34, 211, 238, 0.06); }

.btn-small { padding: 8px 16px; font-size: 0.88rem; }
.btn-large { padding: 15px 28px; font-size: 1.02rem; }

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

.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 24px 48px;
}

.hero-glow {
  position: absolute;
  inset: -180px -40% auto;
  height: 560px;
  background:
    radial-gradient(600px 320px at 22% 20%, rgba(139, 92, 246, 0.16), transparent 70%),
    radial-gradient(560px 300px at 78% 12%, rgba(34, 211, 238, 0.12), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-sub { color: var(--muted); font-size: 1.08rem; max-width: 56ch; }
.hero-sub strong { color: var(--text); }

.hero-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 30px 0 26px;
}

.path-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}
.path-card:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-2px);
}

.path-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.path-title { font-weight: 600; font-size: 0.98rem; }
.path-cta { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.path-card:hover .path-cta { color: var(--cyan); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.hero-photo { position: relative; }
.hero-photo img {
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    0 0 0 6px rgba(255, 255, 255, 0.02);
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 34px;
  background: var(--accent-grad);
  opacity: 0.14;
  filter: blur(26px);
  z-index: -1;
}

/* ---------- Stats ---------- */

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 56px;
  padding: 0;
}

.stats li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label { color: var(--muted); font-size: 0.84rem; line-height: 1.4; }

/* ---------- Sections ---------- */

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

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.section-kicker {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.1em;
}

.section-sub { color: var(--muted); margin-bottom: 34px; max-width: 64ch; }

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

.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  margin-top: 28px;
}

.about-copy p { margin-bottom: 18px; color: var(--muted); }
.about-copy strong, .about-copy em { color: var(--text); }

.about-facts {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px;
  height: fit-content;
}
.about-facts h3 { font-size: 1.02rem; margin-bottom: 14px; }
.about-facts ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.about-facts li { color: var(--muted); font-size: 0.92rem; }
.about-facts strong { color: var(--text); }

/* ---------- Spaceman ---------- */

.spaceman-feature {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(139, 92, 246, 0.08), rgba(34, 211, 238, 0.05) 60%, transparent),
    var(--bg-raised);
}

.spaceman-media { min-height: 100%; }
.spaceman-media img { width: 100%; height: 100%; object-fit: cover; }

.spaceman-copy { padding: 36px 34px; }
.spaceman-copy h3 { font-size: 1.35rem; margin-bottom: 14px; }
.spaceman-copy > p { color: var(--muted); margin-bottom: 18px; }

.check-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.check-list li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
  font-size: 0.95rem;
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.spaceman-angle { margin-top: 26px; }
.spaceman-angle h4 { font-size: 1.05rem; margin-bottom: 16px; color: var(--text); }

.angle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.angle-grid > div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px 24px;
}
.angle-grid h5 {
  font-family: var(--font-display);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.angle-grid p { color: var(--muted); font-size: 0.94rem; }
.angle-grid em { color: var(--text); }

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

.timeline {
  position: relative;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding-left: 30px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--violet), var(--cyan) 70%, transparent);
  opacity: 0.4;
}

.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--violet);
}
.timeline-item:nth-child(2)::before { border-color: #5f9cf3; }
.timeline-item:nth-child(3)::before { border-color: #38bdf8; }
.timeline-item:nth-child(4)::before { border-color: var(--cyan); }

.timeline-item h3 { font-size: 1.2rem; margin-bottom: 2px; }
.timeline-item .role { font-weight: 600; color: var(--text); font-size: 0.98rem; }
.timeline-item .dates { color: var(--faint); font-size: 0.86rem; margin-bottom: 10px; }

.timeline-item header.subrole { margin-top: 18px; }

.timeline-item ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.timeline-item ul li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}
.timeline-item ul li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--faint);
}
.timeline-item ul li strong { color: var(--text); }

.timeline-item-compact ul { gap: 5px; }

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

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 6px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 26px 28px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.project-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.project-card h3 { font-size: 1.08rem; margin-bottom: 2px; }
.project-dates { color: var(--faint); font-size: 0.84rem; margin-bottom: 12px; }
.project-card > p:not(.project-dates) { color: var(--muted); font-size: 0.95rem; margin-bottom: 12px; }

.project-points { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.project-points li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}
.project-points li::before { content: "–"; position: absolute; left: 0; color: var(--faint); }

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

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 6px;
}

.skill-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px 26px;
}
.skill-group h3 { font-size: 1rem; margin-bottom: 16px; }

.skill-group-featured {
  border-color: rgba(139, 92, 246, 0.4);
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.09), rgba(34, 211, 238, 0.05));
}

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.84rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.skill-note { margin-top: 16px; color: var(--muted); font-size: 0.88rem; font-style: italic; }

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

.section-contact { text-align: center; padding-bottom: 90px; }
.section-contact h2 { justify-content: center; }
.section-contact .section-sub { margin-left: auto; margin-right: auto; }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 40px;
  text-align: center;
  color: var(--faint);
  font-size: 0.88rem;
}
.site-footer p { margin-bottom: 6px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--cyan); }

/* ---------- Reveal animation ---------- */

/* Applies only when JS is running (html.js set by script.js), so content
   is never hidden without JavaScript */
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
html.js .reveal.visible { opacity: 1; transform: none; }

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

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

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { max-width: 380px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .spaceman-feature { grid-template-columns: 1fr; }
  .spaceman-media img { max-height: 340px; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 24px 24px;
    gap: 16px;
    background: rgba(10, 13, 20, 0.97);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .hero { padding-top: 48px; }
  .hero-paths { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .angle-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .section { padding: 52px 20px; }
}
