/* ============ TOKENS ============ */
:root {
  --bg: #060a14;
  --bg-raised: #0b1120;
  --bg-card: #0d1426;
  --line: #1c2740;
  --text: #dbe4f5;
  --text-dim: #8b98b8;
  --accent: #5eead4;      /* teal */
  --accent-2: #fbbf24;    /* amber */
  --accent-glow: rgba(94, 234, 212, 0.35);
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
}

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

::selection { background: var(--accent); color: var(--bg); }

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

main, .hero, .nav, .footer { position: relative; z-index: 1; }

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 5vw;
  background: rgba(6, 10, 20, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav__logo {
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
.nav__blink { color: var(--accent-2); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav__links { display: flex; gap: 2rem; }
.nav__links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--accent); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  background: var(--accent);
  color: #04211c;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--accent-glow); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn--small { padding: 0.5rem 1.1rem; font-size: 0.85rem; }
.btn--big { padding: 1rem 2.2rem; font-size: 1.1rem; font-family: var(--font-mono); }

/* ============ HERO ============ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 7vw 4rem;
  width: 100%;
  position: relative;
}

.hero__orbit {
  position: absolute;
  top: 50%; right: 4vw;
  width: min(46vw, 760px); height: min(46vw, 760px);
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
}
.orbit {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(94, 234, 212, 0.18);
  border-radius: 50%;
  animation: spin 40s linear infinite;
}
.orbit--2 { inset: 90px; animation-duration: 26s; animation-direction: reverse; border-color: rgba(251, 191, 36, 0.15); }
.orbit--3 { inset: 190px; animation-duration: 18s; }
.orbit__sat {
  position: absolute;
  top: -14px; left: 50%;
  font-size: 1.4rem;
  transform: translateX(-50%);
}
.orbit__sat--dot {
  width: 10px; height: 10px;
  top: -5px;
  background: var(--accent-2);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-2);
}
.orbit__sat--dot.small { width: 6px; height: 6px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.hero__content { max-width: 820px; }

.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
}

.hero__title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #fff 30%, var(--accent) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__sub {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  font-weight: 500;
  color: var(--text);
  min-height: 1.6em;
}
.cursor { color: var(--accent); animation: blink 0.9s steps(1) infinite; }

.hero__tagline {
  margin-top: 1.4rem;
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 620px;
}
.hero__tagline strong { color: var(--text); }

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }

.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 3.2rem;
  max-width: 760px;
}
.stat {
  border-left: 2px solid var(--line);
  padding-left: 1rem;
}
.stat__num {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
}
.stat__label { font-size: 0.82rem; color: var(--text-dim); }

.hero__scroll {
  position: absolute;
  bottom: 2rem; left: 7vw;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-decoration: none;
  animation: bob 2.4s ease-in-out infinite;
}
.hero__scroll:hover { color: var(--accent); }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ============ SECTIONS ============ */
.section {
  max-width: 1500px;
  margin: 0 auto;
  padding: 6rem 7vw;
}

.section__head { margin-bottom: 3rem; }
.section__num {
  color: var(--accent-2);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
}
.section__num::after {
  content: "";
  display: inline-block;
  width: 60px; height: 1px;
  background: var(--accent-2);
  vertical-align: middle;
  margin-left: 12px;
  opacity: 0.5;
}
.section__head h2 {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 700;
  margin-top: 0.4rem;
  letter-spacing: -0.01em;
}
.section__blurb { color: var(--text-dim); margin-top: 0.3rem; }

/* ============ STAGES ============ */
.stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}
.stage {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.8rem;
  transition: transform 0.25s, border-color 0.25s;
}
.stage:hover { transform: translateY(-4px); border-color: var(--accent); }
.stage__badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--accent-2);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}
.stage h3 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.stage p { color: var(--text-dim); font-size: 0.95rem; }
.stage p strong { color: var(--text); }

/* ============ TIMELINE ============ */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.entry { position: relative; }
.entry::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 5px);
  top: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.entry:first-child::before { background: var(--accent); }

.entry__meta {
  display: flex;
  gap: 1.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  margin-bottom: 0.5rem;
}
.entry__loc { color: var(--text-dim); }

.entry__body h3 { font-size: 1.2rem; font-weight: 600; }
.entry__org { color: var(--accent); font-weight: 500; }

.entry__body ul {
  margin: 0.7rem 0 0.9rem 1.1rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* ============ TAGS ============ */
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags span {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.07);
  border: 1px solid rgba(94, 234, 212, 0.2);
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
}
.tags--big span { font-size: 0.8rem; padding: 0.35rem 0.85rem; }

/* ============ PROJECT CARDS ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.4rem;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.7rem;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.card--featured {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--bg-card), rgba(94, 234, 212, 0.06));
}
.card__top {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}
.card__status { color: var(--accent-2); }
.card__status.live { color: #4ade80; }
.card h3 { font-size: 1.3rem; }
.card p { color: var(--text-dim); font-size: 0.95rem; flex-grow: 1; }
.card p strong { color: var(--text); }
.card__link {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-decoration: none;
}
.card__link:hover { text-decoration: underline; }
.card__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.2rem; }
.inline-link { color: var(--accent); text-decoration: none; }
.inline-link:hover { text-decoration: underline; }

/* ============ CREDENTIALS ============ */
.credential-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.credential-card {
  min-height: 175px;
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(145deg, var(--bg-card), rgba(94, 234, 212, 0.035));
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.credential-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.credential-card__issuer {
  color: var(--accent-2);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}
.credential-card h3 { margin-top: 0.7rem; font-size: 1.08rem; }
.credential-card__action {
  margin-top: auto;
  padding-top: 1.3rem;
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

/* ============ AWARDS ============ */
.awards-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.award {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.25s, transform 0.25s;
}
.award:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.award__year { color: var(--accent-2); font-size: 0.78rem; letter-spacing: 0.1em; padding-top: 0.2rem; }
.award h3 { font-size: 1rem; line-height: 1.35; }
.award p { color: var(--text-dim); font-size: 0.82rem; margin-top: 0.35rem; }

/* ============ GITHUB LIVE ============ */
.gh-live { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.gh-live__title {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.gh-live__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.9rem;
}
.gh-repo {
  display: block;
  text-decoration: none;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  transition: border-color 0.2s, transform 0.2s;
}
.gh-repo:hover { border-color: var(--accent); transform: translateY(-2px); }
.gh-repo__name { font-family: var(--font-mono); font-size: 0.88rem; color: var(--accent); font-weight: 600; }
.gh-repo__desc {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin: 0.35rem 0 0.55rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gh-repo__meta { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-dim); letter-spacing: 0.06em; }

/* ============ TERMINAL ============ */
.terminal {
  margin: 3.5rem auto 0;
  max-width: 640px;
  text-align: left;
  background: #070c17;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.6rem 0.9rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
}
.terminal__dot { width: 11px; height: 11px; border-radius: 50%; }
.terminal__title { margin-left: 0.6rem; font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.06em; }
.terminal__screen {
  padding: 1rem;
  min-height: 130px;
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.7;
}
.terminal__line { color: var(--text-dim); white-space: pre-wrap; word-break: break-word; }
.terminal__line--cmd { color: var(--text); }
.terminal__line a { color: var(--accent); }
.terminal__input-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}
.terminal__input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  caret-color: var(--accent);
}

/* ============ ROCKET TO TOP ============ */
.rocket-top {
  position: fixed;
  bottom: 1.6rem; right: 1.6rem;
  z-index: 90;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, border-color 0.2s;
}
.rocket-top.show { opacity: 1; pointer-events: auto; transform: none; }
.rocket-top:hover { border-color: var(--accent); }
.rocket-top.launching { animation: launch 0.9s ease-in forwards; }
@keyframes launch {
  0% { transform: translateY(0) rotate(-45deg); }
  25% { transform: translateY(6px) rotate(-45deg); }
  100% { transform: translateY(-110vh) rotate(-45deg); opacity: 0.9; }
}

/* ============ SYSTEMS / SKILLS ============ */
.systems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}
.system h3 {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--accent-2);
  margin-bottom: 0.9rem;
  font-weight: 500;
}

.creds {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.cred { color: var(--text-dim); font-size: 0.95rem; }
.cred .mono {
  display: inline-block;
  min-width: 52px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

/* ============ CONTACT ============ */
.section--contact { text-align: center; padding-bottom: 8rem; }
.contact h2 { font-size: clamp(2rem, 5vw, 3rem); margin: 0.5rem 0 1rem; }
.contact__blurb { color: var(--text-dim); max-width: 480px; margin: 0 auto 2.2rem; }
.contact__links { margin-top: 1.6rem; display: flex; justify-content: center; gap: 1rem; font-size: 0.8rem; letter-spacing: 0.15em; }
.contact__links a { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.contact__links a:hover { color: var(--accent); }
.contact__links span { color: var(--line); }

/* ============ FOOTER ============ */
.footer {
  text-align: center;
  padding: 2rem 5vw;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

/* ============ REVEAL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .orbit, .hero__scroll, .nav__blink, .cursor { animation: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .hero__orbit { display: none; }
  .card--featured { grid-column: span 1; }
  .section { padding: 4rem 6vw; }
  .entry__meta { flex-direction: column; gap: 0.15rem; }
  .awards-list { grid-template-columns: 1fr; }
}
