/* New Theme System */
:root {
  --c-glass: #bbbbbc;
  --c-light: #fff;
  --c-dark: #000;
  
  --c-content: #224;
  --c-action: #0052f5;
  
  --c-bg: #E8E8E9;
  
  --glass-reflex-dark: 1;
  --glass-reflex-light: 1;
  
  --saturation: 150%;
}

body {
  font-size: 20px;
  font-family: "DM Sans", sans-serif;
  font-optical-sizing: auto;
  background: var(--c-bg);
  color: var(--c-content);
  
  transition: background 400ms cubic-bezier(1, 0.0, 0.4, 1), color 400ms cubic-bezier(1, 0.0, 0.4, 1);
}

body[data-theme="dark"] {
  --c-glass: #bbbbbc;
  --c-light: #fff;
  --c-dark: #000;
  
  --c-content: #e1e1e1;
  --c-action: #03d5ff;
  
  --c-bg: #1b1b1d;
  
  --glass-reflex-dark: 2;
  --glass-reflex-light: 0.3;
  
  --saturation: 150%;
  
  /* Override background and text colors */
  background: #1b1b1d !important;
  color: #e1e1e1 !important;
}

/* Additional dark theme enforcement */
body[data-theme="dark"] {
  background-color: #1b1b1d !important;
  color: #e1e1e1 !important;
}


/* Legacy theme variables for compatibility */
:root {
    --current-primary: var(--c-action);
    --current-on-primary: var(--c-light);
    --current-primary-container: var(--c-action);
    --current-on-primary-container: var(--c-light);
    --current-secondary: var(--c-content);
    --current-on-secondary: var(--c-light);
    --current-surface: var(--c-bg);
    --current-on-surface: var(--c-content);
    --current-surface-container: var(--c-bg);
    --current-surface-container-high: var(--c-bg);
    --current-surface-container-highest: var(--c-bg);
    --current-background: var(--c-bg);
    --current-on-background: var(--c-content);
    --current-outline: var(--c-content);
    --current-outline-variant: var(--c-content);
    
    /* Liquid Glass Variables */
    --glass-bg: rgba(255, 255, 255, 0.2);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-backdrop: blur(20px);
    --glass-backdrop-saturate: saturate(180%);
}

body[data-theme="dark"] {
    --current-primary: var(--c-action);
    --current-on-primary: var(--c-light);
    --current-primary-container: var(--c-action);
    --current-on-primary-container: var(--c-light);
    --current-secondary: var(--c-content);
    --current-on-secondary: var(--c-light);
    --current-surface: var(--c-bg);
    --current-on-surface: var(--c-content);
    --current-surface-container: var(--c-bg);
    --current-surface-container-high: var(--c-bg);
    --current-surface-container-highest: var(--c-bg);
    --current-background: var(--c-bg);
    --current-on-background: var(--c-content);
    --current-outline: var(--c-content);
    --current-outline-variant: var(--c-content);
    
    /* Dark Glass Variables */
    --glass-bg: rgba(0, 0, 0, 0.01);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body[data-theme="light"] {
    --current-primary: var(--c-action);
    --current-on-primary: var(--c-light);
    --current-primary-container: var(--c-action);
    --current-on-primary-container: var(--c-light);
    --current-secondary: var(--c-content);
    --current-on-secondary: var(--c-light);
    --current-surface: var(--c-bg);
    --current-on-surface: var(--c-content);
    --current-surface-container: var(--c-bg);
    --current-surface-container-high: var(--c-bg);
    --current-surface-container-highest: var(--c-bg);
    --current-background: var(--c-bg);
    --current-on-background: var(--c-content);
    --current-outline: var(--c-content);
    --current-outline-variant: var(--c-content);
    
    /* Light Glass Variables */
    --glass-bg: rgba(0, 0, 0, 0.01);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Light theme body styling */
body[data-theme="light"] {
    background-color: #E8E8E9 !important;
    color: #224 !important;
}

/* Light theme about section styling */
body[data-theme="light"] .about-intro {
    color: #f5f5f5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

body[data-theme="light"] .about-text p {
    color: #f5f5f5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Light theme technology containers styling */
body[data-theme="light"] .skill-item {
    color: #ffffff !important;
}

body[data-theme="light"] .tech-stack span {
    color: #ffffff !important;
}

/* Theme Switcher Styles */
.switcher-wrap {
  position: fixed;
  left: 40px;
  bottom: 40px;
  z-index: 20000;      /* above hello-intro (9999) */
  pointer-events: none; /* pass clicks through except the inner control */
  isolation: isolate;           /* new: its own stacking context */
  transform: none !important;   /* guard: never inherits rogue transforms */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: auto; /* avoid 'transform' here */
}

.switcher {
  /* layout */
  position: static;               /* wrapper handles the fixed */
  pointer-events: auto;
  display: flex;
  flex-direction: column;         /* vertical */
  align-items: center;
  gap: 10px;

  /* sizing (tweak these) */
  --btn: 56px;                    /* button size */
  --pad: 10px;                    /* inner padding */
  --count: 2;                     /* number of options */
  --track: calc(var(--btn) * var(--count) + var(--pad) * (var(--count) - 1));

  width: 76px;
  height: calc(var(--track) + 2*12px);  /* + container top/bottom padding */
  padding: 12px;
  border-radius: 999px;

  /* LIQUID GLASS FILL — keep it light & transparent */
  background: color-mix(in srgb, var(--c-glass) 10%, transparent);
  backdrop-filter: blur(16px) saturate(180%) contrast(108%);
  -webkit-backdrop-filter: blur(16px) saturate(180%) contrast(108%);

  /* thin frosted border + soft shadow */
  border: 1px solid color-mix(in srgb, var(--c-light) 15%, transparent);
  box-shadow:
    0 6px 24px color-mix(in srgb, var(--c-dark) 8%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--c-light) 6%, transparent);

  /* smooth theme transitions */
  transition: background 300ms ease, box-shadow 300ms ease, border-color 300ms ease;

  /* prevent weird fixed-position bugs */
  will-change: auto;
}

.switcher__legend {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.switcher__input {
  position: absolute;
  inset: 0;
  width: 1px; height: 1px; 
  clip: rect(0 0 0 0);
  clip-path: inset(100%); 
  overflow: hidden;
  white-space: nowrap;
}


.switcher__filter {
  position: absolute;
  width: 0;
  height: 0;
  z-index: -1;
}

.switcher__option {
  --c: var(--c-content);
  width: var(--btn);
  height: var(--btn);
  border-radius: 50%;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: color 160ms, transform 160ms, opacity 160ms;
  padding: 0;                     /* no horizontal padding in vertical mode */
  cursor: pointer;
}

.switcher__option:hover {
  --c: var(--c-action);
  transform: translateZ(0) scale(1.06);
}

.switcher__icon { 
  width: 24px; height: 24px;
  color: var(--c); 
  transition: transform 160ms, color 160ms;
}
.switcher__option:hover .switcher__icon { transform: scale(1.12); }
.switcher__option:has(input:checked) .switcher__icon { transform: none; }

/* --- VERTICAL HIGHLIGHT PILL (follows selection) --- */
.switcher::after {
  content: '';
  position: absolute;
  inset: 12px;                    /* matches container padding */
  left: 12px; right: 12px;
  width: calc(100% - 24px);
  height: var(--btn);             /* pill height equals one button */
  border-radius: 999px;

  /* the "glass" inside the pill: brighter + a touch more opaque */
  background: color-mix(in srgb, var(--c-glass) 26%, transparent);

  /* layered inner reflections to feel curved */
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--c-light) 40%, transparent),
    inset 0 -8px 10px color-mix(in srgb, var(--c-dark) 8%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--c-light) 12%, transparent);
  
  /* we'll animate translateY on this */
  transform: translateY(0);
  transition: transform 360ms cubic-bezier(1, 0.0, 0.4, 1),
              background 300ms, box-shadow 300ms;
  z-index: -1; /* sit behind icons */
}

/* optional glossy streak (subtle "curved" refraction) */
.switcher::before {
  content: '';
  position: absolute;
  inset: 12px;
  left: 12px; right: 12px;
  width: calc(100% - 24px);
  height: var(--btn);
  border-radius: 999px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--c-light) 35%, transparent) 0%,
    transparent 45%,
    color-mix(in srgb, var(--c-dark) 12%, transparent) 100%);
  mix-blend-mode: screen;         /* adds sheen from background */
  pointer-events: none;
  transform: translateY(0);
  transition: transform 360ms cubic-bezier(1, 0.0, 0.4, 1);
  z-index: -1;
}

/* map each radio to a vertical step (76px container width, --btn tall) */
.switcher:has(input[c-option="1"]:checked)::after,
.switcher:has(input[c-option="1"]:checked)::before {
  transform: translateY(0);
}

.switcher:has(input[c-option="2"]:checked)::after,
.switcher:has(input[c-option="2"]:checked)::before { transform: translateY(calc(var(--btn) + var(--pad))); }



/* Reusable Liquid Glass Components */
.liquid-glass {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    will-change: transform;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.liquid-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: inherit;
    pointer-events: none;   /* <- was auto */
}

/* Interactive liquid glass with mouse tracking */
.liquid-glass-interactive {
    cursor: pointer;
}

.liquid-glass-interactive:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.25);
}

.liquid-glass-interactive:active {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Size variants */
.liquid-glass-sm {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
}

.liquid-glass-md {
    padding: 1.5rem 2rem;
    border-radius: 16px;
}

.liquid-glass-lg {
    padding: 2rem 3rem;
    border-radius: 24px;
}

.liquid-glass-xl {
    padding: 3rem 4rem;
    border-radius: 32px;
}

        /* Apple Hello Intro Screen */
        .hello-intro {
            position: fixed;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            overflow: hidden;
            isolation: isolate;              /* own stacking context */
            touch-action: none;       /* critical for swipe drag */
            will-change: transform;   /* smoother */
            pointer-events: auto;     /* just in case */
        }

        /* Background element for animation */
        .hello-background {
            position: absolute;
            top: -10%;
            left: -10%;
            width: 120%;
            height: 120%;
            background: none;
            z-index: 0;                      /* <- no negative index */
            will-change: transform;
            backface-visibility: hidden;
            transform-origin: 50% 50%;
        }

/* Ensure dark theme background is used immediately to avoid flash */
body[data-theme="dark"] #helloBackground {
    background: url('assets/background_hello_dark.png') center/cover no-repeat;
}

body[data-theme="light"] #helloBackground {
    background: url('assets/background_hello_light.png') center/cover no-repeat;
}

/* Prevent scrolling when hello screen is active */
body.hello-active {
    overflow: hidden;
    height: 100vh;
}

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

.hello-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 2;
    padding-bottom: 64px;    /* room for the hint inside the card */
}


.hello-text {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(50px);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.hello-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0;
    transform: translateY(30px);
    margin-bottom: 3rem;
    color: rgba(255, 255, 255, 0.9);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Minimal swipe hint */
.swipe-hint{
  position: absolute;
  bottom: 18px;            /* now inside the glass card */
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: rgba(255,255,255,0.85);
  text-shadow:
    0 0 6px rgba(255,255,255,0.25),
    0 0 14px rgba(255,255,255,0.18);
  user-select: none;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
  will-change: opacity, transform, text-shadow;
  animation: hintGlow 2.2s ease-in-out infinite;
}

@keyframes hintGlow{
  0%,100%{
    text-shadow:
      0 0 6px rgba(255,255,255,0.25),
      0 0 14px rgba(255,255,255,0.18);
    opacity: .65;
  }
  50%{
    text-shadow:
      0 0 10px rgba(255,255,255,0.45),
      0 0 20px rgba(255,255,255,0.35);
    opacity: 1;
  }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Liquid Glass Components */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop) var(--glass-backdrop-saturate);
    -webkit-backdrop-filter: var(--glass-backdrop) var(--glass-backdrop-saturate);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Let GSAP handle smooth scrolling to avoid double-easing/jitter */
    /* scroll-behavior: smooth; */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure no transforms on html/body to maintain proper fixed positioning */
html, body { 
    transform: none !important;
    filter: none !important;       /* filters can also break fixed */
    perspective: none !important;  /* just in case */
}

/* Base links: inherit text color; keep subtle underline */
a{
  color: inherit;
  text-decoration-thickness: 0.05em;
  text-underline-position: under;
  text-decoration-color: color-mix(in srgb, currentColor, transparent 70%);
  transition: text-decoration-color 160ms, opacity 160ms;
}
a:hover{ text-decoration-color: color-mix(in srgb, currentColor, transparent 30%); }

/* Kill the blue focus ring and add a subtle custom one */
:focus{ outline: none; }
:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-glass) 35%, transparent);
  border-radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--current-on-surface);
    background: var(--current-background);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Main content initially hidden */
.main-content {
    opacity: 0;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

/* Main content background */
.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: none;
    z-index: -3; /* moved further back to make room for stars */
    filter: blur(20px);
    -webkit-filter: blur(20px);
    transform: scale(1.1);
    transition: background-image 0.4s ease;
}

body[data-theme="dark"] .main-content::before {
    background: var(--main-bg-image, url('assets/background_profile_dark.png')) center/cover no-repeat;
}

body[data-theme="light"] .main-content::before {
    background: var(--main-bg-image, url('assets/background_profile_light.png')) center/cover no-repeat;
}

/* Starfield sits between wallpaper and content */
#starfield {
    position: fixed;
    inset: 0;
    z-index: -2;           /* between -3 wallpaper and the content */
    pointer-events: none;  /* never intercept clicks */
    overflow: hidden;
}

/* Full-bleed canvases */
#starfield .stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    will-change: transform;  /* GPU optimization */
}

/* Optional: subtle dim so it never overpowers your UI */
body[data-theme="light"] #starfield { opacity: 0; }
body[data-theme="dark"]  #starfield { opacity: 0; }

/* Frosted Glass Overlay */
#frost-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;                       /* above stars (-2), below content (0) */
    pointer-events: none;
    backdrop-filter: blur(2px) saturate(110%);
    -webkit-backdrop-filter: blur(2px) saturate(110%);
    background: rgba(255,255,255,0.01); /* tiny veil to sell the glass */
}

body[data-theme="dark"] #frost-overlay {
    background: rgba(0,0,0,0.06);
}

/* Achievements Reel */
.achievements-reel{
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 1rem;
}

.ach-stage{
    position: relative;
    min-height: 240px;         /* minimum height, can expand dynamically */
    height: auto;              /* allow height to grow with content */
    overflow: visible;         /* allow content to be visible */
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 10px 26px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.06);
    /* Ensure the container expands to fit its content */
    display: flex;
    align-items: stretch;
}

.ach-card{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px 24px;
    opacity: 0;
    transform: translateY(12px) scale(.98);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
    min-height: 100%;
    width: 100%;
    box-sizing: border-box;
}

.ach-card h5{
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    text-justify: inter-word;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
    max-width: 100%;
    word-wrap: break-word;
}

.ach-card p{
    opacity: .9;
    line-height: 1.55;
    font-size: .95rem;
}

.ach-card.is-active{
    pointer-events: auto;
}

/* Nav buttons */
.ach-nav{
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.16);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, opacity .2s ease;
}
.ach-nav:hover{ transform: scale(1.06); background: rgba(255,255,255,0.16); }
.ach-nav:disabled{ opacity: .4; cursor: not-allowed; }

/* Light theme tweak */
body[data-theme="light"] .ach-stage{
    background: rgba(255,255,255,0.35);
    border-color: rgba(0,0,0,0.08);
    color: #223;
    text-shadow: none;
}
body[data-theme="light"] .ach-nav{ color:#223; background: rgba(255,255,255,0.6); border-color: rgba(0,0,0,0.06); }

/* Ensure cards are readable in light theme */
body[data-theme="light"] .ach-card{
    color:#223;
    text-shadow:none;
}

/* Micro-metrics styling */
.ach-metricbar{ 
    display:flex; 
    gap:14px; 
    align-items:center; 
    margin-top:8px; 
    flex-wrap:wrap; 
}
.ach-metric{ 
    display:grid; 
    place-items:center; 
    min-width:64px; 
    min-height:64px; 
    padding:8px 10px; 
    border-radius:12px;
    background: rgba(255,255,255,0.08); 
    border:1px solid rgba(255,255,255,0.12); 
}
body[data-theme="light"] .ach-metric{ 
    background: rgba(255,255,255,0.65); 
    border-color: rgba(0,0,0,0.08); 
}
.ach-metric__value{ 
    font-weight:800; 
    font-size:1.2rem; 
    line-height:1; 
}
.ach-metric__label{ 
    font-size:.95rem; 
    opacity:.85; 
}
.ach-ring{ 
    width:44px; 
    height:44px; 
    display:block; 
}
.ach-ring__track{ 
    fill:none; 
    stroke:rgba(255,255,255,0.18); 
    stroke-width:6; 
}
body[data-theme="light"] .ach-ring__track{ 
    stroke:rgba(0,0,0,0.15); 
}
.ach-ring__prog{ 
    fill:none; 
    stroke:currentColor; 
    stroke-width:6; 
    stroke-linecap:round; 
}
.ach-metric--check .ach-check{ 
    font-size:1.4rem; 
    font-weight:900; 
}

/* Lottie animation styling */
.ach-metric--lottie {
    display: grid;
    place-items: center;
    min-width: 64px;
    min-height: 64px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}

.ach-lottie-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.ach-lottie-container dotlottie-wc {
    width: 44px !important;
    height: 44px !important;
    display: block;
}

body[data-theme="light"] .ach-metric--lottie {
    background: rgba(255,255,255,0.65);
    border-color: rgba(0,0,0,0.08);
}

/* Centered Lottie animation for global impact */
.ach-lottie-center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    padding: 0.5rem;
    flex: 1;
}

.ach-lottie-center dotlottie-wc {
    display: block;
    /* Let inline styles control the size */
}

/* Specific styling for Klarna animation - darker in light mode */
.ach-lottie-klarna dotlottie-wc {
    filter: none; /* Default filter for dark mode */
}

/* Make Klarna animation darker in light mode */
body[data-theme="light"] .ach-lottie-klarna dotlottie-wc {
    filter: brightness(0.3) contrast(1.2) saturate(1.1);
}

/* Key Achievements section styling */
#key-achievements-section .achievements-reel {
    margin-top: 1rem;
}

.main-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth scrolling optimization */
.smooth-scroll {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* 1) Declare a consistent nav height */
:root { --nav-h: 72px; }

/* 2) Make the navbar truly fixed to the viewport */
.navbar{
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 3000;
  width: 100%;
  isolation: isolate; /* its own stacking context */
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(10,10,12,0.55);             /* darker tint */
  border-bottom: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 10px 28px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 1rem 0;
  transition: all 0.3s ease;
}

/* 3) Remove transforms from any ancestor that could trap fixed positioning */
.main-content{
  transform: none !important;     /* kills the containing block issue */
}

/* 4) Give the page content top padding so it won't hide under the fixed bar */
.main-content{
  padding-top: calc(var(--nav-h) + 8px);
}

/* 5) Make sure nothing else interferes */
.navbar, .nav-container{
  transform: none !important;
  filter: none !important;
  perspective: none !important;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
    transition: color 0.3s ease;
}

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

.nav-menu a {
    text-decoration: none;
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 8px 16px;
    border-radius: 20px;
}

.nav-menu a:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.08);
}


/* Container + menu */
.nav-container{ position: relative; transform: none !important; }
.nav-menu{
  position: relative;                   /* for absolutely-positioned pill */
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  padding: 8px 10px;                    /* small pad so pill has breathing room */
  margin: 0;
  background: transparent;              /* NO big background */
  border-radius: 999px;
  overflow: visible;
}

/* Links: no background on hover (prevents "second pill" look) */
.nav-menu a{
  position: relative;
  z-index: 1;                           /* above the pill */
  text-decoration: none;
  color: var(--current-on-surface);
  font-weight: 600;
  letter-spacing: .2px;
  padding: 8px 10px;                    /* pill will match this height */
  border-radius: 999px;
  transition: transform 160ms, opacity 160ms;
  background: transparent !important;   /* kill old hover backgrounds */
}
.nav-menu a:hover{ transform: translateY(-1px); }

/* SINGLE glass pill that moves under the active link */
.nav-pill{
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;                  /* set by JS */
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;

  /* Make the moving pill give contrast under the active item */
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -8px 10px rgba(0,0,0,0.12),
    0 6px 16px rgba(0,0,0,0.22);

  transition:
    transform 320ms cubic-bezier(.2,.6,.2,1),
    width 320ms cubic-bezier(.2,.6,.2,1),
    height 320ms cubic-bezier(.2,.6,.2,1),
    left 0s, top 0s; /* position updates come via transform */
}

/* Slightly deeper in dark theme for consistency */
body[data-theme="dark"] .navbar{
  background: rgba(10,10,12,0.72);
  border-bottom-color: rgba(255,255,255,0.16);
}

/* Fallback for browsers without backdrop-filter (older Edge/iOS) */
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
  .navbar{ background: rgba(10,10,12,0.88); }
}

/* Keep jump links from hiding under fixed navbar */
section[id]{ scroll-margin-top: 100px; } /* tweak to your navbar height */

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    background: var(--current-background);
    position: relative;
    overflow: visible; /* Allow logos to move freely */
    padding-top: 2rem;
}

.hero .container {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    gap: 2rem;
    padding: 0.5rem 0;
}

/* Text Container */
.hero-text-container {
    background: transparent;
    padding: 2rem;
    text-align: left;
    z-index: 2;
    position: relative;
}

/* Grid Container */
.hero-grid-container {
    position: absolute;
    bottom: 100px;
    right: 0;
    z-index: 3;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 1rem;
}

/* Animation Container */
.hero-animation-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    z-index: 1;
    position: relative;
    padding-left: 0;
    margin-left: -20px;
    bottom: 100px;
}

.hero-lottie-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    z-index: 1;
    position: relative;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--current-on-background);
}

.hero-skills {
    font-size: 1.1rem;
    color: var(--current-on-surface);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
    font-weight: 500;
}

.hero-title .line {
    display: block;
    opacity: 0;
    transform: translateY(50px);
}


.tech-logos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Force 2 columns for 2x3 layout */
    gap: 1.5rem; /* Tighter spacing for smaller grid */
    max-width: 200px; /* Smaller width to fit in bottom right */
    width: 100%;
    justify-items: center;
    align-items: center;
    overflow: visible; /* Allow logos to move beyond grid boundaries */
    position: relative;
    pointer-events: auto; /* Allow logo interactions */
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--current-on-surface);
    margin-bottom: 2rem;
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
}

.hero-cta {
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    z-index: 3; /* Above the grid to remain clickable */
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop) var(--glass-backdrop-saturate);
    -webkit-backdrop-filter: var(--glass-backdrop) var(--glass-backdrop-saturate);
    color: var(--current-on-surface);
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--c-glass) 22%, transparent);
    color: var(--current-on-surface);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--c-dark) 15%, transparent);
}


/* keep the grid tight and out of the text's way */
.tech-logos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Force 2 columns for 2x3 layout */
    gap: 2.5rem; /* Much tighter spacing - almost touching */
    max-width: 320px;
    width: 100%;
    justify-items: center;
    align-items: center;
    overflow: visible; /* Allow logos to move beyond grid boundaries */
    position: relative;
}

.tech-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem; /* Reduced padding for tighter feel */
    background: transparent;
    border: none;
    border-radius: 8px;
    box-shadow: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* Buttery smooth easing */
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    will-change: transform; /* Optimize for animations */
    position: relative;
    overflow: hidden;
}

.tech-logo img {
    width: 100px; /* Slightly smaller for tighter grid */
    height: 100px;
    object-fit: contain;
    pointer-events: none;
    will-change: transform;
    filter: brightness(.9);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* Buttery smooth easing */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

.tech-logo:hover {
    transform: scale(1.1);
}

.tech-logo:hover img {
    filter: brightness(1);
}

/* Dark theme adjustments */
body[data-theme="dark"] .tech-logo img {
    filter: brightness(1.2);
}

body[data-theme="dark"] .tech-logo:hover img {
    filter: brightness(1.4);
}

/* Sections */
section {
    padding: 5rem 0;
    transition: background-color 0.3s ease;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: #f5f5f5;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateY(50px);
}

/* About Section */
.about {
    background: transparent;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text {
    opacity: 0;
    transform: translateX(-50px);
}

.about-intro {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--current-on-surface);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 1.5rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--current-on-surface);
    line-height: 1.7;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.skill-item {
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop) var(--glass-backdrop-saturate);
    -webkit-backdrop-filter: var(--glass-backdrop) var(--glass-backdrop-saturate);
    color: var(--current-on-surface);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.skill-item:hover {
    background: color-mix(in srgb, var(--c-glass) 22%, transparent);
    color: var(--current-on-surface);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--c-dark) 10%, transparent);
}

.about-image {
    opacity: 0;
    transform: translateX(50px);
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #e8e8e8, #f0f0f0);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
}

.placeholder-text {
    color: #999;
    font-size: 1.1rem;
}

/* Experience Section */
.experience {
    background: transparent;
    overflow: hidden;
}

.timeline {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    min-height: 0;
    isolation: isolate;
    contain: paint;
}

.timeline-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    height: auto;
}

/* Scroll indicators */
.scroll-indicator {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
    pointer-events: none;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(-50%) translateX(0);
    }
    40% {
        transform: translateY(-50%) translateX(10px);
    }
    60% {
        transform: translateY(-50%) translateX(5px);
    }
}

/* The moving container */
.timeline-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
    will-change: transform, opacity;
    opacity: 0;
    transform: translateX(100px);
    z-index: 1;
}

/* Previous / active / next positions */
.timeline-slide.prev {
    opacity: 0.3;
    transform: translateX(-100px);
}

.timeline-slide.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
}

.timeline-slide.next {
    opacity: 0.3;
    transform: translateX(100px);
}

/* The card itself should not be transformed */
.timeline-item {
    position: relative;
    width: 100%;
    min-height: 0;
    border-radius: 16px;
    overflow: hidden;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* Active card gets stronger border and shadow */
.timeline-slide.active .timeline-item {
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Backdrop glass layer */
.timeline-item .glass {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background-clip: padding-box;
    z-index: 0;
}

/* Active card gets stronger glass effect */
.timeline-slide.active .timeline-item .glass {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
}

/* Content above the glass */
.timeline-item .timeline-inner {
    position: relative;
    z-index: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: none;
    overflow: visible;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.timeline-date {
    font-weight: 600;
    color: #e8e8e8;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    font-size: 0.9rem;
}

.company-logo {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    background: none;
    border-radius: 0;
    padding: 0;
    overflow: visible;
}

.company-logo img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    filter: none;
}

/* Rounded corners for specific logos */
.company-logo img[alt*="Stocard"] {
    border-radius: 12px;
    width: 650px;
}

/* When the image fails: show a letter badge */
.company-logo.logo-fallback {
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
}

.timeline-content {
    flex: 1;
}

.timeline-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f5f5f5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    font-size: 1.1rem;
    color: #e8e8e8;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

.timeline-content p {
    color: #f0f0f0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-stack span {
    padding: 0.25rem 0.75rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop) var(--glass-backdrop-saturate);
    -webkit-backdrop-filter: var(--glass-backdrop) var(--glass-backdrop-saturate);
    color: var(--current-on-surface);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.tech-stack span:hover {
    background: color-mix(in srgb, var(--c-glass) 22%, transparent);
    color: var(--current-on-surface);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--c-dark) 10%, transparent);
}

.app-store-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.app-store-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.4);
    background: linear-gradient(135deg, #0056CC, #4A4AC7);
}

.app-store-link svg {
    width: 20px;
    height: 20px;
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.nav-arrow.prev {
    left: -60px;
}

.nav-arrow.next {
    right: -60px;
}

.nav-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Card indicators */
.card-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.achievements {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.achievements li {
    margin-bottom: 0.5rem;
    color: #f0f0f0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    line-height: 1.6;
}

.achievements li::marker {
    color: var(--current-primary);
}

/* Education Section */
.education {
    background: transparent;
}

.education-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Light mode readability container for Education */
body[data-theme="light"] .education .education-content {
    background: rgba(57, 57, 57, 0.299);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    backdrop-filter: blur(6px) saturate(115%);
    -webkit-backdrop-filter: blur(6px) saturate(115%);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    padding: 1.25rem; /* inner padding to lift text off bg */
}

.education-item {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(50px);
}

.education-item h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f5f5f5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
}

.education-item h4 {
    font-size: 1.1rem;
    color: #e8e8e8;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
}

.education-date {
    font-weight: 600;
    color: #e8e8e8;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

.education-item p {
    color: #d0d0d0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    line-height: 1.6;
}

.certifications {
    opacity: 0;
    transform: translateY(50px);
}

.certifications h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f5f5f5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 1.5rem;
}

.cert-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--current-surface-container);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.cert-item:hover {
    background: var(--current-surface-container-high);
    transform: translateY(-2px);
}

.cert-name {
    font-weight: 500;
    color: var(--current-on-surface);
}

.cert-provider {
    color: var(--current-on-surface);
    font-size: 0.9rem;
}

/* Contact Section */
.contact {
    background: rgba(10,10,12,0.35);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow:
        0 -10px 28px rgba(0,0,0,0.28),
        inset 0 1px 0 rgba(255,255,255,0.06);
    color: #fff;
}

.contact .section-title {
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
}

.contact-intro {
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: 3rem;
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateY(30px);
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: rgba(255,255,255,0.08);
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    border: 1px solid rgba(255,255,255,0.12);
}

.contact-item:hover {
    background: rgba(255,255,255,0.16);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.contact-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark theme variant for contact section */
body[data-theme="dark"] .contact {
    background: rgba(10,10,12,0.52);
    border-top-color: rgba(255,255,255,0.16);
}

/* Footer */
.footer {
    background: var(--current-surface-container-highest);
    color: var(--current-on-surface);
    text-align: center;
    padding: 2rem 0;
}

/* Mobile Navigation */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--current-on-background);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 4vw, 3rem);
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* Enhanced Active Card Visibility - Overrides */

/* Make ACTIVE card much darker & crisper */
.timeline-slide.active .timeline-item {
    box-shadow: 0 18px 60px rgba(0,0,0,0.45);
    border-color: rgba(255,255,255,0.16);
    isolation: isolate; /* keep its backdrop effects self-contained */
}

.timeline-slide.active .timeline-item .glass {
    /* stronger backdrop + darker fill */
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    background: rgba(10,10,12,0.55); /* was ~0.05 — make it solid */
}

/* Optional: subtle top-to-bottom scrim to increase legibility on busy bg */
.timeline-slide.active .timeline-item::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.25) 0%,
        rgba(0,0,0,0.25) 100%
    );
    z-index: 1; /* sits above .glass, below content */
}

/* Ensure content stays above scrim */
.timeline-slide.active .timeline-item .timeline-inner {
    position: relative;
    z-index: 2;
}

/* Crisper text on the active card */
.timeline-slide.active .timeline-content h3,
.timeline-slide.active .timeline-content h4,
.timeline-slide.active .timeline-content p,
.timeline-slide.active .timeline-date {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

/* Dim and slightly blur PREV/NEXT cards so they don't compete */
.timeline-slide.prev .timeline-item .glass,
.timeline-slide.next .timeline-item .glass {
    background: rgba(255,255,255,0.04);  /* lighter glass */
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.timeline-slide.prev .timeline-item .timeline-inner,
.timeline-slide.next .timeline-item .timeline-inner {
    opacity: 0.65;
    filter: saturate(90%);
}

/* Make the whole slide visually recede */
.timeline-slide.prev,
.timeline-slide.next {
    opacity: 0.35;        /* you already animate to 0.3 — keep it consistent */
}

/* Keep the timeline's stacking sane so active card sits on top cleanly */
.timeline { isolation: isolate; }
.timeline-slide { z-index: 1; }
.timeline-slide.active { z-index: 2; }

/* Make sure the card itself isn't transformed (you already did this),
   and only the slide container moves. This preserves backdrop correctness. */
.timeline-item { transform: none; }

/* Ensure active card is stacked above others */
.timeline-slide.active { z-index: 3; }
.timeline-slide.prev,
.timeline-slide.next { z-index: 1; }

/* Active card: strong but slightly translucent glass */
.timeline-slide.active .timeline-item {
    isolation: isolate;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

/* Layer 1: semi-opaque dark base to block background text */
.timeline-slide.active .timeline-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 20, 0.32); /* mostly solid, but lets a hint through */
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-radius: inherit;
    z-index: 0;
}

/* Optional subtle highlight overlay for "curved glass" feel */
.timeline-slide.active .timeline-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.06) 0%,
        rgba(255,255,255,0.02) 100%
    );
    pointer-events: none;
    border-radius: inherit;
    z-index: 1;
}

/* Content sits on top */
.timeline-slide.active .timeline-item .timeline-inner {
    position: relative;
    z-index: 2;
}

/* Background cards fade + blur so they don't compete */
.timeline-slide.prev,
.timeline-slide.next {
    opacity: 0.35;
    filter: blur(2px) saturate(90%);
}

/* Optional: soft max height on very short viewports */
@media (max-height: 700px) {
    .timeline-item .timeline-inner {
        padding-bottom: 2.5rem;
    }
}

/* Animated Section Dividers */
#about,
#experience,
#contact {
    position: relative;
}

/* Shared look: soft bloom + razor-thin spine */
#about::after,
#experience::after,
#contact::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: min(96%, 1100px);
    height: 2px;                          /* 1px spine + 1px bloom */
    pointer-events: none;
    background:
        /* bloom layer (sooooo soft) */
        linear-gradient(90deg,
            transparent 0%,
            rgba(0,0,0,0.10) 12%,
            rgba(0,0,0,0.18) 50%,
            rgba(0,0,0,0.10) 88%,
            transparent 100%
        ),
        /* 1px center spine */
        linear-gradient(90deg,
            transparent 0%,
            rgba(0,0,0,0.35) 50%,
            transparent 100%
        );
    background-repeat: no-repeat;
    background-size: 100% 2px, 100% 1px;  /* bloom 2px, spine 1px */
    background-position: 0 0, 0 0.5px;    /* spine sits in the middle */
    opacity: var(--divider-o, 0.28);
    z-index: 2;                            /* keep it above section bg */
    filter: none;                          /* drop the blur: keeps line crisp */
}

/* Position each divider correctly */
#about::after,
#experience::after {
    bottom: 0;
}

#contact::before {
    top: 0;
}

/* Dark theme: lighten the spine/bloom so it sits on dark bg */
body[data-theme="dark"] #about::after,
body[data-theme="dark"] #experience::after,
body[data-theme="dark"] #contact::before {
    background:
        linear-gradient(90deg,
            transparent 0%,
            rgba(255,255,255,0.10) 12%,
            rgba(255,255,255,0.18) 50%,
            rgba(255,255,255,0.10) 88%,
            transparent 100%
        ),
        linear-gradient(90deg,
            transparent 0%,
            rgba(255,255,255,0.38) 50%,
            transparent 100%
        );
}

/* Light theme: a touch stronger by default */
body[data-theme="light"] #about::after,
body[data-theme="light"] #experience::after,
body[data-theme="light"] #contact::before {
    opacity: var(--divider-o, 0.42);
}

/* Optional: if you want even more legibility on very bright wallpapers */
@media (prefers-contrast: more) {
    body[data-theme="light"] #about::after,
    body[data-theme="light"] #experience::after,
    body[data-theme="light"] #contact::before {
        opacity: var(--divider-o, 0.52);
    }
}

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

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(10,10,12,0.85);
        backdrop-filter: blur(14px) saturate(140%);
        -webkit-backdrop-filter: blur(18px) saturate(140%);
        border: 1px solid rgba(255, 255, 255, 0.065);
        border-radius: 20px;
        margin: 1rem;
        width: calc(100% - 2rem);
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 -10px 28px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .nav-menu .nav-link {
        color: #fff !important;
        text-shadow: 0 1px 1px rgba(0,0,0,0.35);
        font-weight: 500;
        padding: 0.5rem 1rem;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    .nav-menu .nav-link:hover {
        background: rgba(255,255,255,0.16);
        color: #fff !important;
        text-shadow: 0 1px 1px rgba(0,0,0,0.35);
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 2rem 0 2rem;
        min-height: 100vh;
    }

    .hero-text-container {
        margin-bottom: 2rem;
    }
    
    .hero-grid-container {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 2rem;
    }

    /* Adjust Lottie animation for tablet */
    .hero-lottie-bg {
        width: 40%;
        opacity: 0.4;
    }

    .tech-animation {
        max-width: 400px;
        max-height: 400px;
        filter: blur(3px);
        transform: scale(0.6);
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .about-text {
        order: 1;
    }

    .about-image {
        order: 2;
        max-width: 300px;
        margin: 0 auto;
    }

    /* Fix hero elements on mobile to not interfere with other sections */
    .hero-grid-container {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        margin-top: 2rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .hero-animation-container {
        position: relative !important;
        margin-top: calc(2rem + 120px);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Fix animation stretching in landscape */
    .hero-animation-container dotlottie-wc {
        max-width: 300px !important;
        max-height: 300px !important;
        width: 300px !important;
        height: 300px !important;
        object-fit: contain !important;
    }

    .timeline-slide {
        min-height: 0;
    }

    .timeline-item {
        min-height: 0;
    }

    .timeline-item .timeline-inner {
        padding: 1.5rem;
    }

    .timeline-container {
        max-width: 90%;
        height: auto;
    }

    .timeline {
        min-height: 0;
    }

    /* Tone down blur on small screens */
    .timeline-slide.prev,
    .timeline-slide.next { 
        filter: blur(1.5px) saturate(95%); 
    }

    .timeline-date {
        font-size: 0.8rem;
    }

    .timeline-content h3 {
        font-size: 1.2rem;
    }

    .timeline-content h4 {
        font-size: 1rem;
    }

    .nav-arrow.prev {
        left: -50px;
    }

    .nav-arrow.next {
        right: -50px;
    }

    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

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

    .contact-item {
        display: inline-flex;
        width: auto;
        max-width: 90%;
        align-self: center;
        justify-content: center;
    }

    .skills {
        justify-content: center;
    }

    .tech-logos-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 0.3rem; /* Maintain tight spacing */
        max-width: 350px;
    }

    .tech-logo {
        padding: 0.3rem;
    }

    .tech-logo img {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .hero-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .timeline-content h3 {
        font-size: 1.3rem;
    }

    .education-item h3 {
        font-size: 1.3rem;
    }

    .btn-primary {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .tech-logos-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 0.2rem; /* Very tight spacing on mobile */
        max-width: 280px;
    }

    .tech-logo {
        padding: 0.2rem;
    }

    .tech-logo img {
        width: 70px;
        height: 70px;
    }

    /* Adjust Lottie animation for mobile */
    .hero-lottie-bg {
        width: 30%;
        opacity: 0.3;
    }

    .tech-animation {
        max-width: 250px;
        max-height: 250px;
        filter: blur(4px);
        transform: scale(0.4);
    }
}

/* High refresh rate optimization - only apply when user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-primary:hover {
        transform: none;
    }
    
    .contact-item:hover {
        transform: none;
    }
}

/* Landscape mode fixes for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-grid-container {
        margin-top: 1rem;
    }

    .hero-animation-container {
        margin-top: 1rem;
    }

    .hero-animation-container dotlottie-wc {
        max-width: 200px !important;
        max-height: 200px !important;
        width: 200px !important;
        height: 200px !important;
    }

    .tech-logos-grid {
        max-width: 150px !important;
        gap: 1rem !important;
    }
}

