/* ════════════════════════════════════════════════
   RESPONSIVE — ANED LLM
   Breakpoints:
     ≥ 2560px : 4K / ultrawide      — scale up
     ≤ 1440px : large laptop        — minor tweaks
     ≤ 1024px : tablet landscape    — tighten grids & padding
     ≤  768px : tablet portrait     — mobile nav, single-col, vertical panels
     ≤  480px : large phone         — reduced spacing, full-width buttons
     ≤  375px : small phone         — minimal spacing
════════════════════════════════════════════════ */

/* ── ALWAYS: hide hamburger on desktop ────── */
.nav-hamburger { display: none; }

/* ════════════════════════════════════════════════
   SITE FOOTER (all pages except desktop homepage)
════════════════════════════════════════════════ */
.site-footer {
  text-align: center;
  padding: 48px 32px;
}
.sf-inner {
  max-width: 820px;
  margin: 0 auto;
}
.sf-logo {
  font-family: var(--font-d);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}
.sf-logo span { color: var(--orange); }
.site-footer p {
  font-size: 16px;
  line-height: 1.7;
}

/* ── Research page sections ────────────────── */
.res-pillars-5 { grid-template-columns: repeat(5, 1fr); gap: 28px; }
.res-section {
  padding: 72px clamp(160px, 16vw, 280px);
}
.res-section-dark {
  background: var(--navy);
  color: var(--cream);
}
.res-section-light {
  background: var(--cream-l);
  color: var(--navy);
}
.site-footer a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}

/* Dark footer (on light pages: research, pricing, contact) */
.footer-dark {
  background: var(--navy-d);
  color: var(--cream);
}
.footer-dark .sf-logo { color: var(--cream); }
.footer-dark p { color: var(--slate); }
.footer-dark a:hover { color: var(--cream); }

/* Light footer (on dark pages: agents, security, solutions) */
.footer-light {
  background: var(--cream-l);
  color: var(--navy);
}
.footer-light .sf-logo { color: var(--navy); }
.footer-light p { color: var(--slate-d); }
.footer-light a:hover { color: var(--navy); }

/* ── Light subpage overrides (agents, security, solutions) ── */
#agents.subpage .btn-ghost,
#security.subpage .btn-ghost,
#solutions.subpage .btn-ghost {
  border-color: rgba(23,42,57,.2);
  color: var(--navy);
}
#agents.subpage .btn-ghost:hover,
#security.subpage .btn-ghost:hover,
#solutions.subpage .btn-ghost:hover {
  border-color: rgba(23,42,57,.5);
  background: rgba(23,42,57,.05);
}
#agents.subpage .eyebrow,
#security.subpage .eyebrow,
#solutions.subpage .eyebrow {
  color: var(--orange);
}
#agents.subpage .section-title,
#security.subpage .section-title,
#solutions.subpage .section-title {
  color: var(--navy);
}
#agents.subpage .ag-hero,
#security.subpage .sec-hero {
  border-bottom-color: rgba(23,42,57,.07);
}

/* Hide footer on desktop homepage (horizontal scroll) */
.home-footer { display: none; }

/* ════════════════════════════════════════════════
   4K / VERY LARGE (≥ 2560px)
════════════════════════════════════════════════ */
@media (min-width: 2560px) {
  html { font-size: 19px; }

  nav { padding: 0 80px; height: 72px; }
  .nav-links li a { height: 72px; line-height: 72px; font-size: 15px; }
  .subpage { padding-top: 72px; }
  .panel   { padding-top: 72px; }

  /* Hero */
  .hero-h1    { font-size: 156px; }
  .hero-h2    { font-size: 76px; }
  .hero-sub   { font-size: 22px; max-width: 620px; }
  .hero-lang-phrase { font-size: 40px; }
  .hero-divider { height: 640px; }

  /* Section headings */
  .section-title,
  .intel-title,
  .ph-name,
  .narr-problem-title { font-size: 64px; }

  /* CTA panel */
  .cta-title { font-size: 136px; }
  .cta-sub   { font-size: 42px; }

  /* Stats */
  .nstat-n { font-size: 64px; }
  .ss-num  { font-size: 72px; }

  /* Panels — increase max padding for 4K real-estate */
  .p-hero    { padding: 80px clamp(200px, 14vw, 380px) 100px clamp(220px, 18vw, 420px); }
  .p-models  { padding: 80px clamp(120px, 10vw, 220px) 100px clamp(220px, 18vw, 420px); gap: 52px; }
  .p-langs   { padding: 80px clamp(120px, 10vw, 220px) 80px  clamp(220px, 18vw, 420px); gap: 44px; }
  .p-cta     { padding: 100px clamp(120px, 10vw, 220px); }

  .narr-left  { padding: 80px 80px 80px clamp(200px, 18vw, 420px); }
  .narr-right { padding: 72px clamp(200px, 18vw, 420px) 72px 80px; }

  .intel-l { padding: 80px 80px 80px clamp(220px, 18vw, 420px); }
  .intel-r { padding: 80px clamp(120px, 10vw, 220px) 80px 80px; }

  .prod-half          { padding: 80px 80px 80px clamp(220px, 18vw, 420px); }
  .prod-half:last-child { padding: 80px clamp(120px, 10vw, 220px) 80px 80px; }

  .models-row { gap: 80px; }

  /* Agents / Security / Research / Pricing / Solutions / Contact */
  .ag-hero  { padding: 100px clamp(200px, 14vw, 380px); gap: 80px; }
  .sec-hero { padding: 100px clamp(200px, 14vw, 380px); gap: 80px; }
  .ag-feats, .ag-handles, .sec-caps,
  .res-hero, .res-principles, .res-steps,
  .sol-hero, .sol-cta { padding-left: clamp(200px, 14vw, 380px); padding-right: clamp(200px, 14vw, 380px); }
  .pricing-hero { padding-left: clamp(200px, 14vw, 380px); padding-right: clamp(200px, 14vw, 380px); }
  .pricing-section { padding-left: clamp(200px, 14vw, 380px); padding-right: clamp(200px, 14vw, 380px); }
  .ct-l { padding-left: clamp(220px, 18vw, 420px); }
  .ct-r { padding-left: clamp(140px, 12vw, 260px); padding-right: clamp(140px, 12vw, 260px); }
}

/* ════════════════════════════════════════════════
   LARGE LAPTOP (≤ 1440px)
════════════════════════════════════════════════ */
@media (max-width: 1440px) {
  /* clamp() already handles this range well.
     Only tighten pages where clamp max is still too wide. */
  .ag-hero  { padding: 80px clamp(80px, 9vw, 180px); gap: 56px; }
  .sec-hero { padding: 80px clamp(80px, 9vw, 180px); gap: 56px; }
}

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

  /* ─ Navigation ─ */
  nav { padding: 0 28px; }
  .nav-links li a { padding: 0 13px; font-size: 13px; }
  .nav-cta { margin-left: 16px; padding: 9px 16px; font-size: 13px; }

  /* ─ 4-col → 2-col ─ */
  .models-row   { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .handles-grid { grid-template-columns: repeat(2, 1fr); }
  .langs-grid   { grid-template-columns: repeat(2, 1fr); }
  .sec-stats    { padding: 56px 52px; grid-template-columns: repeat(2, 1fr); }

  /* ─ 3-col → 2-col ─ */
  .ag-feats       { padding: 60px 52px; grid-template-columns: repeat(2, 1fr); }
  .sol-grid       { grid-template-columns: repeat(2, 1fr); margin: 0 52px; }
  .res-principles { padding: 60px 52px; grid-template-columns: repeat(2, 1fr) !important; }
  .bench-grid     { grid-template-columns: repeat(2, 1fr); }
  .partner-cats   { grid-template-columns: 1fr 1fr; gap: 24px; }
  .pay-rails      { grid-template-columns: repeat(3, 1fr); }
  .pub-grid       { grid-template-columns: 1fr; }

  /* ─ Reduce hero horizontal padding ─ */
  .p-hero   { padding: 60px 52px 80px 64px; }
  .p-models { padding: 60px 52px 80px 64px; gap: 36px; }
  .p-langs  { padding: 60px 52px 60px 64px; gap: 28px; }
  .p-cta    { padding: 80px 52px; }

  .narr-left  { padding: 64px 48px 64px 64px; }
  .narr-right { padding: 56px 64px 56px 48px; }

  .intel-l { padding: 64px 48px 64px 64px; }
  .intel-r { padding: 64px 64px 64px 48px; }

  .prod-half          { padding: 64px 48px 64px 64px; }
  .prod-half:last-child { padding: 64px 64px 64px 48px; }

  /* ─ Subpages ─ */
  .ag-hero    { padding: 80px 52px; gap: 40px; }
  .ag-handles { padding: 60px 52px; }
  .sec-hero   { padding: 80px 52px; gap: 40px; }
  .sec-caps   { padding: 60px 52px; }
  .res-hero   { padding: 60px 52px; }
  .res-steps  { padding: 60px 52px; gap: 52px; }
  .pricing-hero { padding: calc(60px + 64px) 52px 80px; }
  .pricing-section { padding-left: 52px; padding-right: 52px; }
  .pc-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .sol-hero { padding: 60px 52px; }
  .sol-cta  { padding: 52px 52px; }
  .ct-l { padding: 64px 52px; }
  .ct-r { padding: 60px 52px; }

  /* ─ Hero decorative ─ */
  .hero-divider    { height: 400px; }
  .hero-lang-strip { left: calc(50% + 200px); }
  .hero-lang-phrase { font-size: clamp(17px, 2.2vw, 26px); }
  .hero-group-badge { left: 52px; }
}

/* ════════════════════════════════════════════════
   TABLET PORTRAIT / MOBILE (≤ 768px)
════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ─ Navigation ─ */
  nav {
    padding: 0 20px;
    height: 60px;
  }
  .subpage { padding-top: 60px; }
  .panel   { padding-top: 60px; }

  .nav-logo { font-size: 24px; }
  .nav-links { display: none; }
  .nav-cta   { display: none; }

  /* Hamburger icon */
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 1002;
  }
  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--cream);
    border-radius: 2px;
    transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1),
                opacity  .25s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
  }

  /* ── OPEN STATE ─────────────────────────────── */

  /* Lock body scroll */
  body.nav-open { overflow: hidden !important; height: 100vh !important; }

  /* Expand nav to full-screen overlay */
  body.nav-open nav {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    height: 100%;
    flex-wrap: wrap;
    align-content: flex-start;
    background: var(--navy-d);
    overflow-y: auto;
    padding: 0 24px;
  }

  /* Keep logo + hamburger in a row at the top */
  body.nav-open .nav-logo {
    height: 60px;
    display: flex;
    align-items: center;
  }

  /* Hamburger X animation */
  body.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  body.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Show nav links as vertical list below the header row */
  body.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 20px 0 0;
    gap: 0;
    border-top: 1px solid rgba(233,228,224,.08);
  }
  body.nav-open .nav-links li { list-style: none; }
  body.nav-open .nav-links li a {
    display: block;
    height: auto;
    line-height: 1.2;
    padding: 18px 0;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: .04em;
    color: var(--cream);
    border-bottom: 1px solid rgba(233,228,224,.07);
    transition: color .2s;
  }
  body.nav-open .nav-links li a::after { display: none; }
  body.nav-open .nav-links li a:hover  { color: var(--orange); }

  /* Show the real CTA button in the mobile menu */
  body.nav-open .nav-cta {
    display: inline-block;
    width: auto;
    margin: 28px 0 48px;
    padding: 16px 32px;
    background: var(--orange);
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: center;
    border-radius: 2px;
  }
  body.nav-open .nav-cta:hover { background: var(--orange-d); }

  /* ─ Body & page system — kill all horizontal overflow ─ */
  html         { overflow-x: hidden; overflow-y: auto; }
  body         { overflow-x: hidden; overflow-y: auto; height: auto; width: 100%; }
  .page        { width: 100%; max-width: 100%; }
  .subpage     { max-width: 100%; overflow-x: hidden; }

  /* ─ Horizontal scroll → vertical stack ─ */
  #home        { overflow: visible; height: auto; max-width: 100%; }
  .h-scroll    {
    flex-direction: column;
    width: 100% !important;
    max-width: 100%;
    height: auto;
    transform: none !important;
    transition: none !important;
  }
  .panel       { width: 100%; max-width: 100%; height: auto; min-height: 100svh; flex-shrink: unset; overflow-x: hidden; }

  /* Clamp any overflowing children */
  .cta-use-strip { overflow: hidden; }
  .hero-lang-phrase { white-space: normal; }
  .p-hero::before  { display: none; }
  .p-langs::before { display: none; }
  .p-cta::before   { display: none; }
  .blob            { display: none; }

  /* Hide horizontal-scroll chrome */
  .panel-dots    { display: none; }
  .panel-counter { display: none; }
  .scroll-hint   { display: none; }
  .s-stamp       { display: none; }

  /* Keep home footer hidden on mobile too */

  /* ─ Hero panel ─ */
  .p-hero {
    padding: 80px 24px 36px;
    justify-content: center;
    min-height: auto;
  }
  .hero-divider    { display: none; }
  .hero-lang-strip { display: none; }
  .hero-group-badge { display: none; }
  .hero-h2   { margin-bottom: 24px; }
  .hero-sub  { font-size: 15px; max-width: 100%; margin-bottom: 24px; }
  .hero-actions { flex-wrap: wrap; gap: 12px; }
  .cta-use-strip { flex-wrap: wrap; justify-content: flex-start; }

  /* ─ Narrative panel ─ */
  .p-narrative { grid-template-columns: 1fr; height: auto; }
  .narr-left   { padding: 52px 24px; border-right: none; border-bottom: 1px solid rgba(233,228,224,.07); }
  .narr-right  { padding: 52px 24px; }
  .narr-stats  { flex-wrap: wrap; gap: 20px; padding-top: 16px; }
  .nstat       { padding: 0; }
  .nstat-div   { display: none; }

  /* ─ Models panel ─ */
  .p-models   { padding: 52px 24px 64px; gap: 28px; }
  .models-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .models-wrap { margin-top: 16px; }

  /* ─ Simba row ─ */
  .simba-row {
    flex-wrap: wrap;
    padding: 18px 20px;
    gap: 8px 12px;
  }
  .simba-row svg { flex-shrink: 0; }
  .simba-row .s-label {
    white-space: normal;
    font-size: 12px;
    letter-spacing: .1em;
  }
  .simba-row .s-desc {
    width: 100%;
    font-size: 13px;
    line-height: 1.6;
  }

  /* ─ Products panel ─ */
  .p-products { grid-template-columns: 1fr; height: auto; }
  .prod-half  {
    padding: 52px 24px;
    border-right: none;
    border-bottom: 1px solid rgba(23,42,57,.07);
  }
  .prod-half:last-child { padding: 52px 24px; border-bottom: none; }

  /* ─ Languages panel ─ */
  .p-langs   { padding: 52px 24px; gap: 24px; }
  .langs-top { flex-direction: column; gap: 16px; align-items: flex-start; }
  .langs-grid { grid-template-columns: repeat(2, 1fr); }

  /* ─ Intelligence panel ─ */
  .p-intel { grid-template-columns: 1fr; }
  .intel-l {
    padding: 52px 24px;
    border-right: none;
    border-bottom: 1px solid rgba(23,42,57,.07);
  }
  .intel-r  { padding: 52px 24px; }
  .comp-grid { grid-template-columns: 1fr; }

  /* ─ CTA panel ─ */
  .p-cta { padding: 72px 24px; }
  .cta-btns  { flex-wrap: wrap; gap: 12px; justify-content: center; }
  .cta-links { gap: 16px; }

  /* ─ Before/After panel ─ */
  .p-before   { grid-template-columns: 1fr; }
  .pba-before {
    padding: 52px 24px;
    border-right: none;
    border-bottom: 1px solid rgba(233,228,224,.07);
  }
  .pba-after  { padding: 52px 24px; }
  .pba-connector { display: none; }

  /* ─ Agents page ─ */
  .ag-hero {
    grid-template-columns: 1fr;
    padding: 52px 24px;
    min-height: auto;
    gap: 32px;
  }
  .ag-feats   { padding: 52px 24px; grid-template-columns: 1fr; }
  .ag-handles { padding: 52px 24px; }
  .handles-grid { grid-template-columns: repeat(2, 1fr); }

  /* ─ Security page ─ */
  .sec-hero {
    grid-template-columns: 1fr;
    padding: 52px 24px;
    min-height: auto;
    gap: 32px;
  }
  .threat-matrix { grid-template-columns: repeat(2, 1fr); }
  .sec-stats { padding: 44px 24px; grid-template-columns: repeat(2, 1fr); }
  .sec-caps  { padding: 52px 24px; }
  .sc-grid   { grid-template-columns: 1fr; }

  /* ─ Research page ─ */
  .res-hero       { padding: 52px 24px; min-height: auto; }
  .res-principles { padding: 52px 24px; grid-template-columns: 1fr !important; gap: 24px; }
  .res-pillars-5  { grid-template-columns: 1fr !important; }
  .res-section    { padding: 52px 24px; }
  .bench-grid     { grid-template-columns: 1fr; }
  .partner-cats   { grid-template-columns: 1fr; gap: 20px; }
  .pay-rails      { grid-template-columns: 1fr; }
  .pub-grid       { grid-template-columns: 1fr; }
  .token-table th, .token-table td { padding: 10px 12px; font-size: 13px; }
  .res-steps      { padding: 52px 24px; grid-template-columns: 1fr; gap: 40px; }

  /* ─ Pricing page ─ */
  .pricing-hero { padding: calc(52px + 60px) 24px 56px; }
  .pricing-section { padding: 0 24px !important; }
  .pc-grid { grid-template-columns: 1fr !important; }
  .pc.feat { transform: none; }
  .pc.feat:hover { transform: translateY(-6px); }

  /* ─ Solutions page ─ */
  .sol-hero { padding: 52px 24px; min-height: auto; }
  .sol-grid { grid-template-columns: 1fr; margin: 0 24px; }
  .sol-cta  { padding: 52px 24px; }

  /* ─ Contact page ─ */
  .contact-wrap { grid-template-columns: 1fr; }
  .ct-l { padding: 52px 24px; }
  .ct-r { padding: 52px 24px; }
  .form-row { grid-template-columns: 1fr; }

  /* ─ Pricing disclaimer & footer links ─ */
  .pricing-disclaimer {
    padding: 28px 24px !important;
    text-align: left !important;
  }
  .site-footer-links {
    padding: 28px 24px !important;
    gap: 12px 20px !important;
    justify-content: flex-start !important;
  }
}

/* ════════════════════════════════════════════════
   LARGE PHONE (≤ 480px)
════════════════════════════════════════════════ */
@media (max-width: 480px) {
  nav { padding: 0 16px; }
  .nav-logo { font-size: 22px; }

  body.nav-open nav { padding: 0 16px; }
  body.nav-open .nav-links li a { font-size: 18px; padding: 16px 0; }
  body.nav-open .nav-cta { margin: 24px 0 40px; }

  /* Collapse remaining 2-col grids → 1-col */
  .models-row    { grid-template-columns: 1fr; }
  .langs-grid    { grid-template-columns: 1fr; }
  .handles-grid  { grid-template-columns: 1fr; }
  .threat-matrix { grid-template-columns: 1fr; }

  /* Reduce panel padding */
  .p-hero  { padding: 72px 16px 28px; }
  .p-models { padding: 40px 16px 56px; }
  .p-langs  { padding: 40px 16px; }
  .p-cta    { padding: 56px 16px; }
  .narr-left, .narr-right { padding: 40px 16px; }
  .prod-half, .prod-half:last-child { padding: 40px 16px; }
  .intel-l, .intel-r { padding: 40px 16px; }
  .pba-before, .pba-after { padding: 40px 16px; }

  /* Subpages */
  .ag-hero, .ag-feats, .ag-handles { padding: 40px 16px; }
  .sec-hero, .sec-caps { padding: 40px 16px; }
  .sec-stats { padding: 36px 16px; }
  .res-hero, .res-principles, .res-steps, .res-section { padding: 40px 16px; }
  .pricing-hero { padding: calc(40px + 60px) 16px 48px; }
  .pricing-section { padding: 0 16px !important; }
  .sol-hero, .sol-cta { padding: 40px 16px; }
  .sol-grid { margin: 0 16px; }
  .ct-l, .ct-r { padding: 40px 16px; }

  .pricing-disclaimer { padding: 24px 16px !important; }
  .site-footer-links  { padding: 24px 16px !important; }

  /* Buttons — auto width, centered where needed */
  .btn-primary, .btn-ghost {
    justify-content: center;
    padding: 14px 24px;
    text-align: center;
  }
  .hero-actions { flex-wrap: wrap; }
  .cta-btns     { flex-wrap: wrap; justify-content: center; }

  /* Stats */
  .ss-num  { font-size: 44px; }
  .nstat-n { font-size: clamp(28px, 8vw, 44px); }
}

/* ════════════════════════════════════════════════
   SMALL PHONE (≤ 375px)
════════════════════════════════════════════════ */
@media (max-width: 375px) {
  nav { height: 56px; padding: 0 14px; }
  .subpage, .panel { padding-top: 56px; }
  body.nav-open nav { padding: 0 14px; }
  body.nav-open .nav-logo { height: 56px; }
  body.nav-open .nav-links li a { font-size: 17px; padding: 14px 0; }
  body.nav-open .nav-cta { margin: 20px 0 36px; }

  .nav-logo { font-size: 20px; }
  .nav-hamburger { width: 36px; height: 36px; }

  /* Panel padding — minimal */
  .p-hero  { padding: 64px 14px 24px; }
  .p-models { padding: 28px 14px 48px; }
  .p-langs  { padding: 28px 14px; }
  .p-cta    { padding: 48px 14px; }
  .narr-left, .narr-right { padding: 32px 14px; }
  .prod-half, .prod-half:last-child { padding: 32px 14px; }
  .intel-l, .intel-r { padding: 32px 14px; }
  .pba-before, .pba-after { padding: 32px 14px; }

  .ag-hero, .ag-feats, .ag-handles { padding: 32px 14px; }
  .sec-hero, .sec-caps, .sec-stats { padding: 32px 14px; }
  .res-hero, .res-principles, .res-steps, .res-section { padding: 32px 14px; }
  .pricing-hero { padding: calc(32px + 56px) 14px 40px; }
  .pricing-section { padding: 0 14px !important; }
  .sol-hero, .sol-cta { padding: 32px 14px; }
  .sol-grid { margin: 0 14px; }
  .ct-l, .ct-r { padding: 32px 14px; }

  .pricing-disclaimer { padding: 20px 14px !important; }
  .site-footer-links  { padding: 20px 14px !important; }

  /* Tighten small elements */
  .simba-row { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
  .models-row { gap: 8px; }
  .hero-group-badge { font-size: 9px; left: 14px; }
  .cta-title { letter-spacing: -.03em; }
}
