/* ═══════════════════════════════════════════
   VARIABLES & THEME
   ═══════════════════════════════════════════ */

:root {
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);

  --nav-height: 72px;
  --section-pad: clamp(80px, 12vh, 160px);
  --content-width: 1200px;
  --border-radius: 16px;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-secondary: #f0f0f0;
  --text: #1a1a1a;
  --text-secondary: #6b6b6b;
  --accent: #4f46e5;
  --accent-secondary: #10b981;
  --border: rgba(0, 0, 0, 0.08);
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(0, 0, 0, 0.06);
  --glow-color: rgba(79, 70, 229, 0.08);
  --grain-opacity: 0.03;
  --nav-bg: rgba(250, 250, 250, 0.8);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-secondary: #141414;
  --text: #e5e5e5;
  --text-secondary: #888888;
  --accent: #818cf8;
  --accent-secondary: #34d399;
  --border: rgba(255, 255, 255, 0.06);
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.06);
  --glow-color: rgba(129, 140, 248, 0.06);
  --grain-opacity: 0.04;
  --nav-bg: rgba(10, 10, 10, 0.8);
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s var(--ease-out-expo), color 0.5s var(--ease-out-expo);
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════
   CURSOR GLOW
   ═══════════════════════════════════════════ */

.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}

.cursor-glow.active {
  opacity: 1;
}

/* ═══════════════════════════════════════════
   GRAIN OVERLAY
   ═══════════════════════════════════════════ */

.grain {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  animation: grain 0.5s steps(1) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 15%); }
  80% { transform: translate(3%, 35%); }
  90% { transform: translate(-10%, 10%); }
}

/* ═══════════════════════════════════════════
   PARTICLE CANVAS
   ═══════════════════════════════════════════ */

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 48px);
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s var(--ease-out-expo), background 0.5s var(--ease-out-expo);
}

.nav.hidden {
  transform: translateY(-100%);
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
}

.nav-logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out-expo);
}

.nav-logo:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-links {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.3s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out-expo);
}

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

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.3s, border-color 0.3s, transform 0.3s;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-secondary);
  transform: rotate(30deg);
}

.theme-icon {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: opacity 0.3s, transform 0.3s;
}

[data-theme="dark"] .sun { opacity: 1; transform: rotate(0deg); }
[data-theme="dark"] .moon { opacity: 0; transform: rotate(-90deg); }
[data-theme="light"] .sun { opacity: 0; transform: rotate(90deg); }
[data-theme="light"] .moon { opacity: 1; transform: rotate(0deg); }

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--nav-height) clamp(24px, 4vw, 48px) 60px;
  position: relative;
  z-index: 2;
}

.hero-content {
  max-width: var(--content-width);
  width: 100%;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--text-secondary);
}

.label-line {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 500;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 40px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.3);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: var(--text-secondary);
  color: var(--text);
  transform: translateY(-2px);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--accent);
  animation: scrollPulse 2s var(--ease-out-expo) infinite;
}

@keyframes scrollPulse {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  50.1% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ═══════════════════════════════════════════
   SECTIONS (General)
   ═══════════════════════════════════════════ */

.section {
  padding: var(--section-pad) clamp(24px, 4vw, 48px);
  max-width: var(--content-width);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.section-header {
  margin-bottom: clamp(40px, 6vh, 80px);
}

.section-number {
  display: block;
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ═══════════════════════════════════════════
   BENTO GRID (About)
   ═══════════════════════════════════════════ */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.bento-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: clamp(24px, 3vw, 40px);
  transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s var(--ease-out-expo), border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

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

.bento-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}

.bento-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.bento-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.bento-main {
  grid-column: 1 / 8;
  grid-row: 1 / 2;
}

.bento-interests {
  grid-column: 8 / 13;
  grid-row: 1 / 2;
}

.bento-education {
  grid-column: 1 / 6;
  grid-row: 2 / 3;
}

.bento-stats {
  grid-column: 6 / 13;
  grid-row: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.bento-label {
  display: block;
  color: var(--accent);
  margin-bottom: 20px;
}

/* Tags */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.3s;
}

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

/* Education items */
.education-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.edu-degree {
  font-weight: 500;
}

.edu-detail {
  color: var(--text-secondary);
}

/* Stats */
.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 4vw, 4rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 8px;
}

.stat-label {
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   TIMELINE (Experience)
   ═══════════════════════════════════════════ */

.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}

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

.timeline-marker {
  position: absolute;
  left: -40px;
  top: 8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  transition: background 0.3s, box-shadow 0.3s;
  z-index: 1;
}

.timeline-item:hover .timeline-marker {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(79, 70, 229, 0.4);
}

.timeline-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: clamp(20px, 3vw, 32px);
  transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s var(--ease-out-expo), border-color 0.3s;
}

.timeline-content:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
}

.timeline-date {
  color: var(--accent);
  font-size: 0.75rem;
}

.timeline-company {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.timeline-content p:last-of-type {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-sm {
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   PROJECTS GRID
   ═══════════════════════════════════════════ */

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

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: clamp(28px, 3vw, 40px);
  transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s var(--ease-out-expo), border-color 0.3s;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out-expo);
}

.project-card:hover::after {
  transform: scaleX(1);
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1);
}

.project-number {
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.project-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.project-desc {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  flex: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.project-links {
  display: flex;
  gap: 16px;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color 0.3s;
}

.project-link:hover {
  color: var(--accent-secondary);
}

/* ═══════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════ */

.section-contact {
  text-align: center;
  padding-bottom: calc(var(--section-pad) / 2);
}

.contact-content {
  max-width: 600px;
  margin: 0 auto;
}

.contact-text {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 40px;
  transition: transform 0.3s var(--ease-out-expo);
}

.contact-email:hover {
  transform: scale(1.02);
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.3s;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

.footer {
  text-align: center;
  padding: 32px clamp(24px, 4vw, 48px);
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

/* ═══════════════════════════════════════════
   REVEAL ANIMATIONS
   ═══════════════════════════════════════════ */

[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-scramble] {
  opacity: 0;
  transition: opacity 0.4s;
}

[data-scramble].revealed {
  opacity: 1;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }

  .bento-main,
  .bento-interests,
  .bento-education,
  .bento-stats {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .hero-name {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 30px;
  }

  .timeline-marker {
    left: -30px;
    width: 12px;
    height: 12px;
  }

  .timeline::before {
    left: 5px;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }
}

/* ═══════════════════════════════════════════
   MOBILE NAV HAMBURGER
   ═══════════════════════════════════════════ */

@media (max-width: 640px) {
  .nav {
    padding: 0 20px;
  }
}
