:root {
  --bg: #050a15;
  --bg-soft: #0a1428;
  --card: rgba(16, 28, 55, 0.6);
  --text: #f0f4ff;
  --muted: #a0aec0;
  --accent: #00f2ff;
  --accent-2: #7000ff;
  --line: rgba(255, 255, 255, 0.1);
  --glass: blur(12px) saturate(180%);
}

body.light {
  --bg: #f8faff;
  --bg-soft: #edf2ff;
  --card: rgba(255, 255, 255, 0.7);
  --text: #1a202c;
  --muted: #4a5568;
  --accent: #0066ff;
  --accent-2: #6b46c1;
  --line: rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 40%),
    radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--accent-2) 15%, transparent), transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Glassmorphism Utility */
.glass-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

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

.container {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: var(--glass);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0;
}

.logo {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

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

.theme-btn {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: var(--glass);
  color: var(--text);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.hero {
  padding: 8rem 0 4rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  margin: 0.5rem 0 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hero-text {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 2.5rem;
}

.hero-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.hero-actions {
  display: flex;
  gap: 1.2rem;
}

.btn {
  border-radius: 12px;
  padding: 0.8rem 1.8rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 15px rgba(0, 242, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 242, 255, 0.4);
}

.btn-secondary {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: var(--glass);
}

.btn-secondary:hover {
  background: var(--line);
  border-color: var(--muted);
}

.section {
  padding: 6rem 0;
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 3rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card,
.timeline-card,
.work-card,
.contact-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
}

.card h3,
.timeline-card h3,
.work-card h3 {
  margin-top: 0.1rem;
  margin-bottom: 0.5rem;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.hero-image-wrap,
.feature-image-wrap,
.work-thumb-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.hero-image-wrap::after,
.feature-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.4));
  pointer-events: none;
}

.work-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.work-card:hover .work-thumb {
  transform: scale(1.05);
}

.work-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
}

/* Bento Box Layout */
.snapshot-bento {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.5rem;
  margin-top: 2rem;
}

.bento-main {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bento-main h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  margin-bottom: 1.5rem;
  line-height: 1.1;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.large-text {
  font-size: 1.25rem;
  color: var(--muted);
}

.bento-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), var(--card));
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

/* Journey Page Total Redesign */
.journey-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  position: relative;
}

.journey-header {
  text-align: center;
  margin-bottom: 8rem;
}

.journey-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
  margin-bottom: 12rem;
  position: relative;
}

.journey-date-col {
  text-align: right;
  padding-top: 0.5rem;
}

.journey-date-col .date-sticky {
  position: sticky;
  top: 150px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.journey-content-col {
  border-left: 1px solid var(--line);
  padding-left: 4rem;
  position: relative;
}

.journey-content-col::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 1rem;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 50%;
  z-index: 2;
  transition: all 0.3s ease;
}

.journey-section.active .journey-content-col::before {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
  transform: scale(1.5);
}

.journey-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 3.5rem;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.journey-card h3 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
  background: linear-gradient(to right, var(--text), var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.journey-card p {
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.journey-visual-wrap {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.journey-visual-wrap img {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
}

/* Work Page Premium Enhancements */
.work-hero {
  text-align: center;
  padding: 10rem 0 6rem;
}

.work-hero h1 {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  background: linear-gradient(to bottom, var(--text) 30%, var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 2rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.work-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 3rem;
  padding-bottom: 8rem;
}

.work-card-v2 {
  position: relative;
  border-radius: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 3rem;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 500px;
}

.work-card-v2:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.work-card-v2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.work-card-v2:hover::before {
  opacity: 1;
}

.card-header {
  position: relative;
  z-index: 1;
}

.card-category {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
  display: block;
}

.work-card-v2 h3 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.work-card-v2 p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.card-footer {
  margin-top: 3rem;
  position: relative;
  z-index: 1;
}

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.tech-pill {
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 0.8rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text);
  transition: gap 0.3s ease;
}

.work-card-v2:hover .card-link {
  gap: 1rem;
  color: var(--accent);
}

.floating-icon {
  position: absolute;
  bottom: -20px;
  right: -20px;
  font-size: 8rem;
  opacity: 0.03;
  transition: all 0.6s ease;
  pointer-events: none;
}

.work-card-v2:hover .floating-icon {
  opacity: 0.1;
  transform: translate(-20px, -20px) rotate(-10deg) scale(1.2);
}

.site-footer {
  padding: 4rem 0;
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  color: var(--muted);
}

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

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 6rem;
    gap: 3rem;
  }

  .hero-text {
    margin: 0 auto 2rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-image-wrap {
    max-width: 500px;
    margin: 0 auto;
    order: -1;
  }

  .snapshot-bento {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .bento-main {
    grid-row: auto;
    padding: 2rem;
  }

  .journey-section {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 6rem;
  }

  .journey-date-col {
    text-align: left;
    padding-left: 2rem;
  }

  .journey-date-col .date-sticky {
    position: static;
    font-size: 1rem;
  }

  .journey-content-col {
    padding-left: 2rem;
    border-left: 2px solid var(--line);
  }

  .journey-content-col::before {
    left: -7px;
    top: 0;
  }

  .journey-card {
    padding: 2rem;
  }

  .journey-card h3 {
    font-size: 1.8rem;
  }

  .work-grid-v2 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-hub {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-form-card {
    padding: 2rem;
  }
}

@media (max-width: 640px) {
  .container {
    width: 90%;
  }

  h1 {
    font-size: 2.5rem;
  }

  .work-hero h1 {
    font-size: 2.8rem;
  }

  .btn {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
  }

  .social-grid-v2 {
    grid-template-columns: 1fr;
  }

  .footer-wrap {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .journey-container {
    padding-bottom: 2rem;
  }

  .work-card-v2 {
    min-height: auto;
    padding: 2rem;
  }
}

/* Timeline fix for the last section */
.journey-section:last-child .journey-content-col {
  border-left-color: transparent;
}

.journey-section:last-child .journey-content-col::after {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  height: 1.2rem;
  width: 2px;
  background: var(--line);
}

/* Mobile Navigation */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1000;
  padding: 0.5rem;
}

.mobile-nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav a {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}

@media (max-width: 768px) {
  .nav-wrap {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center; /* Vertically center all items in the grid */
    padding: 0.8rem 0;
    min-height: 60px; /* Ensure consistent height */
  }

  .nav-links {
    display: none;
  }

  .logo {
    grid-column: 2;
    text-align: center;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    grid-column: 1;
    justify-self: start;
    height: 100%;
    padding: 0;
  }

  .theme-btn {
    grid-column: 3;
    justify-self: end;
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    display: flex;
    align-items: center;
  }
}

/* Mobile Navigation Enhanced V2 */
.mobile-nav {
  position: fixed;
  top: 60px; /* Aligned with header height */
  left: 0;
  width: 100%;
  height: calc(100vh - 60px);
  background: color-mix(in srgb, var(--bg) 98%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 4rem 2rem;
  gap: 1rem;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 1px solid var(--line);
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-nav-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
  opacity: 0;
  transition: opacity 0.4s ease 0.1s;
}

.mobile-nav.open .mobile-nav-label {
  opacity: 1;
}

.mobile-nav a {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  text-decoration: none;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--order) * 0.08s + 0.1s);
}

.mobile-nav.open a {
  opacity: 1;
  transform: translateX(0);
}

.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--accent);
}

.mobile-nav-footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.5s ease 0.5s;
}

.mobile-nav.open .mobile-nav-footer {
  opacity: 1;
}

.mobile-social-links {
  display: flex;
  gap: 1.5rem;
}

.mobile-social-links a {
  font-size: 0.9rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  color: var(--muted);
}

.mobile-nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Contact Page Premium Overhaul */
.contact-hub {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  padding: 8rem 0;
}

.contact-info-col {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-card-v2 {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  padding: 2.5rem;
  border-radius: 32px;
  transition: all 0.4s ease;
}

.contact-card-v2:hover {
  border-color: var(--accent);
  transform: translateX(10px);
}

.social-grid-v2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.social-tile {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 1.5rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.social-tile:hover {
  transform: translateY(-5px);
}

.social-tile.instagram:hover { border-color: #E1306C; box-shadow: 0 10px 20px rgba(225, 48, 108, 0.2); }
.social-tile.linkedin:hover { border-color: #0077B5; box-shadow: 0 10px 20px rgba(0, 119, 181, 0.2); }
.social-tile.github:hover { border-color: #ffffff; box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1); }

.social-tile h4 { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.15em; margin: 0; }
.social-tile span { font-weight: 700; color: var(--text); font-size: 1.1rem; }

.contact-form-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  padding: 3.5rem;
  border-radius: 40px;
}

.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

@media (max-width: 960px) {
  .contact-hub {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}
