/* =============================================================================
   xImmersion · global.css
   Styles for the homepage (constellation, panels, cards, nav, chatbot widget,
   industry tiles, hero text, etc.). Loaded by index.html.

   Solution and demo reading-mode pages have their own stylesheets:
     - assets/css/solution.css
     - assets/css/demo.css
   ============================================================================= */

:root {
    --brand-blue: #2196F3;
    --brand-blue-deep: #64B5F6; /* Lightened for contrast on dark */
    --brand-blue-bright: #90CAF9;

    --c-demos:      #3AA7FF; 
    --c-solutions:  #FF834D;
    --c-blog:       #AD8BFF;
    --c-videos:     #57FF95;
    --c-showcases:  #EC4899;

    --bg-1: #02060E;      /* Deep Obsidian */
    --paper: #0B121F;     /* Dark Navy Paper */
    --ink: #F0F4F8;       /* Crisp White/Blue text */
    --ink-soft: #94A3B8;  /* Muted Slate */
    --line: rgba(255, 255, 255, 0.08);
    --accent: #FFD600;
    --accent-deep: #F9A825;
    --status-green: #10B981;

    --chat-grad-1: #1565C0;
    --chat-grad-2: #7B5EA7;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-1);
    color: var(--ink);
    font-family: 'Manrope', sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  body {
    background:
      radial-gradient(circle at 20% 30%, rgba(33, 150, 243, 0.07), transparent 50%),
      radial-gradient(circle at 80% 70%, rgba(123, 94, 167, 0.06), transparent 50%),
      var(--bg-1);
    position: relative;
  }
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.04 0 0 0 0 0.09 0 0 0 0 0.16 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: multiply;
  }

  #canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 2; }
  #labels { position: fixed; inset: 0; z-index: 3; pointer-events: none; }

  .globe-label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px; /* Increased from 11px */
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    background: rgba(11, 18, 31, 0.95); /* Deep glass */
    backdrop-filter: blur(8px);
    padding: 8px 16px; /* Larger padding */
    border-radius: 4px;
    border: 1px solid var(--line);
    pointer-events: auto;
    cursor: pointer;
    white-space: nowrap;
    /* Removed transition on opacity to make them pop in instantly */
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; 
    z-index: 20;
  }
  .globe-label:hover {
    background: var(--brand-blue-deep);
    color: white;
    border-color: var(--brand-blue-deep);
  }
  .globe-label.active {
    background: var(--accent);
    border-color: var(--accent-deep);
    color: #02060E;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(255, 214, 0, 0.4);
  }
  .globe-label.hidden { opacity: 0; pointer-events: none; }
  .globe-label.behind {
    /* filter: blur(0.6px) saturate(0.55); */
    opacity: 0 !important;
    pointer-events: none;
  }

  /* Nav */
  .nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 2px 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
  }
  .nav > * { pointer-events: auto; }

  .logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .logo:hover { transform: scale(1.04); }
  .logo:active { transform: scale(0.98); }
  .logo img { 
    height: 112px; width: auto; display: block; 
    filter: drop-shadow(0 0 12px rgba(33, 150, 243, 0.35)); /* Subtle space glow */
    transition: filter 0.4s ease;
  }
  .logo:hover img {
    filter: drop-shadow(0 0 22px rgba(33, 150, 243, 0.7)); /* Glow expands on hover */
  }  .logo img.failed { display: none; }
  .logo-fallback {
    display: none;
    width: 90px; height: 90px;
    background: var(--brand-blue-bright);
    color: white;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
  }
  .logo img.failed + .logo-fallback { display: flex; }

  .nav-right { display: flex; gap: 18px; align-items: center; }
  .nav-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
  }
  .nav-meta .dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--status-green);
    margin-right: 8px;
    animation: pulse-green 2s ease-in-out infinite;
  }
  @keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  }
  .btn-cta {
    background: var(--accent);
    color: #02060E; /* Dark text for visibility on yellow */
    border: none;
    padding: 12px 22px;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .btn-cta:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255, 214, 0, 0.3); }
  .btn-cta::after { content: '→'; transition: transform 0.2s ease; }
  .btn-cta:hover::after { transform: translateX(3px); }

  /* Hero */
  .hero {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 40px;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.7, 0, 0.2, 1);
    max-width: 780px;
  }
  body.panel-open .hero,
  body.detail-open .hero { opacity: 0; transform: translateY(20px); }

  /* When a panel is open, hide top-right meta (status pill + Book a Call button)
     so they don't visually compete with the panel content. The panel itself
     contains its own CTA. */
  body.panel-open .nav-meta,
  body.panel-open .btn-cta,
  body.detail-open .nav-meta,
  body.detail-open .btn-cta {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
  }
  .nav-meta, .btn-cta {
    transition: opacity 0.35s ease, transform 0.35s ease;
  }

  /* Fade the chat bubble while a panel is open — still accessible at low opacity,
     but doesn't compete with the focused content. */
  body.panel-open .chatbot,
  body.detail-open .chatbot {
    opacity: 0.45;
  }
  body.panel-open .chatbot:hover,
  body.detail-open .chatbot:hover {
    opacity: 1;
  }
  .chatbot { transition: opacity 0.3s ease, transform 0.2s ease; }

  .hero-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand-blue-deep);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .hero-eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--brand-blue-deep); }

  .hero-headline {
    font-family: 'Manrope', sans-serif;
    font-weight: 300;
    font-size: clamp(40px, 6vw, 80px);
    line-height: 1.0;
    letter-spacing: -0.035em;
    color: var(--ink);
    max-width: 16ch;
  }
  .hero-headline strong {
    font-weight: 700;
    color: var(--brand-blue-deep);
    position: relative;
  }
  .hero-headline strong::after {
    content: '';
    position: absolute;
    bottom: 0.06em; left: 0; right: 0;
    height: 0.2em;
    background: var(--accent);
    z-index: -1;
    opacity: 0.65;
  }

  /* Headline typewriter rotator */
  .hero-rotator {
    display: inline-block;
    white-space: nowrap;
    /* Reserve vertical + horizontal space so the line never collapses during delete */
    min-height: 1em;
    min-width: 2ch; /* enough space for the caret to sit visible when text is empty */
  }
  .hero-caret {
    display: inline-block;
    width: 0.06em;
    height: 0.85em;
    background: var(--brand-blue-deep);
    margin-left: 0.04em;
    vertical-align: text-bottom;
    animation: heroCaretBlink 1s steps(1) infinite;
    position: relative;
    top: -0.04em;
  }
  @keyframes heroCaretBlink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
  }
  /* When actively typing/deleting, keep caret solid (no blink) */
  .hero-rotator.typing .hero-caret {
    animation: none;
    opacity: 1;
  }

  .hero-sub {
    font-family: 'Manrope', sans-serif;
    font-weight: 400;
    font-size: 17px;
    color: var(--ink-soft);
    margin-top: 22px;
    max-width: 620px;
    line-height: 1.55;
  }

  /* ============ CLIENT CAROUSEL ============ */
  .clients-strip {
    position: fixed;
    bottom: 100px; /* above hero, but on home it gets covered by hero anyway... let me think */
    left: 0; right: 0;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
    height: 60px;
    display: none; /* hidden when panel is open */
    transition: opacity 0.5s ease;
  }
  /* Actually let's place this inside hero block instead */

.trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    margin-top: 32px;
    padding: 8px 24px 8px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    pointer-events: auto;
    backdrop-filter: blur(8px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .trust-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 0;
    padding-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
  }
  .trust-window {
    width: 500px;
    overflow: hidden;
    position: relative;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  }
  .trust-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }
  .trust-pill:hover .trust-window { width: 1000px; /* Expanded state */ }
  
  .trust-track {
    display: flex; 
    gap: 36px; 
    align-items: center;
    animation: scroll-trust 120s linear infinite; 
    width: max-content;
    padding-right: 36px; /* FIX: Balances the flex gap for a perfect 50% loop */
    will-change: transform; /* FIX: Stops the browser from flashing during hover */
  }
  @keyframes scroll-trust { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }
  
  .trust-logo {
    display: block;
    height: 38px !important;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    flex-shrink: 0;
    
    /* Removed the white background and padding */
    
    opacity: 0.5;
    
    /* THE MAGIC TRICK */
    filter: invert(1) grayscale(100%); /* Turns white bg to black, logo to white */
    mix-blend-mode: screen;            /* Makes the black background completely transparent */
    
    transition: all 0.3s ease;
  }
  
  .trust-logo:hover { 
    opacity: 1; 
    /* Keeps the background transparent, but adds a space glow */
    filter: invert(1) grayscale(100%) drop-shadow(0 0 12px rgba(255,255,255,0.6)); 
    transform: translateY(-2px); 
  }

  /* ============ PANEL ============ */
  .panel {
    position: fixed;
    top: 0; right: 0;
    width: 44vw;
    max-width: 620px;
    height: 100vh;
    z-index: 8;
    padding: 110px 40px 60px 36px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.2, 1);
    background: linear-gradient(to left, rgba(11, 18, 31, 0.98), rgba(11, 18, 31, 0.85));
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--line);
  }
  body.panel-open .panel { transform: translateX(0); pointer-events: auto; }

  body.detail-open .panel {
    transform: translateX(0);
    left: 0;
    width: 34vw;
    max-width: 480px;
    padding: 280px 24px 60px 28px;
    background: linear-gradient(to bottom,
      rgba(2, 6, 14, 0) 0px,
      rgba(2, 6, 14, 0) 200px,
      rgba(2, 6, 14, 0.92) 260px,
      var(--bg-1) 320px);
    backdrop-filter: none;
    border-right: 1px solid var(--line);
  }

  .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    transition: all 0.5s ease;
  }
  body.detail-open .panel-header { margin-bottom: 14px; padding-bottom: 10px; }

  .panel-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 40px;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
  }
  .panel-title:hover { color: var(--brand-blue-deep); }
  body.detail-open .panel-title { font-size: 22px; }

  .panel-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--ink-soft);
    text-transform: uppercase;
  }

  /* Close button — top-LEFT of panel */
  .close-btn {
    position: absolute;
    top: 22px;
    left: 22px;
    width: 44px; height: 44px;
    /* Use var(--line) for a subtle border instead of var(--ink) */
    border: 1px solid var(--line); 
    /* Changed from white to var(--paper) to match the theme */
    background: var(--paper); 
    color: var(--ink);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 15;
  }
  body.detail-open .panel .close-btn { display: none; }
  .close-btn:hover { 
    background: var(--ink); 
    color: var(--bg-1); 
    transform: rotate(90deg);
  }
  .close-btn svg { width: 14px; height: 14px; }

  /* Breadcrumb */
  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .breadcrumb-link {
    color: var(--brand-blue-deep);
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s ease;
  }
  .breadcrumb-link:hover { border-color: var(--brand-blue-deep); }
  .breadcrumb-sep { color: var(--ink-soft); }
  .breadcrumb-current { color: var(--ink-soft); }

  .back-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05); /* Subtle dark glass */
    border: 1px solid var(--line);
    color: var(--ink); /* Text color from white to ink */
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
    margin-bottom: 24px;
  }
  .back-pill::before { content: '←'; font-size: 13px; }
  .back-pill:hover {
    background: var(--brand-blue-deep);
    color: white;
    border-color: var(--brand-blue-deep);
    transform: translateX(-2px);
  }

  /* Industry tile */
  .industry-tile {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px 22px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(40px);
    opacity: 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  body.panel-open .industry-tile { transform: translateX(0); opacity: 1; }
  body.panel-open .industry-tile:nth-child(1) { transition-delay: 0.30s; }
  body.panel-open .industry-tile:nth-child(2) { transition-delay: 0.34s; }
  body.panel-open .industry-tile:nth-child(3) { transition-delay: 0.38s; }
  body.panel-open .industry-tile:nth-child(4) { transition-delay: 0.42s; }
  body.panel-open .industry-tile:nth-child(5) { transition-delay: 0.46s; }
  body.panel-open .industry-tile:nth-child(6) { transition-delay: 0.50s; }
  body.panel-open .industry-tile:nth-child(7) { transition-delay: 0.54s; }
  .industry-tile:hover { border-color: var(--c-solutions); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(232, 116, 60, 0.08); }
  .industry-left { display: flex; align-items: center; gap: 14px; }
  .industry-icon {
    width: 42px; height: 42px;
    border-radius: 8px;
    background: rgba(232, 116, 60, 0.1);
    color: var(--c-solutions);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
  }
  .industry-icon svg {
    width: 22px;
    height: 22px;
    display: block;
  }
  .industry-tile:hover .industry-icon {
    background: rgba(232, 116, 60, 0.18);
    transform: scale(1.05);
  }
  .industry-text { min-width: 0; }
  .industry-name {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 2px;
  }
  .industry-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--ink-soft);
    letter-spacing: 0.08em;
  }
  .industry-arrow {
    color: var(--ink-soft);
    font-size: 18px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
  }
  .industry-tile:hover .industry-arrow { color: var(--c-solutions); transform: translateX(4px); }

  /* Card */
  .card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(40px);
    opacity: 0;
    position: relative;
    overflow: hidden;
  }
  body.panel-open .card { transform: translateX(0); opacity: 1; }
  body.panel-open .card:nth-child(1) { transition-delay: 0.30s; }
  body.panel-open .card:nth-child(2) { transition-delay: 0.34s; }
  body.panel-open .card:nth-child(3) { transition-delay: 0.38s; }
  body.panel-open .card:nth-child(4) { transition-delay: 0.42s; }
  body.panel-open .card:nth-child(5) { transition-delay: 0.46s; }
  body.panel-open .card:nth-child(6) { transition-delay: 0.50s; }
  .card:hover { border-color: var(--brand-blue); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(13, 71, 161, 0.08); }
  .card.active-card { 
    border-color: var(--accent); 
    background: rgba(255, 214, 0, 0.04); /* Subtle yellow tint */
    box-shadow: inset 0 0 20px rgba(255, 214, 0, 0.05);
  }

  .card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-blue-bright), var(--brand-blue-deep));
  }
  .card-thumb svg { width: 100%; height: 100%; display: block; }
  .card-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
  }
  .card:hover .card-thumb-img { transform: scale(1.04); }

  .card-thumb.video-thumb,
  .card-thumb.playable-thumb { /* Both legacy + new class supported */
    /* Demos and videos both use this — playable content gets a play overlay. */
  }
  .card-thumb.video-thumb {
    aspect-ratio: 9/16;
    max-height: 320px;
  }
  /* When a card thumbnail contains a self-hosted video (i.e. items in the
     videos panel), switch to portrait aspect ratio. The class is set
     explicitly in renderCard() so this works on every browser, no :has()
     selector required. */
  .card-thumb.card-thumb-portrait {
    aspect-ratio: 9/16;
    max-height: 380px;
  }

  /* Play overlay for any playable thumbnail (demos + videos).
     Smaller card-level version of the hero play button — same visual language,
     subtler glow so it doesn't fight the rest of the card. */
  .video-play,
  .card-play-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 56px; height: 56px;
    background: rgba(255, 214, 0, 0.9);
    border: 1px solid rgba(255, 214, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow:
      0 0 0 4px rgba(255, 214, 0, 0.12),
      0 0 24px rgba(255, 214, 0, 0.4),
      0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .video-play::after,
  .card-play-overlay::after {
    content: '';
    width: 0; height: 0;
    border-left: 14px solid var(--bg-1);
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    margin-left: 4px;
  }
  .card:hover .video-play,
  .card:hover .card-play-overlay {
    transform: translate(-50%, -50%) scale(1.12);
    box-shadow:
      0 0 0 8px rgba(255, 214, 0, 0.15),
      0 0 36px rgba(255, 214, 0, 0.65),
      0 8px 24px rgba(0, 0, 0, 0.3);
  }
  .card-body { padding: 18px 22px 22px; position: relative; }
  .card-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--brand-blue-deep);
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
  }
  .card-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 6px;
    line-height: 1.3;
    padding-right: 30px;
  }
  .card-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--ink-soft);
    letter-spacing: 0.05em;
  }
  .card-arrow {
    position: absolute;
    bottom: 18px;
    right: 22px;
    font-size: 18px;
    color: var(--ink-soft);
    transition: all 0.3s ease;
  }
  .card:hover .card-arrow { color: var(--accent-deep); transform: translateX(4px); }

  .video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .video-grid .card { margin-bottom: 0; }

  .card-group-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 20px 0 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }
  .card-group-header:first-child { margin-top: 0; padding-top: 0; border-top: none; }

  /* ============ CATEGORY TABS (Demos & Blog) ============ */
  .cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    opacity: 0;
    transform: translateY(8px);
    animation: catTabsIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.25s forwards;
  }
  @keyframes catTabsIn { to { opacity: 1; transform: translateY(0); } }
  .cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 12px;
    background: rgba(10, 22, 40, 0.025);
    border: 1px solid transparent;
    border-radius: 20px;
    color: var(--ink);
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    font-size: 12.5px;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.2s ease;
    white-space: nowrap;
    position: relative;
  }
  .cat-tab::before {
    /* Color dot — unique per category */
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--tab-color, var(--ink-soft));
    flex-shrink: 0;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
  }
  .cat-tab:hover {
    background: rgba(10, 22, 40, 0.05);
    transform: translateY(-1px);
  }
  .cat-tab:hover::before { transform: scale(1.3); }
  .cat-tab.active {
    background: var(--tab-bg, rgba(33, 150, 243, 0.1));
    border-color: var(--tab-color, var(--brand-blue));
    color: var(--tab-color, var(--brand-blue));
    font-weight: 600;
    transform: translateY(0);
  }
  .cat-tab.active::before {
    transform: scale(1.35);
    box-shadow: 0 0 0 3px var(--tab-bg, rgba(33, 150, 243, 0.2));
  }
  .cat-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    background: rgba(10, 22, 40, 0.08);
    border-radius: 9px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--ink-soft);
    transition: background 0.22s ease, color 0.22s ease;
  }
  .cat-tab.active .cat-tab-count {
    background: var(--tab-color, var(--brand-blue));
    color: white;
  }
  .cat-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--ink-soft);
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-style: italic;
  }
  .cat-cards { transition: opacity 0.22s ease; }
  .cat-cards.swapping { opacity: 0; }

  body.detail-open .card { margin-bottom: 8px; }
  body.detail-open .industry-tile { margin-bottom: 8px; padding: 14px 18px; }
  body.detail-open .industry-name { font-size: 14px; }
  body.detail-open .industry-icon { width: 32px; height: 32px; }
  body.detail-open .industry-icon svg { width: 16px; height: 16px; }
  body.detail-open .card-thumb { display: none; }
  body.detail-open .card-body { padding: 14px 18px; }
  body.detail-open .card-title { font-size: 14px; padding-right: 24px; line-height: 1.25; }
  body.detail-open .card-meta { font-size: 10px; }
  body.detail-open .card-arrow { bottom: 14px; right: 18px; font-size: 13px; }
  body.detail-open .video-grid { display: block; }
  body.detail-open .card-group-header { font-size: 9px; margin: 12px 0 8px; padding-top: 10px; }
  body.detail-open .cat-tabs { display: none; }

  /* ============ DETAIL VIEW ============ */
  .detail {
    position: fixed;
    top: 0;
    right: 0;
    width: calc(100vw - 34vw);
    max-width: calc(100vw - 480px);
    height: 100vh;
    z-index: 9;
    padding: 110px 60px 60px;
    overflow-y: auto;
    background: var(--bg-1);
    transform: translateX(100%);
    transition: transform 0.95s cubic-bezier(0.7, 0, 0.2, 1);
    background: var(--paper);
    pointer-events: none;
  }
  body.detail-open .detail { transform: translateX(0); pointer-events: auto; }

  .detail-back {
    position: absolute;
    top: 22px;
    left: 36px;
    padding: 10px 18px;
    background: var(--paper); /* Dark paper instead of white */
    border: 1px solid var(--line);
    color: var(--ink);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.25s ease;
  }
  .detail-back:hover { border-color: var(--brand-blue); color: var(--brand-blue-bright); }
  .detail-back::before { content: '←'; font-size: 14px; }

  .detail-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand-blue-deep);
    margin-bottom: 16px;
  }
  .detail-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(36px, 4.2vw, 58px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--ink);
    margin-bottom: 18px;
    max-width: 18ch;
  }
  .detail-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--ink-soft);
    letter-spacing: 0.08em;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
  }
  .detail-hero {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 36px;
    background: linear-gradient(135deg, var(--brand-blue-bright), var(--brand-blue-deep));
    position: relative;
  }
  .detail-hero svg { width: 100%; height: 100%; }
  .detail-play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .detail-play-btn {
    width: 80px; height: 80px;
    background: rgba(255, 214, 0, 0.95); /* Brand yellow — matches the Book a Call CTA */
    border: 1px solid rgba(255, 214, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Soft outer glow that breathes — draws the eye to the demo without being aggressive */
    box-shadow:
      0 0 0 6px rgba(255, 214, 0, 0.18),
      0 0 36px rgba(255, 214, 0, 0.5),
      0 16px 40px rgba(0, 0, 0, 0.4);
    animation: playPulse 2.5s ease-in-out infinite;
    transition: transform 0.25s ease, box-shadow 0.3s ease;
  }
  @keyframes playPulse {
    0%, 100% {
      box-shadow:
        0 0 0 6px rgba(255, 214, 0, 0.18),
        0 0 36px rgba(255, 214, 0, 0.5),
        0 16px 40px rgba(0, 0, 0, 0.4);
    }
    50% {
      box-shadow:
        0 0 0 12px rgba(255, 214, 0, 0.08),
        0 0 50px rgba(255, 214, 0, 0.7),
        0 16px 40px rgba(0, 0, 0, 0.4);
    }
  }
  .detail-play-overlay:hover .detail-play-btn,
  .detail-hero-link:hover .detail-play-btn {
    transform: scale(1.1);
    animation: none;
    box-shadow:
      0 0 0 14px rgba(255, 214, 0, 0.12),
      0 0 60px rgba(255, 214, 0, 0.85),
      0 20px 50px rgba(0, 0, 0, 0.5);
  }
  .detail-play-btn::after {
    content: '';
    width: 0; height: 0;
    border-left: 22px solid var(--bg-1); /* Dark triangle on yellow background */
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    margin-left: 6px;
  }
  /* Detail hero image — replaces SVG thumb when item.image is provided. */
  .detail-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
  }
  /* Wrapper anchor when the hero is clickable (demos with externalUrl). */
  .detail-hero-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
  }
  .detail-hero-link:hover .detail-hero-img { transform: scale(1.02); }
  .detail-hero-link:hover .detail-play-btn {
    transform: scale(1.08);
    background: rgba(255, 214, 0, 0.9);
    border-color: rgba(255, 214, 0, 0.4);
  }
  .detail-hero-link:hover .detail-play-btn::after { border-left-color: var(--bg-1); }

  /* Video-mode hero: when the hero contains a self-hosted <video>, drop the
     hardcoded 16/9 aspect ratio and let the video define its own height.
     The class is toggled by openDetail() in JS so this works on every browser
     without relying on the CSS :has() selector. */
  .detail-hero.detail-hero-video-mode {
    aspect-ratio: auto;
    background: transparent;       /* Let the video's own black bars show */
    overflow: visible;             /* Don't clip if video is taller than expected */
    border-radius: 0;
    display: flex;
    justify-content: center;       /* Center portrait video in wider container */
    align-items: flex-start;
  }

  /* Showcase mode — grid of sample cards replaces single hero image.
     Release forced 16/9, no border or background. */
  .detail-hero.detail-hero-showcase-mode {
    aspect-ratio: auto;
    background: transparent;
    overflow: visible;
    border-radius: 0;
    border: none;
    margin-bottom: 16px;
  }

  /* The video element itself. Sized to fit the panel without forcing crop:
     - max-width: 100% so landscape videos still fill the container width
     - max-height: 75vh so portrait videos always fit the visible viewport
       without needing the user to scroll inside the panel to see the bottom
     - height: auto + width: auto preserves the source aspect ratio
     - object-fit: contain ensures no crop ever — the entire frame is visible */
  .detail-hero-video {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    background: #000;              /* Black around any letterbox/pillarbox area */
    border-radius: 8px;
  }
  .detail-hero-video::-webkit-media-controls-panel {
    /* Slight background tint so controls don't disappear on light video frames */
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
  }

  /* Card thumbnail when the card item is a video (has videoSrc).
     The video is decorative-only here — muted, no controls — purely to show
     the first frame at the correct aspect ratio. The ::after play overlay
     from .playable-thumb still sits on top, signaling "click to play". */
  .card-thumb-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
    /* Disable native controls. The card click handler opens the detail view. */
    pointer-events: none;
  }

  /* Panel-level intro paragraph — sits between the panel title and the video
     grid. Used to give visitors and search engines a concise SEO-rich
     introduction to what the section contains. */
  .panel-intro {
    margin: 4px 0 28px;
    padding: 18px 20px;
    background: rgba(255,255,255,0.02);
    border-left: 2px solid var(--accent);
    border-radius: 0 4px 4px 0;
  }
  .panel-intro p {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink-2);
  }

  /* ═══════════════════════════════════════════════════════════
     SHOWCASE SAMPLE CARDS — 2×2 grid in the panel detail hero.

     Thumbnail fix rationale: at panel width (~600px) split into 2
     columns, 16/9 cards are too short — dark screenshots look like
     black bars. Using 3/2 (taller) shows more content. object-position
     top prioritises the visually rich top half of page screenshots.
     A subtle gradient overlay at the bottom polishes dark edges.
     ═══════════════════════════════════════════════════════════ */
  .showcase-samples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }
  .showcase-sample-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: rgba(11, 18, 31, 0.6);
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
    cursor: pointer;
  }
  .showcase-sample-card:hover {
    border-color: var(--c-demos);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(58, 167, 255, 0.12);
    text-decoration: none;
  }
  .showcase-sample-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;           /* Taller than 16/9 — shows more of page screenshots */
    background:
      radial-gradient(circle at 30% 40%, rgba(58, 167, 255, 0.1), transparent 65%),
      linear-gradient(160deg, rgba(11, 18, 31, 0.95), rgba(2, 6, 14, 1));
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* Screenshot fills the thumb, cropped from the top */
  .showcase-sample-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;   /* Show the top of page screenshots */
    opacity: 0.9;
    transition: transform 0.45s ease, opacity 0.3s ease;
    display: block;
  }
  .showcase-sample-card:hover .showcase-sample-img {
    transform: scale(1.04);
    opacity: 1;
  }
  /* Bottom gradient so the thumbnail fades cleanly into the info area */
  .showcase-sample-thumb::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(transparent, rgba(2, 6, 14, 0.7));
    pointer-events: none;
    z-index: 2;
  }
  /* Fallback icon — sits behind the screenshot, visible only if img fails */
  .showcase-sample-icon {
    position: relative;
    z-index: 1;
    font-size: 26px;
    color: var(--c-demos);
    opacity: 0.35;
    pointer-events: none;
  }
  /* Tag pill */
  .showcase-sample-tag {
    position: absolute;
    top: 8px; left: 8px;
    z-index: 3;
    padding: 3px 9px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
    backdrop-filter: blur(8px);
  }
  .sample-tag-blue  { background: rgba(58,167,255,0.18); color: var(--brand-blue-bright); border: 1px solid rgba(58,167,255,0.25); }
  .sample-tag-green { background: rgba(16,185,129,0.15); color: #6ee7b7;                  border: 1px solid rgba(16,185,129,0.25); }
  .sample-tag-gold  { background: rgba(255,214,0,0.12);  color: var(--accent);            border: 1px solid rgba(255,214,0,0.22); }
  /* Play hover overlay */
  .showcase-sample-hover {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 14, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .showcase-sample-card:hover .showcase-sample-hover { opacity: 1; }
  .showcase-sample-hover .detail-play-btn {
    width: 38px; height: 38px;
    box-shadow: 0 0 0 5px rgba(255,214,0,0.14), 0 0 22px rgba(255,214,0,0.38);
  }
  .showcase-sample-hover .detail-play-btn::after {
    border-left-width: 13px;
    border-top-width: 8px;
    border-bottom-width: 8px;
    margin-left: 3px;
  }
  /* Info section — bigger fonts than previous version */
  .showcase-sample-info {
    padding: 11px 13px 13px;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .showcase-sample-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 15px;               /* Increased from 13px */
    color: var(--ink);
    line-height: 1.25;
  }
  .showcase-sample-desc {
    font-size: 12px;               /* Increased from 11px */
    line-height: 1.45;
    color: var(--ink-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .showcase-sample-link {
    margin-top: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.07em;
    color: var(--c-demos);
    font-weight: 500;
    transition: color 0.2s ease;
  }
  .showcase-sample-card:hover .showcase-sample-link { color: var(--accent); }

  @media (max-width: 480px) {
    .showcase-samples-grid { grid-template-columns: 1fr; gap: 8px; }
  }

  /* Panel-view CTA row — used by demo panel views to surface "Open live demo"
     prominently right after the hero image. */
  .panel-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 24px;
  }
  .panel-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    background: var(--accent);
    color: var(--bg-1);
    border-radius: 6px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  }
  .panel-cta-primary:hover {
    background: var(--accent-deep);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 214, 0, 0.3);
    text-decoration: none;
  }
  .detail-body {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    max-width: 64ch;
  }
  .detail-body p { margin-bottom: 18px; }
  /* h2 = section headings (used in articles & demo write-ups). Same DM Serif italic
     treatment used on standalone pages, slightly smaller for panel context. */
  .detail-body h2 {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 26px;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 40px 0 16px;
    color: var(--ink);
    position: relative;
    padding-top: 14px;
  }
  .detail-body h2::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 28px; height: 2px;
    background: var(--c-solutions);
    border-radius: 2px;
  }
  /* Demo panels use the demos blue accent for h2 underline */
  body.detail-open .panel[data-section="demos"] .detail-body h2::before { background: var(--c-demos); }
  body.detail-open .panel[data-section="blog"] .detail-body h2::before { background: var(--c-blog); }
  body.detail-open .panel[data-section="videos"] .detail-body h2::before { background: var(--c-videos); }
  body.detail-open .panel[data-section="showcases"] .detail-body h2::before { background: var(--c-showcases); }

  /* Showcases panel: let the body content fill the full panel width
     instead of the default 64ch column used for blog/demo articles. */
  body.detail-open .panel[data-section="showcases"] .detail-body {
    max-width: 100%;
  }

  .detail-body h3 {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 18px;
    margin: 28px 0 10px;
    color: var(--ink);
  }
  .detail-body em { font-style: italic; }
  .detail-body strong { color: var(--brand-blue-deep); font-weight: 600; }
  /* Pull quote in panel view — same visual language as standalone demo pages.
     The accent line uses the active section's brand color via category styles. */
  .detail-body blockquote {
    margin: 28px 0;
    padding: 8px 0 8px 22px;
    border-left: 3px solid var(--c-demos);
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 21px;
    line-height: 1.4;
    letter-spacing: -0.005em;
    color: var(--ink);
  }
  .detail-body blockquote p { margin: 0; }
  .detail-body blockquote em { font-style: normal; }
  body.detail-open .panel[data-section="solutions"] .detail-body blockquote { border-left-color: var(--c-solutions); }
  body.detail-open .panel[data-section="blog"] .detail-body blockquote { border-left-color: var(--c-blog); }
  body.detail-open .panel[data-section="videos"] .detail-body blockquote { border-left-color: var(--c-videos); }
  .detail-body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86em;
    background: rgba(33, 150, 243, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--brand-blue-deep);
  }

  /* Reading-mode link — intentionally subtle. Shows at the end of the
     detail body for articles that have a standalone URL. Aesthetically
     restrained (muted color, small type) so it doesn't compete visually,
     but fully crawlable by search engines. */
  .reading-mode-link {
    display: inline-block;
    margin-top: 36px;
    padding: 6px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px solid rgba(10, 22, 40, 0.15);
    transition: color 0.2s ease, border-color 0.2s ease;
  }
  .reading-mode-link::after {
    content: ' ↗';
    opacity: 0.6;
  }
  .reading-mode-link:hover {
    color: var(--brand-blue);
    border-bottom-color: var(--brand-blue);
  }
  .reading-mode-link:hover::after { opacity: 1; }
  .tech-pills {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 16px 0 28px;
  }
  .tech-pill {
    padding: 6px 12px;
    background: var(--brand-blue-deep);
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    border-radius: 3px;
  }

  /* ==================== LEAD CAPTURE WIDGET ==================== */
  .chatbot {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 58px; height: 58px;
    background: linear-gradient(135deg, var(--chat-grad-1), var(--chat-grad-2));
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    box-shadow: 0 8px 28px rgba(13, 71, 161, 0.45);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
  }
  .chatbot:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 36px rgba(94, 63, 166, 0.6);
  }
  .chatbot.lead-open { transform: scale(0.95); }
  .chatbot svg { 
    width: 24px; height: 24px; color: white; 
    position: absolute; 
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; 
  }
  .chatbot .icon-close { opacity: 0; transform: rotate(-90deg) scale(0.5); }
  .chatbot.lead-open .icon-chat { opacity: 0; transform: rotate(90deg) scale(0.5); }
  .chatbot.lead-open .icon-close { opacity: 1; transform: rotate(0) scale(1); }
  .chatbot.lead-open svg { transform: rotate(90deg); }
  .chatbot-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 20px; height: 20px;
    background: var(--accent);
    color: var(--ink);
    border-radius: 50%;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-1);
  }
  .chatbot-badge.show { display: flex; }

  /* Lead capture window */
  .lead-window {
    position: fixed;
    bottom: 100px; right: 28px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 620px;
    max-height: calc(100vh - 140px);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02);
    z-index: 19;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .lead-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  /* Header */
  .lead-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--chat-grad-1), var(--chat-grad-2));
    color: white;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    flex-shrink: 0;
  }
  .lead-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
  }
  .lead-header-info { flex: 1; min-width: 0; }
  .lead-header-name {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
  }
  .lead-header-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.05em;
    opacity: 0.85;
  }
  .lead-header-close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
  }
  .lead-header-close:hover { background: rgba(255, 255, 255, 0.22); }
  .lead-header-close svg { width: 14px; height: 14px; }

  /* Progress dots */
  .lead-progress {
    display: flex;
    gap: 6px;
    padding: 14px 20px 8px;
    background: var(--paper);
    flex-shrink: 0;
  }
  .lead-progress-dot {
    flex: 1;
    height: 3px;
    background: var(--line);
    border-radius: 2px;
    transition: background 0.4s ease;
  }
  .lead-progress-dot.done { background: var(--brand-blue); }
  .lead-progress-dot.current {
    background: linear-gradient(to right, var(--brand-blue), var(--brand-blue-bright));
  }

  /* Body — holds the steps, each step is a "screen" */
  .lead-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px 20px;
    position: relative;
    background: var(--paper);
  }
  .lead-body::-webkit-scrollbar { width: 6px; }
  .lead-body::-webkit-scrollbar-track { background: transparent; }
  .lead-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
  }

  .lead-step {
    display: none;
    flex-direction: column;
    gap: 14px;
    padding: 8px 0 20px;
    animation: stepIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .lead-step.active { display: flex; }
  @keyframes stepIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
  }

  .lead-intro {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 1.25;
    color: var(--ink);
    letter-spacing: -0.01em;
    padding: 8px 0 4px;
  }
  .lead-intro em { color: var(--brand-blue-bright); font-style: normal; }
  .lead-lead {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink-soft);
    margin-bottom: 6px;
  }

  .lead-field { display: flex; flex-direction: column; gap: 6px; }
  .lead-field label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .lead-field label .req {
    color: var(--c-solutions);
    font-size: 9px;
  }
  .lead-field input,
  .lead-field textarea {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
  }
  .lead-field textarea { resize: vertical; min-height: 90px; font-family: 'Manrope', sans-serif; }
  .lead-field input:focus,
  .lead-field textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    background: rgba(33, 150, 243, 0.08);
  }
  .lead-field input.error,
  .lead-field textarea.error {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.06);
  }
  .lead-field .hint-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--ink-soft);
    opacity: 0.7;
    letter-spacing: 0.05em;
  }
  .lead-field .err-text {
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    color: #F87171;
    display: none;
  }
  .lead-field.has-error .err-text { display: block; }

  /* Pill selector (budget, timeline) */
  .lead-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .lead-pill {
    padding: 8px 13px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--ink);
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
  }
  .lead-pill:hover {
    border-color: var(--brand-blue);
    background: rgba(33, 150, 243, 0.08);
  }
  .lead-pill.selected {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: white;
    font-weight: 500;
  }

  /* Action row */
  .lead-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px 14px;
    border-top: 1px solid var(--line);
    background: var(--paper);
    flex-shrink: 0;
  }
  .lead-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .lead-btn.primary {
    background: var(--accent);
    color: #02060E;
  }
  .lead-btn.primary:hover:not(:disabled) {
    background: var(--accent-deep);
    transform: translateY(-1px);
  }
  .lead-btn.primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .lead-btn.secondary {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    flex: 0 0 auto;
    padding: 12px 16px;
  }
  .lead-btn.secondary:hover {
    color: var(--ink);
    border-color: var(--ink-soft);
  }

  /* WhatsApp shortcut link in header of first step */
  .lead-whatsapp-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 20px;
    color: #25D366;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    align-self: flex-start;
  }
  .lead-whatsapp-pill:hover {
    background: rgba(37, 211, 102, 0.18);
    border-color: rgba(37, 211, 102, 0.5);
  }
  .lead-whatsapp-pill svg { width: 14px; height: 14px; }

  /* Success screen */
  .lead-success {
    text-align: center;
    padding: 40px 20px 30px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    animation: stepIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .lead-success.active { display: flex; }
  .lead-success-check {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--status-green), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    animation: checkPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  @keyframes checkPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
  }
  .lead-success-check svg { width: 32px; height: 32px; }
  .lead-success-title {
    font-family: 'DM Serif Display', serif;
    font-size: 26px;
    color: var(--ink);
    letter-spacing: -0.01em;
  }
  .lead-success-msg {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 280px;
  }
  .lead-success-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
  }
  .lead-success-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
    cursor: pointer;
  }
  .lead-success-btn svg { width: 18px; height: 18px; }
  
  .lead-success-btn.tg { background: #2CA5E0; color: white; border: none; }
  .lead-success-btn.tg:hover { background: #229ED9; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(44, 165, 224, 0.3); }

  .lead-success-btn.wa { background: #25D366; color: white; border: none; }
  .lead-success-btn.wa:hover { background: #20BA5A; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3); }

  .lead-success-btn.em { background: rgba(255, 255, 255, 0.05); color: var(--ink); border: 1px solid var(--line); }
  .lead-success-btn.em:hover { background: rgba(33, 150, 243, 0.08); border-color: var(--brand-blue); transform: translateY(-1px); }

  .lead-success-or {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-soft);
    opacity: 0.6;
    margin: 4px 0 0;
  }

  /* Restart link — tiny button on success screen */
  .lead-restart {
    background: none;
    border: none;
    color: var(--ink-soft);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 10px;
    margin-top: 6px;
    transition: color 0.2s ease;
  }
  .lead-restart:hover { color: var(--ink); }

  /* Error banner (shown on submission failure) */
  .lead-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #F87171;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    margin-bottom: 10px;
    display: none;
  }
  .lead-error.show { display: block; }

  @media (max-width: 520px) {
    .lead-window {
      bottom: 96px; right: 16px; left: 16px;
      width: auto;
      max-width: none;
      height: calc(100vh - 120px);
    }
  }
  /* Social Dock - Bottom Right (next to lead capture button) */
  .social-dock {
    position: fixed;
    /* Aligns perfectly with the vertical center of your 58px chat button */
    bottom: 46px; 
    /* Places it nicely to the left of the chat button */
    right: 124px; 
    display: flex;
    flex-direction: row; /* Horizontal row */
    gap: 16px;
    z-index: 10;
    pointer-events: auto;
  }
  .social-icon {
    color: var(--ink-soft);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .social-icon:hover {
    color: white;
    transform: translateY(-3px); /* Moves up on hover instead of right */
    filter: drop-shadow(0 4px 12px rgba(255,255,255,0.2));
  }
  .social-icon svg { width: 22px; height: 22px; }

  /* Move to top center on mobile screens */
  @media (max-width: 768px) {
    .social-dock { 
      top: 36px; /* Aligns vertically with the top logo and button */
      bottom: auto; /* Resets the bottom position */
      left: 45%; 
      right: auto;
      transform: translateX(-50%); 
      flex-direction: row; 
      gap: 20px; 
    }
    .social-icon:hover { transform: translateY(-3px); }
    .social-icon svg { width: 20px; height: 20px; }
  }
  .hint {
    position: fixed;
    top: 50%;
    right: 32px;
    transform: translateY(-50%);
    z-index: 6;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink); /* Made brighter */
    text-shadow: 0 2px 10px rgba(0,0,0,0.8); /* Added shadow for contrast */
    writing-mode: vertical-rl;
    text-orientation: mixed;
    opacity: 0;
    animation: fadeIn 1s ease 1.5s forwards;
    transition: opacity 0.5s ease;
  }
  body.panel-open .hint,
  body.detail-open .hint { opacity: 0 !important; }
  @keyframes fadeIn { to { opacity: 0.9; } } /* Increased visibility from 0.5 */

  /* ===== TABLET LANDSCAPE / SMALL LAPTOPS (1025–1280px) =====
     Desktop layout works mostly here, but detail-open ratio is too tight
     for comfortable article reading. Slightly widen the article column. */
  @media (min-width: 1025px) and (max-width: 1280px) {
    body.detail-open .panel {
      width: 32vw;
      max-width: 420px;
    }
    .detail {
      width: calc(100vw - 32vw);
      max-width: calc(100vw - 420px);
    }
  }

  /* ===== TABLET PORTRAIT (iPad ~810px wide) =====
     Between mobile (≤768px) and desktop (≥1025px). Gives the panel
     more reading width and pulls the focused planet on-screen via JS
     (see getFocusedPos / getDetailPos). */
  @media (min-width: 769px) and (max-width: 1024px) {
    /* Panel-only mode (industries list): panel takes ~52% so the planet
       has room on the left without crowding the title row. */
    .panel {
      width: 52vw;
      max-width: none;
      padding: 110px 32px 80px 32px;
    }
    /* Detail-open mode: list shrinks to ~40% (left), article gets ~60% (right).
       This gives the article body comfortable reading width on iPad portrait
       (was 52vw before — too cramped on the article side). */
    body.detail-open .panel {
      width: 40vw;
      max-width: none;
      padding: 200px 20px 80px 20px;
    }
    .detail {
      width: 60vw;
      max-width: none;
      padding: 110px 32px 120px 32px;
    }
    body.detail-open .detail {
      width: 60vw;
      max-width: none;
    }
    /* Reading-mode link breathing room on tablet too */
    .reading-mode-link {
      margin-top: 32px;
      margin-bottom: 16px;
    }
  }

  /* ============ RELATED DEMOS TRACK ============ */
  .related-demos-section {
    margin: 48px 0 24px;
  }
  .related-demos-section h3 {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 26px;
    color: var(--ink);
    margin-bottom: 16px;
    position: relative;
  }
  .demo-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }
  .demo-track::-webkit-scrollbar {
    height: 6px;
  }
  .demo-track::-webkit-scrollbar-track {
    background: transparent;
  }
  .demo-track::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 3px;
  }
  .demo-track .card {
    flex: 0 0 260px; /* Fixed width for swipe items */
    scroll-snap-align: start;
    margin-bottom: 0;
  }
  /* Prevent the detail-open compact mode from hiding the related demo thumbnails */
  body.detail-open .demo-track .card-thumb {
    display: block;
  }
  body.detail-open .demo-track .card-body {
    padding: 16px 20px 20px;
  }
  body.detail-open .demo-track .card-title {
    font-size: 16px;
  }
  body.detail-open .demo-track .card-meta {
    font-size: 11px;
  }
  body.detail-open .demo-track .card-arrow {
    bottom: 18px; right: 22px; font-size: 18px;
  }
  body.detail-open .demo-track .card {
    margin-bottom: 0;
  }

  /* ===== MOBILE ===== */
  @media (max-width: 768px) {
    .nav { padding: 0px 14px; }
    .logo img { height: 86px; }
    .logo-fallback { width: 70px; height: 70px; font-size: 38px; }
    .nav-meta { display: none; }
    .btn-cta { padding: 9px 14px; font-size: 12px; }
    .hero { padding: 24px; }
    .hero-headline { font-size: clamp(32px, 9vw, 44px); }
    .hero-sub { font-size: 15px; margin-top: 16px; }
    .trust-pill {
      flex-direction: column; gap: 12px; padding: 16px 0;
      border-radius: 0; width: 100%; background: transparent; border: none; backdrop-filter: none;
      -webkit-tap-highlight-color: transparent; /* Presents the native iOS tap flash */
    }
    .trust-pill:hover, .trust-pill:active { 
      background: transparent; 
      box-shadow: none; 
      border-color: transparent; 
    }
    .trust-label { border: none; padding: 0; }
    .trust-window { width: 100%; }
    .trust-pill:hover .trust-window { width: 100%; }
    .trust-strip { margin-top: 18px; }
    .trust-logo { font-size: 13px; }
    .hint { display: none; }

    .panel {
      width: 100vw; max-width: 100vw;
      padding: 80px 20px 60px;
      /* Dark theme matching desktop — was white before, looked off-brand */
      background: linear-gradient(to bottom,
        rgba(2, 6, 14, 0.6) 0px,
        rgba(11, 18, 31, 0.96) 80px,
        rgba(11, 18, 31, 0.99) 200px);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-left: none;
    }
    .panel-header {
      background: transparent;
      backdrop-filter: none;
      padding: 0;
      margin: 0 0 20px;
      border-radius: 0;
    }
    body.detail-open .panel {
      width: 100vw; max-width: 100vw;
      /* Top: 130px = 18px (close-btn top) + 40px (close-btn) + 16px (gap) + 56px (back btn area)
         Bottom: 120px gives the "Reading mode" link breathing room above the iOS Safari toolbar
                and prevents bouncy-scroll snap-back from hiding it. */
      padding: 130px 20px 120px;
      background: linear-gradient(to bottom,
        rgba(2, 6, 14, 0.6) 0px,
        rgba(11, 18, 31, 0.96) 80px,
        var(--bg-1) 200px);
    }
    body.detail-open .detail {
      width: 100vw; max-width: 100vw;
      padding: 0;
    }
  .close-btn {
    position: fixed;
    top: 18px;
    /* Pulled further from left edge so it doesn't overlap the homepage logo (~80px wide on mobile) */
    left: auto;
    right: 18px;
    width: 40px; height: 40px;
    border: 1px solid var(--line);
    background: rgba(11, 18, 31, 0.85);
    color: var(--ink);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 60;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
    body.detail-open .close-btn { top: 18px; }
    /* Back-to-list button sits in its own row below the close button.
       Position: fixed keeps it visible while the article body scrolls. */
    .detail-back {
      position: fixed;
      top: 70px;
      left: 16px;
      padding: 8px 14px;
      font-size: 10px;
      background: rgba(11, 18, 31, 0.85);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 59;
    }

    /* Reading-mode link gets more breathing room below it on mobile so it's
       reachable without iOS bouncy scroll snapping back. */
    .reading-mode-link {
      margin-top: 32px;
      margin-bottom: 24px;
      padding: 12px 0;
    }

    /* When a panel is open on mobile, the panel content fills the screen and
       the homepage's nav meta + social dock + Book a Call CTA are not needed.
       Hiding them prevents the visual clutter shown in user screenshots. */
    body.panel-open .logo,
    body.detail-open .logo,
    body.panel-open .social-dock,
    body.detail-open .social-dock,
    body.panel-open .btn-cta,
    body.detail-open .btn-cta {
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }

    .video-grid { grid-template-columns: 1fr; }
  }

/* Blog hero image figure inside panel detail view */
.detail-body .post-hero-figure {
  margin: 24px 0 28px;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  aspect-ratio: 16/9;
}
.detail-body .post-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hide the duplicate image inside the panel body, since the panel already has a hero image */
.detail-body .post-hero-figure {
  display: none;
}

/* ==========================================================
   SHOWCASE PANEL DETAIL — hero mode + sample cards grid
   ========================================================== */

/* Showcase mode: hero contains a 2×2 card grid, not a single image.
   Release the forced 16/9 aspect ratio. */
.detail-hero.detail-hero-showcase-mode {
  aspect-ratio: auto;
  background: transparent;
  overflow: visible;
  border-radius: 0;
  border: none;
  margin-bottom: 16px;
}

/* 2×2 grid of live sample cards */
.showcase-samples-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.showcase-sample-card {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(11, 18, 31, 0.6);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.showcase-sample-card:hover {
  border-color: var(--c-showcases, #EC4899);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(236, 72, 153, 0.1);
  text-decoration: none;
}
.showcase-sample-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background:
    radial-gradient(circle at 30% 40%, rgba(236, 72, 153, 0.1), transparent 65%),
    linear-gradient(160deg, rgba(11, 18, 31, 0.95), rgba(2, 6, 14, 1));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.showcase-sample-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0.88;
  transition: transform 0.45s ease, opacity 0.3s ease;
  display: block;
}
.showcase-sample-card:hover .showcase-sample-img { transform: scale(1.04); opacity: 1; }
.showcase-sample-thumb::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(2, 6, 14, 0.65));
  pointer-events: none;
  z-index: 2;
}
.showcase-sample-icon {
  position: relative;
  z-index: 1;
  font-size: 26px;
  color: var(--c-showcases, #EC4899);
  opacity: 0.35;
  pointer-events: none;
}
.showcase-sample-tag {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.sample-tag-blue  { background: rgba(58,167,255,0.18);  color: #90CAF9; border: 1px solid rgba(58,167,255,0.25); }
.sample-tag-green { background: rgba(16,185,129,0.15);  color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }
.sample-tag-gold  { background: rgba(255,214,0,0.12);   color: #FFD600; border: 1px solid rgba(255,214,0,0.22); }
.showcase-sample-hover {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 14, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.showcase-sample-card:hover .showcase-sample-hover { opacity: 1; }
.showcase-sample-hover .detail-play-btn {
  width: 38px; height: 38px;
  box-shadow: 0 0 0 5px rgba(255,214,0,0.14), 0 0 22px rgba(255,214,0,0.38);
}
.showcase-sample-hover .detail-play-btn::after {
  border-left-width: 13px;
  border-top-width: 8px;
  border-bottom-width: 8px;
  margin-left: 3px;
}
.showcase-sample-info {
  padding: 11px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.showcase-sample-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.25;
}
.showcase-sample-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.showcase-sample-link {
  margin-top: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.07em;
  color: var(--c-showcases, #EC4899);
  font-weight: 500;
  transition: color 0.2s ease;
}
.showcase-sample-card:hover .showcase-sample-link { color: var(--accent); }

@media (max-width: 480px) {
  .showcase-samples-grid { grid-template-columns: 1fr; gap: 8px; }
}

/* ==========================================================
   MOBILE PANEL FIXES (Overlap, Spacing, and Scroll Snap)
   ========================================================== */
@media (max-width: 768px) {
  /* 1. Add breathing room on sides, push top down to clear the back button, 
        and add heavy bottom padding to defeat the iOS scroll snap-back */
  .detail {
    padding-top: 110px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    padding-bottom: 20px !important;
  }

  /* 2. Anchor the back button neatly in the top left corner */
  .detail-back {
    top: 24px !important;
    left: 24px !important;
  }

  /* 3. Give the reading mode link extra clearance from the absolute bottom */
  .reading-mode-link {
    margin-bottom: 60px !important;
    display: inline-block;
  }
  
  /* 4. Ensure no text or images break out of our new side padding */
  .detail-body {
    width: 100% !important;
    overflow-x: hidden !important;
  }
}