:root {
  --text: #f2f2f2;
  --muted: #bcbcbc;
  --dim: #8f8f8f;
  --border2: #343434;
  --border3: #4b4b4b;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  text-rendering: optimizeLegibility;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

nav,
section,
footer,
.hero,
.page-hero,
.cta-section,
.case-study,
.contact-primary,
.response-bar,
.checklist,
.timeline,
.price-enterprise,
.pricing-contact,
.terminal {
  max-width: 100%;
}

.hero-sub,
.page-hero .hero-sub,
.cm-desc,
.ci-detail,
.rb-detail,
.case-desc,
.terminal-body,
.t-line,
.footer-copy {
  overflow-wrap: anywhere;
}

.mobile-nav-toggle,
.mobile-nav-panel {
  display: none;
}

@media (max-width: 768px) {
  :root {
    --text: #f6f6f6;
    --muted: #d0d0d0;
    --dim: #a3a3a3;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  nav {
    min-width: 0;
    padding-right: 12px;
  }

  .nav-brand {
    min-width: 0;
    padding: 0 18px;
    font-size: 0.8rem;
  }

  .nav-brand-mark {
    width: 24px;
    height: 24px;
  }

  .nav-actions {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    align-self: center;
    height: 36px;
    margin-left: 12px;
    padding: 0 14px;
    border: 1px solid var(--border2);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.76rem;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
  }

  .mobile-nav-toggle:hover,
  .mobile-nav-toggle:focus-visible,
  nav[data-mobile-nav-open="true"] .mobile-nav-toggle {
    color: var(--text);
    border-color: var(--border3);
    background: var(--surface);
    outline: none;
  }

  .mobile-nav-toggle-icon {
    font-size: 0.95rem;
    line-height: 1;
  }

  .mobile-nav-panel {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 95;
    display: none;
    max-height: calc(100vh - 52px);
    overflow-y: auto;
    padding: 16px 20px 20px;
    border-bottom: 1px solid var(--border2);
    background: rgba(9, 9, 9, 0.98);
  }

  nav[data-mobile-nav-open="true"] + .mobile-nav-panel {
    display: block;
  }

  .mobile-nav-list {
    display: grid;
    gap: 10px;
    list-style: none;
  }

  .mobile-nav-link,
  .mobile-nav-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border2);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .mobile-nav-link.active {
    border-color: var(--purple);
    background: var(--purple-faint);
  }

  .mobile-nav-primary {
    justify-content: center;
    margin-top: 14px;
    border-color: var(--purple);
    background: var(--purple);
    color: #000;
    font-weight: 700;
  }

  .hero,
  .page-hero,
  section,
  .cta-section,
  .case-study {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .hero {
    min-height: auto !important;
    align-items: flex-start !important;
    gap: 30px !important;
    padding-top: 88px !important;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }

  .btn-primary,
  .btn-outline {
    justify-content: center;
    width: 100%;
  }

  .btn-outline {
    border-left: 1px solid var(--border2);
  }

  .hero-tag,
  .hero-meta {
    white-space: normal;
  }

  .channels-strip {
    display: block !important;
    overflow: visible !important;
  }

  .channels-label {
    padding: 0 0 14px !important;
    margin: 0 !important;
    border-right: none !important;
  }

  .channel-list {
    display: grid !important;
  }

  .channel-pill {
    padding: 14px 16px !important;
    border-left: 1px solid var(--border2) !important;
    white-space: normal !important;
  }

  .terminal-body {
    padding: 16px;
    font-size: 0.82rem;
    line-height: 1.75;
  }

  .t-key {
    display: block;
    min-width: 0 !important;
    margin-bottom: 4px;
  }

  .footer-copy {
    width: 100%;
    padding: 16px 20px !important;
    border-right: none !important;
    color: var(--dim) !important;
  }

  .footer-links {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .footer-links li {
    flex: 1 1 50%;
    min-width: 0;
  }

  .footer-links li a {
    justify-content: center;
    min-height: 48px;
    padding: 14px 16px;
  }

  .footer-links li:nth-last-child(-n + 2) {
    display: none;
  }

  .hero-sub,
  .page-hero .hero-sub,
  .cm-desc,
  .ci-detail,
  .rb-detail,
  .case-desc {
    color: var(--muted) !important;
    font-size: 0.92rem;
  }

  .hero-meta,
  .rb-label,
  .ci-num,
  .t-comment,
  .t-divider,
  .terminal-titlebar {
    color: var(--dim) !important;
  }
}
