/* ── Reset & base ──────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --surface: #ffffff;
  --border: #e6e8ec;
  --text: #16181d;
  --text-muted: #5b616e;
  --text-faint: #9aa0ab;
  --accent: #1f4bd8;
  --accent-soft: rgba(31, 75, 216, 0.08);
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  --max-width: 760px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

ul {
  list-style: none;
}

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

/* ── Layout ────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.content {
  flex: 1;
  min-width: 0;
}

/* ── Sidebar (desktop: sticky left rail / resume card) ────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar__top {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar__brand {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar__brand-so,
.sidebar__brand-far {
  color: var(--text);
}

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

.sidebar__role {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar__nav a {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.sidebar__nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Year rail: acts as a mini resume timeline / quick nav */
.sidebar__rail {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  overflow-y: auto;
}

.rail__chip {
  position: relative;
  padding: 0.65rem 0.75rem 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-faint);
  border-left: 2px solid var(--border);
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.rail__chip::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s ease;
}

.rail__chip:hover {
  color: var(--text);
}

.rail__chip.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.rail__chip.is-active::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sidebar__footer {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar__footer a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.sidebar__footer a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem 3rem;
}

.hero__eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
}

.hero__name {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.hero__brand-so,
.hero__brand-far {
  color: var(--text);
}

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

.hero__tagline {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 50ch;
  margin-bottom: 1.75rem;
}

.hero__cta {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.hero__cta:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Section shared ────────────────────────────────────────────────────── */
main section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 2rem;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.about-section .section-title,
.contact-section .section-title {
  margin-bottom: 1.25rem;
}

/* ── Timeline (year-wise) ──────────────────────────────────────────────── */
.timeline-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-year {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 1rem;
}

.timeline-year:first-child {
  border-top: none;
  padding-top: 0.5rem;
}

.timeline-year__label {
  margin-bottom: 1.1rem;
}

.timeline-year__label span {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-faint);
  transition: color 0.3s ease;
}

.timeline-year.is-active .timeline-year__label span {
  color: var(--accent);
}

.timeline-year__events {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-item {
  position: relative;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.timeline-item:hover {
  border-color: #d3d8e0;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.06);
}

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

.timeline-item__date {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.timeline-item__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.timeline-item__subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.timeline-item__desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 65ch;
}

.timeline-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.timeline-item__tags span {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ── About ─────────────────────────────────────────────────────────────── */
.about-text {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 65ch;
}

/* ── Contact ───────────────────────────────────────────────────────────── */
.contact-links {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.contact-links a {
  padding: 0.65rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.contact-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── Mobile (extremely mobile-friendly) ───────────────────────────────── */
/* Sidebar collapses into a sticky top bar with a horizontally scrolling
   year rail — no hidden menus, everything reachable with a thumb. */
@media (max-width: 860px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    padding-top: max(0.6rem, env(safe-area-inset-top));
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: rgba(247, 248, 250, 0.92);
    backdrop-filter: blur(10px);
    overflow: visible;
  }

  .sidebar__top {
    flex-shrink: 0;
  }

  .sidebar__brand {
    font-size: 1rem;
  }

  .sidebar__role {
    display: none;
  }

  .sidebar__nav {
    display: none;
  }

  .sidebar__rail {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    padding-top: 0;
    border-top: none;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sidebar__rail::-webkit-scrollbar {
    display: none;
  }

  .rail__chip {
    flex-shrink: 0;
    scroll-snap-align: center;
    padding: 0.5rem 0.9rem;
    border-left: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.85rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .rail__chip::before {
    display: none;
  }

  .rail__chip.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }

  .sidebar__footer {
    display: none;
  }

  .hero {
    padding: 2rem 1.25rem 2rem;
  }

  main section {
    padding: 2.5rem 1.25rem;
  }

  .timeline-item {
    padding: 1.1rem;
  }

  .contact-links a,
  .timeline-item__tags span {
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 0.55rem 0.7rem;
    gap: 0.5rem;
  }

  .sidebar__brand {
    font-size: 0.92rem;
  }

  .rail__chip {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }

  .hero__name {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .hero__tagline {
    font-size: 0.95rem;
  }

  main section {
    padding: 2rem 1rem;
  }

  .contact-links {
    flex-direction: column;
  }

  .contact-links a {
    text-align: center;
  }
}
