/* TESORIN — shared editorial typography and chrome.
   Surface geometry lives in assets/css/surface-system.css and device framing lives
   in assets/css/device-mockup.css. Keep this file focused on type, page rhythm,
   navigation, and buttons. */

:root {
  /* Sized after wealthsimple.com: 128px serif statements, 48px section
     titles, 18px body. */
  --type-display: clamp(52px, 8.9vw, 128px);
  --type-display-home: clamp(56px, 8.9vw, 128px);
  --type-section-xl: clamp(44px, 7.2vw, 104px);
  --type-section-lg: clamp(36px, 5.6vw, 80px);
  --type-section-md: clamp(28px, 3.4vw, 48px);
  --type-card-title: clamp(22px, 2.2vw, 32px);
  --type-lede: var(--text-lede, clamp(19px, 1.7vw, 24px));
  --type-body: 18px;
  --type-body-large: 20px;
  --type-label: 12px;

  --editorial-bg: #fff;
  --editorial-paper: #ffffff;
  --editorial-paper-soft: rgba(255, 255, 255, .72);
  --editorial-ink: #191714;
  --editorial-muted: #716c64;
  --editorial-faint: #9d968c;
  --editorial-line: rgba(11, 11, 11, .095);
  --editorial-line-strong: rgba(11, 11, 11, .14);
  --editorial-peach: var(--accent-terracotta);
  --editorial-peach-soft: var(--accent-terracotta-soft);
  --editorial-gold: var(--accent-olive);
  --editorial-shadow: 0 22px 58px -42px rgba(11, 11, 11, .34);
  --editorial-shadow-soft: 0 14px 40px -34px rgba(11, 11, 11, .28);

  --bg: var(--editorial-bg);
  --bg-2: #fff;
  --bg-3: #fff;
  --paper: var(--editorial-paper);
  --ink: var(--editorial-ink);
  --ink-2: #575149;
  --ink-3: var(--editorial-muted);
  --ink-4: #aaa196;
  --hair: var(--editorial-line);
  --hair-2: var(--editorial-line-strong);
}

html,
body {
  background: var(--editorial-bg);
}

body {
  color: var(--editorial-ink);
  font-size: 18px;
  line-height: 1.5;
}

main :where(h1, h2, h3, h4) {
  text-wrap: balance;
}

main :where(p, li) {
  text-wrap: pretty;
}

/* Editorial headings: serif-led, with the existing wording and hierarchy. */
.display,
.h-xl,
.h-lg,
.pg-head h1,
.legal-head h1,
.spread h2,
.quote,
.box h1 {
  font-family: var(--font-serif, var(--serif)) !important;
  font-style: normal;
  font-weight: 600 !important;
  letter-spacing: -.025em !important;
}

.display {
  max-width: 13.5ch;
  font-size: var(--type-display) !important;
  line-height: .94 !important;
}

/* Keep regular page heroes on the same scale as the pricing page without
   changing each page's existing alignment, width, or placement. */
main > :is(.pg-head, .legal-head) h1.display {
  font-size: var(--text-title) !important;
  line-height: var(--text-title-leading) !important;
}

.hero .display {
  max-width: 12.5ch;
  font-size: var(--type-display-home) !important;
}

.display em.serif,
.display .serif,
.display .serif-em,
.box h1 em {
  font-family: inherit !important;
  font-style: normal !important;
  font-weight: 400 !important;
  letter-spacing: inherit !important;
}

main > .pg-head,
main > .legal-head {
  padding-top: 160px !important;
  background: transparent !important;
  background-image: none !important;
}

.pg-head .micro + .display,
.legal-head .micro + .display {
  margin-top: 22px !important;
}

.display + .lede,
.pg-head .display + .lede,
.legal-head .display + .lede {
  margin-top: 30px !important;
}

.pg-head .hero-actions,
.hero .hero-actions {
  margin-top: 36px !important;
}

.pg-head .hero-meta {
  margin-top: 30px !important;
}

.h-xl {
  max-width: 16ch;
  font-size: var(--type-section-xl) !important;
  line-height: .99 !important;
}

.h-lg {
  max-width: 18ch;
  font-size: var(--type-section-lg) !important;
  line-height: 1.03 !important;
}

.h-md {
  font-size: var(--type-section-md) !important;
  font-weight: 400 !important;
  line-height: 1.1 !important;
  letter-spacing: -.025em !important;
}

.h-sm {
  font-size: clamp(21px, 1.8vw, 26px) !important;
  font-weight: 400 !important;
  line-height: 1.18 !important;
  letter-spacing: -.02em !important;
}

.micro + .h-xl,
.micro + .h-lg,
.micro + .h-md {
  margin-top: 20px !important;
}

.h-xl + .lede,
.h-lg + .lede,
.h-md + .lede {
  margin-top: 24px !important;
}

.lede {
  max-width: 46ch;
  font-size: var(--type-lede) !important;
  font-weight: 400 !important;
  line-height: var(--text-lede-leading, 1.6) !important;
  letter-spacing: -.012em !important;
  color: var(--editorial-ink) !important;
}

.legal-head .lede,
.panel-ink .lede,
.price-board .lede {
  max-width: 50ch;
}

.micro {
  font-family: var(--font-sans, var(--sans)) !important;
  font-size: var(--type-label);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: .12em;
  color: var(--editorial-muted) !important;
}

.quote {
  max-width: 13ch;
  font-size: clamp(38px, 4.8vw, 64px) !important;
  line-height: 1.04 !important;
}

.story-text p {
  font-size: var(--type-body-large) !important;
  line-height: 1.72 !important;
}

.story-text p.lead {
  font-size: clamp(19px, 1.7vw, 22px) !important;
  line-height: 1.55 !important;
  letter-spacing: -.012em !important;
}

.detail h3 {
  max-width: 18ch;
  font-size: clamp(30px, 3.25vw, 44px) !important;
  font-weight: 400 !important;
  line-height: 1.06 !important;
  letter-spacing: -.035em !important;
}

.detail p {
  font-size: var(--type-body) !important;
  line-height: 1.7 !important;
}

.detail-note {
  font-size: 13.5px;
  line-height: 1.65;
}

.detail-label,
.legal-row-label,
.group-title {
  font-size: var(--type-label);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: .11em;
  color: var(--lilac-deep);
}

.spread h2 {
  max-width: 14ch;
  font-size: clamp(42px, 4.8vw, 64px) !important;
  line-height: 1.01 !important;
}

.spread .sub {
  font-family: var(--font-serif, var(--serif)) !important;
  font-size: clamp(20px, 1.8vw, 23px) !important;
  line-height: 1.3 !important;
  font-weight: 500;
}

.spread p:not(.sub) {
  font-size: var(--type-body) !important;
  line-height: 1.68 !important;
}

.spread li,
.detail li {
  font-size: 15.5px;
  line-height: 1.62;
}

.legal-glance .h-xl,
.legal-section > .container > .h-xl {
  max-width: 18ch;
  font-size: clamp(42px, 5.1vw, 68px) !important;
}

.legal-intro {
  max-width: 60ch !important;
  font-size: var(--text-lede) !important;
  line-height: var(--text-lede-leading) !important;
}

.legal-body h3,
.legal-card h3,
.trust-card h3,
.split-cell h3,
.belief h3,
.company-principle h3 {
  font-size: var(--type-card-title) !important;
  font-weight: 400 !important;
  line-height: 1.14 !important;
  letter-spacing: -.025em !important;
}

.legal-body p,
.legal-list li {
  font-size: var(--text-sub) !important;
  line-height: var(--text-sub-leading) !important;
}

.legal-card p,
.trust-card p,
.split-cell p,
.belief p,
.company-principle p {
  font-size: var(--text-sub);
  line-height: var(--text-sub-leading);
}

.panel-ink .h-xl,
.price-board .h-xl {
  max-width: 18ch;
  font-size: clamp(38px, 4.7vw, 62px) !important;
}

.q summary {
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .005em;
  color: var(--editorial-ink);
}

.q .a {
  font-size: var(--text-small);
  line-height: 1.4;
  color: var(--editorial-ink);
}

.official-link .label {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.official-link .detail,
.official-note {
  line-height: 1.65;
}

.box h1 {
  max-width: 12ch;
  font-size: var(--text-title);
  line-height: var(--text-title-leading);
}

.box .lead,
.success-main .lead {
  font-size: var(--text-lede);
  line-height: var(--text-lede-leading);
}

/* Floating, quiet navigation. */
.nav,
.nav.scrolled {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (min-width: 881px) {
  .nav-inner {
    margin-top: 2px;
    padding: 9px 12px 9px 18px;
    border: 1px solid rgba(11, 11, 11, .09);
    border-radius: 999px;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 10px 34px -26px rgba(11, 11, 11, .42);
    backdrop-filter: saturate(140%) blur(18px);
    -webkit-backdrop-filter: saturate(140%) blur(18px);
  }
}

.nav-links a {
  color: #625c54;
}

.nav-links a:hover,
.nav-links a.on {
  color: var(--editorial-ink);
}

.nav-cta,
.btn-primary {
  background: var(--editorial-ink);
  color: #fffdf9;
  border-color: var(--editorial-ink);
  box-shadow: 0 10px 26px -18px rgba(25, 23, 20, .65);
}

.nav-cta:hover,
.btn-primary:hover {
  background: var(--accent-olive);
  transform: translateY(-1px);
}

.btn {
  border-radius: 999px;
  letter-spacing: -.01em;
}

.btn-ghost {
  background: transparent;
  border-color: var(--editorial-line-strong);
  color: var(--editorial-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}

.btn-ghost:hover {
  background: var(--editorial-paper);
  color: var(--editorial-ink);
  border-color: rgba(11, 11, 11, .22);
}

/* Feature navigation colors only; rail geometry lives in features-navigation.css. */
.feature-nav a,
.feature-nav .idx {
  color: var(--editorial-muted);
}

.feature-nav a:hover,
.feature-nav a:focus-visible,
.feature-nav a[aria-current="true"] {
  color: var(--editorial-ink);
}

@media (max-width: 880px) {
  main > .pg-head,
  main > .legal-head {
    padding-top: 136px !important;
  }

  .display,
  .hero .display {
    max-width: 13ch;
    font-size: clamp(48px, 12vw, 70px) !important;
  }

  .h-xl {
    font-size: clamp(40px, 9vw, 58px) !important;
  }

  .h-lg {
    font-size: clamp(34px, 7.6vw, 48px) !important;
  }

  .quote {
    font-size: clamp(36px, 8.5vw, 52px) !important;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  main > .pg-head,
  main > .legal-head {
    padding-top: 126px !important;
  }

  .display,
  .hero .display {
    max-width: 12.5ch;
    font-size: clamp(44px, 13vw, 58px) !important;
    line-height: .97 !important;
  }

  .pg-head .micro + .display,
  .legal-head .micro + .display {
    margin-top: 18px !important;
  }

  .display + .lede,
  .pg-head .display + .lede,
  .legal-head .display + .lede {
    margin-top: 24px !important;
  }

  .h-xl,
  .legal-glance .h-xl,
  .legal-section > .container > .h-xl,
  .panel-ink .h-xl,
  .price-board .h-xl {
    max-width: 15ch;
    font-size: clamp(36px, 10.8vw, 48px) !important;
    line-height: 1.02 !important;
  }

  .h-md {
    font-size: clamp(26px, 7.8vw, 34px) !important;
  }

  .lede {
    max-width: 34ch;
  }

  .detail h3 {
    font-size: clamp(28px, 8.6vw, 38px) !important;
  }

  .spread h2 {
    font-size: clamp(36px, 10vw, 48px) !important;
  }

  .story-text p,
  .detail p {
    font-size: 15.5px !important;
  }

  .spread li,
  .detail li {
    font-size: 16px;
  }

  .official-link .label {
    font-size: 17px;
  }

}
