/* ========================================
       CSS VARIABLES
       ======================================== */
    :root {
      --color-bg: #FAFBFC;
      --color-surface: #fff;
      --color-primary: #CE003D;
      --color-primary-hover: linear-gradient(112deg, #CE003D 0%, #EDB553 100%);
      --color-text: #132440;
      --color-text-secondary: #66707c;
      --color-accent: #50B8C6;
      --color-footer-bg: #3e0012;
      --color-footer-text: #fafbfc;
      --radius: 10px;
      --shadow: 0 4px 20px rgba(33, 128, 141, 0.05);
      --space: 3rem;
      --font-base: 'Inter', 'Geist', Arial, sans-serif;
    }

    /* ========================================
       BASE STYLES
       ======================================== */
    html {
      font-family: var(--font-base);
      color: var(--color-text);
      background: var(--color-bg);
      scroll-behavior: smooth;
    }

    body {
      margin: 0;
      padding: 0;
      background: var(--color-bg);
    }

    h1, h2, h3, h4, h5, h6 {
      margin-top: 0.5rem;
      margin-bottom: 0.7rem;
      font-weight: 600;
    }

    p {
      color: var(--color-text-secondary);
      margin-bottom: 1rem;
    }

    a {
      color: var(--color-primary);
      text-decoration: none;
    }

    a:hover {
      color: var(--color-primary-hover);
    }

    /* ========================================
       HEADER & NAVIGATION
       ======================================== */
    header {
      position: sticky;
      top: 0;
      z-index: 1000;
      background: rgba(255, 255, 255, 0.97);
      box-shadow: 0 1px 10px rgba(33, 128, 141, 0.07);
      border-radius: 0 0 var(--radius) var(--radius);
      overflow: hidden;
    }

    .nav-container {
      margin: 0 auto;
      margin: 0 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 64px;
    }

    .logo {
      font-size: 1.7rem;
      font-weight: 700;
      color: var(--color-primary);
      letter-spacing: -0.01em;
      text-decoration: none;
    }

    /* Hamburger Menu Button */
    .hamburger {
      display: none;
      flex-direction: column;
      cursor: pointer;
      padding: 0.5rem;
      background: none;
      border: none;
      z-index: 1001;
    }

    .hamburger span {
      width: 25px;
      height: 3px;
      background-color: var(--color-text);
      margin: 3px 0;
      transition: all 0.3s ease;
      border-radius: 2px;
    }

    .hamburger.active span:nth-child(1) {
      transform: rotate(45deg) translate(7px, 7px);
    }

    .hamburger.active span:nth-child(2) {
      opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
      transform: rotate(-45deg) translate(8px, -8px);
    }

        ul.nav-menu {
      display: flex;
      gap: 0.75rem;
      list-style: none;
      margin: 0;
      padding: 0;
      border-radius: var(--radius) 0 0 var(--radius);
    }

    .nav-link {
      color: var(--color-text);
      text-decoration: none;
      font-weight: 600;
      letter-spacing: 0.02em;
      padding: 0.9rem;
      border-radius: var(--radius);
      transition: color 0.2s, background 0.2s;
    }

    .nav-link:hover {
      color: var(--color-surface);
      background: var(--color-primary-hover);
      box-shadow: 0 2px 6px rgb(255, 255, 255);
    }

    /* ========================================
       HERO SECTION
       ======================================== */
    .hero {
      position: relative;
      padding: 2.5rem 0;
      background: linear-gradient(112deg, #CE003D 0%, #EDB553 100%);
      color: #fff;
      text-align: center;
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      margin: 5px;
      min-height: 20vh;
      overflow: hidden;
    }

    .hero-content {
      position: relative;
      z-index: 2;
    }

    .hero-titles-wrapper {
      position: relative;
      min-height: 16rem; /* Increased for better mobile stability (501px - 800px) */
      margin: 0.8rem 0;
    }

    @media (min-width: 801px) {
      .hero-titles-wrapper {
        min-height: 12rem; /* Original value seems sufficient for desktop */
      }
    }
    @media (max-width: 500px) {
      .hero-titles-wrapper {
        min-height: 18rem; /* Further increased for very small mobile screens */
      }
    }

    .hero-title {
      font-size: 2.7rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      /* height: 100%; */ /* Removed to allow natural height */
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    }

    .hero-title.active {
      opacity: 1;
      visibility: visible;
    }

    .hero-title .BC {
      font-weight: 900;
      font-size: 1.5em;
      background: #f5ccd8;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      letter-spacing: 0.06em;
    }

    .BC-enh {
      font-weight: 900;
      font-size: 1.5em;
      color: white;
    }

    .BC-enh.rotated-n {
      display: inline-block;
      transform: rotate(0deg);
      transition: none;
    }

    .BC-enh.rotated-n.active {
      animation: rotateNtoU 1.5s ease-in-out forwards;
    }

    .hero-subtitle {
      font-size: 1.25rem;
      font-weight: 400;
      letter-spacing: 0.01em;
      margin-bottom: 2rem;
      color: #FAFBFC;
      min-height: 4rem; /* Increased for better mobile stability */
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .hero-actions {
      display: flex;
      gap: 1rem;
      justify-content: center;
      margin-top: 1rem;
    }

    .btn {
      background: var(--color-primary);
      color: #fafbfc;
      border-radius: var(--radius);
      padding: 0.65rem 1.25rem;
      font-weight: 600;
      box-shadow: 0 2px 8px rgba(33, 128, 141, 0.10);
      border: none;
      text-decoration: none;
      font-size: 1rem;
      margin: 0.2rem;
      transition: background 0.18s;
      cursor: pointer;
    }

    .btn:hover {
      background: var(--color-primary-hover);
      color: #fff;
    }

    /* Canvas Background */
    #neuralCanvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border-radius: var(--radius);
      pointer-events: none;
      z-index: 1;
    }

    /* Hero Carousel Controls */
    .arrows {
      position: absolute;
      width: 100%;
      top: 50%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 20px;
      box-sizing: border-box;
      transform: translateY(-50%);
      z-index: 3;
    }

    button.arrow {
      background: rgba(0, 0, 0, 0.1);
      border: none;
      color: white;
      font-size: 28px;
      padding: 12px 18px;
      border-radius: var(--radius);
      cursor: pointer;
      user-select: none;
      transition: background 0.3s ease;
    }

    button.arrow:hover {
      background: rgba(0, 0, 0, 0.3);
    }

    .dots {
      position: absolute;
      bottom: 10px;
      width: 100%;
      text-align: center;
      z-index: 3;
    }

    .dot {
      display: inline-block;
      width: 14px;
      height: 14px;
      margin: 0 6px;
      background: rgba(255, 255, 255, 0.4);
      border-radius: 50%;
      cursor: pointer;
      transition: background 0.3s ease;
    }

    .dot.active {
      background: white;
    }

    .dot:hover {
      background: rgba(255, 255, 255, 0.7);
    }

    /* ========================================
       MAIN CONTENT
       ======================================== */
    main {
      padding: 2.5rem 0;
      position: relative;
    }

    #mainCanvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }

    .container {
      margin: 0 auto;
      padding: 1rem 2rem;
      position: relative;
      z-index: 1;
    }

    .card {
      background: var(--color-surface);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 2rem;
      margin-bottom: 2rem;
      transition: box-shadow 0.25s;
    }

    .container-section {
      background: #fff;
      border-radius: 10px;
      box-shadow: 0 4px 20px rgba(33, 128, 141, 0.05);
      padding: 2rem 1rem;
      margin-bottom: 2rem;
      transition: box-shadow 0.25s;
      margin: 0rem 12rem;
    }

    .container-section:hover {
      box-shadow: 0 6px 30px rgba(33, 128, 141, 0.18);
    }

    /* ========================================
       GAUGES
       ======================================== */
    .gauges-wrapper {
      display: flex;
      justify-content: center;
      gap: 40px;
      flex-wrap: wrap;
      margin: 40px auto;
      max-width: 1000px;
    }

    .gauge-container {
      position: relative;
      width: 280px;
      height: 180px;
    }

    .gauge-text {
      position: absolute;
      top: 70%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      z-index: 10;
    }

    .gauge-value {
      font-size: 56px;
      font-weight: 700;
      background: linear-gradient(45deg, #9100DA 0%, #daa700 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      margin: 0;
      line-height: 1;
    }

    .gauge-label {
      font-size: 14px;
      color: #64748b;
      margin-top: 8px;
      font-weight: 500;
    }

    .gauge-bg {
      fill: none;
      stroke: #e2e8f0;
      stroke-width: 20;
      stroke-linecap: round;
    }

    .gauge-progress {
      fill: none;
      stroke: url(#gradient);
      stroke-width: 20;
      stroke-linecap: round;
      stroke-dasharray: 220;
      stroke-dashoffset: 220;
      transition: stroke-dashoffset 2s ease-out;
    }

    svg {
      filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.15));
    }

    /* ========================================
       FOOTER
       ======================================== */
    footer {
      background: var(--color-footer-bg);
      color: var(--color-footer-text);
      padding: 2.5rem 0 1.4rem;
      box-shadow: 0 -2px 8px rgba(33, 128, 141, 0.04);
      font-size: 1rem;
      border-radius: var(--radius) var(--radius) 0 0;
      margin-top: 2rem;
    }

    .footer-container {
      max-width: 1200px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 2rem;
      align-items: start;
      padding: 0 var(--space);
    }

    .footer-section h3 {
      color: white;
      margin-bottom: 0.7rem;
      font-size: 1.15em;
    }

    .footer-section p {
      margin: 0.3rem 0 0.6rem;
      color: var(--color-footer-text);
    }

    .footer-bottom {
      text-align: center;
      padding-top: 1.2rem;
      border-top: 1px solid white;
      color: #c6dee5;
    }

    /* ========================================
       ANIMATIONS
       ======================================== */
    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(8px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes rotateNtoU {
      0% {
        transform: rotate(0deg);
      }
      100% {
        transform: rotate(180deg);
      }
    }



    /* ========================================
       RESPONSIVE DESIGN
       ======================================== */

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

      ul.nav-menu {
        position: fixed;
        top: 64px;
        right: -100%;
        width: 70%;
        max-width: 300px;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        padding: 2rem 0;
        gap: 0;
        box-shadow: -2px 0 10px rgba(33, 128, 141, 0.1);
        transition: right 0.3s ease;
        backdrop-filter: blur(10px);
      }

      ul.nav-menu.active {
        right: 0;
      }

      ul.nav-menu li {
        width: 100%;
      }

      .nav-link {
        display: block;
        width: 100%;
        padding: 1rem 1.5rem;
        border-radius: 0;
        text-align: left;
      }

      .nav-link:hover {
        background: var(--color-primary);
      }
    }

    @media (max-width: 800px) {
      .nav-container,
      .container,
      .footer-container {
        max-width: 96vw;
        padding: 0;
      }

      .hero-title {
        font-size: 2rem;
      }

      main {
        padding: 1.3rem 0;
      }

      .card {
        padding: 1rem;
      }
      .container-section {
        margin: 0rem 1rem 2rem 1rem;
      }
    }

    @media (max-width: 768px) {
      .gauges-wrapper {
        flex-direction: column;
        align-items: center;
      }
    }

    @media (max-width: 500px) {
      .nav-menu {
        gap: 1rem;
      }

      .hero {
        padding: 2.5rem 1rem;
      }

      .hero-title {
        font-size: 1.35rem;
      }

      .btn {
        font-size: 0.98rem;
        padding: 0.6rem 1rem;
      }
    }
    .brand-logo {height: 64px; width: auto; }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      text-decoration: none;
    }
