:root {
  --bg: #090d16;
  --surface: #111827;
  --surface-hover: #1a2333;
  --border: #1f293d;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.1);
  --accent-glow: rgba(56, 189, 248, 0.15);
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 1px 1px rgba(255, 255, 255, 0.03) inset;
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --text: #0f1724;
  --muted: #64748b;
  --accent: #0284c7;
  --accent-soft: #e0f2fe;
  --border: #cbd5e1;
  --shadow-elevation: 0 10px 30px rgba(0, 0, 0, 0.06), 0 0 1px 1px rgba(0, 0, 0, 0.04) inset;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: 
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 35%),
    var(--bg);
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Ambient background glows with high-end refinement */
.ambient-glow {
  position: absolute;
  width: min(500px, 80vw);
  height: min(500px, 80vw);
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.25;
  pointer-events: none;
  max-width: 100%;
}
.glow-1 { top: -50px; left: -100px; background: rgba(56, 189, 248, 0.15); }
.glow-2 { top: 35%; right: -100px; background: rgba(147, 51, 234, 0.1); }

.page-shell {
  width: min(1140px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 64px;
  max-width: 100%;
  overflow-x: hidden;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 99px;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1140px, calc(100% - 32px));
  z-index: 1000;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  opacity: 1;
}

/* Completely hide navbar on scroll down */
.navbar.nav-hidden {
  transform: translateX(-50%) translateY(-120px);
  opacity: 0;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.brand-badge {
  background: var(--accent);
  color: var(--bg);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.brand-verified {
  display: grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-left: -6px;
  border-radius: 50%;
  background: #1d9bf0;
}

.brand-verified svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

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

.nav-cta {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 99px;
  color: var(--text) !important;
}
.nav-cta::after {
  display: none !important;
}
.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.hamburger-bar {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
  padding: 160px 0 60px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 99px;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-intro h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 600px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px var(--accent-glow);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevation);
}

.hero-metrics {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}

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

.divider-vertical {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* Hero Highlight Card */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  box-shadow: var(--shadow-elevation);
  padding: 28px;
  background: linear-gradient(145deg, var(--surface), var(--surface-hover));
}

.card-header-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.hero-card h3 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.card-company {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.card-summary {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.tech-stack-mini {
  display: flex;
  gap: 8px;
  list-style: none;
  flex-wrap: wrap;
}

.tech-stack-mini li {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* Sections General */
.section {
  padding: 70px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 36px;
}

.section-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
}

.section-header h2 {
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* About Grid */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
}

.about-text-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevation);
  padding: 32px;
}

.about-text-card p {
  color: var(--muted);
  margin-bottom: 0;
}

/* Timeline */
.timeline-container {
  display: flex;
  flex-direction: column;
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevation);
  padding: 28px;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.badge-role {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 99px;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

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

.timeline-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Skills Bento */
.skills-bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevation);
  padding: 24px;
}

.skill-box h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.skill-box p {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Bento Grid for Projects */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevation);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-card.span-2 {
  grid-column: span 2;
}

.card-top-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.card-top-tags span {
  font-size: 0.72rem;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  color: var(--accent);
}

.bento-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.bento-card p {
  color: var(--muted);
  font-size: 0.94rem;
}

/* Films Grid */
.films-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.film-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevation);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.film-badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  width: fit-content;
  margin-bottom: 12px;
  font-weight: 600;
}

.film-card h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.film-award {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 500;
}

.film-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.film-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
  margin-top: auto;
}
.film-link:hover {
  color: var(--accent);
  transform: translateX(3px);
}

/* Contact Section */
.contact-section {
  padding-bottom: 20px;
}

.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevation);
  background: linear-gradient(145deg, var(--surface), var(--surface-hover));
  border-radius: calc(var(--radius) * 1.5);
  padding: 50px 30px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.contact-box h2 {
  font-size: 2rem;
  margin: 12px 0 16px;
}

.contact-box p {
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 28px;
}

.contact-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Footer & Live Clock */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0 10px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  gap: 8px;
  text-align: center;
}

.footer-copyright,
.footer-credit {
  margin: 0;
}

.footer-copyright {
  color: var(--text);
}

.footer-credit {
  color: var(--muted);
}

#live-clock {
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-left: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.footer a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.footer a:hover {
  color: var(--accent);
}

/* Floating Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2147483647;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, color 0.2s ease;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.06);
  border-color: var(--accent);
  color: var(--accent);
}

/* Responsive Media Queries */
@media (max-width: 960px) {
  .hero-section,
  .about-grid,
  .bento-grid,
  .films-grid {
    grid-template-columns: 1fr;
  }
  
  .bento-card.span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 75px;
    left: 20px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    flex-direction: column;
    align-items: stretch;
    display: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    backdrop-filter: blur(16px);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    text-align: left;
  }
  
  .nav-links a::after {
    display: none;
  }

  .nav-cta {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    margin-top: 4px;
  }

  .skills-bento {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .divider-vertical {
    display: none;
  }

  .footer {
    align-items: center;
    text-align: center;
  }
}

/* --- Scroll Reveal Entrance Effects --- */
.reveal-section {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* --- Clean 3D Lift Effect for ALL Cards (No Tilt/Rotation) --- */
.hero-card, .bento-card, .film-card, .skill-box, .education-card, .about-terminal-card, .timeline-card {
  will-change: transform, box-shadow, border-color;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.hero-card:hover, .bento-card:hover, .film-card:hover, .skill-box:hover, .education-card:hover, .about-terminal-card:hover, .timeline-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 25px rgba(56, 189, 248, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Blinking Terminal Cursor */
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 28px;
  background-color: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
  animation: blinkCursor 1s infinite steps(1);
}

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

/* Click Ripple Animation Styling */
.click-ripple {
  position: fixed;
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: rippleExpand 0.6s cubic-bezier(0, 0.2, 0.8, 1) forwards;
  z-index: 99999;
}

@keyframes rippleExpand {
  0% {
    width: 10px;
    height: 10px;
    opacity: 1;
  }
  100% {
    width: 120px;
    height: 120px;
    opacity: 0;
  }
}

.btn-primary {
  transition: transform 0.2s cubic-bezier(0.1, 0.7, 0.1, 1), background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Theme Toggle Button --- */
.theme-toggle {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-elevation);
}

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

/* Icon visibility switches based on root theme attribute */
.theme-toggle .moon-icon {
  display: block;
}
.theme-toggle .sun-icon {
  display: none;
}

[data-theme="light"] .theme-toggle .moon-icon {
  display: none;
}
[data-theme="light"] .theme-toggle .sun-icon {
  display: block;
}

/* Badge CSS */
div:has(> .live-dot) {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  padding: 8px 16px !important;
  border-radius: 99px !important;
  box-shadow: var(--shadow-elevation) !important;
  width: fit-content !important;
}

.live-dot {
  width: 7px !important;
  height: 7px !important;
  background: var(--accent) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 10px var(--accent) !important;
  display: inline-block !important;
  position: relative !important;
}

.live-dot::after {
  content: '' !important;
  position: absolute !important;
  inset: -3px !important;
  border: 1px solid var(--accent) !important;
  border-radius: 50% !important;
  opacity: 0.6 !important;
  animation: badgePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
}

@keyframes badgePulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

div:has(> .live-dot) span:last-child {
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

/* --- Standalone Education Section Styles --- */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.education-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-elevation);
  position: relative;
  overflow: hidden;
}

.edu-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.edu-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.edu-tag {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 99px;
}

.edu-degree {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.edu-institution {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 12px;
}

.edu-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* --- Unified Mobile Card Boundary & Alignment Fix for ALL Cards --- */
@media (max-width: 768px) {
  .section, 
  .education-section, 
  .bento-grid,
  .films-grid,
  .skills-bento,
  .about-grid,
  .timeline-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .bento-card,
  .education-card,
  .timeline-card,
  .skill-box,
  .film-card,
  .hero-card,
  .about-text-card,
  .about-terminal-card,
  .contact-box {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .section-header {
    padding-left: 0 !important;
    margin-left: 0 !important;
    margin-bottom: 20px !important;
  }
}

/* --- About Terminal HUD Card Styling --- */
.about-terminal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-elevation);
  display: flex;
  flex-direction: column;
}

.terminal-bar {
  background: var(--surface-hover);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.t-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.t-dot.red { background: #ef4444; }
.t-dot.yellow { background: #f59e0b; }
.t-dot.green { background: #10b981; }

.t-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 8px;
}

.terminal-body {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.t-prompt {
  color: var(--accent);
  font-weight: 600;
}

.t-output {
  color: var(--text);
  padding-left: 16px;
  margin-bottom: 4px;
}

.t-highlight {
  color: #10b981;
  padding-left: 16px;
}

/* --- Paragraph Spacing Fix --- */
.about-text-card p + p {
  margin-top: 18px !important;
}


/* --- Ultimate Mobile Layout & Card Fix --- */
@media (max-width: 768px) {
  /* Lock viewport boundaries */
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Force the page shell and sections to have safe mobile margins */
  .page-shell {
    width: calc(100% - 24px) !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  .section {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Force all grids to single-column stack with equal width */
  .about-grid,
  .education-timeline,
  .education-grid,
  .bento-grid,
  .films-grid,
  .skills-bento,
  .footer-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  /* Force every single card type to fill 100% cleanly without breaking out */
  .bento-card,
  .education-card,
  .edu-hud-card,
  .timeline-card,
  .skill-box,
  .film-card,
  .hero-card,
  .about-text-card,
  .about-terminal-card,
  .contact-box {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Reset section headers alignment for mobile */
  .section-header {
    padding-left: 0 !important;
    margin-left: 0 !important;
    margin-bottom: 16px !important;
  }
}

/* --- Fix Mobile Skills Bento Overlap & Clipping --- */
@media (max-width: 768px) {
  .skills-bento {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    width: 100% !important;
    height: auto !important;
  }

  .skill-box {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: unset !important;
    transform: none !important;
    overflow: visible !important;
    margin-bottom: 0 !important;
  }
}

/* --- Global Removal of JS 3D Tilt / Rotation --- */
.hero-card, 
.bento-card, 
.film-card, 
.skill-box, 
.education-card, 
.edu-hud-card,
.about-terminal-card, 
.timeline-card {
  transform: none !important;
  transform-style: flat !important;
}

.hero-card:hover, 
.bento-card:hover, 
.film-card:hover, 
.skill-box:hover, 
.education-card:hover, 
.edu-hud-card:hover,
.about-terminal-card:hover, 
.timeline-card:hover {
  transform: translateY(-6px) !important;
}

/* --- Cinematic Code-Slate Brand Badge --- */
.brand-badge {
  background: var(--surface-hover) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  font-family: var(--font-mono) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.08) !important;
}

.brand:hover .brand-badge {
  background: var(--accent) !important;
  color: var(--bg) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25) !important;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .skills-bento,
  .bento-grid,
  .films-grid,
  .education-grid {
    padding-top: 16px !important;
  }

  .skill-box:first-child,
  .bento-card:first-child,
  .film-card:first-child,
  .education-card:first-child {
    margin-top: 12px !important;
  }
}

/* Product-inspired portfolio hero and interface surfaces */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 38px;
  padding: 158px 0 72px;
  position: relative;
  isolation: isolate;
}

.hero-section::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 120px;
  left: 50%;
  width: min(900px, 100%);
  height: 460px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 50% 20%, rgba(56, 189, 248, 0.15), transparent 62%),
    radial-gradient(ellipse at 80% 85%, rgba(129, 140, 248, 0.08), transparent 48%);
  filter: blur(20px);
  pointer-events: none;
}

.hero-intro {
  width: 100%;
  text-align: center;
}

.hero-intro h1 {
  max-width: 980px;
  margin: 0 auto 18px;
  font-size: clamp(2.45rem, 6.2vw, 4.65rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.gradient-text {
  background-image: linear-gradient(110deg, #38bdf8 8%, #60d6d0 54%, #818cf8 100%);
}

.hero-desc {
  max-width: 720px;
  margin: 0 auto 28px;
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  text-align: center;
}

.hero-actions {
  justify-content: center;
  margin-bottom: 32px;
}

.hero-metrics {
  justify-content: center;
  gap: 12px;
  padding-top: 0;
  border-top: 0;
}

.metric-item {
  min-width: 145px;
  padding: 12px 18px;
  background: rgba(17, 24, 39, 0.68);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: left;
}

[data-theme="light"] .metric-item {
  background: rgba(255, 255, 255, 0.78);
}

.metric-num {
  font-size: 1.35rem;
}

.divider-vertical {
  display: none;
}

.hero-card {
  width: min(100%, 900px);
  padding: clamp(22px, 4vw, 36px);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(56, 189, 248, 0.1), transparent 42%),
    linear-gradient(145deg, var(--surface), var(--surface-hover));
}

.hero-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.hero-card-topline .card-header-badge {
  margin-bottom: 0;
}

.hero-card-period {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.hero-card-period .live-dot {
  flex: 0 0 7px;
}

.hero-card-content {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
  align-items: stretch;
  gap: 28px;
}

.hero-card h3 {
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  margin-bottom: 6px;
}

.card-company {
  margin-bottom: 14px;
}

.card-summary {
  max-width: 540px;
  margin-bottom: 0;
  line-height: 1.7;
}

.hero-card-focus {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  background: rgba(9, 13, 22, 0.34);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.86rem;
}

[data-theme="light"] .hero-card-focus {
  background: rgba(248, 250, 252, 0.8);
}

.hero-card-focus-label {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card-focus > span:not(.hero-card-focus-label)::before {
  content: "↗";
  margin-right: 9px;
  color: var(--accent);
}

.hero-card .tech-stack-mini {
  margin-top: 20px;
}

.section {
  padding-top: 82px;
}

.section-header {
  margin-bottom: 32px;
}

.about-text-card,
.timeline-card,
.skill-box,
.bento-card,
.film-card,
.education-card,
.contact-box {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bento-card,
.film-card,
.skill-box,
.education-card,
.timeline-card,
.about-text-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.bento-card:hover,
.film-card:hover,
.skill-box:hover,
.education-card:hover,
.timeline-card:hover,
.about-text-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: var(--shadow-elevation), 0 0 28px rgba(56, 189, 248, 0.08);
}

.btn:focus-visible,
.nav-links a:focus-visible,
.theme-toggle:focus-visible,
.nav-toggle:focus-visible,
.film-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (max-width: 768px) {
  .hero-section {
    gap: 30px;
    padding: 132px 0 52px;
  }

  .hero-desc {
    width: 100%;
    max-width: 36rem;
    margin: 0 auto 24px;
    padding: 0 8px;
    line-height: 1.65;
    text-align: center;
  }

  .hero-section::before {
    top: 100px;
    height: 380px;
  }

  .hero-intro h1 {
    font-size: clamp(2.25rem, 9vw, 3.4rem);
  }

  .hero-metrics {
    flex-direction: row;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .metric-item {
    flex: 1 1 135px;
  }

  .hero-card-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-card-focus {
    gap: 8px;
  }

  .section {
    padding-top: 62px;
  }
}

@media (max-width: 420px) {
  .hero-card-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .hero-metrics {
    gap: 8px;
  }

  .metric-item {
    min-width: 125px;
    padding: 10px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
