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

:root {
  --bg:          #080b12;
  --bg-card:     #0d1120;
  --bg-card-2:   #111827;
  --border:      rgba(255,255,255,0.07);
  --border-h:    rgba(255,255,255,0.14);
  --accent:      #4f8ef7;
  --accent-dim:  rgba(79,142,247,0.15);
  --accent-glow: rgba(79,142,247,0.35);
  --text:        #e8edf5;
  --text-sub:    #8b96a8;
  --text-dim:    #4a5568;
  --mono:        'JetBrains Mono', monospace;
  --sans:        'Inter', system-ui, sans-serif;
  --radius:      12px;
  --radius-lg:   20px;
  --transition:  0.3s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; font-size: 16px; }

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Typography ───────────────────────────────────────────── */
h1 { font-size: clamp(2.8rem, 8vw, 6rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text-sub); }
p + p { margin-top: 1rem; }
strong { color: var(--text); font-weight: 600; }

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
section { padding: 7rem 0; }

.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.section-sub {
  font-size: 1.05rem;
  max-width: 600px;
  margin-top: 0.75rem;
  margin-bottom: 3rem;
}

/* ── NAV ──────────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background var(--transition), backdrop-filter var(--transition);
}
#nav.scrolled {
  background: rgba(8,11,18,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.nav-links {
  display: flex;
  gap: 2.5rem;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-sub);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-sub);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── HERO ─────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

#starfield {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  max-width: 800px;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.hero-name {
  opacity: 0;
  animation: fadeUp 0.8s 0.4s forwards;
  background: linear-gradient(135deg, #ffffff 0%, #a8c4f8 60%, #4f8ef7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-role {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 500;
  color: var(--text);
  opacity: 0;
  animation: fadeUp 0.8s 0.6s forwards;
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-sub);
  line-height: 1.7;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s forwards;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 1s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-primary:hover {
  background: #6ba3f9;
  box-shadow: 0 0 36px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-ghost {
  border: 1px solid var(--border-h);
  color: var(--text-sub);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1s 1.5s forwards;
}
.hero-scroll-hint span {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ── ABOUT ────────────────────────────────────────────────── */
#about { background: linear-gradient(180deg, var(--bg) 0%, #0a0f1e 100%); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  margin-top: 0.5rem;
}

.about-text h2 { margin-bottom: 1.5rem; }
.about-text p  { font-size: 1rem; }

.about-facts {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.fact { display: flex; flex-direction: column; }
.fact-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.fact-unit { font-size: 1rem; font-weight: 400; color: var(--text-sub); }
.fact-label { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.3rem; }

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}
.detail-card h3 {
  font-size: 0.75rem;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.edu-degree { font-weight: 600; color: var(--text); font-size: 0.95rem; }
.edu-school { color: var(--text-sub); font-size: 0.875rem; margin-top: 0.2rem; }
.edu-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}
.edu-courses {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.edu-courses li {
  font-size: 0.72rem;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: var(--mono);
}
.edu-divider {
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}
.thesis-text { font-size: 0.9rem; }

/* ── SKILLS ───────────────────────────────────────────────── */
#skills { background: #0a0f1e; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--transition), transform var(--transition);
}
.skill-card:hover {
  border-color: var(--border-h);
  transform: translateY(-2px);
}
.skill-icon {
  width: 40px; height: 40px;
  color: var(--accent);
  margin-bottom: 1rem;
}
.skill-icon svg { width: 100%; height: 100%; }
.skill-card h3 { margin-bottom: 1rem; font-size: 0.95rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-sub);
  transition: var(--transition);
}
.tag.highlight {
  background: var(--accent-dim);
  border-color: rgba(79,142,247,0.3);
  color: var(--accent);
}
.tag:hover { border-color: var(--accent); color: var(--text); }

/* ── PROJECTS ─────────────────────────────────────────────── */
#projects { background: linear-gradient(180deg, #0a0f1e 0%, var(--bg) 100%); }

.projects-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}
.project-card:hover::before { opacity: 1; }
.project-card:hover {
  border-color: rgba(79,142,247,0.3);
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.project-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.project-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ptag {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(79,142,247,0.2);
}

.project-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.project-desc {
  font-size: 0.875rem;
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.25rem;
}
.project-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.project-metrics li {
  font-size: 0.8rem;
  color: var(--text-sub);
  font-family: var(--mono);
}
.metric-val {
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.4rem;
}
.project-footer { margin-top: auto; }
.project-link {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--accent);
  transition: letter-spacing var(--transition);
}
.project-link:hover { letter-spacing: 0.03em; }
.project-link.muted { color: var(--text-dim); cursor: default; }

/* ── ASTROPHOTOGRAPHY ─────────────────────────────────────── */
#astro {
  background: radial-gradient(ellipse at 60% 50%, rgba(20,30,60,0.8) 0%, var(--bg) 70%);
  position: relative;
}

.astro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.astro-text h2 { margin-bottom: 1.5rem; }
.astro-text p { font-size: 0.95rem; }

.astro-badges {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}
.astro-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-sub);
  font-weight: 500;
}
.astro-badge svg {
  width: 18px; height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.star-field-box {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #020408;
}
#astroCanvas {
  width: 100%; height: 100%;
  display: block;
}
.astro-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(8,11,18,0.95), transparent);
  padding: 1.5rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.astro-caption-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.astro-caption-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-sub);
}

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

.contact-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.contact-inner h2 { margin-bottom: 1rem; }
.contact-sub {
  font-size: 1rem;
  margin-bottom: 3rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: left;
  transition: border-color var(--transition), transform var(--transition);
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.contact-card svg {
  width: 22px; height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}
.cc-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}
.cc-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.contact-lang {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.lang-sep { color: var(--border-h); }

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
footer p {
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-dim);
}

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50%       { transform: scaleY(1.2); opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
.hide-sm { display: inline; }

@media (max-width: 900px) {
  .about-grid,
  .astro-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .skills-grid,
  .projects-list { grid-template-columns: 1fr; }
  .about-facts { flex-wrap: wrap; gap: 1.5rem; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .hide-sm { display: none; }
  section { padding: 5rem 0; }
  .hero-cta { flex-direction: column; align-items: center; }
}
