/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0e17;
  --bg-alt: #0d1220;
  --panel: #11172a;
  --panel-border: #212a42;
  --text: #e7ecf5;
  --text-muted: #8b96b0;
  --accent: #4fd1c5;
  --accent-strong: #7ee8de;
  --accent-2: #f2b84b;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --container-w: 1100px;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

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

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }

.accent { color: var(--accent); }

/* ---------- Background grid ---------- */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(79, 209, 197, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 209, 197, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 75%);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 23, 0.75);
  border-bottom: 1px solid var(--panel-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.logo-dot { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--bg) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 68px;
  z-index: 1;
}

.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  right: 10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(79, 209, 197, 0.18), transparent 70%);
  filter: blur(20px);
  z-index: -1;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  margin-bottom: 18px;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.05;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 30%, #9fb3c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #06110f;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(79, 209, 197, 0.5);
}

.btn-ghost {
  border: 1px solid var(--panel-border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Hero portrait ---------- */
.hero-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.portrait-ring {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  padding: 6px;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent));
  animation: spin 12s linear infinite;
}

.portrait-ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--bg);
  z-index: 1;
}

.portrait-img,
.portrait-fallback {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  border-radius: 50%;
  object-fit: cover;
  animation: unspin 12s linear infinite;
  z-index: 2;
}

.portrait-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 700;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes unspin { to { transform: rotate(-360deg); } }

.portrait-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 8px 16px;
  border-radius: 20px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.2);
}

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--panel-border);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.scroll-cue span {
  width: 4px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollcue 1.6s ease infinite;
}

@keyframes scrollcue {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(10px); }
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: 120px 0;
  z-index: 1;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}

.section-label {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.section-heading {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 48px;
  max-width: 700px;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}

.about-body p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.about-body strong { color: var(--text); }

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--panel-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 48px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -38px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}

.timeline-content {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.timeline-content:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-head h3 {
  font-size: 1.2rem;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-2);
  white-space: nowrap;
}

.timeline-org {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.timeline-content ul { padding-left: 18px; }

.timeline-content li {
  position: relative;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 8px;
}

.timeline-content li::marker {
  color: var(--accent);
}

.timeline-content li strong { color: var(--text); }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.skill-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.skill-card h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 18px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 0.85rem;
  background: rgba(79, 209, 197, 0.08);
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
}

/* ---------- Education ---------- */
.edu-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 32px 36px;
  max-width: 700px;
}

.edu-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.edu-head h3 { font-size: 1.3rem; }

.edu-degree { color: var(--text); margin-bottom: 6px; font-weight: 500; }

.edu-detail { color: var(--text-muted); margin-bottom: 16px; font-size: 0.95rem; }

.edu-award {
  font-size: 0.9rem;
  color: var(--accent-2);
  border-top: 1px solid var(--panel-border);
  padding-top: 16px;
}

/* ---------- Contact ---------- */
.contact-inner { text-align: center; }

.contact-inner .section-heading { margin: 0 auto 20px; }

.contact-copy {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 40px;
  font-size: 1.05rem;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
  word-break: break-word;
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.contact-icon { font-size: 1.1rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--panel-border);
  padding: 28px 0;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.back-to-top:hover { color: var(--accent); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-text { order: 2; }
  .hero-portrait { order: 1; }
  .hero-meta { justify-content: center; }
  .hero-actions { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-links { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--panel-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 18px;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-toggle { display: flex; }
  .portrait-ring { width: 220px; height: 220px; }
  .timeline { padding-left: 24px; }
  .timeline-marker { left: -30px; }
  .timeline-content { padding: 22px 20px; }
}
