/* ════════════════════════════════════════════════════════════════════════════
 * Ethernodes mobile layout patch — v2
 * ────────────────────────────────────────────────────────────────────────────
 * Loaded AFTER styles.css. Activates only ≤768px. Desktop untouched.
 * Companion JS: mobile.js
 *
 * Changes from v1:
 *   - Removed `body * { max-width: 100vw }` (was breaking hero sphere center)
 *   - Surgical overflow control via specific selectors
 *   - Partners grid items now show name below logo
 *   - Original .products is hidden; new .mob-products module replaces it
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Mobile-only injected elements — hidden on desktop */
.mob-hamburger { display: none; }
.mob-menu { display: none; }
.mob-partners-grid { display: none; }
.mob-products { display: none; }

/* ─── Activate mobile layout ─────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* ─── 0. Global guard ──────────────────────────────────────────────── */
  html, body { overflow-x: hidden; }
  .eth-container,
  .ecosystem__inner,
  .disc__inner,
  .team__inner,
  .footer__inner {
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* ─── 1. Topnav ────────────────────────────────────────────────────── */
  .topnav__inner { padding-left: 16px; padding-right: 16px; }
  .topnav__wordmark { height: 38px; }
  .topnav__nav { display: none !important; }
  .topnav__cta { display: none !important; }
  .mob-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    background: transparent;
    border: 1px solid var(--eth-border, #3A3D3A);
    border-radius: 10px;
    color: var(--eth-fg, #E7EAE7);
    cursor: pointer;
    margin-left: auto;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.18s, background 0.18s;
  }
  .mob-hamburger:hover,
  .mob-hamburger.is-open {
    border-color: var(--eth-green-200, #93FF96);
    color: var(--eth-green-200, #93FF96);
  }
  .mob-hamburger svg { width: 20px; height: 20px; }
  .mob-menu {
    display: block;
    position: fixed;
    top: 84px; left: 0; right: 0; bottom: 0;
    background: rgba(20, 21, 20, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 49;
    padding: 24px 24px 48px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.28s ease;
    overflow-y: auto;
  }
  .mob-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .mob-menu__list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 4px;
  }
  .mob-menu__link {
    display: block;
    padding: 18px 8px;
    font-size: 18px; font-weight: 500;
    color: var(--eth-fg, #E7EAE7);
    text-decoration: none;
    border-bottom: 1px solid var(--eth-border, #3A3D3A);
    transition: color 0.18s;
  }
  .mob-menu__link:hover,
  .mob-menu__link:active { color: var(--eth-green-200, #93FF96); }
  .mob-menu__sub {
    padding-left: 16px;
    font-size: 15px;
    color: var(--eth-fg-muted, #A0A6A0);
  }
  .mob-menu__cta {
    display: block;
    margin-top: 24px;
    padding: 14px 22px;
    background: var(--eth-green-200, #93FF96);
    color: var(--eth-ink-900, #1E1F1E);
    border-radius: 999px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    font-size: 15px;
  }

  /* ─── 2. Hero ──────────────────────────────────────────────────────── */
  .hero { padding-left: 16px; padding-right: 16px; }
  .hero__title {
    font-size: clamp(36px, 9vw, 56px);
    line-height: 1.05;
  }
  .hero__stats { flex-direction: column; gap: 12px; padding: 0 8px; }
  .hero__stat { width: 100%; max-width: 100%; }

  /* ─── 3. Partners ecosystem ────────────────────────────────────────── */
  .constellation { display: none !important; }
  .eth-particles { display: none !important; }
  .ecosystem__group-desc { display: none; }
  .mob-partners-grid {
    display: block;
    padding: 8px 4px 24px;
  }
  .mob-partners-cluster { margin-bottom: 32px; }
  .mob-partners-cluster__head {
    font-family: var(--eth-font-mono, ui-monospace, monospace);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--eth-green-200, #93FF96);
    margin-bottom: 14px;
    padding-left: 10px;
    border-left: 2px solid var(--eth-green-200, #93FF96);
  }
  .mob-partners-cluster__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .mob-partners-cluster__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 14px 8px 10px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--eth-border, #3A3D3A);
    border-radius: 14px;
    transition: border-color 0.18s, background 0.18s;
    min-height: 110px;
  }
  .mob-partners-cluster__item:hover,
  .mob-partners-cluster__item:active {
    border-color: var(--eth-green-200, #93FF96);
    background: rgba(147,255,150,0.05);
  }
  .mob-partners-cluster__logo {
    width: 100%; height: 56px;
    display: flex; align-items: center; justify-content: center;
  }
  .mob-partners-cluster__logo img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    filter: brightness(1.05);
  }
  .mob-partners-cluster__name {
    font-size: 11px;
    color: var(--eth-fg, #E7EAE7);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    margin: 0;
  }
  .mob-partners-cluster__item .mob-partners-fallback {
    font-family: var(--eth-font-mono, ui-monospace, monospace);
    font-size: 11px;
    color: var(--eth-fg-muted, #A0A6A0);
    text-align: center;
  }

  /* ─── 4. Products — hide desktop bisagra, show mobile module ───────── */
  .products { display: none !important; }
  .mob-products {
    display: block;
    padding: 56px 16px 32px;
    position: relative;
  }
  .mob-products__head { margin-bottom: 24px; }
  .mob-products__eyebrow {
    font-family: var(--eth-font-mono, ui-monospace, monospace);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--eth-green-200, #93FF96);
    padding-left: 10px;
    border-left: 2px solid var(--eth-green-200, #93FF96);
    display: inline-block;
    margin-bottom: 12px;
  }
  .mob-products__title {
    font-size: clamp(26px, 6vw, 34px);
    line-height: 1.15;
    color: var(--eth-fg, #E7EAE7);
    margin: 0 0 12px;
    font-weight: 600;
  }
  .mob-products__intro {
    color: var(--eth-fg-muted, #A0A6A0);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 20px;
  }
  .mob-products__tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border: 1px solid var(--eth-border, #3A3D3A);
    border-radius: 999px;
    padding: 4px;
    background: rgba(255,255,255,0.03);
  }
  .mob-products__tab {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--eth-fg-muted, #A0A6A0);
    font-family: var(--eth-font-mono, ui-monospace, monospace);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-products__tab.is-active {
    background: var(--eth-green-200, #93FF96);
    color: var(--eth-ink-900, #1E1F1E);
    font-weight: 600;
  }
  .mob-products__card {
    display: none;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--eth-border, #3A3D3A);
    border-radius: 18px;
    padding: 24px 18px;
  }
  .mob-products__card.is-active {
    display: block;
    animation: mob-fade-in 0.28s ease;
  }
  @keyframes mob-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .mob-products__card-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
  }
  .mob-products__card-eyebrow-label {
    font-family: var(--eth-font-mono, ui-monospace, monospace);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--eth-green-200, #93FF96);
    padding-left: 8px;
    border-left: 2px solid var(--eth-green-200, #93FF96);
  }
  .mob-products__card-chip {
    font-size: 11px;
    padding: 4px 10px;
    border: 1px solid var(--eth-border, #3A3D3A);
    border-radius: 999px;
    color: var(--eth-fg-muted, #A0A6A0);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .mob-products__card-title {
    font-size: 22px;
    line-height: 1.2;
    color: var(--eth-fg, #E7EAE7);
    margin: 0 0 12px;
    font-weight: 600;
  }
  .mob-products__card-desc {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--eth-fg-muted, #A0A6A0);
    margin: 0 0 20px;
  }
  .mob-products__stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }
  .mob-products__stat {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--eth-border, #3A3D3A);
    border-radius: 12px;
    padding: 12px 14px;
  }
  .mob-products__stat-label {
    display: block;
    font-family: var(--eth-font-mono, ui-monospace, monospace);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--eth-green-200, #93FF96);
    padding-left: 8px;
    border-left: 2px solid var(--eth-green-200, #93FF96);
    margin-bottom: 6px;
  }
  .mob-products__stat-value {
    font-size: 22px;
    font-weight: 600;
    color: var(--eth-fg, #E7EAE7);
    line-height: 1.1;
  }
  .mob-products__stat-value .eth-stat__unit {
    font-size: 14px;
    color: var(--eth-fg-muted, #A0A6A0);
    margin-left: 2px;
  }
  .mob-products__stat-note {
    display: block;
    font-size: 11px;
    color: var(--eth-fg-muted, #A0A6A0);
    margin-top: 4px;
    opacity: 0.7;
  }
  .mob-products__cta {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 14px 22px;
    background: var(--eth-green-200, #93FF96);
    color: var(--eth-ink-900, #1E1F1E);
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 18px;
    box-sizing: border-box;
  }
  .mob-products__partners {
    border-top: 1px solid var(--eth-border, #3A3D3A);
    padding-top: 16px;
  }
  .mob-products__partners-label {
    font-family: var(--eth-font-mono, ui-monospace, monospace);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--eth-green-200, #93FF96);
    padding-left: 8px;
    border-left: 2px solid var(--eth-green-200, #93FF96);
    margin-bottom: 12px;
    display: block;
  }
  /* ─── Horizontal scroll-snap carousel ───────────────────────────────
     - Native swipe with snap; no JS.
     - Edge fade mask (left + right) tells user there's more off-screen.
     - Soft green glow at the inner edges hints "interactive surface".
     ─────────────────────────────────────────────────────────────────── */
  .mob-products__partners-carousel {
    position: relative;
    margin: 0 -18px;          /* bleed to card edges so fade looks natural */
  }
  .mob-products__partners-carousel::before,
  .mob-products__partners-carousel::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 36px;
    pointer-events: none;
    z-index: 2;
  }
  .mob-products__partners-carousel::before {
    left: 0;
    background: linear-gradient(to right,
      rgba(30,31,30,1) 0%,
      rgba(30,31,30,0.85) 35%,
      rgba(30,31,30,0) 100%);
    box-shadow: inset 6px 0 18px -10px rgba(147,255,150,0.30);
    animation: mob-carousel-edge-pulse 2.8s ease-in-out infinite;
  }
  .mob-products__partners-carousel::after {
    right: 0;
    background: linear-gradient(to left,
      rgba(30,31,30,1) 0%,
      rgba(30,31,30,0.85) 35%,
      rgba(30,31,30,0) 100%);
    box-shadow: inset -6px 0 18px -10px rgba(147,255,150,0.30);
    animation: mob-carousel-edge-pulse 2.8s ease-in-out infinite;
    animation-delay: 1.4s;   /* offset so both sides don't pulse in sync */
  }
  @keyframes mob-carousel-edge-pulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
  }
  @media (prefers-reduced-motion: reduce) {
    .mob-products__partners-carousel::before,
    .mob-products__partners-carousel::after {
      animation: none;
      opacity: 0.85;
    }
  }
  .mob-products__partners-grid {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin: 0;
    padding: 4px 18px;        /* counter the -18px bleed so first/last sit inside card */
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 18px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mob-products__partners-grid::-webkit-scrollbar { display: none; }
  .mob-products__partners-grid li {
    flex: 0 0 88px;           /* fixed item width for predictable snap */
    aspect-ratio: 2 / 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--eth-border, #3A3D3A);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    scroll-snap-align: start;
    transition: border-color 0.18s, background 0.18s, transform 0.18s;
  }
  .mob-products__partners-grid li:active {
    border-color: var(--eth-green-200, #93FF96);
    background: rgba(147,255,150,0.06);
    transform: scale(0.96);
  }
  .mob-products__partners-grid img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  /* ─── 5. Discover ──────────────────────────────────────────────────── */
  .disc { padding-left: 16px; padding-right: 16px; }

  /* ─── 6. Team grid ─────────────────────────────────────────────────── */
  .team { padding-left: 16px; padding-right: 16px; }
  .team__grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
  }
  .team-card__portrait { aspect-ratio: 1 / 1; }
  .team-card__name-row { flex-wrap: wrap; gap: 6px; }
  .team-card__name-row h4 { font-size: 14px; }
  .team-card__role { font-size: 10px; }
  .team-card__quote { font-size: 12px; }

  /* ─── 7. Footer ────────────────────────────────────────────────────── */
  .footer,
  .footer__inner {
    padding-left: 16px;
    padding-right: 16px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* ─── 8. Scroll-to-continue pill ───────────────────────────────────── */
  .scroll-fixed {
    transform: scale(0.6);
    transform-origin: bottom center;
    opacity: 0.8;
  }
  .scroll-fixed__label { font-size: 10px; }

  /* ─── 9. Hero composition tightening (no logo animation in mobile) ────
     - Compress vertical rhythm so logo sits high.
     - Sphere moved up so it doesn't get covered by the stats cards.
     - Logo: let the desktop JS animation play (don't override).
     ─────────────────────────────────────────────────────────────────── */
  .hero {
    padding-top: 24px;
    padding-bottom: 32px;
  }
  .hero__inner {
    gap: 14px;
  }
  /* Sphere — keep its desktop animation but reposition higher so it sits
     between the logo and the title, NOT covered by the TVL/APR cards. */
  .hero__sphere {
    top: 28%;
  }
  /* Logo: ride up close to the nav (no animation override — desktop JS owns it) */
  .hero__logo {
    margin-top: 8px;
    width: 180px;
    max-width: 55vw;
  }
  /* Title: tighter margins */
  .hero__title {
    margin-top: 0;
    margin-bottom: 12px;
  }
}

/* ─── end mobile patch v2 ──────────────────────────────────────────────── */
