:root {
  --bg: #000005;
  --ink: #edeef4;
  --muted: #9aa1b6;
  --faint: #6a7088;
  --accent: #8ea4ff;          /* starlight blue */
  --accent-soft: rgba(142, 164, 255, 0.12);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --card: rgba(255, 255, 255, 0.028);
  --card-2: rgba(255, 255, 255, 0.05);
  --maxw: 1100px;
  --gutter: 28px;
  --frame-h: 600px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: #000;           /* pure black base — stays black under dimming */
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fixed star field, dimmed by a black wash so text reads cleanly. */
.sky {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: url("../img/stars-tile.png");
  background-repeat: repeat;
  background-size: 620px auto;
  background-attachment: fixed;
  opacity: 0.45;                    /* dim the stars; base black shows through */
}
.sky::after {                        /* gentle vignette, pure black (no gray tint) */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(130% 90% at 50% 0%, transparent 40%, rgba(0,0,0,0.55) 100%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 5, 0.6);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; max-width: var(--maxw); margin: 0 auto; padding: 14px var(--gutter); }
.wordmark { font-family: var(--mono); font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.wordmark .accent { color: var(--accent); }
.wordmark:hover { text-decoration: none; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 84px 0 40px; }
.hero-inner { max-width: 700px; margin: 0 auto; }
.avatar {
  width: 132px; height: 132px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 0 7px rgba(142,164,255,0.05), 0 20px 56px rgba(0,0,0,0.7);
}
.name { font-size: clamp(2.5rem, 6.5vw, 3.9rem); font-weight: 700; letter-spacing: -0.035em; margin: 24px 0 12px; line-height: 1.03; }
.headline { font-size: clamp(1.02rem, 2.4vw, 1.24rem); color: var(--ink); font-weight: 600; margin: 0 0 18px; }
.subhead { font-size: 1.0rem; color: var(--muted); margin: 0 auto 22px; max-width: 580px; }
.subhead strong { color: var(--ink); font-weight: 600; }
.location { font-size: 0.92rem; color: var(--muted); margin: 0 0 28px; display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.location .sep { color: var(--faint); }
.open-badge { color: #aef0c6; font-weight: 500; display: inline-flex; align-items: center; }
.open-badge::before { content: ""; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #4fd987; box-shadow: 0 0 8px #4fd987; }

.actions { display: flex; gap: 11px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; padding: 11px 20px; border-radius: 10px; border: 1px solid rgba(142,164,255,0.26); color: var(--ink); font-weight: 500; font-size: 0.92rem; background: rgba(142,164,255,0.12); transition: background .18s, transform .18s, border-color .18s; }
.btn:hover { background: rgba(142,164,255,0.2); border-color: rgba(142,164,255,0.5); text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: #000510; border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: #a8baff; }
.btn.small { padding: 9px 15px; font-size: 0.86rem; }

/* ---------- Sections ---------- */
section { padding-block: 40px; }                  /* adjacent sections → 80px gap */
.section-head { margin-bottom: 36px; }
.eyebrow { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
h2.title { font-size: clamp(1.7rem, 3.6vw, 2.25rem); font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.section-sub { color: var(--muted); margin: 8px 0 0; max-width: 640px; }

/* ---------- Projects ---------- */
.project { margin-bottom: 80px; }                 /* matches inter-section gap */
.project:last-child { margin-bottom: 0; }
.project-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 28px; margin-bottom: 22px; }
.project-head .left { max-width: 680px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.tag { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.01em; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(142,164,255,0.22); padding: 4px 9px; border-radius: 999px; }
.project h3 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
.title-link { color: var(--ink); transition: color .18s; }
.title-link:hover { color: var(--accent); text-decoration: none; }
.project .tagline { color: var(--ink); font-weight: 600; margin: 0 0 8px; }
.project .desc { color: var(--muted); margin: 0; font-size: 0.97rem; }
.project .note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; color: var(--ink); font-size: 0.92rem; }
.note-badge { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.02em; color: #aef0c6; background: rgba(79,217,135,0.12); border: 1px solid rgba(79,217,135,0.32); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.btn.disabled { opacity: 0.6; cursor: default; pointer-events: none; background: var(--card); border-color: var(--line); color: var(--muted); }
.project-head .right { display: flex; gap: 10px; flex-shrink: 0; }

/* Shared showcase shell — both projects share the same height for consistency */
.showcase {
  height: var(--frame-h);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(10, 12, 20, 0.66);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  overflow: hidden;
  backdrop-filter: blur(4px);
}

/* Browser-chrome frame (FindsYouJobs live demo) */
.browser { display: flex; flex-direction: column; height: 100%; }
.browser-bar { display: flex; align-items: center; gap: 14px; height: 46px; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.035); flex-shrink: 0; }
.dots { display: flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a3f52; display: block; }
.dots i:nth-child(1){ background:#ff5f57;} .dots i:nth-child(2){ background:#febc2e;} .dots i:nth-child(3){ background:#28c840;}
.tabs { display: flex; gap: 6px; }
.tab { font-size: 0.82rem; font-weight: 500; color: var(--muted); background: transparent; border: 1px solid transparent; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-family: var(--sans); }
.tab:hover { color: var(--ink); background: rgba(255,255,255,0.05); }
.tab[aria-selected="true"] { color: var(--ink); background: var(--accent-soft); border-color: rgba(142,164,255,0.3); }
.url { margin-left: auto; font-family: var(--mono); font-size: 0.74rem; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.url::before { content: "🔒"; font-size: 0.7rem; }
.browser-viewport { position: relative; flex: 1; overflow: hidden; background: #fff; }
.browser-viewport iframe { border: 0; position: absolute; top: 0; left: 0; transform-origin: top left; }

/* Phone shelf (LeetCodeLytics) */
.shelf { display: flex; align-items: center; gap: 26px; height: 100%; padding: 0 30px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.shelf::-webkit-scrollbar { height: 8px; }
.shelf::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.phone {
  position: relative; height: calc(var(--frame-h) - 64px); aspect-ratio: 1170 / 2532;
  flex-shrink: 0; scroll-snap-align: center;
  border-radius: 30px; padding: 8px;
  background: #15171f; border: 1px solid var(--line-strong);
  box-shadow: 0 18px 44px rgba(0,0,0,0.55);
}
.phone::before { content: ""; position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: 30%; height: 7px; border-radius: 99px; background: #000; z-index: 2; }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 23px; display: block; }
.shelf-hint { /* placeholder slot styling for not-yet-provided shots */ }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--line-strong), transparent); }
.timeline li { position: relative; padding: 0 0 30px 36px; }
.timeline li::before { content: ""; position: absolute; left: -1px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: #000; border: 2px solid var(--accent); box-shadow: 0 0 9px rgba(142,164,255,0.5); }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.tl-head h3 { font-size: 1.14rem; margin: 0; font-weight: 700; }
.tl-role { font-weight: 500; color: var(--accent); font-size: 0.95rem; }
.tl-meta { font-family: var(--mono); font-size: 0.76rem; color: var(--faint); margin-left: auto; }
.timeline p { margin: 5px 0 8px; color: var(--muted); font-size: 0.93rem; }
.timeline ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.93rem; }
.timeline ul li { padding: 2px 0; }
.timeline strong { color: var(--ink); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.skill-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.skill-card.wide { grid-column: 1 / -1; border-color: rgba(142,164,255,0.22); background: rgba(142,164,255,0.05); }
.skill-card h4 { margin: 0 0 8px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); }
.skill-card p { margin: 0; color: var(--ink); font-size: 0.93rem; }

/* ---------- Education + achievements ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.col-h { font-size: 1.3rem; font-weight: 700; margin: 0 0 18px; letter-spacing: -0.02em; }
.edu { margin-bottom: 16px; }
.edu h4 { margin: 0 0 2px; font-size: 1.02rem; }
.edu p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.achievements { list-style: none; margin: 0; padding: 0; }
.achievements li { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.93rem; }
.achievements li:last-child { border-bottom: none; }
.achievements strong { color: var(--ink); }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.astronaut-end { width: 120px; height: auto; display: block; margin: 0 auto 4px; opacity: 0.4; animation: float 8s ease-in-out infinite; }
.contact h2 { margin: 0 0 10px; }
.contact .muted { margin: 0 auto 22px; max-width: 460px; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-2deg);} 50% { transform: translateY(-12px) rotate(2deg);} }

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

/* ---------- Playable rocket ---------- */
.rocket {
  position: fixed; top: 0; left: 0; width: 116px; height: auto; z-index: 5;
  opacity: 0.4; cursor: pointer; will-change: transform;
}
.rocket img { width: 100%; height: auto; display: block; }
.rocket:hover { opacity: 0.62; }
.rocket:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  :root { --frame-h: 460px; }
  .nav-links { display: none; }
  .project-head { flex-direction: column; align-items: stretch; }
  .project-head .right { order: 3; }
  .skills-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 30px; }
  .rocket { width: 84px; }
}

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