:root {
  --bg: #05060c;
  --ink: #eef0f7;
  --muted: #9aa1b8;
  --faint: #6b7088;
  --accent: #9db4ff;       /* starlight blue */
  --accent-warm: #e8c07d;  /* badge gold, used sparingly */
  --line: rgba(255, 255, 255, 0.10);
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.06);
  --maxw: 1080px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  /* Hand-drawn night sky: tiled star field over deep black */
  background-image: url("../img/stars-tile.png");
  background-repeat: repeat;
  background-size: 560px auto;
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle vignette so text always reads over the stars */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(157, 180, 255, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(5, 6, 12, 0.35), rgba(5, 6, 12, 0.72));
  z-index: 0;
}

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

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

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

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #05060c; padding: 8px 14px; border-radius: 8px; z-index: 50;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 20px 24px;
}
.wordmark { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.wordmark:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 64px 24px 40px; text-align: center; }
.hero-inner { max-width: 720px; margin: 0 auto; }
.avatar {
  width: 160px; height: 160px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 6px rgba(157, 180, 255, 0.06), 0 18px 50px rgba(0, 0, 0, 0.6);
}
.name {
  font-size: clamp(2.6rem, 7vw, 4.2rem); font-weight: 700; letter-spacing: -0.03em;
  margin: 26px 0 10px; line-height: 1.02;
}
.headline { font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: var(--ink); font-weight: 600; margin: 0 0 18px; }
.subhead { font-size: 1.02rem; color: var(--muted); margin: 0 auto 22px; max-width: 600px; }
.subhead strong { color: var(--ink); font-weight: 600; }
.location { font-size: 0.95rem; color: var(--muted); margin: 0 0 26px; }
.location .dot { margin: 0 8px; color: var(--faint); }
.open-badge {
  color: #b9f5d0; font-weight: 500;
}
.open-badge::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px;
  border-radius: 50%; background: #57d98a; box-shadow: 0 0 8px #57d98a; vertical-align: middle;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--ink); font-weight: 500; font-size: 0.95rem;
  background: var(--card); transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.btn:hover { background: var(--card-hover); border-color: rgba(157,180,255,0.4); text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: #05060c; border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: #b5c6ff; }
.btn.small { padding: 9px 16px; font-size: 0.9rem; }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 56px 24px; }
.section-head { margin-bottom: 36px; }
.section h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.section-sub { color: var(--muted); margin: 0; }

/* ---------- Projects ---------- */
.project {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px; align-items: center;
  padding: 32px; margin-bottom: 28px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  backdrop-filter: blur(6px);
}
.project.reverse .project-copy { order: 2; }
.project.reverse .project-shots { order: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.02em;
  color: var(--accent); background: rgba(157, 180, 255, 0.10);
  border: 1px solid rgba(157, 180, 255, 0.22); padding: 4px 9px; border-radius: 999px;
}
.project h3 { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.project-tagline { color: var(--ink); font-weight: 600; margin: 0 0 12px; }
.project p { margin: 0 0 12px; color: var(--muted); }
.project p em { color: var(--accent-warm); font-style: normal; font-weight: 600; }
.project-links { margin-top: 18px; }

.project-shots { display: grid; gap: 14px; }
.project-shots figure { margin: 0; }
.project-shots img {
  width: 100%; display: block; border-radius: 12px; border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.project-shots figcaption { font-size: 0.8rem; color: var(--faint); margin-top: 7px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--line), transparent);
}
.timeline li { position: relative; padding: 0 0 30px 38px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(157, 180, 255, 0.5);
}
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.tl-head h3 { font-size: 1.2rem; margin: 0; font-weight: 700; }
.tl-role { font-weight: 500; color: var(--accent); font-size: 0.98rem; }
.tl-meta { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }
.timeline p { margin: 6px 0 8px; color: var(--muted); font-size: 0.95rem; }
.timeline ul { margin: 0; padding-left: 18px; color: var(--muted); }
.timeline ul li { padding: 2px 0; }
.timeline ul li::before { display: none; }
.timeline strong, .timeline p strong { color: var(--ink); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.skill-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
}
.skill-card h4 { margin: 0 0 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.skill-card p { margin: 0; color: var(--ink); font-size: 0.96rem; }

/* ---------- Education + achievements ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.col-h { font-size: 1.4rem !important; margin-bottom: 18px !important; }
.edu { margin-bottom: 18px; }
.edu h4 { margin: 0 0 2px; font-size: 1.05rem; }
.edu p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.achievements { list-style: none; margin: 0; padding: 0; }
.achievements li { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.achievements li:last-child { border-bottom: none; }
.achievements strong { color: var(--ink); }

/* ---------- Contact ---------- */
.contact { text-align: center; padding-top: 30px; }
.astronaut-end {
  width: 220px; max-width: 60%; height: auto; display: block; margin: 0 auto 6px;
  mix-blend-mode: screen; opacity: 0.92;
  animation: float 7s ease-in-out infinite;
}
.contact h2 { margin-top: 0; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 40px;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); color: var(--faint); font-size: 0.85rem;
}

/* ---------- Playable rocket ---------- */
.rocket {
  position: fixed; top: 0; left: 0; width: 210px; height: 92px; z-index: 5;
  background: url("../img/rocket-sprite.png") center bottom / 210px auto no-repeat;
  mix-blend-mode: screen;
  cursor: pointer; will-change: transform;
  filter: drop-shadow(0 0 14px rgba(157, 180, 255, 0.25));
}
.rocket:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .project { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .project.reverse .project-copy { order: 1; }
  .project.reverse .project-shots { order: 2; }
  .skills-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 28px; }
  .rocket { width: 150px; height: 66px; background-size: 150px auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .astronaut-end { animation: none; }
}
