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

:root {
  --bg:         #f8fafc;
  --bg-card:    #ffffff;
  --bg-card-h:  #f1f5f9;
  --border:     rgba(15,23,42,0.09);
  --border-h:   rgba(99,102,241,0.45);
  --text:       #0f172a;
  --text-muted: #64748b;
  --accent-1:   #6366f1;
  --accent-2:   #0ea5e9;
  --gradient:   linear-gradient(135deg, #6366f1 0%, #0ea5e9 55%, #06b6d4 100%);
  --radius:     12px;
  --nav-h:      64px;
  --max-w:      880px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 16px;
  font-optical-sizing: auto;
  line-height: 1.75;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

/* Space Grotesk for all display / UI text */
h1, h2, h3,
.nav-logo,
.nav-links a,
.section-label,
.hero-tag,
.hero-tagline,
.hero-subtitle,
.skill-group-title,
.project-title,
.writing-title,
.company-name,
.tl-role,
.timeline-dates,
.tag,
.social-link {
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

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

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ─── Nav ───────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background: rgba(248,250,252,0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--border);
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

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

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

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

/* ─── Section common ────────────────────────────────────────── */
section { padding: 6rem 0; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.section-label::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--border);
}

/* ─── Fade-in animation ─────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Hero ──────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -5%;
  width: 50%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(14,165,233,0.07) 0%, transparent 70%);
  pointer-events: none;
}

/* Two-column hero layout */
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  width: 100%;
}

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

.hero-avatar-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid rgba(99,102,241,0.4);
  box-shadow: 0 0 0 6px rgba(99,102,241,0.07), 0 24px 48px rgba(15,23,42,0.12);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6366f1;
  margin-bottom: 1.5rem;
}

.hero-tag .dot {
  width: 6px; height: 6px;
  background: #6366f1;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #0f172a 0%, #6366f1 55%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero-bio {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

/* Social icons */
.social-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}

.social-link:hover {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.06);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.12);
}

.social-link i { font-size: 0.9rem; }

/* ─── About ─────────────────────────────────────────────────── */
.about-text p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--text); font-weight: 500; }

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

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05);
}

.skill-group:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 4px 16px rgba(99,102,241,0.08);
}

.skill-group-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6366f1;
  margin-bottom: 0.5rem;
}

.skill-group-items {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Work / Timeline ───────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 3rem;
}

/* Glowing gradient vertical line — clearly on the left */
.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 28px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--accent-1) 0%,
    rgba(99,102,241,0.3) 40%,
    rgba(99,102,241,0.06) 100%
  );
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

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

/* ── Dot ── */
.tl-dot {
  position: absolute;
  left: 0;
  top: 1.3rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-1);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.08);
  transition: all 0.3s ease;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-1);
  opacity: 0.45;
  transition: all 0.3s ease;
}

.timeline-item:hover .tl-dot {
  box-shadow: 0 0 0 6px rgba(99,102,241,0.12), 0 0 22px rgba(99,102,241,0.25);
}

.timeline-item:hover .tl-dot::after {
  opacity: 1;
  transform: scale(1.25);
}

/* ── Card ── */
.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid rgba(99,102,241,0.2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.25rem 1.25rem;
  transition: border-left-color 0.3s, box-shadow 0.3s, transform 0.25s;
  box-shadow: 0 1px 4px rgba(15,23,42,0.06);
}

.timeline-item:hover .tl-card {
  border-left-color: var(--accent-1);
  border-color: rgba(99,102,241,0.18);
  box-shadow: 0 6px 24px rgba(99,102,241,0.10), 0 1px 4px rgba(15,23,42,0.06);
  transform: translateX(3px);
}

/* ── Card header: logo + company + date pill ── */
.tl-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.timeline-company {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.company-logo-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,0.08);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,23,42,0.10);
}

.company-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.company-logo-fallback {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(99,102,241,0.22);
  background: rgba(99,102,241,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6366f1;
  flex-shrink: 0;
}

.company-info { display: flex; flex-direction: column; gap: 0.15rem; }
.company-name { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.company-detail { font-size: 0.78rem; color: var(--text-muted); font-weight: 400; }

/* ── Date pill ── */
.timeline-dates {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-1);
  background: rgba(99,102,241,0.07);
  border: 1px solid rgba(99,102,241,0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  align-self: flex-start;
  letter-spacing: 0.02em;
}

/* ── Role title row ── */
.tl-role {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0ea5e9;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(15,23,42,0.07);
  letter-spacing: 0.01em;
}

/* ── Bullets ── */
.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.tl-narrative {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin: 0;
}

.timeline-desc li {
  list-style: none;
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.35rem;
}

.timeline-desc li:last-child { margin-bottom: 0; }

.timeline-desc li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent-1);
  font-size: 0.8rem;
  top: 0.05rem;
}

/* ─── Projects ──────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: default;
  box-shadow: 0 1px 4px rgba(15,23,42,0.06);
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-h);
  box-shadow: 0 8px 28px rgba(99,102,241,0.12);
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.project-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.project-link-icon {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.project-card:hover .project-link-icon { color: var(--text); }

.project-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

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

.tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(99,102,241,0.07);
  color: #6366f1;
  border: 1px solid rgba(99,102,241,0.18);
}

/* ─── Writing ───────────────────────────────────────────────── */
.writing-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.writing-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05);
}

.writing-item:hover {
  border-color: var(--border-h);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.09);
}

.writing-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.writing-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.writing-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.3rem;
  line-height: 1.5;
  opacity: 0.8;
}

.writing-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
  transition: color 0.2s, transform 0.2s;
}

.writing-item:hover .writing-arrow {
  color: var(--accent-1);
  transform: translateX(3px);
}

/* ─── Footer ────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  transition: color 0.2s;
}

footer a:hover { color: var(--text); }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
  nav { padding: 0 1rem; }
  .nav-links { gap: 1.25rem; }
  .nav-links li:nth-child(4) { display: none; }
  section { padding: 4rem 0; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 1.5rem; }
  .hero-avatar { width: 110px; height: 110px; }
}
