    /* ========================
   RESET & ROOT
======================== */
    *,
    *::before,
    *::after {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    :root {
      --navy: #0f1729;
      --navy2: #1a2744;
      --amber: #f59e0b;
      --amber2: #fbbf24;
      --coral: #ef4444;
      --teal: #0d9488;
      --bg: #f8f7f4;
      --bg2: #f0eee9;
      --white: #ffffff;
      --text: #1a1a2e;
      --muted: #6b7280;
      --border: #e5e3de;
      --border2: #d1cfc8;

      --nav-h: 64px;
      --sub-h: 44px;
      --pad-x: 5%;
      /* Common horizontal grid padding variable */
      
      --nav-bg: rgba(248, 247, 244, 0.95);
      --panel-bg: rgba(255, 255, 255, 0.88);
      --panel-border: rgba(255, 255, 255, 0.6);
    }

    html[data-theme="dark"] {
      --bg: #212121;
      --bg2: #2f2f2f;
      --white: #171717;
      --text: #ececec;
      --muted: #b4b4b4;
      --border: #424242;
      --border2: #545454;
      --navy: #ffffff;
      --navy2: #f0f0f0;
      --nav-bg: rgba(33, 33, 33, 0.95);
      --panel-bg: rgba(47, 47, 47, 0.88);
      --panel-border: rgba(255, 255, 255, 0.1);
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: 'Figtree', sans-serif;
      overflow-x: visible;
      min-height: 100vh;
    }

    img {
      max-width: 100%;
    }

    a {
      text-decoration: none;
      color: inherit;
    }

    button {
      font-family: inherit;
      cursor: pointer;
    }

    input, textarea {
      color: var(--navy);
      font-family: inherit;
    }

    /* ========================
   TOP NAV (branding + CTA)
======================== */
    #main-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 var(--pad-x);
      height: var(--nav-h);
      background: var(--nav-bg);
      backdrop-filter: blur(20px);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 200;
      gap: 16px;
    }

    #nav-logo {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }

    #nav-logo-icon {
      width: 34px;
      height: 34px;
      background: #0f1729;
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    #nav-logo-icon svg {
      width: 18px;
      height: 18px;
    }

    #nav-logo-name {
      font-family: 'Fraunces', serif;
      font-size: 22px;
      font-weight: 900;
      color: var(--navy);
      letter-spacing: -0.5px;
    }

    #nav-cta {
      padding: 9px 22px;
      background: var(--navy);
      color: var(--white);
      border: none;
      border-radius: 9px;
      font-size: 14px;
      font-weight: 600;
      white-space: nowrap;
      transition: background 0.2s, transform 0.15s;
      flex-shrink: 0;
    }

    #nav-cta:hover {
      background: var(--navy2);
      transform: translateY(-1px);
    }

    /* Mobile hamburger */
    #nav-hamburger {
      display: none;
      flex-direction: column;
      gap: 5px;
      background: none;
      border: none;
      padding: 4px;
      cursor: pointer;
    }

    #nav-hamburger span {
      display: block;
      width: 22px;
      height: 2px;
      background: var(--navy);
      border-radius: 2px;
      transition: 0.3s;
    }

    /* ========================
   CATEGORY SUBNAV
======================== */
    #category-nav {
      position: sticky;
      top: var(--nav-h);
      z-index: 190;
      background: var(--white);
      border-bottom: 1px solid var(--border);
      height: var(--sub-h);
      overflow-x: auto;
      scrollbar-width: none;
    }

    #category-nav::-webkit-scrollbar {
      display: none;
    }

    #category-nav-inner {
      display: flex;
      align-items: center;
      height: 100%;
      padding: 0 var(--pad-x);
      white-space: nowrap;
      width: max-content;
      gap: 16px;
    }

    .cat-nav-item {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 0 4px;
      height: var(--sub-h);
      font-size: 13px;
      font-weight: 500;
      color: var(--muted);
      border-bottom: 2px solid transparent;
      cursor: pointer;
      transition: color 0.2s, border-color 0.2s;
      white-space: nowrap;
      position: relative;
    }

    /* Floating preview panel */
    .nav-preview-panel {
      --shift-x: 0px;
      position: absolute;
      top: 100%;
      left: calc(50% + var(--shift-x));
      transform: translateX(-50%) translateY(12px);
      width: 320px;
      background: var(--panel-bg);
      backdrop-filter: blur(20px) saturate(190%);
      -webkit-backdrop-filter: blur(20px) saturate(190%);
      border: 1px solid var(--panel-border);
      border-radius: 16px;
      padding: 20px;
      box-shadow: 0 20px 40px rgba(15, 23, 41, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      white-space: normal;
      text-align: left;
      z-index: 500;
      transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                  transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                  visibility 0.25s;
    }

    /* Triangle pointer */
    .nav-preview-panel::before {
      content: '';
      position: absolute;
      bottom: 100%;
      left: calc(50% - var(--shift-x));
      transform: translateX(-50%);
      border-width: 6px;
      border-style: solid;
      border-color: transparent transparent var(--panel-bg) transparent;
    }

    /* Hover interactions on desktop */
    @media (min-width: 1024px) {
      .cat-nav-item:hover .nav-preview-panel {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(-50%) translateY(4px);
      }
    }

    /* Disabled on mobile/tablets to prevent horizontal scroll nav clipping */
    @media (max-width: 1023px) {
      .nav-preview-panel {
        display: none !important;
      }
    }

    /* NPP Elements Styling */
    .npp-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      width: 100%;
    }

    .npp-title {
      font-family: 'Fraunces', serif;
      font-size: 15px;
      font-weight: 700;
      color: var(--navy);
    }

    .npp-badge {
      font-size: 9px;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 4px;
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    .badge-teal {
      background: rgba(13, 148, 136, 0.1);
      color: var(--teal);
    }

    .badge-amber {
      background: rgba(245, 158, 11, 0.1);
      color: var(--amber);
    }

    .npp-desc {
      font-size: 12.5px;
      color: var(--muted);
      line-height: 1.5;
      margin-bottom: 14px;
    }

    .npp-section-title {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 9.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--muted);
      margin-bottom: 8px;
      border-bottom: 1px solid var(--border);
      padding-bottom: 4px;
    }

    .npp-steps {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 14px;
    }

    .npp-steps li {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      font-size: 12px;
      color: var(--text);
      line-height: 1.4;
    }

    .npp-step-num {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--bg2);
      color: var(--navy);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 9.5px;
      font-weight: 700;
      flex-shrink: 0;
      margin-top: 1px;
    }

    .npp-formula {
      background: var(--navy);
      color: var(--white);
      font-family: 'IBM Plex Mono', monospace;
      font-size: 11px;
      padding: 8px 12px;
      border-radius: 8px;
      text-align: center;
      border: 1px solid rgba(255, 255, 255, 0.15);
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    /* Desktop Viewport: Spread items evenly with NO scrollbar/scrolling */
    @media (min-width: 1024px) {
      #category-nav {
        overflow: visible;
      }
      #category-nav-inner {
        width: 100%;
        justify-content: space-between;
        gap: 0;
      }
    }

    .cat-nav-item:hover {
      color: var(--text);
    }

    .cat-nav-item.active {
      color: var(--navy);
      font-weight: 600;
      border-bottom-color: var(--amber);
    }

    .cat-nav-icon {
      font-size: 14px;
      line-height: 1;
    }

    /* ========================
   HERO SECTION
======================== */
    #hero {
      padding: 48px var(--pad-x) 0;
      display: flex;
      gap: 60px;
      align-items: flex-start;
      position: relative;
      overflow: visible;
      max-width: 1600px;
      margin: 0 auto;
    }

    #hero::before {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      width: 50%;
      height: 100%;
      background: radial-gradient(ellipse at top right, rgba(245, 158, 11, 0.07) 0%, transparent 65%);
      pointer-events: none;
    }

    /* Hero Left */
    #hero-left {
      flex: 1;
      padding-top: 24px;
      min-width: 0;
    }

    #hero-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: var(--white);
      border: 1px solid var(--border2);
      border-radius: 100px;
      padding: 5px 14px 5px 6px;
      margin-bottom: 32px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    #hero-pill-dot {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: var(--amber);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      color: var(--white);
    }

    #hero-pill-text {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }



    #hero-title {
      font-family: 'Fraunces', serif;
      font-size: clamp(38px, 6vw, 88px);
      font-weight: 900;
      line-height: 0.92;
      letter-spacing: -3px;
      margin-bottom: 28px;
    }

    #hero-title .tl1,
    #hero-title .tl2 {
      display: block;
      color: var(--navy);
    }

    #hero-title .tl3 {
      display: block;
      color: var(--amber);
      font-style: italic;
    }

    #hero-desc {
      font-size: clamp(15px, 1.2vw, 18px);
      line-height: 1.7;
      color: var(--muted);
      max-width: 480px;
      margin-bottom: 44px;
    }

    #hero-actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 52px;
    }

    #hero-btn-primary {
      padding: 15px 30px;
      background: var(--navy);
      color: var(--white);
      border-radius: 12px;
      font-size: 15px;
      font-weight: 600;
      border: none;
      box-shadow: 0 4px 20px rgba(15, 23, 41, 0.2);
      transition: transform 0.15s, box-shadow 0.15s;
    }

    #hero-btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 28px rgba(15, 23, 41, 0.25);
    }

    #hero-btn-secondary {
      padding: 15px 30px;
      background: var(--white);
      color: var(--text);
      border-radius: 12px;
      font-size: 15px;
      font-weight: 500;
      border: 1px solid var(--border2);
      transition: background 0.2s;
    }

    #hero-btn-secondary:hover {
      background: var(--bg2);
    }


    /* Hero Right */
    #hero-right {
      width: min(520px, 48%);
      flex-shrink: 0;
      position: relative;
      padding-bottom: 72px;
      margin-top: 64px;
    }

    #hero-carousel {
      position: relative;
      width: 100%;
    }

    .hero-slide {
      transition: opacity 0.6s ease-in-out;
    }

    .hero-graph-card {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 24px;
      padding: 28px;
      box-shadow: 0 20px 56px rgba(15, 23, 41, 0.1), 0 6px 20px rgba(15, 23, 41, 0.05);
    }

    .graph-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
    }

    .graph-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
    }

    .graph-controls {
      display: flex;
      gap: 6px;
    }

    .g-ctrl {
      padding: 4px 12px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 500;
      border: 1px solid var(--border);
      cursor: pointer;
    }

    .g-ctrl.active {
      background: var(--navy);
      color: var(--white);
      border-color: var(--navy);
    }

    .g-ctrl:not(.active) {
      background: transparent;
      color: var(--muted);
    }

    .graph-svg-wrap {
      background: var(--bg);
      border-radius: 10px;
      padding: 14px;
      margin-bottom: 16px;
    }

    #graph-svg-wrap svg {
      width: 100%;
      height: auto;
      display: block;
    }

    #graph-legend {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: var(--muted);
    }

    .legend-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    /* Floating annotation cards with premium glassmorphism and subtle animations */
    .ann-card {
      position: absolute;
      background: var(--panel-bg);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid var(--panel-border);
      border-radius: 16px;
      padding: 14px 18px;
      box-shadow: 0 12px 32px rgba(15, 23, 41, 0.08), 0 4px 12px rgba(15, 23, 41, 0.03);
      z-index: 10;
      transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    }

    #ann-steps {
      top: 0;
      right: -24px;
      width: 170px;
      transform: translateY(170px);
    }

    #ann-steps:hover {
      transform: translateY(164px) scale(1.03);
      box-shadow: 0 20px 40px rgba(15, 23, 41, 0.12);
    }

    #ann-error {
      bottom: 12px;
      /* Adjusted bottom to clear the graph legend while keeping cool overlap */
      left: -32px;
      width: 150px;
    }

    #ann-error:hover {
      transform: translateY(-4px) scale(1.03);
      box-shadow: 0 20px 40px rgba(15, 23, 41, 0.12);
    }

    .ann-label {
      font-size: 9px;
      color: var(--muted);
      font-family: 'IBM Plex Mono', monospace;
      margin-bottom: 4px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .ann-value {
      font-size: 20px;
      font-weight: 700;
      font-family: 'Fraunces', serif;
      color: var(--navy);
    }

    .ann-sub {
      font-size: 11px;
      color: var(--muted);
      margin-top: 2px;
    }

    .ann-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: rgba(13, 148, 136, 0.1);
      border-radius: 4px;
      padding: 2px 6px;
      font-size: 10px;
      color: var(--teal);
      font-weight: 600;
      margin-top: 4px;
    }


    /* ========================
   SECTION SHARED STYLES
======================== */
    .section {
      padding: 90px var(--pad-x);
      max-width: 1600px;
      margin: 0 auto;
    }

    .s-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--white);
      border: 1px solid var(--border2);
      border-radius: 100px;
      padding: 5px 14px;
      margin-bottom: 20px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }

    .s-chip-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--amber);
    }

    .s-chip span {
      font-size: 12px;
      font-weight: 600;
      color: var(--navy);
      letter-spacing: 0.3px;
    }

    .s-title {
      font-family: 'Fraunces', serif;
      font-size: clamp(36px, 4vw, 52px);
      font-weight: 900;
      letter-spacing: -2px;
      line-height: 1.0;
      margin-bottom: 16px;
      color: var(--navy);
    }

    .s-title em {
      color: var(--amber);
      font-style: italic;
    }

    .s-desc {
      font-size: 16px;
      color: var(--muted);
      line-height: 1.7;
      max-width: 520px;
      margin-bottom: 56px;
    }

    /* ========================
   FEATURES BENTO
======================== */
    #features-section {
      padding-top: 80px;
    }

    #bento-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      grid-template-rows: auto auto;
      gap: 14px;
    }

    .bento-card {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 30px;
      transition: box-shadow 0.2s, transform 0.2s;
    }

    .bento-card:hover {
      box-shadow: 0 8px 28px rgba(15, 23, 41, 0.08);
      transform: translateY(-2px);
    }

    .bc-icon {
      font-size: 26px;
      margin-bottom: 14px;
    }

    .bc-title {
      font-family: 'Fraunces', serif;
      font-size: 20px;
      font-weight: 700;
      color: var(--navy);
      margin-bottom: 8px;
      letter-spacing: -0.4px;
    }

    .bc-desc {
      font-size: 13.5px;
      color: var(--muted);
      line-height: 1.6;
    }

    #bento-1 {
      grid-column: 1 / 2;
    }

    #bento-2 {
      grid-column: 2 / 3;
    }

    #bento-3 {
      grid-column: 3 / 4;
    }

    #bento-4 {
      grid-column: 1 / 3;
      display: flex;
      gap: 24px;
      align-items: center;
    }

    #bento-4-text {
      flex: 1;
    }

    #bento-4-visual {
      width: 180px;
      flex-shrink: 0;
    }

    #bento-4-visual svg {
      width: 100%;
      height: auto;
    }

    #bento-5 {
      grid-column: 3 / 4;
    }

    /* ========================
   CATEGORIES GRID
======================== */
    #categories-section {
      background: var(--white);
      border-top: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
      padding: 80px var(--pad-x);
    }

    #categories-inner {
      max-width: 1600px;
      margin: 0 auto;
    }

    #categories-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      margin-bottom: 44px;
      gap: 16px;
      flex-wrap: wrap;
    }

    #categories-header-left .s-title {
      margin-bottom: 0;
    }

    #btn-view-all {
      padding: 10px 20px;
      background: var(--white);
      color: var(--text);
      border-radius: 9px;
      font-size: 13.5px;
      font-weight: 500;
      border: 1px solid var(--border2);
      transition: background 0.2s;
      white-space: nowrap;
      flex-shrink: 0;
    }

    #btn-view-all:hover {
      background: var(--bg2);
    }

    #cats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1px;
      background: var(--border);
      border: 1px solid var(--border);
      border-radius: 16px;
      overflow: hidden;
    }

    .cat-c {
      background: var(--white);
      padding: 28px;
      cursor: pointer;
      position: relative;
      transition: background 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                  transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                  box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .cat-c:hover {
      background: var(--bg);
      transform: translateY(-4px);
      box-shadow: 0 12px 28px rgba(15, 23, 41, 0.08);
      z-index: 2;
    }

    .cat-c-num {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 10px;
      color: rgba(245, 158, 11, 0.65);
      margin-bottom: 10px;
      letter-spacing: 0.5px;
    }

    .cat-c-name {
      font-family: 'Fraunces', serif;
      font-size: 18px;
      font-weight: 700;
      color: var(--navy);
      margin-bottom: 6px;
      letter-spacing: -0.3px;
    }

    .cat-c-desc {
      font-size: 12.5px;
      color: var(--muted);
      line-height: 1.5;
      margin-bottom: 14px;
    }

    .cat-c-badge {
      display: inline-block;
      background: var(--bg2);
      border-radius: 4px;
      padding: 3px 10px;
      font-size: 11px;
      color: var(--muted);
      font-weight: 500;
    }

    /* ========================
   POPULAR TOOLS
======================== */
    #tools-section {}

    #tools-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      margin-bottom: 40px;
      flex-wrap: wrap;
      gap: 12px;
    }



    #tools-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 20px;
    }

    .tool-big {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 32px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    }

    .tool-list-title {
      font-family: 'Fraunces', serif;
      font-size: 28px;
      font-weight: 700;
      color: var(--navy);
      margin-bottom: 4px;
      letter-spacing: -0.8px;
    }

    .tool-list-sub {
      font-size: 13px;
      color: var(--muted);
      margin-bottom: 28px;
    }

    .tool-items {
      display: flex;
      flex-direction: column;
    }

    .tool-i {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 0;
      border-bottom: 1px solid var(--border);
    }

    .tool-i:last-child {
      border-bottom: none;
    }

    .tool-i-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .tool-i-icon {
      width: 34px;
      height: 34px;
      background: var(--bg2);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 15px;
      flex-shrink: 0;
    }

    .tool-i-name {
      font-size: 13.5px;
      font-weight: 600;
      color: var(--text);
    }

    .tool-i-cat {
      font-size: 11px;
      color: var(--muted);
      font-family: 'IBM Plex Mono', monospace;
      margin-top: 2px;
    }





    /* ========================
   FOOTER
======================== */
    #footer {
      background: var(--white);
      border-top: 1px solid var(--border);
      padding: 60px var(--pad-x) 36px;
    }

    #footer-inner {
      max-width: 1600px;
      margin: 0 auto;
    }

    #footer-grid {
      display: grid;
      grid-template-columns: 2fr 1fr 1fr 1fr;
      gap: 48px;
      margin-bottom: 48px;
    }

    #footer-brand-name {
      font-family: 'Fraunces', serif;
      font-size: 22px;
      font-weight: 900;
      color: var(--navy);
      margin-bottom: 10px;
      letter-spacing: -0.5px;
    }

    #footer-brand-p {
      font-size: 13.5px;
      color: var(--muted);
      line-height: 1.6;
      max-width: 240px;
    }

    .footer-col h5 {
      font-size: 11px;
      font-weight: 700;
      color: var(--navy);
      text-transform: uppercase;
      letter-spacing: 0.6px;
      margin-bottom: 14px;
    }

    .footer-col ul {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 9px;
    }

    .footer-col ul li a {
      font-size: 13.5px;
      color: var(--muted);
      transition: color 0.2s;
    }

    .footer-col ul li a:hover {
      color: var(--text);
    }

    #footer-bottom {
      border-top: 1px solid var(--border);
      padding-top: 22px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 12px;
    }

    #footer-copy {
      font-size: 12.5px;
      color: var(--muted);
    }

    #footer-badge {
      background: rgba(245, 158, 11, 0.1);
      border: 1px solid rgba(245, 158, 11, 0.28);
      border-radius: 6px;
      padding: 4px 12px;
      font-size: 11.5px;
      color: var(--amber);
      font-weight: 600;
    }

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

    /* 1200px */
    @media (max-width: 1200px) {
      #hero {
        flex-direction: column;
        gap: 64px;
        padding-top: 60px;
      }

      #hero-right {
        width: 100%;
        max-width: 560px;
        padding-bottom: 0;
        margin-top: 0;
      }

      #hero-left {
        padding-top: 0;
      }

      #ann-steps {
        display: none;
      }

      #ann-error {
        display: none;
      }

      #bento-grid {
        grid-template-columns: 1fr 1fr;
      }

      #bento-1 {
        grid-column: 1 / 2;
      }

      #bento-2 {
        grid-column: 2 / 3;
      }

      #bento-3 {
        grid-column: 1 / 2;
      }

      #bento-4 {
        grid-column: 2 / 3;
        flex-direction: column;
      }

      #bento-4-visual {
        width: 100%;
      }

      #bento-5 {
        grid-column: 1 / 3;
      }

      #cats-grid {
        grid-template-columns: repeat(2, 1fr);
      }

      #footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
      }
    }

    /* 900px */
    @media (max-width: 900px) {
      #tools-grid {
        grid-template-columns: 1fr;
      }

    }

    /* 700px */
    @media (max-width: 700px) {
      :root {
        --nav-h: 58px;
        --sub-h: 40px;
        --pad-x: 6%;
      }

      #nav-logo-name {
        font-size: 19px;
      }

      #nav-cta {
        padding: 8px 16px;
        font-size: 13px;
      }

      .section {
        padding: 60px var(--pad-x);
      }

      #features-section {
        padding-top: 50px;
      }

      #categories-section {
        padding: 60px var(--pad-x);
      }

      #hero {
        gap: 40px;
      }

      #bento-grid {
        grid-template-columns: 1fr;
      }

      #bento-1,
      #bento-2,
      #bento-3 {
        grid-column: 1;
      }

      #bento-4 {
        grid-column: 1;
        flex-direction: column;
      }

      #bento-5 {
        grid-column: 1;
      }

      #cats-grid {
        grid-template-columns: 1fr 1fr;
      }

      #footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
      }

      #footer {
        padding: 48px var(--pad-x) 28px;
      }
    }

    /* 767px Mobile Breakpoint overrides */
    @media (max-width: 767px) {
      #main-nav {
        height: auto !important;
        padding: 12px var(--pad-x) !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
      }
      #nav-actions {
        width: 100% !important;
        justify-content: space-between !important;
        gap: 10px !important;
      }
      #nav-search-container {
        max-width: 100% !important;
        flex: 1 !important;
      }
      #theme-toggle {
        margin-left: 0 !important;
      }
      #nav-cta {
        padding: 8px 14px !important;
        font-size: 12px !important;
      }
      #hero-title {
        font-size: 2.6rem !important;
        letter-spacing: -1.5px !important;
        line-height: 0.95 !important;
      }
      .s-title {
        font-size: 2.2rem !important;
        letter-spacing: -1px !important;
        line-height: 1.05 !important;
      }
    }

    /* 480px */
    @media (max-width: 480px) {
      .section {
        padding: 48px var(--pad-x);
      }

      #features-section {
        padding-top: 36px;
      }

      #categories-section {
        padding: 48px var(--pad-x);
      }

      #hero {
        gap: 32px;
      }

      #cats-grid {
        grid-template-columns: 1fr;
      }

      #hero-actions {
        flex-direction: column;
      }

      #hero-btn-primary,
      #hero-btn-secondary {
        width: 100%;
        text-align: center;
      }

      #hero-title {
        font-size: 2.2rem !important;
        letter-spacing: -1px !important;
      }

      .s-title {
        font-size: 1.8rem !important;
        letter-spacing: -0.8px !important;
      }

      #footer {
        padding: 36px var(--pad-x) 20px;
      }
    }

/* ==========================================================================
   NEW FEATURES: SEARCH & DARK MODE OVERRIDES
   ========================================================================= */

/* SVG dark-mode mapping */
svg line[stroke="#e5e3de"] { stroke: var(--border); }
svg line[stroke="#f0eee9"] { stroke: var(--bg2); }
svg path[stroke="#e5e3de"] { stroke: var(--border); }
svg rect[fill="#f0eee9"] { fill: var(--bg2); stroke: var(--border); }
svg text[fill="#9ca3af"] { fill: var(--muted); }
svg circle[fill="#f8f7f4"] { fill: var(--bg); }
svg circle[fill="#0f1729"] { fill: var(--navy); }
#bento-4-visual svg rect[fill="#f0eee9"] { fill: var(--bg2); stroke: var(--border); }
#bento-4-visual svg text[fill="#6b7280"] { fill: var(--muted); }

/* Search highlight animation */
@keyframes rowHighlightFlash {
  0% {
    background-color: rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
  }
  50% {
    background-color: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.1);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
}
.row-highlight-flash {
  animation: rowHighlightFlash 2.5s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 8px;
}

/* ========================
   SEARCH BAR & ACTIONS
======================== */
#nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

#nav-search-container {
  position: relative;
  flex: 1;
  max-width: 240px;
  transition: max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#nav-search-box {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 10px;
  height: 38px;
  width: 100%;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

#nav-search-box:hover {
  background: var(--border);
}

#nav-search-box:focus-within {
  background: var(--white);
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

#nav-search-box .search-icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
  margin-right: 8px;
  flex-shrink: 0;
}

#nav-search-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  padding: 6px 0;
}

#nav-search-input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.search-shortcut {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  background: var(--white);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  pointer-events: none;
  flex-shrink: 0;
}

#nav-search-box:focus-within .search-shortcut {
  display: none;
}

#search-clear-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
}

#search-clear-btn:hover {
  color: var(--text);
}

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 41, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
  max-height: 280px;
  overflow-y: auto;
  z-index: 300;
  display: flex;
  flex-direction: column;
  padding: 6px;
  scrollbar-width: thin;
}

.search-dropdown.hidden {
  display: none;
}

.search-dropdown-header {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 8px 4px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.search-dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.search-dropdown-item:hover, .search-dropdown-item.selected {
  background: var(--bg2);
}

.search-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.search-item-title mark {
  background: rgba(245, 158, 11, 0.2);
  color: var(--text);
  font-weight: 700;
  border-radius: 2px;
}

.search-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  gap: 8px;
}

.search-item-desc {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.search-item-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 500;
  flex-shrink: 0;
}

.search-dropdown-no-results {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* ========================
   THEME TOGGLE
======================== */
#theme-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

#theme-toggle:hover {
  color: var(--text);
  transform: scale(1.1);
}

#theme-toggle svg {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}

/* Toggle Sun/Moon transforms */
html:not([data-theme="dark"]) .sun-icon {
  opacity: 0;
  transform: translateY(20px) rotate(45deg);
}

html:not([data-theme="dark"]) .moon-icon {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

html[data-theme="dark"] .sun-icon {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

html[data-theme="dark"] .moon-icon {
  opacity: 0;
  transform: translateY(-20px) rotate(-45deg);
}

/* Search & Theme Toggle Responsiveness */
@media (max-width: 768px) {
  #nav-logo-name {
    display: block;
    font-size: 1.1rem;
  }
  #nav-search-container {
    max-width: 180px;
  }
}

/* ==========================================================================
   VMATH AI CHATBOT
   ========================================================================= */

#vmath-chatbot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

/* Floating Action Button */
#vmath-chatbot-fab {
  background: linear-gradient(135deg, var(--amber) 0%, #d97706 100%);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 14px 24px;
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  pointer-events: auto;
}

#vmath-chatbot-fab:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.4);
}

.fab-icon-sparkle {
  font-size: 20px;
  line-height: 1;
  animation: pulse-sparkle 2s infinite ease-in-out;
}

@keyframes pulse-sparkle {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; text-shadow: 0 0 10px rgba(255, 255, 255, 0.8); }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Chat Window */
#vmath-chatbot-window {
  width: 360px;
  height: 520px;
  max-height: calc(100vh - 100px);
  background: var(--panel-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 41, 0.15), 0 0 0 1px rgba(255,255,255,0.1) inset;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
  pointer-events: auto;
}

#vmath-chatbot-window.hidden {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  pointer-events: none;
}

/* Chat Header */
#vmath-chatbot-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(var(--navy), 0.02);
}

#vmath-chatbot-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vmath-bot-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(15, 23, 41, 0.1);
}

.vmath-bot-name {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.vmath-bot-status {
  font-size: 11px;
  color: var(--teal);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vmath-bot-status::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

#vmath-chatbot-close {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#vmath-chatbot-close:hover {
  background: var(--bg2);
  color: var(--text);
}

#vmath-chatbot-close svg {
  width: 18px;
  height: 18px;
}

/* Chat Messages */
#vmath-chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
}

.vmath-message {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  max-width: 85%;
}

.vmath-message-bot {
  align-self: flex-start;
}

.vmath-message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.vmath-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.vmath-message-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.vmath-message-user .vmath-message-bubble {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 16px;
}

.vmath-message-bubble p {
  margin-bottom: 8px;
}
.vmath-message-bubble p:last-child {
  margin-bottom: 0;
}

/* Input Area */
#vmath-chatbot-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--white);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

#vmath-chatbot-input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}

#vmath-chatbot-input:focus {
  background: var(--bg);
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

#vmath-chatbot-send {
  background: var(--amber);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.2s;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

#vmath-chatbot-send:hover {
  background: var(--amber2);
  transform: translateY(-2px);
}

#vmath-chatbot-send svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 480px) {
  #vmath-chatbot-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 120px);
    right: 16px;
    bottom: 80px;
  }
}

/* ==========================================================================
   CATEGORY NAVIGATION & SCROLL OFFSET
   ========================================================================= */

.cat-c, #categories-section, #tools-section {
  scroll-margin-top: 130px; /* 108px sticky nav height + 22px padding offset */
}
