/* ─────────────────────────────────────────────────────────
 * Mobile responsive fixes · comprehensive pass
 * Phone (<640px) and tablet (641–1024px) overrides for every
 * grid / table / card layout that overflows on small screens.
 * ──────────────────────────────────────────────────────── */


/* ═══════════ TABLET (641-1024px) ═══════════ */
@media (max-width: 1024px) {

  /* Hero · cinematic proof strip → 2-column */
  .cine-proof-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 28px 0 !important;
    padding: 24px 16px !important;
  }
  .cine-proof-cell {
    border-right: none !important;
    padding: 0 14px !important;
  }
  .cine-proof-cell:nth-child(odd) {
    border-right: 1px solid rgba(244,196,48,0.10) !important;
  }

  /* Hero · marquee stat block stacks tighter */
  .cine-marquee-stat {
    padding: 22px 24px !important;
    margin-bottom: 36px !important;
  }
  .cine-stat-block {
    flex-wrap: wrap !important;
    gap: 14px !important;
    justify-content: center !important;
  }
  .cine-stat-tail {
    display: block !important;
    margin: 8px 0 0 !important;
    text-align: center !important;
    width: 100% !important;
  }

  /* Context band · grid stacks */
  #context > .wrap > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  #context > .wrap > div:first-child > div:nth-child(2) {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
  }

  /* Built-on · 3-column on tablet */
  .builton-inner { grid-template-columns: 1fr !important; gap: 20px !important; padding: 0 24px !important; }
  .builton-row { grid-template-columns: repeat(3, 1fr) !important; }

  /* Resources · 2-column on tablet */
  .resources { grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }

  /* Tile grid · 2-column */
  .tile-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }

  /* Three paths · stack */
  .paths { grid-template-columns: 1fr !important; gap: 16px !important; }

  /* Standing · stack */
  .standing-grid { grid-template-columns: 1fr !important; gap: 18px !important; max-width: 600px !important; }

  /* Footer · 2-column */
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
}


/* ═══════════ PHONE (≤640px) ═══════════ */
@media (max-width: 640px) {

  /* General wrap padding tightening */
  .wrap, .nav-row, .ticker-head { padding-left: 18px !important; padding-right: 18px !important; }

  /* Top tape: hide most items, keep the one anchor */
  .tape-row {
    padding: 8px 18px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 18px !important;
    scrollbar-width: none;
  }
  .tape-row::-webkit-scrollbar { display: none; }
  .tape-row .item { font-size: 9.5px !important; flex-shrink: 0; }

  /* Nav · tighter */
  .nav-row { height: 60px !important; }
  .brand-text .b1 { font-size: 14px !important; }
  .brand-text .b2 { font-size: 8.5px !important; }
  .nav-mid { display: none !important; }
  .nav-status { font-size: 9px !important; padding: 5px 10px !important; }

  /* ── Hero ── */
  .hero-cinematic { padding: 56px 0 40px !important; min-height: auto !important; }
  .cine-eyebrow { font-size: 9px !important; padding: 7px 14px !important; margin-bottom: 22px !important; }
  .cine-headline { font-size: clamp(36px, 11vw, 56px) !important; margin-bottom: 22px !important; }
  .cine-sub { font-size: 14.5px !important; margin-bottom: 28px !important; padding: 0 8px !important; }
  .cine-marquee-stat { padding: 16px 18px !important; margin-bottom: 28px !important; }
  .cine-stat-num { font-size: 26px !important; }
  .cine-stat-num .op { font-size: 13px !important; }
  .cine-stat-eq { font-size: 22px !important; margin: 0 4px !important; }
  .cine-stat-tail { font-size: 9px !important; margin-top: 4px !important; }
  .cine-proof-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 22px 0 !important;
    padding: 22px 12px !important;
    margin-bottom: 36px !important;
  }
  .cine-proof-cell { padding: 0 10px !important; }
  .cine-proof-cell .num { font-size: 20px !important; margin-bottom: 6px !important; }
  .cine-proof-cell .lbl { font-size: 9px !important; }
  .cine-cta-row {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 280px !important;
    margin-bottom: 36px !important;
  }
  .cine-cta-primary, .cine-cta-ghost {
    text-align: center !important;
    padding: 13px 22px !important;
    width: 100% !important;
  }

  /* ── Live ticker ── */
  .ticker-head {
    flex-direction: column !important;
    gap: 4px !important;
    align-items: flex-start !important;
    padding: 9px 18px 7px !important;
  }
  .ticker-title { font-size: 9.5px !important; }
  .ticker-meta { font-size: 8.5px !important; }
  .ticker-item { gap: 12px !important; padding: 6px 18px 6px 0 !important; margin-right: 18px !important; font-size: 11px !important; }
  .ticker-item .ti-meta { font-size: 10px !important; }
  .ticker-item .ti-time { font-size: 10px !important; }

  /* ── Photo anchor ── */
  .photo-anchor { height: auto !important; min-height: 360px !important; max-height: none !important; padding: 56px 0 !important; }
  .photo-anchor .photo-content { padding: 0 18px !important; }
  .photo-anchor .photo-eyebrow { font-size: 9.5px !important; margin-bottom: 18px !important; }
  .photo-anchor .photo-headline { font-size: 26px !important; line-height: 1.15 !important; margin-bottom: 14px !important; }
  .photo-anchor .photo-sub { font-size: 14px !important; }

  /* ── Body sections ── */
  .body-light .section,
  .body-light .section-sm {
    padding: 56px 0 !important;
  }
  .body-light h2 { font-size: clamp(26px, 6vw, 36px) !important; line-height: 1.1 !important; }
  .body-light .section-head { margin-bottom: 32px !important; }
  .body-light .section-head p { font-size: 15px !important; }

  /* Context band */
  #context { padding: 40px 0 !important; }
  #context > .wrap > div:first-child { gap: 22px !important; }
  #context > .wrap > div:first-child > div:nth-child(2) {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  #context > .wrap > div:first-child > div:nth-child(2) > div {
    padding: 12px 10px !important;
  }
  #context > .wrap > div:first-child h3 {
    font-size: 22px !important;
    max-width: none !important;
  }
  #context > .wrap > p {
    font-size: 10.5px !important;
    margin-top: 18px !important;
    padding: 0 12px !important;
  }

  /* Tile grid · 1-col */
  .tile-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .body-light .tile { padding: 22px !important; }
  .body-light .tile h3 { font-size: 16px !important; }
  .body-light .tile p { font-size: 13.5px !important; }

  /* Flow diagram wrap · tighter padding */
  .flow-wrap { padding: 32px 14px !important; }

  /* ── Ledger table → card list on mobile ── */
  .ledger-table-shell { overflow: visible !important; border-radius: var(--radius) !important; }
  .ledger-table { display: block !important; min-width: 0 !important; }
  .ledger-table thead { display: none !important; }
  .ledger-table tbody, .ledger-table tr, .ledger-table td { display: block !important; }
  .ledger-table tr {
    padding: 16px 18px !important;
    border-bottom: 1px solid var(--bl-rule) !important;
    background: var(--bl-bg-card);
    position: relative;
  }
  .ledger-table tr:last-child { border-bottom: none !important; }
  .ledger-table td {
    padding: 4px 0 !important;
    border-bottom: none !important;
    font-size: 13px !important;
  }
  /* Add labels via data attributes */
  .ledger-table td.name {
    font-family: var(--ff-serif);
    font-size: 16px !important;
    color: var(--bl-ink) !important;
    font-weight: 600;
    padding-bottom: 6px !important;
    margin-bottom: 6px !important;
    border-bottom: 1px solid var(--bl-rule) !important;
  }
  .ledger-table td:nth-child(2) {
    color: var(--bl-ink-mute) !important;
    font-size: 12.5px !important;
    line-height: 1.45;
    margin-bottom: 8px !important;
  }
  .ledger-table td.addr {
    font-family: var(--ff-mono);
    font-size: 11.5px !important;
  }
  .ledger-table td.addr a {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(184, 144, 44, 0.06);
    border-radius: 3px;
  }
  .ledger-table td:last-child {
    margin-top: 8px !important;
  }
  .ledger-table .verified {
    display: inline-flex;
    padding: 3px 10px;
    background: rgba(31, 224, 127, 0.08);
    border-radius: 999px;
    font-size: 10.5px !important;
    letter-spacing: 0.12em;
  }
  .ledger-foot {
    flex-direction: column !important;
    gap: 10px !important;
    padding: 14px 18px !important;
    align-items: flex-start !important;
    font-size: 10.5px !important;
  }
  .ledger-foot span { width: 100%; }

  /* Built-on · 1-col */
  .builton { padding: 22px 0 !important; margin-top: 36px !important; }
  .builton-inner { gap: 14px !important; padding: 0 18px !important; }
  .builton-row { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .builton-cell { padding: 10px 12px !important; }
  .builton-cell .name { font-size: 12.5px !important; }
  .builton-cell .role { font-size: 8.5px !important; }
  .builton-label { font-size: 9.5px !important; }

  /* Three paths · stack */
  .paths { grid-template-columns: 1fr !important; gap: 12px !important; }
  .body-light .path { padding: 26px 22px !important; min-height: auto !important; }
  .body-light .path h3 { font-size: 19px !important; }
  .body-light .path p { font-size: 13.5px !important; }

  /* Standing · stack */
  .standing-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  .body-light .standing-card { padding: 24px !important; }
  .body-light .standing-card h3 { font-size: 19px !important; }
  .body-light .standing-card p { font-size: 13.5px !important; }

  /* Resources · 1-col */
  .resources { grid-template-columns: 1fr !important; gap: 10px !important; }
  .body-light .resource { padding: 16px 18px !important; }

  /* Closing CTA */
  .closing-cta { padding: 56px 0 !important; }
  .closing-content { padding: 0 18px !important; }
  .closing-eyebrow { font-size: 9.5px !important; padding: 7px 14px !important; margin-bottom: 22px !important; }
  .closing-headline { font-size: 28px !important; line-height: 1.12 !important; margin-bottom: 18px !important; }
  .closing-sub { font-size: 14.5px !important; margin-bottom: 28px !important; }
  .closing-cta-row {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 280px !important;
    margin: 0 auto !important;
  }
  .closing-btn-primary, .closing-btn-ghost {
    text-align: center !important;
    padding: 13px 22px !important;
    width: 100% !important;
  }

  /* Footer */
  .footer { padding: 40px 0 28px !important; }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    margin-bottom: 32px !important;
    padding: 0 18px !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center !important;
    padding: 22px 18px 0 !important;
    font-size: 9.5px !important;
  }
  .footer-meta { font-size: 13px !important; }

  /* Section eyebrow flow line shorter on mobile */
  .section-eyebrow-flow::before { width: 32px !important; }
}


/* ═══════════ Very small phone (<380px) ═══════════ */
@media (max-width: 380px) {
  .cine-headline { font-size: 32px !important; }
  .closing-headline { font-size: 24px !important; }
  .photo-anchor .photo-headline { font-size: 22px !important; }
  .body-light h2 { font-size: 24px !important; }

  .cine-proof-cell .num { font-size: 18px !important; }
  #context > .wrap > div:first-child > div:nth-child(2) > div .counter,
  #context > .wrap > div:first-child > div:nth-child(2) > div div:first-child {
    font-size: 22px !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
 * AAA+ CEREMONIAL LAYER · mobile parity pass · added 2026-05-17
 * The AAA+ updates shipped 2026-05-10 (Two Covenants block, Physics Gate hero,
 * Kommit hero, Anokye throne) were built at desktop scale. Their inline
 * <style> blocks in index.html / technical.html set fixed clamp() floors of
 * 240px that overflow on phones <390px wide. These rules bring mobile parity
 * without touching the desktop appearance — they only fire ≤640px.
 * ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {

  /* ── Two Covenants block (index.html · .duality-section) ── */
  /* Mini-medallions overflow viewport at desktop floor — pull them in. */
  .mini-medallion {
    width: clamp(180px, 62vw, 240px) !important;
    height: clamp(180px, 62vw, 240px) !important;
    margin: 0 auto !important;
  }
  .mini-ingot,
  .mini-aperture {
    transform: scale(0.85) !important;
  }
  .side-label  { font-size: 11px !important; letter-spacing: 2px !important; }
  .side-tag    { font-size: 9px  !important; }
  .side-essence{ font-size: 12px !important; line-height: 1.4 !important; }
  .sov-node-bridge {
    width: clamp(48px, 14vw, 64px) !important;
    height: clamp(48px, 14vw, 64px) !important;
  }
  .duality-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    text-align: center !important;
  }

  /* ── Physics Gate hero medallion (technical.html#physics-gate) ── */
  .physics-medallion {
    width: clamp(180px, 58vw, 220px) !important;
    height: clamp(180px, 58vw, 220px) !important;
    margin: 0 auto !important;
  }
  .physics-hero::before {
    width: 280px !important;
    height: 280px !important;
  }
  .struck-ingot {
    transform: rotate(7deg) scale(0.78) !important;
  }
  .physics-hero .royal-mark,
  .kommit-hero .royal-mark {
    font-size: clamp(18px, 5.2vw, 24px) !important;
    letter-spacing: 4px !important;
  }
  .physics-hero .hero-essence,
  .kommit-hero .hero-essence {
    font-size: 13px !important;
    padding: 0 16px !important;
  }

  /* ── Kommit hero medallion (technical.html#kommit) ── */
  .kommit-medallion {
    width: clamp(180px, 58vw, 220px) !important;
    height: clamp(180px, 58vw, 220px) !important;
    margin: 0 auto !important;
  }
  .kommit-hero::before {
    width: 280px !important;
    height: 280px !important;
  }
  .kommit-aperture-hero { transform: scale(0.82) !important; }
  .kommit-aperture-hero .hash,
  .kommit-medallion .hash { font-size: 7px !important; }
  /* Hide corner hash labels on narrow phones — they clip the viewport */
  .kommit-medallion .hash-tr,
  .kommit-medallion .hash-br { display: none !important; }

  /* ── NANANOM Council · Anokye throne card (technical.html#nananom) ── */
  /* 36px inline padding is too tight on 320-390px phones. */
  .god-card.anokye {
    padding: 22px 18px !important;
  }
  .god-card.anokye .gname .g-name {
    font-size: 20px !important;
  }
  .god-card.anokye .role-tag {
    font-size: 9px !important;
    letter-spacing: 2px !important;
  }
  /* Council seat numbers shouldn't dominate on small cards */
  .god-card[data-seat]::after {
    font-size: 9px !important;
    bottom: 6px !important;
    right: 8px !important;
  }

  /* ── Heritage throne · Twi proverb (heritage.html · .throne-twi) ── */
  .throne-twi {
    font-size: clamp(20px, 5.5vw, 28px) !important;
    line-height: 1.3 !important;
    max-width: 90vw !important;
    margin: 0 auto !important;
    padding: 0 12px !important;
  }
  .throne-translation {
    font-size: 10px !important;
    letter-spacing: 2.5px !important;
  }

  /* ── Ceremonial covenant marks (compliance + diligence) ── */
  /* Already mobile-safe per audit, but tighten letter-spacing for visual rhythm */
  .ceremonial-mark .royal-mark {
    font-size: 13px !important;
    letter-spacing: 3.5px !important;
  }
  .adinkra-seal {
    width: 20px !important;
    height: 20px !important;
  }

  /* ── Section ceremonial headers (.nananom-ceremony) ── */
  .nananom-ceremony .royal-mark {
    font-size: clamp(20px, 5.6vw, 28px) !important;
  }
  .nananom-ceremony .sublabel {
    font-size: 10px !important;
    padding: 0 12px !important;
  }
}
