/**
 * RiftOre Kenya — responsive layout
 * Mobile ≤640 · Tablet ≤960 · Laptop ≤1279 · Desktop ≥1280
 */

/* —— Base fluid helpers —— */
img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

.table-wrap,
.level-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.level-table {
  min-width: 520px;
}

.hero-actions,
.cta-band .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  max-width: 100%;
}

/* —— Desktop (≥1280) —— */
@media (min-width: 1280px) {
  .shell {
    width: min(1200px, calc(100% - 3rem));
  }

  .pillar-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .destination-rail.rewards-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .trust-band {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* —— Laptop (961–1279) —— */
@media (max-width: 1279px) and (min-width: 961px) {
  .shell {
    width: min(1100px, calc(100% - 2.5rem));
  }

  .pillar-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .destination-rail {
    grid-template-columns: repeat(2, 1fr);
  }

  .destination-rail.rewards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-band {
    grid-template-columns: repeat(4, 1fr);
  }

  .process-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h1 {
    font-size: clamp(2.2rem, 4.2vw, 3.2rem);
  }

  .hero-brand {
    font-size: clamp(3.2rem, 7vw, 5rem);
  }

  .page-home .home-hero-brand-name {
    font-size: clamp(3.4rem, 7vw, 5rem);
  }
}

@media (max-width: 960px) and (min-width: 641px) {
  .home-launch-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
  }

  .page-home .section-launch-offer,
  .page-home .home-offer {
    padding-top: 1.75rem;
  }
}

/* —— Tablet (641–960) —— */
@media (max-width: 960px) {
  .shell {
    width: calc(100% - 2rem);
  }

  .header-inner {
    min-height: 70px;
    position: relative;
  }

  .nav-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 1rem;
    z-index: 60;
    border-bottom: 1px solid var(--line);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    background: rgba(3, 6, 4, 0.97);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a,
  .site-nav .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 0.85rem 1rem;
  }

  .split,
  .footer-grid,
  .dash-grid,
  .dash-grid.cols-2,
  .dash-grid.cols-3,
  .reward-strip,
  .pillar-grid,
  .pillar-grid-4,
  .destination-rail,
  .destination-rail.rewards-grid,
  .trust-band,
  .info-grid,
  .ops-pillars,
  .plan-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-grid,
  .dash-grid.cols-2,
  .dash-grid.cols-3 {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pillar {
    min-height: 300px;
  }

  .process-gallery {
    grid-template-columns: 1fr 1fr;
  }

  .process-wide {
    grid-column: 1 / -1;
  }

  .hero {
    min-height: min(78vh, 640px);
  }

  .hero-content {
    padding: 2.25rem 0 3rem;
    max-width: 100%;
  }

  .hero-brand {
    font-size: clamp(2.6rem, 11vw, 3.8rem);
  }

  .hero h1 {
    font-size: clamp(1.7rem, 5vw, 2.35rem);
  }

  .hero-lead {
    font-size: 0.98rem;
    max-width: 48ch;
  }

  .page-home .home-hero {
    min-height: min(78vh, 640px);
  }

  .page-home .home-hero-content {
    padding: 3.5rem 0 2.75rem;
    max-width: 100%;
  }

  .page-hero {
    padding: 2rem 0 0.95rem;
  }

  .page-hero h1 {
    font-size: clamp(1.9rem, 6vw, 2.8rem);
  }

  .section {
    padding-block: 2rem;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    border-radius: 22px;
  }

  .cta-band h2 {
    max-width: none;
  }

  .cta-band .hero-actions,
  .cta-band .btn {
    width: 100%;
  }

  .cta-band .btn {
    text-align: center;
    justify-content: center;
  }

  .dest-card,
  .dest-content {
    min-height: 260px;
  }

  .photo-frame img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: cover;
  }

  .auth-wrap {
    padding: 1.5rem 0 3rem;
  }

  .auth-panel {
    width: 100%;
    max-width: 520px;
    margin-inline: auto;
  }

  .marquee-track {
    font-size: 0.85rem;
    gap: 0.75rem;
  }
}

/* —— Mobile (≤640) —— */
@media (max-width: 640px) {
  .shell {
    width: calc(100% - 1.25rem);
  }

  .header-inner {
    min-height: 64px;
  }

  .site-nav {
    top: 64px;
    max-height: calc(100vh - 64px);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-text strong {
    font-size: 1.05rem;
  }

  .brand-text em {
    font-size: 0.72rem;
  }

  .split,
  .footer-grid,
  .dash-grid,
  .dash-grid.cols-2,
  .dash-grid.cols-3,
  .reward-strip,
  .pillar-grid,
  .pillar-grid-4,
  .destination-rail,
  .destination-rail.rewards-grid,
  .trust-band,
  .info-grid,
  .ops-pillars,
  .plan-grid,
  .process-gallery {
    grid-template-columns: 1fr;
  }

  .process-wide {
    grid-column: auto;
  }

  .pillar {
    min-height: 280px;
  }

  .hero {
    min-height: auto;
    align-items: end;
  }

  .hero-content {
    padding: 1.5rem 0 2.1rem;
  }

  .hero-brand {
    font-size: clamp(2.2rem, 13vw, 2.9rem);
  }

  .hero-brand span {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .hero h1 {
    font-size: clamp(1.5rem, 7vw, 1.95rem);
    max-width: none;
  }

  .hero-lead {
    font-size: 0.92rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }

  .hero-horizon {
    height: 18vh;
    min-height: 100px;
  }

  .scroll-hint {
    display: none;
  }

  .page-home .home-hero {
    min-height: min(86vh, 640px);
  }

  .page-home .home-hero-brand-name {
    font-size: clamp(2.65rem, 13vw, 3.35rem);
    letter-spacing: 0.04em;
  }

  .page-home .home-hero h1 {
    font-size: clamp(1.2rem, 5vw, 1.45rem);
    line-height: 1.25;
    font-weight: 600;
  }

  .section-head h2,
  .split h2 {
    font-size: clamp(1.4rem, 6.5vw, 1.85rem);
  }

  .lede {
    font-size: 0.95rem;
  }

  .feature-list li {
    font-size: 0.9rem;
  }

  .home-launch-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .invest-card {
    padding: 0.7rem 0.65rem 0.65rem;
  }

  .invest-offer-tag {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.58rem;
    padding: 0.15rem 0.38rem;
  }

  .dest-card,
  .dest-content {
    min-height: 220px;
  }

  .dest-content {
    padding: 1rem;
  }

  .dest-content h3 {
    font-size: 1.4rem;
  }

  .place-chips li {
    font-size: 0.7rem;
    padding: 0.22rem 0.5rem;
  }

  .trust-band {
    padding: 1rem;
    gap: 0.7rem;
    border-radius: 18px;
  }

  .trust-item strong {
    font-size: 1.25rem;
  }

  .cta-band {
    margin-bottom: 2rem;
    padding: 1.15rem;
    border-radius: 18px;
  }

  .cta-band .hero-actions .btn {
    min-height: 44px;
  }

  .page-hero {
    padding: 1.75rem 0 0.85rem;
  }

  .page-hero h1 {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .info-block {
    padding: 1.1rem;
  }

  .auth-panel {
    padding: 1.35rem;
    border-radius: 20px;
  }

  .auth-panel h1 {
    font-size: 1.55rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea,
  .password-toggle,
  .phone-row select,
  .phone-row input {
    min-height: 48px;
    font-size: 16px; /* prevents iOS zoom */
  }

  .phone-row {
    grid-template-columns: 1fr;
  }

  .password-field {
    flex-direction: column;
  }

  .password-toggle {
    width: 100%;
  }

  .share-row {
    gap: 0.45rem;
  }

  .share-btn {
    flex: 1 1 calc(50% - 0.45rem);
    min-width: 140px;
  }

  .level-chips {
    gap: 0.35rem;
  }

  .level-chip {
    font-size: 0.74rem;
    padding: 0.35rem 0.55rem;
  }

  .kenya-ribbon {
    height: 6px;
  }

  .footer-grid {
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
  }

  .plan-card,
  .dash-card {
    padding: 1.15rem;
  }

  .amount {
    font-size: 1.8rem !important;
  }
}

/* —— Small phones (≤380) —— */
@media (max-width: 380px) {
  .shell {
    width: calc(100% - 1rem);
  }

  .hero-brand {
    font-size: 2rem;
  }

  .hero h1 {
    font-size: 1.35rem;
  }

  .page-home .home-hero-brand-name {
    font-size: 2.15rem;
  }

  .page-home .home-hero h1 {
    font-size: 1.12rem;
  }

  .btn {
    padding-inline: 1rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .share-btn {
    flex: 1 1 100%;
  }

  .home-launch-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.5rem;
    padding-bottom: 0.3rem;
    -webkit-overflow-scrolling: touch;
  }

  .home-launch-grid .invest-card {
    flex: 0 0 min(78vw, 210px);
    scroll-snap-align: start;
  }

  .invest-kicker {
    padding-right: 0;
  }

  .invest-offer-tag {
    position: static;
    align-self: flex-start;
    margin-bottom: 0.1rem;
  }
}

/* —— Landscape phones —— */
@media (max-height: 480px) and (orientation: landscape) {
  .hero {
    min-height: auto;
  }

  .hero-content {
    padding: 1.25rem 0 1.75rem;
  }

  .hero-canvas {
    opacity: 0.55;
  }

  .page-home .home-hero {
    min-height: auto;
  }

  .page-home .home-hero-content {
    padding: 1.5rem 0 1.75rem;
  }

  .page-home .hero-horizon {
    height: 14vh;
    min-height: 80px;
  }
}

/* —— Reduce motion —— */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .marquee-track {
    animation: none;
  }
}
