/* P1.money typography audit — responsive type and readable UI scale */
:root {
  --p1-type-body: clamp(1rem, .965rem + .16vw, 1.125rem);
  --p1-type-body-sm: clamp(.9375rem, .91rem + .12vw, 1rem);
  --p1-type-ui: clamp(.75rem, .725rem + .1vw, .8125rem);
  --p1-type-micro: clamp(.6875rem, .66rem + .08vw, .75rem);
  --p1-type-lede: clamp(1.125rem, 1.055rem + .34vw, 1.375rem);
  --p1-type-h1: clamp(4.5rem, 10vw, 9.625rem);
  --p1-type-h2: clamp(3.25rem, 6vw, 5.875rem);
  --p1-type-h3: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-size: var(--p1-type-body);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

p,
li,
dd,
input,
textarea,
select {
  font-size: var(--p1-type-body);
  line-height: 1.6;
}

button,
.button,
.nav-cta,
.mobile-menu-toggle,
.site-nav a,
.site-footer nav a,
.badge,
.eyebrow,
.field label,
.case-label,
.metrics-grid span,
.portal-pill,
.portal-back-link,
.portal-card-link,
.auth-message,
.card-num {
  font-size: var(--p1-type-ui) !important;
}

.eyebrow,
.badge,
.field label,
.site-nav,
.site-footer,
.portal-pill,
.portal-back-link,
.portal-card-link {
  letter-spacing: .09em;
}

.hero h1 {
  font-size: var(--p1-type-h1);
  line-height: .82;
}

.pricing-band h2,
.flow-section h2,
.final-cta h2,
.page-hero h1,
.auth-card h1 {
  font-size: var(--p1-type-h2);
  line-height: .9;
}

.hero-lede,
.page-hero p,
.final-cta p {
  font-size: var(--p1-type-lede);
  line-height: 1.5;
}

.card h3,
.portal-section-title h2,
.portal-panel h2,
.portal-empty h2,
.portal-loading h2,
.auth-admin-card h2 {
  font-size: var(--p1-type-h3);
  line-height: 1.12;
}

.price-card h3 {
  font-size: clamp(3rem, 4.5vw, 3.75rem);
  line-height: .95;
}

.case-card strong {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  line-height: 1.08;
}

.metrics-grid strong,
.portal-mini strong,
.auth-case-row strong {
  font-size: clamp(.9375rem, .9rem + .12vw, 1rem);
  line-height: 1.3;
}

.card p,
.price-card p,
.flow-list span,
.page-copy p,
.legal-copy p,
.legal-copy li,
.feature-list li,
.portal-muted,
.portal-sidebar-note,
.portal-card-summary,
.portal-field dd,
.portal-timeline-copy span,
.auth-card p,
.auth-admin-card p,
.notice {
  font-size: var(--p1-type-body);
  line-height: 1.6;
}

.flow-list strong,
.portal-timeline-copy strong,
.portal-card-meta span,
.portal-mini span,
.portal-field dt,
.case-label,
.metrics-grid span {
  font-size: var(--p1-type-micro) !important;
  line-height: 1.25;
}

.button,
.nav-cta,
.mobile-menu-toggle,
.portal-card-link,
.portal-back-link {
  min-height: 48px;
}

.site-footer .footer-legal {
  font-size: clamp(.6875rem, .66rem + .08vw, .75rem) !important;
  line-height: 1.65 !important;
}

input,
textarea,
select {
  font-size: 1rem !important;
  line-height: 1.45 !important;
}

@media (max-width: 980px) {
  :root {
    --p1-type-h1: clamp(3.75rem, 12vw, 7rem);
    --p1-type-h2: clamp(3rem, 8vw, 5rem);
  }
}

@media (max-width: 760px) {
  :root {
    --p1-type-body: 1rem;
    --p1-type-body-sm: .9375rem;
    --p1-type-ui: .75rem;
    --p1-type-micro: .6875rem;
    --p1-type-lede: clamp(1.0625rem, 4.6vw, 1.25rem);
    --p1-type-h1: clamp(3.35rem, 16.5vw, 4.875rem);
    --p1-type-h2: clamp(2.65rem, 12vw, 3.875rem);
    --p1-type-h3: clamp(1.55rem, 7vw, 2rem);
  }

  body {
    font-size: 1rem;
    line-height: 1.55;
  }

  .hero h1,
  .pricing-band h2,
  .flow-section h2,
  .final-cta h2,
  .page-hero h1,
  .auth-card h1 {
    text-wrap: balance;
  }

  .hero-lede,
  .page-hero p,
  .final-cta p,
  .auth-card p,
  .portal-muted,
  .portal-card-summary,
  .portal-field dd {
    font-size: 1rem;
    line-height: 1.58;
  }

  .portal-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .portal-empty,
  .portal-loading {
    order: -1;
  }

  .portal-topbar h1 {
    font-size: clamp(2.65rem, 12vw, 3.25rem) !important;
    line-height: .98;
  }

  .portal-empty h2,
  .portal-loading h2,
  .portal-panel h2,
  .portal-section-title h2 {
    font-size: clamp(1.5rem, 7vw, 2rem) !important;
  }

  .auth-card h1 {
    font-size: clamp(3rem, 14vw, 4.25rem) !important;
  }

  .button,
  .nav-cta,
  .mobile-menu-toggle,
  .portal-card-link,
  .portal-back-link {
    min-height: 48px !important;
    font-size: .75rem !important;
  }

  .site-footer nav a {
    font-size: .6875rem !important;
    min-height: 28px !important;
  }

  .site-footer nav a[href="/portal/"] {
    min-height: 44px !important;
    font-size: .75rem !important;
  }
}

@media (max-width: 380px) {
  :root {
    --p1-type-h1: clamp(3rem, 15.5vw, 4.1rem);
    --p1-type-h2: clamp(2.35rem, 11vw, 3.35rem);
  }

  .hero-lede,
  .page-hero p,
  .final-cta p,
  .auth-card p,
  .portal-muted {
    font-size: .96875rem;
  }

  .button,
  .mobile-menu-toggle,
  .portal-card-link,
  .portal-back-link {
    font-size: .6875rem !important;
  }
}
