/* ─────────────────────────────────────────────────────────
   MOBILE / RESPONSIVE OVERRIDES — shared across all pages
   Breakpoints: 1024 (laptop), 900 (tablet), 640 (phone)
   ───────────────────────────────────────────────────────── */

/* Touch devices: disable custom cursor, restore native cursor */
@media (hover: none), (pointer: coarse) {
  body { cursor: auto !important; }
  #cursor { display: none !important; }
}

/* Safety net: prevent any descendant overflow from widening the page */
html { overflow-x: hidden; max-width: 100%; }

/* ── TABLET / SMALL LAPTOP ─────────────────────────────── */
@media (max-width: 1024px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.25rem; }
  .hero,
  .snap-section,
  .metrics,
  .services,
  .projects,
  .contact { padding-left: 1.5rem; padding-right: 1.5rem; }
  .snap-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .services-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .about-text { padding: 3rem 2rem; }
  footer { padding: 1.5rem; }
}

/* ── TABLET ────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Nav */
  nav { padding: .85rem 1.2rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 9px; letter-spacing: .08em; }
  .nav-pill { padding: 7px 12px; font-size: 9px !important; }

  /* Hero (index) */
  .hero {
    grid-template-columns: 1fr !important;
    padding: 7rem 1.25rem 3rem !important;
    gap: 2.5rem !important;
    min-height: auto !important;
  }
  .hero-right { order: -1; }
  .hero-photo { max-width: 260px !important; height: 340px !important; }
  .hero-wm { font-size: 32vw !important; right: -2rem !important; opacity: .6; }
  .card-stack { height: 380px !important; }

  /* Metrics */
  .metrics {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    padding: 3.5rem 1.25rem !important;
  }
  .metrics-grid { grid-template-columns: 1fr 1fr !important; }
  .metric-num { font-size: 34px !important; }

  /* Services */
  .services { padding: 3.5rem 1.25rem !important; }
  .services-header { grid-template-columns: 1fr !important; gap: 1rem !important; }
  .services-note { margin-left: 0 !important; max-width: 100% !important; }
  .services-grid { grid-template-columns: 1fr !important; }

  /* Projects (index) */
  .projects { padding: 3.5rem 1.25rem !important; }
  .proj-grid { grid-template-columns: 1fr !important; }
  .projects-header { flex-wrap: wrap; gap: 1rem; }

  /* Projects page */
  .proj-grid.cols-3,
  .proj-grid:not(.cols-1) { grid-template-columns: 1fr !important; }

  /* About strip */
  .about-strip { grid-template-columns: 1fr !important; }
  .about-photo-wrap { max-height: 380px; }
  .about-text { padding: 2.5rem 1.5rem !important; }

  /* Contact */
  .contact {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
    padding: 3.5rem 1.25rem !important;
  }
  .avail-panel { padding: 1.75rem !important; }

  /* Snap section */
  .snap-section { padding: 3rem 1.25rem !important; }
  .snap-grid { grid-template-columns: 1fr 1fr !important; gap: .75rem !important; }
  .snap-card { padding: 1.25rem !important; }

  /* Ticker */
  .ticker-item { padding: 0 1.5rem !important; font-size: 11px !important; }

  /* ── Case study pages (shakiro, kai, mfa, tir, onepipeline) ── */
  .cs-hero {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    padding: 7rem 1.25rem 3rem !important;
  }
  .meta-row,
  .building-grid,
  .edu-row,
  .social-row { grid-template-columns: 1fr 1fr !important; }
  .results-bar { grid-template-columns: 1fr 1fr !important; }
  .villa-grid,
  .milestones { grid-template-columns: 1fr 1fr !important; }
  .expect-grid,
  .skills-grid { grid-template-columns: 1fr !important; }
  .cs-body { padding: 3rem 1.25rem !important; }
  .cs-img-grid,
  .cs-img-grid.cols-3,
  .cs-img-row { grid-template-columns: 1fr !important; }
  .tl-item {
    grid-template-columns: 1fr !important;
    gap: .5rem !important;
    padding: 1.25rem 1.25rem !important;
  }
  .contact-strip {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 2rem !important;
    text-align: left;
  }
  .kara-section {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
    padding: 1.75rem !important;
  }
  .kara-role { word-break: break-word; overflow-wrap: anywhere; }

  /* Footer */
  footer {
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1.25rem !important;
  }
  .footer-links { gap: 1rem !important; flex-wrap: wrap; }
}

/* ── PHONE ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Nav: compact, fits one line */
  nav { padding: .75rem 1rem !important; }
  .nav-logo { font-size: 12px !important; gap: 6px !important; }
  .nav-avatar { width: 26px !important; height: 26px !important; }
  .nav-links { gap: .7rem !important; }
  .nav-links li:not(:has(.nav-pill)) { display: none; }
  .nav-pill { padding: 6px 11px !important; font-size: 9px !important; }

  /* Remove mobile filler — these add visual weight without info on phone */
  .ticker { display: none !important; }            /* purely decorative scrolling words */
  .snap-section { display: none !important; }     /* duplicates Projects section below */

  /* Hero */
  .hero { padding: 5.5rem 1rem 2.5rem !important; gap: 2rem !important; }
  .hero-hl { font-size: 44px !important; }
  .hero-sub1 { font-size: 16px !important; }
  .hero-sub2 { font-size: 14px !important; line-height: 1.7 !important; }
  .hero-photo { max-width: 220px !important; height: 290px !important; }
  .hero-wm { font-size: 38vw !important; }
  .hero-ctas { width: 100%; }
  .btn-primary, .btn-ghost { font-size: 11px !important; }

  /* Body copy readability bump */
  .proj-what,
  .svc-body,
  .metric-label,
  .about-text p,
  .contact-left p,
  .card-body,
  .cs-subtitle,
  .cs-section p { font-size: 14px !important; line-height: 1.7 !important; }

  /* Snap cards — when they appear (tablet/case-study pages), make them readable */
  .snap-card { padding: 1.4rem !important; }
  .snap-card .card-eyebrow { opacity: .7 !important; font-size: 10px !important; }
  .snap-card .card-body { opacity: .85 !important; font-size: 13px !important; }
  .snap-card[data-theme="yellow"] .card-body,
  .snap-card[data-theme="yellow"] .card-eyebrow { color: #4a3700; opacity: 1 !important; }

  /* Metrics */
  .metrics { padding: 2.75rem 1rem !important; }
  .metrics-grid { grid-template-columns: 1fr !important; }
  .metric-cell { padding: 1.5rem !important; }
  .metric-num { font-size: 30px !important; }
  .metric-label { font-size: 13px !important; }

  /* Services */
  .services { padding: 2.75rem 1rem !important; }
  .svc-card { padding: 1.5rem !important; }

  /* Projects */
  .projects { padding: 2.75rem 1rem !important; }
  .proj-card { padding: 1.5rem !important; }
  .proj-card.featured { padding: 1.5rem !important; }
  .proj-card.featured .proj-title { font-size: 22px !important; }
  .proj-visual { height: 120px !important; font-size: 30px !important; }

  /* About */
  .about-text { padding: 2rem 1.25rem !important; }

  /* Contact */
  .contact { padding: 2.75rem 1rem !important; }
  .avail-panel { padding: 1.5rem !important; }
  .contact-ctas { width: 100%; }

  /* Section titles smaller on phone */
  .section-title { font-size: clamp(26px, 7vw, 34px) !important; }
  .cs-title { font-size: 28px !important; overflow-wrap: anywhere; }

  /* Case study pages */
  .cs-hero { padding: 5.5rem 1rem 2.5rem !important; }
  .meta-row,
  .building-grid,
  .edu-row,
  .social-row,
  .results-bar,
  .villa-grid,
  .milestones { grid-template-columns: 1fr !important; }
  .cs-body { padding: 2.5rem 1rem !important; }

  /* Snap section */
  .snap-section { padding: 2.5rem 1rem !important; }

  /* Ticker */
  .ticker-item { padding: 0 1rem !important; font-size: 10px !important; }

  /* Footer */
  footer p { font-size: 11px !important; }
  .footer-links a { font-size: 11px !important; }

  /* ─── READABILITY BUMP ─────────────────────────────────
     Eyebrow labels, tags, captions, and secondary text all
     bump up on phone. Desktop 9–10px reads as 6–7px on a
     phone — too small. Keeps hierarchy, just less aggressive.
     ──────────────────────────────────────────────────────── */

  /* Eyebrow / kicker labels: 9px → 11px */
  .section-label,
  .section-tag,
  .cs-section-tag,
  .cs-eyebrow,
  .hero-eyebrow,
  .card-eyebrow,
  .currently-label,
  .skill-category,
  .avail-panel-label,
  .kara-col-label,
  .shakiro-label,
  .ca-label,
  .svc-num,
  .meta-label,
  .result-label,
  .breadcrumb,
  .proj-client { font-size: 11px !important; }

  /* Tag pills: 9px → 10px */
  .proj-tag,
  .svc-tag,
  .cs-tag,
  .tl-tag,
  .badge { font-size: 10px !important; }

  /* Nav links + pill: small bump for legibility */
  .nav-links a { font-size: 10px !important; }
  .nav-links a.nav-pill { font-size: 11px !important; padding: 7px 13px !important; }

  /* CTAs and small action text: 10–11px → 12px */
  .proj-cta,
  .btn-ghost-light,
  .next-label { font-size: 11px !important; }
  .btn-primary { font-size: 12px !important; }
  .btn-ghost { font-size: 12px !important; }
  .btn-sage { font-size: 12px !important; }

  /* Captions and subtitle text: 10px → 12px */
  .ca-sub,
  .sc-handle,
  .avail-sub,
  .avail-sub-text,
  .photo-caption,
  .cs-img-caption,
  .tl-date,
  .edu-note,
  .cert,
  .building-status,
  .currently-sub,
  .stat-label { font-size: 12px !important; line-height: 1.6 !important; }

  /* Misc body text: 11–13px → 14px */
  .ticker-item,
  .expect-desc,
  .skills-list,
  .edu-detail,
  .tl-detail,
  .tl-org,
  .meta-value,
  .result-num + .result-label,
  .kara-sub,
  .kara-role,
  .proj-result,
  .hero-body,
  .page-desc,
  .filter-btn { font-size: 13px !important; line-height: 1.7 !important; }

  /* Card titles / important stats — keep prominence but ensure not tiny */
  .ca-value,
  .sc-name,
  .avail-name,
  .filter-label { font-size: 14px !important; }
}

/* Hide watermark text on very small screens — it eats vertical space */
@media (max-width: 480px) {
  .hero-wm { display: none !important; }
}
