:root {
  --bg: #131d36;
  --bg-card: #1a2745;
  --bg-card-hover: #213052;
  --text: #eaf0fb;
  --text-dim: #a4b2cc;
  --accent: #5eead4;
  --accent-soft: rgba(94, 234, 212, 0.14);
  --border: #2b3a5e;
  --max: 860px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(19, 29, 54, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 0.15rem 0.5rem;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* Hero */
.hero {
  min-height: 82vh;
  display: flex;
  align-items: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 55vw;
  height: 55vw;
  max-width: 700px;
  max-height: 700px;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.10) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner { max-width: var(--max); margin: 0 auto; }

.hero-kicker {
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin-bottom: 0.75rem;
}
.hero-kicker .prompt { color: var(--text-dim); }
.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-title {
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 0.5rem;
}
.hero-title .dim { font-weight: 400; }

.hero-tags { margin: 1.5rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hero-tags span {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.hero-about { max-width: 620px; color: var(--text-dim); }

.hero-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.stats {
  margin-top: 2.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.stat {
  flex: 1 1 150px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}
.stat strong {
  display: block;
  color: var(--accent);
  font-size: 1.15rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  white-space: nowrap;
}
.stat span { color: var(--text-dim); font-size: 0.8rem; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: var(--accent-soft); transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--bg); font-weight: 600; }
.btn-primary:hover { background: #6adfd4; }

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem 2rem;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-title .accent {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.1rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 0.5rem;
}

/* Experience */
.company-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.8rem;
}

.company-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.company-head h4 { font-size: 1.35rem; }
.company-meta { color: var(--text-dim); font-size: 0.88rem; }
.company-intro { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 1.6rem; line-height: 1.6; }
.card-footnote { margin-top: 1.4rem; font-size: 0.85rem; font-style: italic; }

.pill {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
}
.role-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.role-chip em {
  font-style: normal;
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
  margin-left: 0.35rem;
}
.role-chip.current {
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.timeline { position: relative; padding-left: 1.2rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; padding: 0 0 1.8rem 1.2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.2rem;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-4px);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-when {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.timeline-body h5 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.timeline-body .sub-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.8rem 0 0.3rem;
}
.timeline-body ul { list-style: none; }
.timeline-body li {
  color: var(--text-dim);
  font-size: 0.92rem;
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.35rem;
}
.timeline-body li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.3rem;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.skill-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}
.skill-card h5 { color: var(--accent); margin-bottom: 0.4rem; font-size: 0.95rem; }
.skill-card p { color: var(--text-dim); font-size: 0.9rem; }

/* Education */
.edu-list { display: flex; flex-direction: column; gap: 0.8rem; }

.edu-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
}
.edu-item h5 { font-size: 1rem; }
.edu-item .dim { font-size: 0.88rem; }
.edu-meta {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
}

.award { margin-top: 1.5rem; color: var(--text-dim); font-size: 0.92rem; }

/* Contact */
.contact { text-align: center; }
.contact .section-title { justify-content: center; }
.contact .section-title::after { display: none; }
.contact p { color: var(--text-dim); }
.contact .hero-cta { justify-content: center; }
.location { margin-top: 1.5rem; font-size: 0.9rem; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Hero entrance */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.hero-inner > * {
  animation: rise 0.55s ease both;
}
.hero-inner > *:nth-child(2) { animation-delay: 0.08s; }
.hero-inner > *:nth-child(3) { animation-delay: 0.16s; }
.hero-inner > *:nth-child(4) { animation-delay: 0.24s; }
.hero-inner > *:nth-child(5) { animation-delay: 0.32s; }
.hero-inner > *:nth-child(6) { animation-delay: 0.40s; }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* Gentle stagger for items inside a revealed section */
.reveal .timeline-item,
.reveal .skill-card,
.reveal .edu-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible .timeline-item,
.reveal.visible .skill-card,
.reveal.visible .edu-item {
  opacity: 1;
  transform: none;
}
.reveal.visible :is(.timeline-item, .skill-card, .edu-item):nth-child(1) { transition-delay: 0.05s; }
.reveal.visible :is(.timeline-item, .skill-card, .edu-item):nth-child(2) { transition-delay: 0.15s; }
.reveal.visible :is(.timeline-item, .skill-card, .edu-item):nth-child(3) { transition-delay: 0.25s; }
.reveal.visible :is(.timeline-item, .skill-card, .edu-item):nth-child(4) { transition-delay: 0.35s; }

/* Accent underline sweep on section titles */
.section-title::after {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s ease 0.2s;
}
.reveal.visible .section-title::after { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-inner > * { animation: none; }
  .reveal,
  .reveal .timeline-item,
  .reveal .skill-card,
  .reveal .edu-item,
  .section-title::after {
    opacity: 1; transform: none; transition: none;
  }
}

.btn { font-family: inherit; background: none; cursor: pointer; }
.btn-primary { background: var(--accent); }

/* Print — clean light one-pager for "Download PDF" */
@media print {
  :root {
    --bg: #fff;
    --bg-card: #fff;
    --text: #111;
    --text-dim: #444;
    --accent: #0e7a6e;
    --accent-soft: transparent;
    --border: #ccc;
  }
  body { font-size: 11px; }
  .nav, .hero-cta, .footer, .cursor, .hero::before { display: none !important; }
  .hero { min-height: 0; padding: 0 0 1rem; }
  .hero-kicker { display: none; }
  .section { padding: 1rem 0; }
  .reveal, .reveal .timeline-item, .reveal .skill-card, .reveal .edu-item,
  .hero-inner > *, .section-title::after {
    opacity: 1 !important; transform: none !important;
    animation: none !important; transition: none !important;
  }
  .company-card, .skill-card, .edu-item, .stat { border: 1px solid var(--border); box-shadow: none; }
  .contact { text-align: left; }
  .contact .hero-cta { display: flex !important; }
  .contact .btn { border: none; padding: 0; color: var(--accent); }
  a { text-decoration: none; color: inherit; }
  #experience { break-inside: avoid-page; }
}

@media (max-width: 600px) {
  .nav { padding: 0.8rem 1.2rem; }
  .nav-links a { margin-left: 1rem; font-size: 0.82rem; }
  .section { padding: 3rem 1.2rem; }
  .hero { padding: 3rem 1.2rem; }
  .company-card { padding: 1.2rem; }
}
