:root {
  --bg: #07080d;
  --bg-alt: #12141d;
  --bg-alt-2: #171a26;
  --border: #262a3a;
  --border-hover: #3d4460;
  --text: #f1f3f7;
  --muted: #9aa4b8;
  --accent: #5eead4;
  --accent-2: #7c9eff;
  --accent-3: #f472b6;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --gradient-vibrant: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
  --radius: 16px;
  --max-width: 1080px;
  --shadow-glow: 0 0 0 1px rgba(124, 158, 255, 0.15), 0 20px 40px -20px rgba(124, 158, 255, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(94, 234, 212, 0.07), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(124, 158, 255, 0.08), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(244, 114, 182, 0.05), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo {
  font-family: "Space Grotesk", "Inter", -apple-system, sans-serif;
  letter-spacing: -0.01em;
}

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

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

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 8, 13, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  background: var(--gradient-vibrant);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
  padding-bottom: 4px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

/* Scroll progress bar */
.scroll-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  pointer-events: none;
}

.scroll-progress {
  height: 100%;
  width: 0%;
  background: var(--gradient-vibrant);
  box-shadow: 0 0 10px rgba(124, 158, 255, 0.7);
}

/* Hero */
.hero {
  position: relative;
  padding: 120px 24px 80px;
  text-align: left;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(600px circle at var(--spot-x, 30%) var(--spot-y, 20%), rgba(124, 158, 255, 0.14), transparent 45%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.35;
  animation: float 12s ease-in-out infinite;
}

.hero::before {
  background: var(--accent);
  top: -160px;
  left: -120px;
}

.hero::after {
  background: var(--accent-2);
  top: -80px;
  right: -160px;
  animation-delay: -6s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 40px) scale(1.08); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 16px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 12px 2px rgba(94, 234, 212, 0.6);
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  margin: 0 0 8px;
  background: linear-gradient(180deg, #ffffff, #b9c2d6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-role {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 18px;
  background: var(--gradient-vibrant);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 640px;
  margin: 0 0 36px;
}

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

.cursor-blink {
  color: var(--accent);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-stats {
  display: flex;
  gap: 44px;
  flex-wrap: wrap;
  margin-top: 52px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
  background: var(--gradient-vibrant);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-3px); }

.btn-primary {
  background: var(--gradient-vibrant);
  background-size: 200% 200%;
  color: #08110f;
  box-shadow: 0 12px 30px -10px rgba(94, 234, 212, 0.5);
}

.btn-primary:hover {
  background-position: 100% 0;
  box-shadow: 0 16px 36px -8px rgba(124, 158, 255, 0.55);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.btn-ghost:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(124, 158, 255, 0.25), 0 12px 24px -12px rgba(124, 158, 255, 0.4);
}

/* Sections */
section {
  padding: 88px 0;
  border-top: 1px solid var(--border);
  position: relative;
}

section .container > h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 40px;
  font-size: 1.05rem;
}

#bio p {
  color: var(--muted);
  max-width: 720px;
  font-size: 1.05rem;
}

/* Timeline (My Story) */
.timeline {
  position: relative;
  margin-top: 12px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-3));
  opacity: 0.35;
}

.timeline-item {
  position: relative;
  padding: 0 0 40px 44px;
}

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

.timeline-item.from-left { transform: translateX(-32px); opacity: 0; }
.timeline-item.from-right { transform: translateX(32px); opacity: 0; }
.timeline-item.from-left.revealed,
.timeline-item.from-right.revealed { transform: translateX(0); opacity: 1; }

.timeline-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 3px solid var(--accent-2);
  box-shadow: 0 0 0 5px rgba(124, 158, 255, 0.12);
}

.timeline-content {
  background: linear-gradient(180deg, var(--bg-alt-2), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

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

.timeline-year {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.timeline-org {
  color: var(--accent-2);
  font-weight: 500;
  margin: 2px 0 8px;
  font-size: 0.95rem;
}

.timeline-content h3 { margin: 0; font-size: 1.15rem; }
.timeline-content p { color: var(--muted); margin: 6px 0 0; }

.timeline-projects {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-project {
  padding-left: 14px;
  border-left: 2px solid var(--border);
}

.timeline-project-name {
  display: block;
  font-weight: 600;
  color: var(--accent-2);
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.timeline-project p {
  margin: 0;
  font-size: 0.92rem;
}

/* Tech stack */
.tech-group { margin-bottom: 28px; }

.tech-group h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.badge:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-alt-2);
  color: var(--accent);
}

/* Cards */
.card {
  position: relative;
  display: block;
  background: linear-gradient(180deg, var(--bg-alt-2), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: var(--radius);
  background: var(--gradient-vibrant);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.card:hover {
  border-color: transparent;
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
}

.card:hover::before {
  opacity: 1;
}

.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.tool-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.tool-card h3 svg { color: var(--accent-2); transition: transform 0.25s ease; }
.tool-card:hover h3 svg { transform: translate(3px, -3px); }

.tool-card p {
  color: var(--muted);
  margin: 0;
}

.tool-tagline {
  font-weight: 600;
  color: var(--text) !important;
  margin: 0 0 10px !important;
  font-size: 0.95rem;
}

.tag-tool { background: rgba(94, 234, 212, 0.15); color: var(--accent); margin-bottom: 14px; }

/* Tilt (3D hover) */
.tilt {
  transition: transform 0.1s ease-out, border-color 0.25s ease, box-shadow 0.25s ease;
  transform-style: preserve-3d;
}

/* Magnetic buttons */
.magnetic { transition: transform 0.15s ease-out, box-shadow 0.2s ease, border-color 0.2s ease; }

/* Blog cards */
.blog-card h3 { margin: 14px 0 8px; font-size: 1.1rem; }
.blog-card p { color: var(--muted); margin: 0 0 14px; }
.blog-card .date { color: var(--muted); font-size: 0.85rem; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.tag-tools { background: rgba(124, 158, 255, 0.15); color: var(--accent-2); }
.tag-travel { background: rgba(94, 234, 212, 0.15); color: var(--accent); }

.blog-teaser-footer {
  margin-top: 32px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 44px 0;
  color: var(--muted);
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-vibrant);
  opacity: 0.6;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-email {
  color: var(--accent-2);
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-email:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.social-links {
  display: flex;
  gap: 14px;
}

.social-links a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px -8px rgba(94, 234, 212, 0.5);
}

/* Blog listing page */
.filter-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-tab {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.filter-tab.active {
  color: #08110f;
  background: var(--gradient-vibrant);
  border-color: transparent;
  font-weight: 600;
}

/* Post page */
.post-header { padding: 72px 0 24px; }
.post-header h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 700;
  margin: 14px 0;
}
.post-meta { color: var(--muted); }
.post-content { color: var(--text); max-width: 720px; font-size: 1.05rem; }
.post-content p { color: var(--muted); }
.post-content li { color: var(--muted); margin-bottom: 6px; }
.post-content ul { margin: 12px 0; padding-left: 22px; }

.post-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 36px 0 12px;
}
.post-content h2:first-child { margin-top: 0; }

.post-content code {
  background: var(--bg-alt-2);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.post-content pre {
  background: var(--bg-alt-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 16px 0;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 0.88em;
  line-height: 1.7;
}

.post-content a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.back-link {
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}
.back-link:hover { gap: 8px; }

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .hero::before, .hero::after { width: 300px; height: 300px; }
}
