/* ============================================================
   MEWAYZ Site — Shared shell: nav, footer, buttons, container.
   Used by Home, Features, Pricing, Customers, About, Contact.
   ============================================================ */

:root {
  --ink: #0A0A0A;
  --paper: #FAFAFA;
  --warm: #F0EDE4;
  --cream: #E8E2D3;
  --accent: #4F46E5;
  --accent-warm: #FF5C1F;
  --mute: #6B6B6B;
  --line: rgba(10,10,10,0.12);
}

html, body {
  background: var(--paper);
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1480px; margin: 0 auto; padding: 0 64px; }

/* ====== NAVBAR ====== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(20px);
  background: rgba(250,250,250,0.85);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 64px;
  max-width: 1480px;
  margin: 0 auto;
}
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.nav-hex {
  width: 32px; height: 32px;
  background-image: url("assets/mewayz-symbol.png");
  background-size: contain; background-repeat: no-repeat;
}
.nav-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.nav-links {
  display: flex; align-items: center; gap: 36px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
}
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  opacity: 0.72;
  transition: opacity 120ms;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; }
.nav-cta { display: flex; align-items: center; gap: 12px; }

/* ====== Mobile burger (hidden on desktop) ====== */
.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0;
  background: transparent; border: 1px solid var(--border-1, rgba(10,10,10,0.12));
  border-radius: 10px; cursor: pointer;
}
.nav-burger span {
  display: block; width: 18px; height: 2px; margin: 0 auto;
  background: var(--ink); border-radius: 2px;
  transition: transform 160ms ease, opacity 160ms ease;
}
.nav.open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ====== Buttons ====== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: transform 120ms, background 120ms, color 120ms;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #1a1a1a; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: rgba(10,10,10,0.04); }
.btn-accent { background: var(--accent); color: var(--paper); }
.btn-accent:hover { background: #3D34D4; }
.btn-big { padding: 16px 26px; font-size: 16px; }

/* ====== Page header (sub-pages) ====== */
.page-head {
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.page-head .eyebrow {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 28px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 72px;
  line-height: 0.94;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
  max-width: 1200px;
}
.page-head h1 .accent { color: var(--accent); }
.page-head .lead {
  font-family: var(--font-sans);
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink); opacity: 0.78;
  max-width: 760px;
  margin: 0;
}

/* ====== Sections ====== */
.section { padding: 96px 0; border-bottom: 1px solid var(--line); }
.section-warm { background: var(--paper-warm); }
.section-cream { background: var(--paper-cream); }
.section-dark { background: var(--ink); color: var(--paper); }
.section-dark .section-eyebrow { color: rgba(250,250,250,0.55); }
.section-dark .section-lead { color: rgba(250,250,250,0.78); }

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-sans);
  font-size: 47px; font-weight: 700;
  line-height: 1.02; letter-spacing: -0.025em;
  margin: 0 0 18px;
}
.section-title em {
  font-family: var(--font-display); font-style: italic;
  color: var(--accent); font-weight: 400; font-size: 50px;
}
.section-lead {
  font-family: var(--font-sans);
  font-size: 19px; line-height: 1.5;
  color: var(--ink); opacity: 0.72;
  max-width: 720px; margin: 0 0 56px;
}

/* ====== Footer ====== */
.footer {
  padding: 80px 0 40px;
  background: var(--ink);
  color: var(--paper);
}
.footer-top {
  display: block;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(250,250,250,0.08);
}
.footer-brand-col { display: flex; flex-direction: column; max-width: 460px; margin-bottom: 44px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer .nav-hex { filter: invert(1); }
.footer-tag {
  margin: 18px 0 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: rgba(250,250,250,0.65);
  max-width: 280px;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 36px 28px;
}
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-h {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(250,250,250,0.45);
  margin-bottom: 8px;
}
.footer-col a {
  color: rgba(250,250,250,0.82);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  transition: color 120ms;
}
.footer-col a:hover { color: var(--paper); }
.footer-bot {
  margin-top: 32px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(250,250,250,0.5);
}
.footer-meta a { color: inherit; text-decoration: none; }
.footer-meta a:hover { color: var(--paper); }

/* ====== Responsive layer (site-wide) ======
   body-prefixed selectors so these win over per-page inline <style> base rules
   (which otherwise beat the linked stylesheet on source order). */
@media (max-width: 1100px) {
  body .container { padding: 0 40px; }
  body .nav-inner { padding: 0 40px; }
  body .nav-links { gap: 24px; font-size: 14px; }
  body .page-head h1 { font-size: 60px; }
  body .section-title { font-size: 44px; }
  body .section-title em { font-size: 46px; }
}
@media (max-width: 820px) {
  body .container { padding: 0 24px; }
  body .nav-inner { padding: 0 24px; height: 64px; }
  /* Burger-driven mobile nav: links become a dropdown panel toggled by the burger */
  body .nav-burger { display: flex; order: 3; }
  body .nav-cta { gap: 8px; }
  body .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface, #fff); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(10,10,10,0.25);
    padding: 8px 24px 16px;
    max-height: 0; overflow: hidden; opacity: 0; pointer-events: none;
    transition: max-height 220ms ease, opacity 160ms ease;
  }
  body .nav.open .nav-links {
    max-height: 70vh; overflow-y: auto; opacity: 1; pointer-events: auto;
  }
  body .nav-links a {
    padding: 14px 4px; font-size: 16px; opacity: 1;
    border-bottom: 1px solid var(--line);
  }
  body .nav-links a:last-child { border-bottom: none; }
  body .nav-links a.active { color: var(--accent); }
  body .section { padding: 64px 0; }
  body .page-head { padding: 56px 0 40px; }
  body .page-head h1 { font-size: 48px; }
  body .page-head .lead { font-size: 18px; }
  body .section-title { font-size: 36px; }
  body .section-title em { font-size: 40px; }
  body .section-lead { font-size: 17px; }
  body .footer { padding: 56px 0 32px; }
  body .footer-top { grid-template-columns: 1fr; gap: 36px; padding-bottom: 36px; }
  body .footer-cols { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}
@media (max-width: 480px) {
  body .container { padding: 0 16px; }
  body .nav-inner { padding: 0 16px; }
  body .nav-cta .btn-ghost { display: none; }
  body .nav-name { font-size: 20px; }
  body .page-head h1 { font-size: 44px; }
  body .section-title { font-size: 30px; }
  body .section-title em { font-size: 33px; }
  body .footer-cols { grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* ---- Big display headings on shared sections (final CTA, manifesto) ---- */
@media (max-width: 820px) {
  body .final-cta { padding: 72px 0; }
  body .final-cta h2 { font-size: 46px; }
  body .final-cta p { font-size: 17px; }
  body .manifesto { padding: 64px 0; }
  body .manifesto p { font-size: 21px; }
  body .manifesto p em { font-size: 24px; }
  body .manifesto p:first-of-type::first-letter { font-size: 54px; }
}
@media (max-width: 480px) {
  body .final-cta h2 { font-size: 38px; }
  body .manifesto p { font-size: 19px; }
  body .manifesto p:first-of-type::first-letter { font-size: 48px; }
}

/* ---- Big display headings & stat numbers on shared sections.
   Short stat numbers (.num/.amount/.amt/.mark) shrink modestly; prose headings shrink more. ---- */
@media (max-width: 820px) {
  body .copy h2 { font-size: 40px; }
  body .big { font-size: 50px; }
  body .num { font-size: 48px; }
  body .mark { font-size: 45px; }
  body .amount, body .amt { font-size: 50px; }
  body .lifetime h2 { font-size: 46px; }
  body .feat-row h3 { font-size: 44px; }
  body .t-section h2 { font-size: 40px; }
  body .form-side h2 { font-size: 38px; }
}
@media (max-width: 480px) {
  body .copy h2 { font-size: 32px; }
  body .big { font-size: 45px; }
  body .num { font-size: 45px; }
  body .mark { font-size: 40px; }
  body .amount, body .amt { font-size: 46px; }
  body .lifetime h2 { font-size: 38px; }
  body .feat-row h3 { font-size: 34px; }
  body .t-section h2 { font-size: 32px; }
}

/* ---- Per-page inline grids: collapse on small screens.
   Selectors are body-prefixed so they beat each page's own inline base rules
   regardless of stylesheet source order. Harmless on pages lacking the class. ---- */
@media (max-width: 920px) {
  body .cl-layout, body .docs-layout, body .tour-layout { grid-template-columns: 1fr; }
  /* un-stick the side menus once stacked, so they don't overlap the content */
  body .cl-layout > aside, body .docs-layout > aside, body .tour-layout > aside,
  body .cl-nav, body .docs-nav, body .tour-nav {
    position: static !important; max-height: none !important; overflow: visible !important;
  }
}
@media (max-width: 820px) {
  body .calc, body .steps, body .feat-grid, body .preview-block, body .price-recap,
  body .principles, body .benefits, body .process,
  body .routes, body .form-layout, body .two, body .offices, body .qlinks,
  body .case-feat, body .quote-grid, body .ind-grid, body .mini-cases,
  body .cat-grid, body .channels,
  body .calc-body, body .calc-out, body .packs-grid, body .addons-row, body .lt-grid,
  body .faqs, body .feat-strip, body .doc-grid, body .tiers,
  body .feat-row, body .feat-row.flip,
  body .screens, body .screens.three, body .screens.feature,
  body .tl-grid, body .pr-grid, body .letter-card, body .pp-grid
    { grid-template-columns: 1fr; }
  body .stats, body .stat-bar, body .hero-stats, body .quick-row,
  body .int-grid, body .logo-grid,
  body .mod-grid, body .nums, body .team-grid, body .int-strip,
  body .badge-grid, body .docs-stats
    { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  body .stats, body .stat-bar, body .hero-stats, body .quick-row, body .int-grid,
  body .mod-grid, body .nums, body .team-grid, body .badge-grid, body .docs-stats
    { grid-template-columns: repeat(2, 1fr); }
  body .logo-grid, body .int-strip { grid-template-columns: repeat(3, 1fr); }
}


/* ===== Small-screen responsiveness hardening (2026-07-22) =====
   body-prefixed so these win over per-page inline <style> base rules. */
@media (max-width: 768px) {
  html, body { overflow-x: clip; }   /* clip, not hidden: never break sticky nav */
}
@media (max-width: 560px) {
  /* Collapse common multi-column containers to one column on phones. grid-template-columns
     is a no-op on non-grid elements, so a broad selector list is safe (false matches do
     nothing); min-width:0 lets grid items shrink below their min-content (the overflow trap). */
  body [class$="-grid"], body [class*="-grid "],
  body [class$="-cols"], body [class*="-cols "],
  body [class$="-row"], body [class*="-row "],
  body [class$="-strip"], body [class*="-strip "],
  body [class*="split"], body [class*="two-col"],
  body [class*="stats"], body [class*="metrics"], body [class*="-cards"] {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
  }
  body [class$="-grid"] > *, body [class*="-grid "] > *,
  body [class$="-cols"] > *, body [class*="-cols "] > *,
  body [class$="-row"] > *, body [class*="-row "] > *,
  body [class$="-strip"] > *, body [class*="-strip "] > *,
  body [class*="split"] > *, body [class*="two-col"] > *,
  body [class*="stats"] > *, body [class*="metrics"] > *, body [class*="-cards"] > * {
    min-width: 0;
  }
}
@media (max-width: 400px) {
  body .container { padding: 0 14px; }
  body .page-head h1 { font-size: 34px; }
  body .page-head .lead { font-size: 16px; }
  body .section-title { font-size: 26px; }
  body .section-title em { font-size: 28px; }
  body .footer-cols { grid-template-columns: 1fr; gap: 20px; }
}


/* ===== Nav fit (2026-07-22) — the 10-item horizontal nav needs ~1430px to fit
   brand + links + CTAs, so it overflowed on tablets and most laptops (821–1400px).
   Collapse to the burger dropdown up to 1024px; compress the horizontal links from
   1025–1520px so they fit. Placed last so it wins the cascade. ===== */
@media (max-width: 1024px) {
  body .nav-burger { display: flex; order: 3; }
  body .nav-cta { gap: 8px; }
  body .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface, #fff); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(10,10,10,0.25);
    padding: 8px 24px 16px; font-size: 16px;
    max-height: 0; overflow: hidden; opacity: 0; pointer-events: none;
    transition: max-height 220ms ease, opacity 160ms ease;
  }
  body .nav.open .nav-links { max-height: 70vh; overflow-y: auto; opacity: 1; pointer-events: auto; }
  body .nav-links a { padding: 14px 4px; font-size: 16px; opacity: 1; border-bottom: 1px solid var(--line); }
  body .nav-links a:last-child { border-bottom: none; }
  body .nav-links a.active { color: var(--accent); }
}
@media (min-width: 1025px) and (max-width: 1520px) {
  body .nav-inner { padding: 0 32px; }
  body .nav-links { gap: 16px; font-size: 13px; }
  body .nav-cta { gap: 10px; }
  body .nav-cta .btn { padding: 10px 16px; font-size: 14px; }
}


/* ===== Button-row wrap (2026-07-22): centered/nowrap CTA rows (.ctas, .*-actions …)
   clipped their 2nd button on phones. flex-wrap is a no-op on non-flex, so broad. ===== */
@media (max-width: 560px) {
  body [class$="ctas"], body [class*="ctas "], body [class$="-actions"],
  body [class$="-buttons"], body [class$="-btns"], body [class*="btn-row"], body .actions {
    flex-wrap: wrap;
  }
}


/* ===== Decorative hex on mobile (2026-07-22) — the faint absolute .bg-hex (opacity .05)
   is positioned off the right edge (right:-180px, width:600px) with a transform; mobile
   Safari doesn't reliably clip a transformed absolute child under overflow:hidden, so it
   bleeds past the viewport and forces horizontal scroll. Hide the decoration on phones. ===== */
@media (max-width: 768px) {
  body .bg-hex { display: none !important; }
}


/* ===== Responsive tables (2026-07-22) — unwrapped wide tables (e.g. careers .roles-table)
   were cut off on phones. Make any table scroll inside its own box instead. ===== */
@media (max-width: 768px) {
  body table, body table[class] { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}


/* ===== Oversized heading cap (2026-07-22) — many pages have 110-200px hero/CTA
   headings with no mobile reduction, so their words ran off-screen on phones (like the
   docs 128px hero). Cap the common patterns fluidly. body-prefixed + descendant so these
   out-specify per-page .x-hero h1{...} rules; clamp scales with viewport. ===== */
@media (max-width: 560px) {
  body [class*="hero"] h1, body [class*="-head"] h1 {
    font-size: clamp(32px, 12vw, 46px) !important; line-height: 1.04; overflow-wrap: anywhere;
  }
  body .final-cta h2, body [class*="final-cta"] h2, body [class*="cta"] h2 {
    font-size: clamp(28px, 11vw, 44px) !important; overflow-wrap: anywhere;
  }
  /* Big display numbers/amounts (stat figures, prices) with no mobile reduction. */
  body [class*="stat"] .num, body .big-stat .num, body [class*="amount"],
  body .ps-num, body [class*="ps-num"], body [class*="big"] .num {
    font-size: clamp(28px, 13vw, 50px) !important; overflow-wrap: anywhere;
  }
}

/* === Phase 1 dark theme — shell components (opt-in via <html data-theme="dark">) ===
   All rules scoped under :root[data-theme="dark"] → inert unless opted in.
   Re-specifies the components that use --ink/--paper as SURFACES (which a bare
   token flip would invert wrong): nav, footer, buttons, section-dark, mobile menu. */
:root[data-theme="dark"] {
  --ink:#ECECEC; --paper:#0E0E11; --warm:#16151A; --cream:#1B1922;
  --mute:#9A9A9A; --line:rgba(255,255,255,0.14); --accent:#8079F2;
}
:root[data-theme="dark"] .nav { background: rgba(14,14,17,0.82); border-bottom-color: rgba(255,255,255,0.10); }
:root[data-theme="dark"] .nav-hex { filter: invert(1); }
:root[data-theme="dark"] .footer { background:#050506; }
:root[data-theme="dark"] .footer .nav-hex { filter:none; }
:root[data-theme="dark"] .section-dark { background:#050506; }
:root[data-theme="dark"] .btn-primary { background:#ECECEC; color:#0E0E11; }
:root[data-theme="dark"] .btn-primary:hover { background:#FFFFFF; }
:root[data-theme="dark"] .btn-ghost { color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] .btn-ghost:hover { background: rgba(255,255,255,0.06); }
:root[data-theme="dark"] body .nav-links { background:#16151A; }
:root[data-theme="dark"] .footer .nav-name { color:#ECECEC !important; }
