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

:root {
  --bg:       #f0f8ff;
  --accent:   #38bdf8;
  --accent2:  #0ea5e9;
  --text:     #1a1c2e;
  --text2:    #5a6272;
  --text3:    #4a5568;
  --border:   rgba(0,0,0,0.07);
  --border-h: rgba(14,165,233,0.35);

  /* Apple glass */
  --glass-bg:     rgba(255,255,255,0.68);
  --glass-border: rgba(255,255,255,0.85);
  --glass-shadow: 0 4px 30px rgba(0,0,0,0.08), inset 0 0 0 0.5px rgba(255,255,255,0.7);
  --glass-blur:   saturate(180%) blur(20px);

  --font:   'Inter', system-ui, -apple-system, sans-serif;
  --mono:   'JetBrains Mono', 'Fira Code', monospace;
  --radius: 16px;
  --max-w:  900px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

code {
  font-family: var(--mono);
  font-size: 0.83em;
  background: rgba(14,165,233,0.1);
  color: var(--accent2);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Canvas ─────────────────────────────────────────────── */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#navbar, section, footer { position: relative; z-index: 1; }

/* ── Apple Glass ─────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
}

/* ── Typography ─────────────────────────────────────────── */
.section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 2.5rem;
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

section { padding: 6rem 0; }

/* ── Navbar ─────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(238,244,253,0.75);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent2);
}

.nav-links { display: flex; gap: 2rem; }

.nav-links a {
  font-size: 0.85rem;
  color: var(--text2);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

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

.hero-content {
  text-align: center;
  max-width: 620px;
}

/* ── Nav Avatar (replaces JF text) ──────────────────────── */
.nav-avatar {
  display: grid;          /* stack images in same cell */
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  overflow: hidden;
}

.nav-avatar img {
  grid-area: 1 / 1;      /* both imgs occupy same cell */
  width: 36px;
  height: 36px;
  object-fit: contain;
  transition: opacity 0.12s ease;
}

#face-default { opacity: 1; }
#face-smile   { opacity: 0; }

.nav-avatar.smiling #face-default { opacity: 0; }
.nav-avatar.smiling #face-smile   { opacity: 1; }

#nav-logo-trigger {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
#nav-logo-trigger:hover { opacity: 0.8; }

.hero-greeting {
  font-size: 0.78rem;
  color: var(--text3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-name {
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
}

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

.hero-title {
  font-size: 1rem;
  color: var(--text2);
  margin-bottom: 0.75rem;
}

.hero-sub {
  font-size: 0.875rem;
  color: var(--text3);
  line-height: 1.9;
  margin-bottom: 2.5rem;
}

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.25s;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent2);
  color: #fff;
  box-shadow: 0 4px 16px rgba(14,165,233,0.35);
}
.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(56,189,248,0.4);
}

.btn-outline {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--glass-border);
  color: var(--text2);
  box-shadow: var(--glass-shadow);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent2);
  transform: translateY(-2px);
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero-scroll span {
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text3);
}

.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--accent2), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.8; }
}

/* ── About ──────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.about-text p {
  color: var(--text2);
  margin-bottom: 1rem;
  font-size: 0.925rem;
}
.about-text strong { color: var(--text); }

.skills-box { padding: 1.75rem; }

.skills-box h3 {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 1.5rem;
}

.skill-group { margin-bottom: 1.1rem; }

.skill-label {
  font-size: 0.7rem;
  color: var(--text3);
  display: block;
  margin-bottom: 0.45rem;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  display: inline-block;
  background: rgba(14,165,233,0.09);
  border: 0.5px solid rgba(14,165,233,0.3);
  color: var(--accent2);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.78rem;
  transition: all 0.2s;
}
.tag:hover {
  background: rgba(14,165,233,0.16);
}
.tag-sm { font-size: 0.72rem; padding: 0.15rem 0.55rem; }

.cert-line {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text3);
  border-top: 0.5px solid var(--border);
  padding-top: 1rem;
}
.cert-icon { color: var(--accent2); margin-right: 0.4rem; }

/* ── Timeline ───────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 2rem; }

.timeline-item {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 2rem;
  align-items: start;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 1.5rem;
  text-align: right;
}

.timeline-period {
  font-size: 0.75rem;
  color: var(--accent2);
  font-family: var(--mono);
}

.timeline-loc { font-size: 0.7rem; color: var(--text3); }

.timeline-card {
  padding: 1.5rem;
  transition: box-shadow 0.25s, transform 0.25s;
}
.timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.1), inset 0 0 0 0.5px rgba(14,165,233,0.3);
}

.card-header { margin-bottom: 1rem; }
.card-header h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; }
.company { font-size: 0.8rem; color: var(--text2); }

.timeline-card ul {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.timeline-card li {
  font-size: 0.865rem;
  color: var(--text2);
  padding-left: 1rem;
  position: relative;
  line-height: 1.6;
}

.timeline-card li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent2);
  font-size: 1rem;
}

.timeline-card li strong { color: var(--text); }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ── Projects ───────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.project-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: box-shadow 0.25s, transform 0.25s;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1), inset 0 0 0 0.5px rgba(14,165,233,0.3);
}

.project-top { display: flex; justify-content: space-between; align-items: center; }
.project-tag { font-size: 0.66rem; color: var(--accent2); letter-spacing: 0.06em; text-transform: uppercase; }
.project-date { font-size: 0.68rem; color: var(--text3); font-family: var(--mono); }
.project-card h3 { font-size: 0.95rem; font-weight: 600; line-height: 1.35; }
.project-org { font-size: 0.76rem; color: var(--text3); }
.project-card p:not(.project-org) { font-size: 0.855rem; color: var(--text2); flex: 1; line-height: 1.65; }
.project-card strong { color: var(--text); }

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

.edu-item {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 2rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.25s;
}
.edu-item:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.09), inset 0 0 0 0.5px rgba(14,165,233,0.25);
}

.edu-meta { display: flex; flex-direction: column; gap: 0.3rem; text-align: right; }
.edu-period { font-size: 0.75rem; color: var(--accent2); font-family: var(--mono); }
.edu-loc { font-size: 0.7rem; color: var(--text3); }
.edu-body h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; }
.edu-school { font-size: 0.83rem; color: var(--text2); margin-bottom: 0.4rem; }
.edu-courses { font-size: 0.76rem; color: var(--text3); line-height: 1.65; }

/* ── Contact ────────────────────────────────────────────── */
#contact { text-align: center; }

.contact-lead {
  color: var(--text2);
  max-width: 460px;
  margin: 0 auto 2.5rem;
  font-size: 0.925rem;
}

.contact-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  color: var(--text2);
  padding: 0.75rem 1.4rem;
  border-radius: 50px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: all 0.25s;
}

.contact-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.contact-item:hover {
  color: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(14,165,233,0.15);
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.76rem;
  color: var(--text3);
  border-top: 0.5px solid var(--border);
  position: relative;
  z-index: 1;
}

/* ── Reveal ─────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Hamburger ───────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: all 0.25s ease;
}
/* X animation when open */
#navbar.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#navbar.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
#navbar.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .about-grid, .projects-grid { grid-template-columns: 1fr; }
  .timeline-item, .edu-item { grid-template-columns: 1fr; gap: 0.75rem; }
  .timeline-meta, .edu-meta { text-align: left; flex-direction: row; gap: 1rem; }
  .nav-links { gap: 1.2rem; }
  section { padding: 4rem 0; }
  .container { padding: 0 1.25rem; }
}

@media (max-width: 480px) {
  /* Navbar: avatar left, hamburger right */
  .nav-inner {
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
  }
  .nav-hamburger { display: flex; }

  /* Nav links: dropdown below navbar */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: rgba(238,244,253,0.96);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-bottom: 0.5px solid rgba(0,0,0,0.08);
    padding: 0.5rem 0 1rem;
  }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links a {
    display: block;
    padding: 0.7rem 0;
    font-size: 0.95rem;
  }
  #navbar.nav-open .nav-links { display: flex; }

  /* Hero */
  .hero-name { font-size: clamp(2.4rem, 13vw, 3.5rem); }
  .hero-sub { font-size: 0.82rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .btn { width: 200px; text-align: center; }

  section { padding: 3rem 0; }
  .container { padding: 0 1rem; }
  .section-title { margin-bottom: 1.75rem; }

  /* Cards */
  .timeline-card, .project-card, .edu-item, .skills-box {
    padding: 1.25rem;
  }
  .card-tags { gap: 0.35rem; }

  /* Skills */
  .skill-group { margin-bottom: 0.75rem; }

  /* Contact */
  .contact-links { flex-direction: column; gap: 1rem; align-items: center; }
}
