/* ============================================
   CSS Reset & Base Styles
   ============================================ */

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

:root {
    /* Colors */
    --color-primary: #000000;
    --color-secondary: #ffffff;
    --color-accent: #6366f1;
    --color-text: #1a1a1a;
    --color-text-light: #6b7280;
    --color-bg: #ffffff;
    --color-bg-alt: #f9fafb;
    --color-border: #e5e7eb;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --container-max-width: 1280px;
    --section-padding: clamp(4rem, 8vw, 8rem);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

/* ============================================
   Navigation
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.nav.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo a {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-xl);
}

.nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text);
    position: relative;
    padding: var(--spacing-xs) 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width var(--transition-base);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--color-primary);
    transition: all var(--transition-base);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--color-bg-alt);
}

.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
    /* Prevent layout shift */
    min-width: 100%;
    min-height: 100%;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--spacing-lg);
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

.hero-title-line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-title-line:nth-child(2) {
    animation-delay: 0.2s;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: var(--color-text-light);
    margin-bottom: var(--spacing-xl);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-text-light);
    font-size: 0.875rem;
    opacity: 0;
    animation: fadeIn 1s ease-out 1s forwards;
}

.scroll-arrow {
    width: 2px;
    height: 30px;
    background-color: var(--color-text-light);
    position: relative;
    animation: scrollBounce 2s infinite;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--color-text-light);
    border-bottom: 2px solid var(--color-text-light);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    font-family: var(--font-primary);
    position: relative;
    overflow: hidden;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-secondary);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 rgba(124, 92, 255, 0);
}

.btn-primary:hover, .btn-primary:focus-visible {
    background-color: transparent;
    color: var(--color-primary);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(124, 92, 255, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 rgba(124, 92, 255, 0);
}

.btn-secondary:hover, .btn-secondary:focus-visible {
    background-color: var(--color-primary);
    color: var(--color-secondary);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(124, 92, 255, 0.15);
}

/* ============================================
   Sections
   ============================================ */

.section {
    padding: var(--section-padding) var(--spacing-lg);
    position: relative;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

.section-label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

.section-title {
    color: var(--color-primary);
}

/* ============================================
   About Section
   ============================================ */

.about {
    background-color: var(--color-bg);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3xl);
    align-items: center;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.about-text {
    color: var(--color-text-light);
}

.about-heading {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.about-list {
    list-style: none;
    padding: 0;
    margin-top: var(--spacing-lg);
}

.about-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: var(--spacing-md);
    color: var(--color-text-light);
    line-height: 1.6;
}

.about-list li::before {
    content: "▹";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-primary);
    font-weight: bold;
}

.about-list strong {
    display: block;
    color: var(--color-text);
    margin-bottom: 4px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 4vw, 4rem);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.9375rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Services Section
   ============================================ */

.services {
    background-color: var(--color-bg-alt);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
}

.service-card {
    padding: var(--spacing-xl);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border-radius: 8px;
}

.service-card:hover, .service-card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--color-primary);
    border-color: var(--color-primary);
}

.service-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

.service-title {
    margin-bottom: var(--spacing-sm);
    font-size: 1.5rem;
}

.service-description {
    color: var(--color-text-light);
    line-height: 1.7;
}

/* ============================================
   Portfolio Section
   ============================================ */

.portfolio {
    background-color: var(--color-bg);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-xl);
}

.portfolio-item {
    cursor: pointer;
    transition: transform var(--transition-base);
}

.portfolio-item:hover {
    transform: translateY(-4px);
}

.portfolio-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    background-color: var(--color-bg-alt);
}

.portfolio-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-border) 100%);
    transition: transform var(--transition-slow);
}

.portfolio-item:hover .portfolio-placeholder {
    transform: scale(1.05);
}

.portfolio-title {
    margin-bottom: var(--spacing-xs);
    font-size: 1.5rem;
}

.portfolio-category {
    color: var(--color-text-light);
    font-size: 0.9375rem;
}

/* ============================================
   Contact Section
   ============================================ */

.contact {
    background-color: var(--color-bg-alt);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--spacing-3xl);
    max-width: 1000px;
    margin: 0 auto;
}

.contact-text {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-xl);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.contact-detail {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.contact-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
}

.contact-value {
    font-size: 1.125rem;
    color: var(--color-primary);
    transition: color var(--transition-fast);
}

.contact-value:hover {
    color: var(--color-accent);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-input {
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    background-color: var(--color-bg);
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--color-text);
    transition: all var(--transition-base);
    resize: vertical;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-textarea {
    min-height: 120px;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background-color: var(--color-primary);
    color: var(--color-secondary);
    padding: var(--spacing-xl) var(--spacing-lg);
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-links {
    display: flex;
    gap: var(--spacing-xl);
}

.footer-link {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
}

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

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .about-grid,
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: clamp(3rem, 6vw, 5rem);
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--color-bg);
        flex-direction: column;
        padding: var(--spacing-lg);
        gap: var(--spacing-md);
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    .hero {
        min-height: 500px;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: var(--spacing-md);
    }
    
    .hero-content {
        padding: var(--spacing-md);
    }
    
    .section {
        padding: var(--spacing-xl) var(--spacing-md);
    }
}

/* ============================================
   Performance Optimizations
   ============================================ */

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

/* GPU Acceleration for smooth animations */
.hero-canvas,
.service-card,
.portfolio-item {
    will-change: transform;
}

/* ===== Tools Marquee Section ===== */
.tools-marquee {
    padding: 76px 16px; /* +4px */
    background: #ffffff;
    color: #111;
    overflow: hidden;
  }
  
  .tools-title {
    text-align: center;
    font-size: clamp(30px, 4vw, 48px); /* +2px */
    font-weight: 700;
    margin: 0 0 36px; /* +4px */
    color: #111;
    letter-spacing: 0.2px;
  }
  
  /* ===== Marquee Layout ===== */
  .marquee {
    position: sticky;
    max-width: 1380px;  /* +60px */
    margin: 0 auto 24px; /* +4px */
    height: 118px;     /* +10px */
    display: flex;
  }
  
  .marquee--second {
    margin-bottom: 0;
  }
  
  .marquee__viewport {
    width: 100%;
    overflow: hidden;
  }
  
  .marquee__track {
    display: flex;
    align-items: center;
    gap: 22px; /* +2px */
    width: max-content;
    will-change: transform;
  }
  
  /* ===== Icon Pills ===== */
  .pill {
    width: 100px;       /* +8px */
    height: 100px;
    border-radius: 20px; /* +2px */
    background: #ffffff;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
    flex: 0 0 auto;
    color: #222;
  }
  
  .pill img {
    width: 58px;       /* +6px */
    height: 58px;
    object-fit: contain;
    filter: none;
    transition: transform 0.3s ease, filter 0.3s ease;
  }
  
  .pill:hover img {
    transform: scale(1.15);
    filter: grayscale(0%) contrast(1);
  }
  
  /* ===== Edge Fade ===== */
  .marquee__fade {
    position: absolute;
    left: 0;
    top: 0;
    width: 130px; /* +10px */
    height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 2;
  }
  
  .marquee__fade--right {
    left: auto;
    right: 0;
    background: linear-gradient(270deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
  }
  
  /* ===== Animations ===== */
  @keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
  
  .marquee__track {
    animation: marquee var(--duration, 50s) linear infinite;
  }
  
  .marquee__track--rtl { animation-direction: normal; }
  .marquee__track--ltr { animation-direction: reverse; }
  
  .marquee:hover .marquee__track {
    animation-play-state: paused;
  }
  
  /* ===== Accessibility ===== */
  @media (prefers-reduced-motion: reduce) {
    .marquee__track {
      animation: none;
      transform: translateX(0);
    }
  }
  
  /* ===== Responsive ===== */
  @media (max-width: 640px) {
    .marquee {
      height: 96px; /* +8px */
    }
  
    .pill {
      width: 82px; /* +8px */
      height: 82px;
      border-radius: 16px;
    }
  
    .pill img {
      width: 46px; /* +6px */
      height: 46px;
    }
  
    .marquee__fade {
      width: 90px; /* +10px */
    }
  }
/* ============================================
   Process Section
   ============================================ */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.process-step {
    position: relative;
    padding: var(--spacing-lg);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.process-step:hover {
    transform: translateY(-6px);
    border-color: var(--color-primary);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--color-primary);
}

.process-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    opacity: 0.15;
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-md);
    transition: opacity 0.5s ease;
}

.process-step:hover .process-number {
    opacity: 0.3;
}

.process-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.process-desc {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   Why Noble Quality Section
   ============================================ */
.why-section {
    background-color: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.why-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.why-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.why-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    color: var(--color-primary);
    margin-top: 4px;
}

.why-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--color-text);
    margin-top: 5px;
}

.why-content p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ============================================
   Engagement Models Section
   ============================================ */
.engagement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.engagement-card {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.engagement-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-primary);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--color-primary);
}

.engagement-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.engagement-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.engagement-desc {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
    flex-grow: 1;
}

/* ============================================
   FAQ Section
   ============================================ */
.faq-list {
    max-width: 800px;
    margin: var(--spacing-xl) auto 0;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-item:first-child {
    border-top: 1px solid var(--color-border);
}

.faq-button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: var(--spacing-lg) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--color-text);
    font-size: 1.1rem;
    font-weight: 500;
    font-family: var(--font-primary);
    transition: color 0.3s ease;
}

.faq-button:hover, .faq-button:focus-visible {
    color: var(--color-primary);
    outline: none;
}

.faq-icon {
    width: 24px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
}

.faq-icon::before, .faq-icon::after {
    content: '';
    position: absolute;
    background-color: currentColor;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-icon::before {
    top: 11px;
    left: 4px;
    width: 16px;
    height: 2px;
}

.faq-icon::after {
    top: 4px;
    left: 11px;
    width: 2px;
    height: 16px;
}

.faq-button[aria-expanded="true"] .faq-icon::after {
    transform: rotate(90deg);
}
.faq-button[aria-expanded="true"] .faq-icon::before {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-answer-inner {
    padding-bottom: var(--spacing-lg);
    color: var(--color-text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

.faq-button[aria-expanded="true"] + .faq-answer {
    max-height: 500px;
}

/* ============================================
   Final CTA Section
   ============================================ */
.final-cta {
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
    text-align: center;
    border-top: 1px solid var(--color-border);
}

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

.final-cta-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

.final-cta-desc {
    color: var(--color-text-light);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xl);
    line-height: 1.5;
}

.final-cta-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

@media (max-width: 480px) {
    .final-cta-actions {
        flex-direction: column;
    }
}

/* =========================
   Terminal Test Run Section
   ========================= */
   .tt-terminal-section {
    background: #ffffff;
    padding: clamp(56px, 7vw, 96px) 0;
    color: #0b1220;
  }
  
  .tt-container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3.5vw, 28px);
  }
  
  .tt-header {
    margin-bottom: clamp(18px, 3vw, 28px);
  }
  
  .tt-eyebrow {
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(11, 18, 32, 0.65);
    margin: 0 0 10px;
  }
  
  .tt-title {
    font-size: clamp(1.5rem, 2.4vw, 2.2rem);
    line-height: 1.15;
    margin: 0 0 10px;
  }
  
  .tt-subtitle {
    margin: 0;
    max-width: 70ch;
    color: rgba(11, 18, 32, 0.72);
    font-size: clamp(1rem, 1.35vw, 1.05rem);
  }
  
  /* Terminal frame */
  .tt-terminal {
    position: relative;
    margin-top: 22px;
    border-radius: 18px;
    overflow: hidden;
    /* subtle premium shadow */
    box-shadow:
      0 18px 50px rgba(5, 9, 20, 0.12),
      0 6px 18px rgba(5, 9, 20, 0.08);
  }
  
  /* Modern glow / gradient border (subtle) */
  .tt-terminal::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 19px;
    background: linear-gradient(
      135deg,
      rgba(124, 92, 255, 0.55),
      rgba(57, 220, 255, 0.35),
      rgba(0, 255, 163, 0.25)
    );
    filter: blur(10px);
    opacity: 0.35;
    pointer-events: none;
  }
  
  /* Inner border */
  .tt-terminal::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
  }
  
  /* Top chrome bar */
  .tt-terminal-chrome {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(24, 28, 40, 0.98), rgba(17, 20, 29, 0.98));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  
  .tt-dots {
    display: inline-flex;
    gap: 8px;
    align-items: center;
  }
  
  .tt-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
  }
  .tt-dot--red { background: #ff5f57; }
  .tt-dot--yellow { background: #febc2e; }
  .tt-dot--green { background: #28c840; }
  
  .tt-terminal-title {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "JetBrains Mono", monospace;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .tt-terminal-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "JetBrains Mono", monospace;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  /* Body */
  .tt-terminal-body {
    position: relative;
    background: radial-gradient(1200px 420px at 30% -30%, rgba(124, 92, 255, 0.18), transparent 60%),
                radial-gradient(900px 380px at 110% 20%, rgba(57, 220, 255, 0.12), transparent 55%),
                linear-gradient(180deg, #0c0f17 0%, #070913 100%);
  }
  
  /* Sheen overlay */
  .tt-sheen {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent 35%, transparent 65%, rgba(255,255,255,0.03));
    opacity: 0.35;
    pointer-events: none;
  }
  
  /* Output area */
  .tt-output-wrap {
    position: relative;
    padding: 18px 18px 10px;
  }
  
  .tt-output {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "JetBrains Mono", monospace;
    font-size: clamp(0.75rem, 2vw, 0.95rem);
    line-height: 1.5;
    color: rgba(236, 242, 255, 0.90);
    text-shadow: 0 0 18px rgba(80, 180, 255, 0.06);
    min-height: 280px;
  }
  
  .tt-replay-btn {
    display: block;
    margin: 1rem auto 0;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .tt-replay-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
  }
  
  /* Cursor should be inline at the end of the terminal output */
  .tt-cursor {
    position: static !important;
    display: inline-block;
    margin-left: 2px;
    vertical-align: baseline;
    pointer-events: none;
    color: rgba(236, 242, 255, 0.9);
  }

   /* REMOVE/OVERRIDE if present */
  .tt-cursor {
    bottom: 14px;
    left: 18px;
  }
  
  /* status bar */
  .tt-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(236, 242, 255, 0.65);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "JetBrains Mono", monospace;
    font-size: 0.86rem;
  }
  
  .tt-status-left {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .tt-pill {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .tt-pill--muted {
    background: rgba(255, 255, 255, 0.04);
  }
  
  .tt-status-right {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }
  
  .tt-kbd {
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
  }
  
  .tt-dim {
    color: rgba(236, 242, 255, 0.55);
  }
  
  /* Caption below terminal */
  .tt-caption {
    margin: 14px 0 0;
    color: rgba(11, 18, 32, 0.65);
    max-width: 85ch;
    font-size: 0.98rem;
  }
  
  /* Inline terminal colors (apply via JS markup) */
  .tt-fg-dim { color: rgba(236, 242, 255, 0.60); }
  .tt-fg-cyan { color: rgba(110, 231, 255, 0.95); }
  .tt-fg-green { color: rgba(106, 255, 179, 0.92); }
  .tt-fg-yellow { color: rgba(255, 214, 102, 0.95); }
  .tt-fg-red { color: rgba(255, 120, 120, 0.95); }
  .tt-fg-purple { color: rgba(183, 164, 255, 0.95); }
  
  .tt-hr {
    display: block;
    color: rgba(236, 242, 255, 0.22);
  }
  
  /* Mobile responsiveness */
  @media (max-width: 640px) {
    .tt-output {
      font-size: 0.90rem;
      min-height: 240px;
    }
  
    .tt-terminal-title {
      font-size: 0.86rem;
    }
  
    /* Allow terminal to grow on small screens instead of scrolling inside */
    .tt-output-wrap {
      /* removed max-height and overflow to let it expand */
    }
  }
  
  /* Cursor blink animation */
  @keyframes tt-blink {
    0%, 48% { opacity: 1; }
    49%, 100% { opacity: 0; }
  }
  
  /* Reduce motion: no blinking cursor animation */
  @media (prefers-reduced-motion: reduce) {
    .tt-cursor { animation: none !important; }
  }

/* Base Styles */
.expertise-section {
  padding: 5rem 2rem;
  background-color: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.expertise-section .section-title {
  text-align: center;
  font-size: 2.5rem;
  color: var(--color-text);
  margin-bottom: 1rem;
  font-weight: 700;
}

.expertise-section .section-subtitle {
  text-align: center;
  color: var(--color-text-light);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 4rem;
  line-height: 1.6;
}

/* Grid Layout */
.competencies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Card Container */
.competency-card {
  perspective: 1000px;
  min-height: 350px;
  height: auto;
  cursor: pointer;
  outline: none;
}

.competency-card:focus-visible {
  outline: 2px solid var(--color-primary);
  border-radius: 12px;
}

/* Card Inner Container */
.card-inner {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.competencies-grid .competency-card:hover .card-inner,
.competencies-grid .competency-card:focus-visible .card-inner,
.competencies-grid .competency-card.is-flipped .card-inner {
  transform: rotateY(180deg);
}

/* Card Faces */
.card-front,
.card-back {
  grid-area: 1 / 1;
  width: 100%;
  min-height: 350px;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Front Side */
.card-front {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--color-primary);
}

.competency-card:hover .card-front .card-icon {
  transform: translateY(-5px);
}

.card-title {
  font-size: 1.5rem;
  color: var(--color-text);
  margin-bottom: 1rem;
  font-weight: 600;
}

.card-preview {
  color: var(--color-text-light);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.hover-hint {
  display: inline-block;
  color: var(--color-primary);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  margin-top: auto;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.competency-card:hover .hover-hint {
  background: var(--color-bg);
  border-color: var(--color-primary);
  transform: scale(1.05);
}

/* Back Side */
.card-back {
  background: var(--color-primary);
  color: var(--color-bg);
  transform: rotateY(180deg);
  text-align: left;
  justify-content: flex-start;
  overflow: hidden;
}

.card-back .card-title {
  color: var(--color-bg);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.card-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-tech {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.card-tech li {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .expertise-section {
    padding: 3rem 1.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .competencies-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
  
  .competency-card {
    min-height: 320px;
  }
  
  .card-front,
  .card-back {
    padding: 2rem 1.5rem;
    min-height: 320px;
  }
}

/* Touch Device Adaptation */
@media (hover: none) and (pointer: coarse) {
  .hover-hint {
    content: "Tap to learn more";
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .card-inner,
  .card-icon,
  .hover-hint {
    transition: none;
  }
}

/* Animation for card appearance */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.competency-card {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.competency-card:nth-child(1) { animation-delay: 0.1s; }
.competency-card:nth-child(2) { animation-delay: 0.2s; }
.competency-card:nth-child(3) { animation-delay: 0.3s; }

/* ============================================
   Global Reveal Animation System
   ============================================ */
.reveal {
  opacity: 0;
  will-change: opacity, transform, filter;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal--up { transform: translateY(30px); }
.reveal--down { transform: translateY(-30px); }
.reveal--left { transform: translateX(30px); }
.reveal--right { transform: translateX(-30px); }
.reveal--scale { transform: scale(0.95); }

.reveal.is-visible {
  opacity: 1;
  transform: translate(0) scale(1);
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: opacity 0.5s ease !important;
    transform: none !important;
    filter: none !important;
  }
}
