/* Text sizes stay readable on laptops and phones; spacing can still be fluid. */
:root {
  --type-body: 1rem;
  --type-small: .875rem;
  --type-heading: clamp(1.75rem, 2.3vw, 2.5rem);
}

body { font-size: var(--type-body); line-height: 1.65; }
html { min-width: 0; }

.page :is(.section-lede, .section-head .section-lede, .split-copy p, .panel-card p,
  .check-list li, .step p, .faq details p, .cta-banner p, .proof-item p,
  .featured-case p, .insight-body p.excerpt, .detail-row p, .place-copy p,
  .lead-copy p, .lead-points li, .lead-fit, .case-file-body p, .case-outcome,
  .case-scope li, .legal-body p, .legal-body li, .paid-form-heading p,
  .paid-landing-points li, .paid-landing-shopping-note, .paid-landing-fit,
  .paid-section-heading p, .paid-deliverable p, .paid-evidence-copy > p,
  .paid-evidence-points li, .paid-process-step p, .paid-question-list p,
  .article-author p, .related-articles li, .tool-card p) {
  font-size: var(--type-body);
  line-height: 1.7;
}

.page :is(.section-title, .cta-banner h2, .footer-cta h2) {
  font-size: var(--type-heading);
  line-height: 1.2;
}

.page :is(.service-card h3, .panel-card h3, .insight-card h2, .insight-card h3,
  .step h3, .detail-row h3, .faq summary, .tool-card h3) {
  font-size: 1.125rem;
  line-height: 1.4;
}

.page :is(.service-card p, .stat-label, .chip, .case-count, .date, .breadcrumbs ol,
  .article-meta, .kicker-line, .footer-col h3, .footer-col a, .footer-col p,
  .footer-bottom, .policies a, .legal-updated, .paid-proof-metric span,
  .paid-trust-inner p, .landing-header-note, .paid-section-kicker,
  .paid-evidence-kicker, .paid-landing-eyebrow, .place-badge span) {
  font-size: var(--type-small);
  line-height: 1.6;
}

.page :is(.micro-link, .case-link, .read-more, .text-link, .panel-link,
  .paid-text-link, .tech-row h3) { font-size: .9375rem; line-height: 1.5; }
.page .chip { letter-spacing: .045em; }
.page .service-card p { font-size: 1rem; max-width: 28ch; }
.page :is(.hero-copy p, .page-hero .lede, .paid-landing-lede) { font-size: 1.125rem; line-height: 1.7; }
.page .hero-copy p { width: 100%; max-width: 49ch; }
.home-page .hero-copy { width: min(43vw, 600px); }
.page .hero h1 { font-size: clamp(2.5rem, 3.5vw, 4rem); }
.page .page-hero h1 { font-size: clamp(2.25rem, 3.5vw, 3.75rem); }
.page .article-body { max-width: 760px; }
.page .article-body :is(p, ul, ol, blockquote) { font-size: 1.125rem; line-height: 1.8; }
.page .article-body h2 { font-size: 1.75rem; }
.page .article-body h3 { font-size: 1.375rem; }
.page .article-body :is(table, pre) { max-width: 100%; overflow-x: auto; }
.page .article-body table { display: block; }
.page .article-table { width: 100%; }
.page .article-table th { text-align: left; }
.page .article-figure { padding: 16px; }
.page .article-body :is(code, pre) { font-size: .9375rem; }
.about-page .page .team-bio { font-size: 1rem; line-height: 1.7; }
.about-page .page :is(.team-role, .team-more-link, .about-inline-link) { font-size: .875rem; }
.page .tool-widget-shell :is(.saq__disclaimer, small) { font-size: .875rem; line-height: 1.6; }
.page .button, .page .pill { min-height: 44px; height: auto; padding: 10px 18px; font-size: .9375rem; }
.page .button { white-space: normal; text-align: center; }
.page .tech-row { padding-block: 16px; gap: 16px; grid-template-columns: 110px 1fr; }
.page .tech-row h3::before { margin-right: 8px; }
.page .tech-stack-art { filter: none; box-shadow: none; }

/* Keep the existing navigation and give it room before switching to the menu. */
.site-header { width: min(calc(100% - 48px), 1440px); height: 48px; }
.site-header .brand { min-width: 152px; gap: 10px; }
.site-header .brand-word { font-size: 1.375rem; }
.site-header .brand-mark { width: 30px; height: 30px; filter: none; }
.site-header .nav { gap: 18px; margin-left: 24px; }
.site-header .nav a, .site-header .header-login { font-size: .875rem; line-height: 1.4; }
.site-header .nav-group > a { gap: 5px; }
.site-header .header-actions { gap: 12px; padding-left: 20px; }
.site-header .pill { padding-inline: 14px; font-size: .875rem; }
.site-header .nav-drop a { font-size: .9375rem; min-height: 44px; }
.site-header .icon-btn { width: 44px; height: 44px; }

.theme-toggle {
  display: inline-flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--home-border, #3d526d);
  border-radius: 50%;
  background: var(--home-panel, #152438);
  color: var(--home-text, #f5f8ff);
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--home-accent, #93c5fd); color: var(--home-accent, #93c5fd); }
.theme-toggle:focus-visible { outline: 2px solid var(--home-accent, #93c5fd); outline-offset: 3px; }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle-sun { display: none; }
html[data-home-theme='dark'] .theme-toggle-sun { display: block; }
html[data-home-theme='dark'] .theme-toggle-moon { display: none; }

/* Let longer case descriptions determine the panel height. */
@media (min-width: 901px) {
  .page .featured-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    align-items: center;
    gap: 48px;
    min-height: 480px;
    padding: 40px 96px;
  }
  .page .featured-copy { position: relative; top: auto; left: auto; width: auto; max-width: 320px; }
  .page .featured-case { position: relative; right: auto; bottom: auto; width: 100%; }
}

/* Place mobile carousel controls below the case text. */
@media (max-width: 900px) {
  .page .featured-panel { padding-bottom: calc(var(--carousel-control-size) + 36px); }
  .page .slide-arrow { top: auto; bottom: 18px; transform: none; }
  .page .slide-arrow:is(:hover, :focus-visible) { transform: scale(1.06); }
}

@media (max-width: 1280px) {
  .site-header .header-actions { margin-left: auto; padding-left: 12px; }
  .site-header .header-login { display: none; }
  .site-header .icon-btn { display: inline-flex; }
  .site-header .nav {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(360px, calc(100vw - 48px));
    max-height: calc(100svh - 100px);
    margin: 0;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border: 1px solid var(--home-border, #3d526d);
    border-radius: 10px;
    background: var(--home-panel, #152438);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
  }
  .menu-open .site-header .nav { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
  .site-header .nav a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; font-size: 1rem; }
  .site-header .nav-group { display: block; }
  .site-header .nav-caret { display: none; }
  .site-header .nav-drop {
    position: static;
    min-width: 0;
    margin: 0;
    padding: 0 0 0 16px;
    border: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  .site-header .nav-drop::before { content: none; }
  .site-header .nav-drop a { font-size: .9375rem; }
  .site-header .nav .nav-login-mobile { display: flex; border-top: 1px solid var(--home-border, #3d526d); padding-top: 12px; }
}

@media (max-width: 900px) {
  .home-page .hero { height: auto; min-height: 880px; padding: 120px 24px 300px; }
  .home-page .hero-copy { position: relative; top: auto; left: auto; width: min(100%, 520px); }
  .home-page .home-celestial { top: calc(100% - 230px); width: 140px; }
  .home-page .hero-layer--foreground { top: auto; height: 60%; }
  .home-page .home-day-landscape { top: 40%; }
  .page .hero h1 { font-size: clamp(2.25rem, 7vw, 3rem); }
  .home-page .hero .hero-copy p { font-size: 1rem; }
  .page .tech-row { grid-template-columns: 100px 1fr; }
  .page .service-card p { max-width: none; }
  .page .place-badge span { font-size: .75rem; }
}

@media (max-width: 560px) {
  .site-header { width: calc(100% - 32px); }
  .site-header .brand { min-width: 0; gap: 6px; }
  .site-header .brand-word { font-size: 1.125rem; }
  .site-header .brand-mark { width: 26px; height: 26px; }
  .site-header .header-actions { gap: 8px; padding-left: 8px; }
  .site-header--landing .landing-header-cta { max-width: 144px; min-height: 40px; padding: 6px 10px; white-space: normal; font-size: .8125rem; line-height: 1.3; }
  .site-header--landing .landing-header-cta .icon { display: none; }
  .page .article-body :is(p, ul, ol, blockquote) { font-size: 1.0625rem; }
  .page .tech-row { grid-template-columns: 1fr; gap: 10px; }
}
