/* -------------------
   1. Design System & Base
------------------- */
:root {
  /* Color System */
  --color-primary: #0072ff;
  --color-primary-dark: #005bb5; 
  --color-primary-weak: rgba(0, 114, 255, 0.1); 
  --color-primary-glow: rgba(0, 114, 255, 0.3); 
  
  /* Dark Theme (Default) */
  --color-bg: #0f0f0f; 
  --color-panel:#1a1a1a; 
  --color-text-light: #eeeeee; 
  --color-text-muted: #999999; 
  --color-border: #333333; 
  --color-grain-opacity: 0.07;
  --color-header-bg: rgba(15, 15, 15, 0.75);
  --color-header-border: rgba(255, 255, 255, 0.1);
  --color-card-bg: rgba(255, 255, 255, 0.05);
  --color-card-border: rgba(255, 255, 255, 0.1);
  --color-input-bg: rgba(0,0,0,0.2);
  --color-input-border: rgba(255,255,255,0.1);
  --color-social-icon-filter: invert(0.9) brightness(1.2);
  --color-lightbox-bg: rgba(15, 15, 15, 0.85);
  
  /* Effects */
  --glow: 0 0 20px var(--color-primary-glow);
  --glow-strong: 0 0 35px var(--color-primary-glow);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35); /* Updated to 8pt grid */
  --gradient-primary: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);

  /* Typography */
  --font-body: 'Poppins', sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  
  /* Animation */
  --ease-spring: cubic-bezier(0.2, 0.9, 0.2, 1);
  
  color-scheme: dark;
  accent-color: var(--color-primary);
}

/* --- ADDED: Light Theme --- */
body:not(.dark-mode) {
  /* Light Theme */
  --color-bg: #f5f5f7; 
  --color-panel: #ffffff; 
  --color-text-light: #1d1d1f; 
  --color-text-muted: #555555; 
  --color-border: #dddddd; 
  --color-grain-opacity: 0.03;
  --color-header-bg: rgba(255, 255, 255, 0.75);
  --color-header-border: rgba(0, 0, 0, 0.1);
  --color-card-bg: rgba(255, 255, 255, 0.5);
  --color-card-border: rgba(0, 0, 0, 0.1);
  --color-input-bg: rgba(0,0,0,0.02);
  --color-input-border: rgba(0,0,0,0.1);
  --color-social-icon-filter: invert(0.1) brightness(0.9);
  --color-lightbox-bg: rgba(245, 245, 247, 0.85);
  
  color-scheme: light;
}


* { margin: 0; padding: 0; box-sizing: border-box; }

html { 
    scroll-behavior: smooth; 
    overflow-x: hidden; /* Prevents horizontal scrolling on the main page */
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text-light);
  font-size: 17px; /* Updated for readability */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* This one is good, but the html one was also needed */
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
  
  /* ADDED: Page load animation */
  opacity: 0;
  animation: fadeIn 0.5s ease-out 0.1s forwards;
}
@keyframes fadeIn {
    to { opacity: 1; }
}

/* Global Grain Texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: var(--color-grain-opacity); /* UPDATED: Variable */
    z-index: -1; 
    pointer-events: none;
    transition: opacity 0.4s ease;
}

body.modal-open { position: fixed; overflow: hidden; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body {
    transition: none;
    animation: none; /* ADDED */
    opacity: 1; /* ADDED */
  }
}

img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
a { color: var(--color-primary); text-decoration: none; transition: color 0.3s var(--ease-spring); }
a:hover { color: var(--color-text-light); }

::-webkit-scrollbar {
    width: 10px;
    background-color: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}


/* -------------------
   2. Layout & Typography
------------------- */
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
section { padding: 96px 0; position: relative; } /* Updated to 8pt grid */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 5vw, 2.5rem); text-align: center; margin-bottom: 24px; } /* 40px -> 2.5rem */
.section-lede { color: var(--color-text-muted); text-align: center; margin: 0 auto 64px; max-width: 65ch; font-size: 1.1rem; } /* Updated to 8pt grid */

/* UPDATED: Section Heading Underline (Thinner, solid accent) */
h2 {
    position: relative;
    padding-bottom: 16px;
}
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 64px; /* Updated to 8pt grid */
    height: 2px; /* Thinner */
    background: var(--color-primary); /* Solid accent color */
    border-radius: 2px;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 0.6s var(--ease-spring);
}
.reveal.visible h2::after,
h2.reveal.visible::after {
    transform: translateX(-50%) scaleX(1);
}
#contact-title { text-align: left; } /* Keep contact title left-aligned */
#contact-title::after {
    left: 0;
    transform: translateX(0) scaleX(0);
    transform-origin: left;
}
.reveal.visible #contact-title::after {
    transform: translateX(0) scaleX(1);
}


/* -------------------
   3. Utilities & Helpers
------------------- */
.skip-link {
  position: absolute; top: -100px; left: 0; background: var(--color-primary);
  color: #ffffff; padding: 8px 16px; z-index: 9999; 
  transition: top 0.3s var(--ease-spring);
  border-radius: 0 0 6px 0; 
}
.skip-link:focus { top: 0; }

/* SCROLL ANIMATION: Updated to 8pt grid */
.reveal {
  opacity: 0;
  transform: translateY(32px); /* Start 32px down */
  transition: opacity 0.8s var(--ease-spring), transform 0.8s var(--ease-spring); /* Animate both */
  transition-delay: var(--delay, 0s);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0); /* Move to original position */
}

/* -------------------
   4. Buttons & Interactive Elements
------------------- */
.btn {
  display: inline-block; padding: 14px 32px; border-radius: 8px; font-family: var(--font-heading);
  font-weight: 600; font-size: 1rem; transition: all 0.3s var(--ease-spring);
  border: 2px solid transparent; cursor: pointer; text-align: center;
}
.btn-primary { 
    background: var(--gradient-primary); 
    color: #ffffff; 
    box-shadow: var(--glow); 
}
.btn-primary:hover, .btn-primary:focus-visible { 
    transform: translateY(-4px) scale(1.03); 
    box-shadow: 0 0 40px var(--color-primary-glow); /* ENHANCED glow */
}
.btn-ghost { 
    background-color: transparent; 
    border-color: var(--color-primary); 
    color: var(--color-primary); 
}
.btn-ghost:hover, .btn-ghost:focus-visible { 
  background-color: var(--color-primary); 
  color: #ffffff; 
  transform: translateY(-4px); 
  border-color: var(--color-primary);
  box-shadow: 0 0 40px var(--color-primary-glow); /* ENHANCED glow */
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--color-primary); outline-offset: 3px; border-radius: 4px;
}
.styled-contact-form input:focus-visible, .styled-contact-form textarea:focus-visible { outline: none; }

/* -------------------
   5. Header & Navigation
------------------- */
.header {
  position: sticky; top: 0; z-index: 1000; padding: 24px 0; /* Updated to 8pt grid */
  background: var(--color-header-bg); /* UPDATED: Variable */
  backdrop-filter: blur(16px); /* Stronger blur */
  border-bottom: 1px solid var(--color-header-border); /* UPDATED: Variable */
  transition: box-shadow 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.header.scrolled { box-shadow: 0 8px 32px rgba(0,0,0,0.3); } /* Updated shadow */

.header-container { display: flex; align-items: center; justify-content: space-between; width: 90%; max-width: 1200px; margin: 0 auto; }
.logo { font-size: 1.3rem; font-family: var(--font-heading); font-weight: 700; color: var(--color-text-light); letter-spacing: 1px; }
.navbar ul { display: flex; gap: 40px; } /* 40px is 8*5 */

.navbar a { 
  color: var(--color-text-muted); 
  font-weight: 600; 
  position: relative; 
  padding: 4px 0; 
  transition: color 0.3s var(--ease-spring), transform 0.3s var(--ease-spring); 
}
.navbar a:hover, .navbar a.active { 
  color: var(--color-text-light); 
  transform: translateY(-2px);
}
.navbar a::after {
    content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px;
    background: var(--gradient-primary); transform: scaleX(0); transform-origin: center;
    transition: transform 0.4s var(--ease-spring);
}
.navbar a:hover::after, .navbar a.active::after { transform: scaleX(1); }
.navbar a.active { transform: translateY(0); }
.navbar a.active:hover { transform: translateY(-2px); }

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ADDED: Theme Toggle Button Styles */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, background-color 0.3s ease;
}
.theme-toggle:hover, .theme-toggle:focus-visible {
    color: var(--color-text-light);
    background-color: var(--color-primary-weak);
}
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
.dark-mode .theme-toggle .sun { display: block; }
.dark-mode .theme-toggle .moon { display: none; }


.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; z-index: 1001; } /* 10px -> 8px */
.hamburger span { display: block; width: 28px; height: 3px; background: var(--color-primary); margin: 6px 0; transition: all 0.3s ease; border-radius: 2px; }
.hamburger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.header .logo-img {
    height: 32px; /* 35px -> 32px */
    width: auto; 
    display: block; 
}

/* -------------------
   6. Hero Section (UPDATED)
------------------- */
.hero { 
  display: flex; 
  align-items: center; 
  justify-content: center;
  min-height: 90vh; 
  padding: 96px 0; /* 100px -> 96px */
  text-align: center;
  overflow: hidden; 
}

.hero-content-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-content {
  will-change: transform;
}

.hero-text { 
  max-width: none; 
  margin: 0; 
}
.megatitle { font-size: clamp(3.2rem, 8vw, 5.5rem); } /* 6rem -> 5.5rem */
.megatitle .accent-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-subheadline {
    font-size: clamp(1.2rem, 3vw, 1.75rem);
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--color-primary); /* Use accent color as requested */
    margin: -8px 0 24px; /* 10px -> 8px */
    opacity: 0.9;
}

.lede { 
  font-size: 1.25rem; /* 1.3rem -> 1.25rem (20px) */
  color: var(--color-text-muted); 
  margin: 32px auto 40px; 
  max-width: 60ch;
  min-height: 0; 
}
.hero-ctas { 
  display: flex; 
  gap: 24px; /* 20px -> 24px */
  flex-wrap: wrap; 
  justify-content: center; 
}

/* Scroll Down Indicator */
.scroll-down-indicator {
    position: absolute;
    bottom: 32px; /* 30px -> 32px */
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-text-muted);
    transition: opacity 0.3s ease, color 0.3s ease;
    animation: bounce 2s infinite ease-out;
}
.scroll-down-indicator:hover {
    color: var(--color-primary);
    animation-play-state: paused;
}
.header.scrolled + main .scroll-down-indicator {
    opacity: 0;
    pointer-events: none;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translate(-50%, 0);
  }
  40% {
    transform: translate(-50%, -8px); /* 10px -> 8px */
  }
  60% {
    transform: translate(-50%, -4px); /* 5px -> 4px */
  }
}

.typing-cursor { display: none; }

@media (prefers-reduced-motion: reduce) {
  .scroll-down-indicator { animation: none; }
  .lede { min-height: 0; }
}


/* -------------------
   7. About Section (MODERN DESIGN)
------------------- */
.about { 
    background-color: transparent; /* Dark mode default */
    position: relative;
    overflow: hidden; 
}
.about .container {
    position: relative;
    z-index: 1;
}

/* UPDATED: 2-column layout (Text Left, Image Right) */
.about-grid-modern { 
  display: grid; 
  grid-template-columns: 1.2fr 1fr; /* Text left (wider), Image right */
  gap: 64px; /* 60px -> 64px */
  align-items: flex-start;
}

.about-visual-portrait {
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky; 
    top: 128px; /* 120px -> 128px */
    order: 2; /* Image on the right */
}

.glassmorphic-frame {
    background: var(--color-card-bg); /* UPDATED: Variable */
    border: 1px solid var(--color-card-border); /* UPDATED: Variable */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 24px;
    padding: 16px;
    transition: all 0.4s ease;
}
.glassmorphic-frame img {
    border-radius: 16px;
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.about-text-content-modern { 
    text-align: left; 
    order: 1; /* Text on the left */
}

/* === UPDATED: About Bio Style === */
.about-bio {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 24px;
    border-left: 4px solid var(--color-primary); /* ADDED */
    padding-left: 24px; /* ADDED */
    font-style: italic; /* ADDED */
    opacity: 0.9;
}
.about-bio strong {
    color: var(--color-text-light);
    font-style: normal;
    font-weight: 600;
}


/* -------------------
   8. Services Section (DEPRECATED - No HTML)
------------------- */


/* -------------------
   9. Portfolio Section
------------------- */
.portfolio { background-color: transparent; }


/* === 9b. PORTFOLIO PREVIEW STYES (NEW HOVER) === */
.portfolio-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px; /* 12px -> 16px */
    margin-bottom: 32px; /* 30px -> 32px */
}
.sort-label {
    font-weight: 600;
    color: var(--color-text-muted);
}
#portfolio-sort {
    background: var(--color-bg); 
    color: var(--color-text-light);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px; 
    transition: border-color 0.3s ease, background-color 0.4s ease;
}
#portfolio-sort:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 4px var(--color-primary-weak); 
}

.portfolio-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px; /* 30px -> 32px */
}

/* Card is now an <a> tag */
.portfolio-preview-item {
    display: block;
    background: var(--color-card-bg); /* UPDATED: Variable */
    border: 1px solid var(--color-card-border); /* UPDATED: Variable */
    backdrop-filter: blur(10px); /* Glassmorphic default */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); /* Glassmorphic default */
    border-radius: 12px;
    text-align: left;
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-spring), border-color 0.4s ease-in-out;
    overflow: hidden;
    position: relative;
    text-decoration: none;
}
/* NEW HOVER EFFECT (as per manifesto) */
.portfolio-preview-item:hover,
.portfolio-preview-item:focus-within {
    transform: scale(1.03); /* Subtle scale */
    box-shadow: 0 0 32px var(--color-primary-glow); /* Subtle glow */
    border-color: var(--color-primary);
}
.portfolio-preview-item img {
    width: 100%;
    height: 280px;
    object-fit: cover; 
    border-radius: 0;
    margin-bottom: 0; 
    border: none; 
    transition: transform 0.4s var(--ease-spring);
}
/* Removed image-only zoom */
.portfolio-preview-item:hover img,
.portfolio-preview-item:focus-within img {
    transform: none; 
}

/* NEW: Hide overlay as per manifesto */
.portfolio-content-overlay {
    display: none;
}
/* Hide old content elements */
.portfolio-content, .portfolio-preview-item p {
    display: none;
}


/* === 9c. CERTIFICATIONS STYLES (NEW HOVER) === */
.certifications { background-color: transparent; }

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px; /* 30px -> 32px */
    margin: 0 auto;
}

/* Card is now an <a> tag */
.certification-card {
    display: block;
    background: var(--color-card-bg); /* UPDATED: Variable */
    border: 1px solid var(--color-card-border); /* UPDATED: Variable */
    backdrop-filter: blur(10px); /* Glassmorphic default */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); /* Glassmorphic default */
    border-radius: 12px;
    text-align: left;
    overflow: hidden; 
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-spring), border-color 0.4s ease-in-out;
    cursor: pointer;
    position: relative;
    text-decoration: none;
}
/* NEW HOVER EFFECT (as per manifesto) */
.certification-card:hover,
.certification-card:focus-within {
    transform: scale(1.03); /* Subtle scale */
    box-shadow: 0 0 32px var(--color-primary-glow); /* Subtle glow */
    border-color: var(--color-primary);
}
.certification-card img {
    width: 100%;
    height: 220px;
    object-fit: cover; 
    background-color: #f5f5ff; 
    transition: transform 0.4s ease;
}
/* Removed image-only zoom */
.certification-card:hover img,
.certification-card:focus-within img {
    transform: none;
}

/* NEW: Hide overlay as per manifesto */
.cert-content-overlay {
    display: none;
}
/* Hide old content elements */
.cert-content {
    display: none;
}
.certification-card::after {
    display: none;
}


/* -------------------
   10. Testimonials Section (UPDATED TO GRID & REMOVE BUTTONS)
------------------- */
.testimonials {
    background-color: transparent;
}

/* Updated Layout: Grid (like portfolio) instead of carousel */
.testimonial-carousel {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px; 
}

/* Removed carousel navigation styles */

.testimonial {
  /* No flex properties needed for grid items */
  background: var(--color-card-bg); 
  border: 1px solid var(--color-card-border); 
  backdrop-filter: blur(10px); 
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); 
  padding: 32px; 
  border-radius: 12px;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-spring), border-color 0.4s ease-in-out; /* UPDATED TRANSITION */
  position: relative;
  padding-top: 40px; 
}

/* ADDED HOVER EFFECT (Same as Portfolio) */
.testimonial:hover {
    transform: scale(1.03); 
    box-shadow: 0 0 32px var(--color-primary-glow); 
    border-color: var(--color-primary);
}

.testimonial-quote-icon {
    position: absolute;
    top: -8px; /* 10px -> 8px */
    left: 24px; /* 20px -> 24px */
    font-size: 6rem;
    font-family: var(--font-heading);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0.2; /* Dark mode opacity */
    line-height: 1;
    z-index: 0;
}

.testimonial-body { 
    margin-bottom: 24px; /* 20px -> 24px */
    color: var(--color-text-muted); 
    font-size: 1.05rem; 
    font-style: italic; 
    position: relative; 
    z-index: 1;
}
.testimonial-author { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
    padding-top: 24px; /* 20px -> 24px */
    border-top: 1px solid var(--color-card-border); /* UPDATED: Variable */
    position: relative; 
    z-index: 1;
}
.testimonial-author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-primary); } /* 60px -> 64px */
.author-info h4 { color: var(--color-text-light); }
.author-info cite { color: var(--color-text-muted); font-style: normal; }

/* Removed progress bar */

/* -------------------
   10.5. FAQ Section (NEW)
------------------- */
.faq {
    background-color: transparent;
}
.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Left column narrower than right */
    gap: 64px;
    align-items: flex-start;
}

/* FAQ Left Column Text */
.faq-text-content {
    text-align: left;
    position: sticky;
    top: 128px; /* Sticky on scroll */
}
.faq-tag {
    display: inline-block;
    background: var(--color-primary-weak);
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 114, 255, 0.2);
}
.faq-heading {
    text-align: left; /* Override default center */
    margin-bottom: 24px;
    font-size: 2.5rem;
}
/* Remove the center-line underline for the left-aligned FAQ title */
.faq-heading::after {
    display: none;
}
.faq-lede {
    text-align: left;
    margin: 0;
    max-width: none;
}

/* FAQ Right Column Accordion */
.faq-item {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s var(--ease-spring);
}
.faq-item:hover {
    border-color: var(--color-primary-glow);
}
.faq-item.active {
    border-color: var(--color-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    background: rgba(255,255,255,0.07); /* Slightly lighter bg when open */
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 24px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--color-text-light);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}
.faq-question:hover {
    color: var(--color-primary);
}

.faq-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary-weak);
    color: var(--color-primary);
    transition: transform 0.3s var(--ease-spring), background-color 0.3s ease;
    flex-shrink: 0;
    margin-left: 16px;
}
.faq-item.active .faq-icon {
    transform: rotate(180deg);
    background: var(--color-primary);
    color: #ffffff;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-spring);
}
.faq-answer-inner {
    padding: 0 24px 24px 24px;
    color: var(--color-text-muted);
    line-height: 1.6;
    font-size: 1rem;
}


/* -------------------
   11. Contact Section (UPDATED)
------------------- */
.contact { background-color: transparent; } 

.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 80px; align-items: center; }
#contact #contact-title, #contact .section-lede { text-align: left; margin: 0; max-width: none; }
#contact .section-lede { margin-top: 24px; margin-bottom: 40px; }

/* Alt contact info with icons */
.contact-info-alt {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.contact-info-link {
    display: flex;
    align-items: center;
    gap: 16px; /* 12px -> 16px */
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}
.contact-info-link svg {
    color: var(--color-primary);
    flex-shrink: 0; /* Prevent icon from shrinking */
}
.contact-info-link:hover {
    color: var(--color-primary);
}
.contact-info-link span {
    transition: transform 0.3s var(--ease-spring);
}
.contact-info-link:hover span {
    transform: translateX(4px);
}

.social-links { display: flex; gap: 24px; margin-top: 40px; }
.social-links img { 
    width: 32px; height: 32px; opacity: 0.7; 
    transition: transform 0.3s var(--ease-spring), opacity 0.3s; 
    filter: var(--color-social-icon-filter); /* UPDATED: Variable */
}
.social-links a:hover img { opacity: 1; transform: scale(1.15) rotate(5deg); }

.contact-form-container { 
    background: var(--color-card-bg); /* UPDATED: Variable */
    border: 1px solid var(--color-card-border); /* UPDATED: Variable */
    backdrop-filter: blur(10px); /* Glassmorphic default */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); /* Glassmorphic default */
    padding: 40px; border-radius: 12px; 
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease; 
}
.styled-contact-form { display: grid; grid-template-columns: 1fr; gap: 24px; } /* 20px -> 24px */

/* --- UPDATED: Floating Label Styles --- */
.form-group { 
    display: flex; 
    flex-direction: column; 
    position: relative;
}
.form-group label {
    position: absolute;
    left: 18px;
    top: 16px; /* Aligns with input padding */
    font-size: 1rem;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: all 0.3s var(--ease-spring);
    margin-bottom: 0; /* Override old margin */
    background: var(--color-panel); /* Uses panel color to "cut out" the border */
    padding: 0 4px;
}
.styled-contact-form input:focus + label,
.styled-contact-form textarea:focus + label,
.styled-contact-form input:not(:placeholder-shown) + label,
.styled-contact-form textarea:not(:placeholder-shown) + label {
    top: -10px;
    left: 14px;
    font-size: 0.9rem;
    color: var(--color-primary);
}
/* Make label background transparent only when not-focused and empty */
.styled-contact-form input:placeholder-shown + label,
.styled-contact-form textarea:placeholder-shown + label {
    background: transparent;
    padding: 0;
}

.styled-contact-form input, .styled-contact-form textarea {
  padding: 16px; /* 16px 18px -> 16px */
  border-radius: 8px; 
  border: 2px solid var(--color-input-border); /* UPDATED: Variable */
  background: var(--color-input-bg); /* UPDATED: Variable */
  color: var(--color-text-light); font-size: 1rem;
  font-family: var(--font-body); transition: all 0.25s var(--ease-spring);
  width: 100%; /* <<< FIX: Ensures full width on all screens */
}
.styled-contact-form input:focus, .styled-contact-form textarea:focus {
  border-color: var(--color-primary); 
  box-shadow: 0 0 0 4px var(--color-primary-weak); 
  outline: none;
}
.styled-contact-form textarea { resize: vertical; min-height: 160px; } /* 150px -> 160px */
.styled-contact-form button { width: 100%; font-size: 1.1rem; }
#form-status { margin-top: 16px; padding: 12px; border-radius: 8px; font-weight: 600; display: none; text-align: center; }
#form-status.success { background: var(--color-primary-weak); color: var(--color-primary); } 
#form-status.error { background: rgba(255, 0, 68, 0.1); color: #ff6c8f; }

/* -------------------
   12. Footer (NEW REDESIGN)
------------------- */
.footer { 
    padding: 80px 0 40px;
    border-top: 1px solid var(--color-header-border); /* UPDATED: Variable */
    background-color: transparent; /* Dark mode bg */
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h4 {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: 16px;
    font-family: var(--font-heading);
}
.footer-col-logo {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}
.footer-logo img {
    height: 32px; /* 35px -> 32px */
    width: auto;
}
.copyright { 
    color: var(--color-text-muted); 
    font-size: 0.9rem; 
    line-height: 1.5;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px; /* 10px -> 8px */
}
.footer-nav a {
    color: var(--color-text-muted);
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s ease;
}
.footer-nav a:hover {
    color: var(--color-primary);
    transform: translateX(4px);
}

.footer-socials {
    display: flex;
    gap: 24px; /* 20px -> 24px */
}
.footer-socials img {
    width: 24px; /* 28px -> 24px */
    height: 24px; /* 28px -> 24px */
    opacity: 0.7;
    transition: transform 0.3s var(--ease-spring), opacity 0.3s;
    filter: var(--color-social-icon-filter); /* UPDATED: Variable */
}
.footer-socials a:hover img {
    opacity: 1;
    transform: scale(1.15);
}

.footer-bottom {
    border-top: 1px solid var(--color-header-border); /* UPDATED: Variable */
    padding-top: 32px; /* 30px -> 32px */
    text-align: right;
}

.back-to-top { 
    color: var(--color-text-muted); 
    font-weight: 600; 
    font-size: 0.9rem; 
}
.back-to-top:hover { color: var(--color-primary); }


/* -------------------
   13. Image Lightbox
------------------- */
.lightbox {
    position: fixed; inset: 0; z-index: 10000; display: flex;
    align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 16px; /* 1rem -> 16px */
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox-overlay {
    position: absolute; inset: 0;
    background: var(--color-lightbox-bg); /* UPDATED: Variable */
    backdrop-filter: blur(8px);
    cursor: pointer;
}
.lightbox-content-wrapper {
    position: relative; z-index: 1;
    max-width: 90vw; max-height: 90vh;
    display: flex;
    transform: scale(0.95);
    transition: transform 0.4s var(--ease-spring);
}
.lightbox.active .lightbox-content-wrapper { transform: scale(1); }

#lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute; top: -16px; right: -16px; /* 15px -> 16px */
    width: 40px; height: 40px; font-size: 1.8rem;
    color: var(--color-text-light);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s var(--ease-spring), color 0.3s ease, background-color 0.4s ease;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    z-index: 2;
}
.lightbox-close:hover {
    color: var(--color-primary);
    transform: rotate(90deg);
}

/* Glassmorphic overrides removed, as they are now default */


/* -------------------
   14. Skills & Tools Section (NEW)
------------------- */
.skills-container {
    max-width: 1100px;
    margin: 0 auto;
}

.skills-subtitle {
    font-size: 1.75rem; 
    margin-bottom: 24px; 
    margin-top: 48px;
    color: var(--color-text-light); 
    text-align: left;
    position: relative;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}
.skills-subtitle:first-of-type {
    margin-top: 0;
}

.skills-grid {
    display: grid;
    /* === UPDATED: Skill Card Size === */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.skill-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    /* === UPDATED: Skill Card Size === */
    padding: 24px;
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring), border-color 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--glow-strong);
    border-color: var(--color-primary-glow);
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.skill-icon {
    color: var(--color-primary);
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.skill-card h4 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--color-text-light);
    line-height: 1.3;
}

.skill-description {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.skill-progress-bar {
    height: 8px;
    background-color: var(--color-input-bg);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    /* Animation logic: */
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.2s var(--ease-spring) 0.3s;
}

/* This triggers the animation when the card is revealed */
.reveal.visible .skill-progress {
    transform: scaleX(1);
}

/* Toolkit styles (moved from About section) */
.toolkit-icons { 
  display: flex; 
  flex-wrap: wrap;
  gap: 32px; /* 30px -> 32px */
  justify-content: flex-start;
  padding: 8px 0px; /* 10px -> 8px */
}
.tool-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 16px; 
}
.tool-icon-wrapper {
    width: 72px; /* 70px -> 72px */
    height: 72px; /* 70px -> 72px */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary-weak);
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 16px var(--color-primary-glow); /* 15px -> 16px */
    transition: all 0.3s var(--ease-spring);
}
.tool-item:hover .tool-icon-wrapper {
    transform: scale(1.1);
    box-shadow: 0 0 24px var(--color-primary-glow), 0 0 8px var(--color-primary); /* 25px -> 24px, 10px -> 8px */
}
.tool-item img { 
    width: 32px; /* 36px -> 32px */
    height: 32px; /* 36px -> 32px */
    opacity: 1; 
    transition: none; 
    filter: invert(0.1) brightness(1.5);
}
.tool-item img[src*="figma"] { filter: none; } /* Figma icon fix */
.tool-item span { 
    font-size: 0.9rem; 
    color: var(--color-text-light); 
    font-weight: 600;
}
.tool-item .mastery-level {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    opacity: 0.8;
    font-family: var(--font-body);
    font-weight: 400;
    margin-top: -14px; 
    line-height: 1;
}


/* -------------------
   15. Responsive Design
------------------- */
@media (max-width: 992px) {
  .contact-grid { grid-template-columns: 1fr; gap: 64px; }
  
  /* Add FAQ to responsive breakdown */
  .faq-grid { grid-template-columns: 1fr; gap: 48px; }
  .faq-text-content { position: static; margin-bottom: 24px; text-align: center; }
  .faq-heading { text-align: center; font-size: 2rem; }
  .faq-lede { text-align: center; margin: 0 auto; }
  
  .about-grid-modern {
      grid-template-columns: 1fr;
      gap: 40px;
  }
  .about-visual-portrait {
      position: static; 
      top: auto;
      max-width: 400px; 
      margin: 0 auto;
      order: 1; /* Image first on mobile */
  }
  .about-text-content-modern {
      order: 2; /* Text second on mobile */
  }
  
  /* UPDATED to target new skills section */
  .skills-subtitle {
      text-align: left; 
  }
  .toolkit-icons {
      justify-content: flex-start; 
  }

  #contact #contact-title, #contact .section-lede { text-align: center; }
  #contact-title::after {
      left: 50%;
      transform: translateX(-50%) scaleX(0);
      transform-origin: center;
  }
  .reveal.visible #contact-title::after {
      transform: translateX(-50%) scaleX(1);
  }

  .social-links { justify-content: center; }
  .contact-info-link {
      justify-content: center; /* Center icons + text */
  }

  .portfolio-preview-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .certifications-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .skills-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

  .hero-ctas {
    flex-direction: column;
    align-items: center; 
    gap: 16px;
  }
  .hero-ctas .btn {
    width: 100%; 
    max-width: 300px;
    text-align: center;
  }

  .footer-grid {
      grid-template-columns: 1fr 1fr; /* 2x2 grid */
  }
  .footer-col-logo {
      grid-column: 1 / -1; /* Logo spans full width */
      align-items: center;
      text-align: center;
  }
  .footer-bottom {
      display: flex;
      justify-content: center;
  }

  /* === MOVED FROM 768px - THIS IS THE FIX === */
  .hamburger { display: block; }
  .navbar {
    position: fixed; top: 81px; /* (header is 24+24+32+1 = 81) */
    right: -100%; width: 100%; height: calc(100vh - 81px);
    background: var(--color-header-bg); 
    backdrop-filter: blur(15px);
    padding: 40px 0; 
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.4s ease;
    border-top: 1px solid var(--color-border); 
  }
  .navbar.active { right: 0; }
  .navbar ul { flex-direction: column; align-items: center; gap: 32px; font-size: 1.3rem; }
  /* === END OF FIX === */
}

@media (max-width: 768px) {
  section { padding: 64px 0; } /* 70px -> 64px */
  .section-lede { margin-bottom: 40px; font-size: 1.05rem; }
  
  /* FIX 1 (Contact Title): Reduced the minimum font size for h2 on small screens */
  h2 { font-size: clamp(1.5rem, 7vw, 2.2rem); } 
  
  .lede { 
    font-size: 1.1rem;
    min-height: 0; 
  }
  
  .header-controls { gap: 8px; }
  
  /* --- The rules for .hamburger, .navbar, .navbar.active, .navbar ul --- */
  /* --- were MOVED to the (max-width: 992px) block --- */
  
  .hero { min-height: 80vh; padding: 64px 0; text-align: center; }
  .hero-content-centered {
      gap: 40px;
  }
  .hero-text {
      text-align: center; 
  }
  .lede {
      margin-left: auto;
      margin-right: auto; 
  }
  .hero-ctas { 
      flex-direction: column; 
      align-items: center;
      gap: 16px;
      justify-content: center; 
  }

  .portfolio-preview-grid { grid-template-columns: 1fr; }
  .certifications-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-grid { gap: 40px; } 
  .contact-form-container { padding: 32px; } /* 30px -> 32px */

  .lightbox-content-wrapper {
      padding: 0;
  }
  .lightbox-close {
       top: 8px; right: 8px;
       background: rgba(10, 10, 10, 0.7);
       color: #ffffff; 
       border: none;
       width: 32px; height: 32px; /* 36px -> 32px */
       font-size: 1.5rem;
  }

  /* UPDATED to target new skills section */
  .toolkit-icons {
      justify-content: center;
  }
  .skills-subtitle {
      text-align: center;
  }

  .footer-grid {
      grid-template-columns: 1fr; /* Single column */
      text-align: center;
  }
  .footer-col-logo, .footer-col {
      align-items: center;
  }
  
  /* FIX 2 (Footer Socials): Center the icons inside their flex container */
  .footer-socials {
      justify-content: center;
  }
  
  .footer-nav a:hover {
      transform: none; /* Disable hover movement */
  }
}