/* Global responsive — Credit Risk Dynamics marketing site */

/* ----- Mobile navigation ----- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

header.is-nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

header.is-nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

header.is-nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

body.nav-open {
  overflow: hidden;
}

@media (min-width: 1101px) and (max-width: 1320px) {
  .header {
    padding: 0 32px;
    gap: 12px;
  }

  .nav-link {
    font-size: 10px;
    letter-spacing: 0.12em;
    padding-bottom: 8px;
  }

  .logo-title {
    font-size: 14px;
    letter-spacing: 0.14em;
  }

  .demo,
  .brief {
    height: 40px;
    padding: 0 18px;
    font-size: 10px;
    letter-spacing: 0.14em;
  }
}

@media (max-width: 1100px) {
  .container {
    padding: 0 20px;
  }

  /* Force mobile layout (fixes shrink-to-fit desktop on some phones) */
  header .header nav.nav,
  header .header .header-nav-cluster nav.nav {
    display: none !important;
  }

  header.is-nav-open .header nav.nav,
  header.is-nav-open .header .header-nav-cluster nav.nav {
    display: flex !important;
  }

  .process-wrap {
    grid-template-columns: 1fr !important;
  }

  .header {
    padding: 0 16px;
    height: 72px;
    position: relative;
  }

  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(7, 17, 27, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  header .header {
    position: relative;
  }

  .logo {
    min-width: 0;
    flex: 1;
  }

  .logo-title {
    font-size: 12px;
    letter-spacing: 0.14em;
    line-height: 22px;
  }

  .logo-line {
    height: 40px;
    margin-right: 12px;
  }

  .nav-toggle {
    display: flex;
  }

  nav.nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 140px;
    background: #07111b;
    overflow-y: auto;
  }

  header.is-nav-open nav.nav {
    display: flex;
  }

  nav.nav .nav-link {
    font-size: 13px;
    letter-spacing: 0.16em;
    padding: 18px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-width: 2px;
  }

  nav.nav .nav-link.active {
    border-bottom-color: #d8a23a;
  }

  .header-nav-cluster {
    flex: 0;
    margin-left: 0;
  }

  .header > .right,
  .header-nav-cluster > .right {
    display: none;
  }

  header.is-nav-open .header > .right,
  header.is-nav-open .header-nav-cluster > .right {
    display: flex;
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 151;
    flex-direction: column;
    gap: 12px;
  }

  header.is-nav-open .header > .right .demo,
  header.is-nav-open .header > .right .brief,
  header.is-nav-open .header-nav-cluster > .right .demo,
  header.is-nav-open .header-nav-cluster > .right .brief {
    width: 100%;
    height: 48px;
    justify-content: center;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    max-width: 100%;
  }

  .footer-wrap {
    padding: 0 20px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 40px;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
    row-gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    align-items: center;
  }

  .footer-policy {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 32px;
  }

  .site-footer .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  /* ----- Shared page heroes ----- */
  .platform-hero {
    min-height: auto;
    padding: 88px 0 56px;
    box-sizing: border-box;
  }

  .platform-hero-content {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
    padding-top: 24px;
  }

  .platform-left h1,
  .platform-hero .hero-content h1,
  .hero-content h1 {
    font-size: 40px !important;
    max-width: 100%;
  }

  .platform-left p,
  .hero-description,
  .hero-subtitle {
    max-width: 100%;
    font-size: 17px !important;
    line-height: 1.65 !important;
  }

  .hero-content {
    width: 100%;
    padding-top: 24px;
  }

  .platform-hero .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .platform-section .section-title,
  .platform-cta h2 {
    font-size: 36px !important;
  }

  .why-grid {
    grid-template-columns: 1fr !important;
    gap: 48px;
  }

  .why-left h2 {
    font-size: 38px;
  }

  .page-stub {
    padding: 120px 20px 80px;
  }

  .page-stub h1 {
    font-size: 40px;
  }

  /* ----- Home (index) ----- */
  .hero {
    height: auto;
    min-height: 100svh;
    padding-top: 72px;
    padding-bottom: 48px;
    box-sizing: border-box;
  }

  .hero::after {
    background: linear-gradient(
      180deg,
      #07111b 0%,
      rgba(7, 17, 27, 0.94) 38%,
      rgba(7, 17, 27, 0.78) 100%
    );
  }

  .hero-content {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: calc(100svh - 72px);
    padding: 28px 20px 32px;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .left {
    width: 100%;
    padding-top: 4px;
  }

  .hero h1 {
    font-size: 36px;
    line-height: 1.12;
  }

  .tag {
    letter-spacing: 0.22em;
    margin-bottom: 20px;
    font-size: 10px;
    line-height: 1.5;
  }

  .desc {
    width: 100%;
    margin-top: 28px;
    font-size: 17px;
    line-height: 1.65;
  }

  .buttons {
    flex-direction: column;
    margin-top: 36px;
    gap: 12px;
  }

  .buttons .primary,
  .buttons .secondary {
    width: 100%;
    height: 52px;
  }

  .scroll {
    margin-top: 40px;
  }

  .problem-wrap {
    padding: 0 20px;
  }

  .problem-title {
    font-size: 38px;
    max-width: 100%;
  }

  .process {
    padding: 80px 0;
  }

  .process-wrap {
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .process-left h2 {
    font-size: 38px;
  }

  .process-left p {
    font-size: 16px;
    line-height: 1.7;
  }

  .process-flow {
    flex-direction: column;
    height: auto;
    gap: 16px;
    align-items: center;
  }

  .process-flow .arrow {
    transform: rotate(90deg);
  }

  .process-box.input-box,
  .process-box.engine-box,
  .process-box.output-box {
    width: 100%;
    max-width: 280px;
  }

  .impact {
    padding: 80px 0;
  }

  .impact-wrap {
    width: 100%;
    padding: 0 20px;
  }

  .impact-title {
    width: 100%;
    font-size: 38px;
    margin-bottom: 48px;
  }

  .impact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    column-gap: 0;
  }

  .cta {
    padding: 80px 20px;
  }

  .cta-wrap {
    width: 100%;
    padding: 0;
  }

  .cta h2 {
    font-size: 38px;
  }

  .cta p {
    width: 100%;
    font-size: 17px;
    line-height: 1.65;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
    margin-top: 40px;
    gap: 12px;
  }

  .cta-primary,
  .cta-secondary {
    width: 100%;
  }

  .footer-wrap {
    width: 100%;
  }

  .res-layout {
    flex-direction: column;
    gap: 32px;
  }

  .res-sidebar {
    position: static;
    flex: none;
    width: 100%;
  }

  .res-hero h1 {
    font-size: 2rem;
  }

  .api-docs-shell {
    grid-template-columns: 1fr;
    padding: 0 20px 48px;
  }

  .api-nav {
    position: static;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    max-height: none;
    padding: 24px 0;
  }

  .api-docs-hero h1 {
    font-size: 2rem;
  }

  .api-endpoint-row {
    flex-direction: column;
  }

  .resources-page,
  .api-docs-page {
    padding-top: 72px;
  }
}

@media (max-width: 480px) {
  .footer-links {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 32px;
  }

  .problem-tag,
  .impact-tag,
  .cta small {
    letter-spacing: 0.28em;
    font-size: 11px;
  }
}
