:root {
  --page: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #eceef3;
  --ink: #1d1d1f;
  --muted: #62636a;
  --quiet: #7b7d85;
  --line: rgba(29, 29, 31, .12);
  --blue: #3568ed;
  --blue-dark: #2451c7;
  --blue-soft: #e9efff;
  --green: #087b5a;
  --green-soft: #e7f7f1;
  --amber: #8b5a00;
  --amber-soft: #fff6dc;
  --red: #b4232b;
  --red-soft: #fff0f0;
  --shadow: 0 24px 70px -42px rgba(18, 25, 45, .38);
  --radius: 22px;
  --radius-sm: 14px;
  --shell: 1120px;
  --content: 760px;
  --pad: clamp(20px, 5vw, 48px);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--sans);
  font-size: clamp(1rem, .97rem + .14vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 2%, rgba(53, 104, 237, .11), transparent 30rem),
    linear-gradient(rgba(29, 29, 31, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 29, 31, .025) 1px, transparent 1px);
  background-size: auto, 64px 64px, 64px 64px;
  mask-image: linear-gradient(#000 0 38rem, transparent 68rem);
}

img, svg { display: block; max-width: 100%; }
a { color: var(--blue-dark); text-underline-offset: .16em; }
a:hover { color: var(--blue); }
p, ul, ol { margin: 0 0 1.2rem; }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: .48rem; }
strong { font-weight: 680; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  line-height: 1.08;
  letter-spacing: -.027em;
}

h1 { font-size: clamp(2.65rem, 7.4vw, 5.7rem); letter-spacing: -.052em; }
h2 { font-size: clamp(2rem, 4.8vw, 3.55rem); }
h3 { font-size: clamp(1.2rem, 2.1vw, 1.55rem); letter-spacing: -.018em; }
h4 { font-size: 1rem; letter-spacing: -.008em; }

:focus-visible {
  outline: 3px solid rgba(53, 104, 237, .55);
  outline-offset: 3px;
  border-radius: 5px;
}

::selection { color: #fff; background: var(--blue); }

.shell {
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 9px;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform .18s ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 245, 247, .87);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.nav-row {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}

img.brand-mark { width: 29px; height: 29px; border-radius: 7px; }
.brand-mark:not(img) { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(53,104,237,.14); }
.brand-text { font-weight: 720; letter-spacing: -.025em; font-size: 1.17rem; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(15px, 2.2vw, 28px);
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  white-space: nowrap;
}

.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

.nav-cta {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  font-weight: 670;
  font-size: .9rem;
  white-space: nowrap;
}

.nav-cta:hover { color: #fff; background: var(--blue-dark); }

.mobile-nav { display: none; margin-left: auto; position: relative; }
.mobile-nav summary {
  min-width: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 650 .78rem var(--mono);
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav > div, .mobile-nav > nav {
  position: fixed;
  top: 76px;
  left: 14px;
  right: 14px;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow);
  max-height: calc(100dvh - 92px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-nav a { min-height: 46px; display: flex; align-items: center; padding: 8px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; }
.mobile-nav a:hover { background: var(--surface-soft); }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin: 0;
  padding-top: 20px;
  color: var(--quiet);
  font-size: .83rem;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs [aria-current="page"] { color: var(--ink); }
.breadcrumbs > [aria-hidden="true"] { color: #a0a1a7; }
.breadcrumbs > a + [aria-current="page"]::before { content: "/"; color: #a0a1a7; margin-right: .45rem; }

.page-hero {
  padding: clamp(54px, 9vw, 112px) 0 clamp(62px, 10vw, 122px);
  overflow: hidden;
}

.page-hero .shell { position: relative; }
.page-hero .shell::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: var(--pad);
  top: -42px;
  border: 1px solid rgba(53,104,237,.16);
  border-radius: 50%;
  box-shadow: 0 0 0 46px rgba(53,104,237,.04), 0 0 0 92px rgba(53,104,237,.025);
  pointer-events: none;
}

.page-hero h1 { max-width: 920px; position: relative; z-index: 1; }
.page-hero h1 em { color: var(--blue); font-style: normal; }

.eyebrow, .kicker {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1.15rem;
  color: var(--blue-dark);
  font: 680 .72rem/1.2 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow::before, .kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; }

.lede {
  max-width: 740px;
  margin: clamp(22px, 3vw, 32px) 0 0;
  color: var(--muted);
  font-size: clamp(1.12rem, 1.4vw, 1.3rem);
  line-height: 1.58;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font: 670 .95rem/1 var(--sans);
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button-primary:hover { color: #fff; background: var(--blue-dark); }
.button-secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { color: var(--blue-dark); border-color: rgba(53,104,237,.45); }

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}
.meta-strip > * {
  display: inline-flex;
  align-items: center;
  min-height: 33px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.65);
  font: 560 .76rem var(--mono);
}

.section { padding: clamp(68px, 10vw, 120px) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: var(--content); margin-bottom: clamp(32px, 5vw, 54px); }
.section-head p { max-width: 680px; margin: 1rem 0 0; color: var(--muted); font-size: 1.06rem; }
.section > .shell > p:not([class]), .section article > p { max-width: var(--content); }

.grid { display: grid; gap: clamp(15px, 2.2vw, 24px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  min-width: 0;
  padding: clamp(22px, 3.6vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.section-alt .card { background: var(--page); box-shadow: none; }
.card h2, .card h3, .card h4 { margin-bottom: .8rem; }
.card p:last-child, .card ul:last-child, .card ol:last-child { margin-bottom: 0; }
.card p { color: var(--muted); }
.card-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 12px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font: 700 .82rem var(--mono);
}

.notice {
  max-width: var(--content);
  padding: 20px 22px;
  border: 1px solid rgba(139, 90, 0, .25);
  border-left: 4px solid #d99a20;
  border-radius: 6px var(--radius-sm) var(--radius-sm) 6px;
  color: #644b16;
  background: var(--amber-soft);
}
.notice strong { color: #4f3a0d; }
.notice p:last-child { margin-bottom: 0; }
.grid + .notice, .steps + .notice { margin-top: 30px; }
.notice + p { margin-top: 1rem; }
.notice.danger { border-color: rgba(180,35,43,.22); border-left-color: var(--red); color: #7b2328; background: var(--red-soft); }
.notice.success { border-color: rgba(8,123,90,.2); border-left-color: var(--green); color: #075f47; background: var(--green-soft); }

.steps { display: grid; gap: 16px; counter-reset: step; }
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.step::before {
  content: counter(step, decimal-leading-zero);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-radius: 50%;
  font: 700 .76rem var(--mono);
}
.step h3 { margin-bottom: .55rem; }
.step p:last-child { margin-bottom: 0; color: var(--muted); }
.step > div:first-child:not(:last-child) { display: none; }
.step > div:nth-child(2) { min-width: 0; }

.check-list, .link-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 1.75rem; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 800; }
.link-list li { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.link-list li:first-child { padding-top: 0; }
.link-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.link-list a { font-weight: 650; }

.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.related-grid a {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 22px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.related-grid a:hover { border-color: rgba(53,104,237,.45); box-shadow: var(--shadow); }
.related-grid > a > span { color: var(--blue-dark); font: 650 .78rem var(--mono); }

.cta-band {
  margin: clamp(30px, 6vw, 80px) auto;
  padding: clamp(30px, 5vw, 56px);
  color: #fff;
  background: #18244a;
  border-radius: clamp(20px, 3vw, 32px);
  overflow: hidden;
  position: relative;
}
.cta-band::after { content: ""; position: absolute; width: 270px; height: 270px; right: -70px; top: -110px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 44px rgba(255,255,255,.035), 0 0 0 88px rgba(255,255,255,.025); }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { max-width: 760px; }
.cta-band p { max-width: 680px; margin: 1rem 0 1.5rem; color: rgba(255,255,255,.74); }
.cta-band .button-secondary { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 15px 17px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--ink); background: var(--surface-soft); font-size: .83rem; }
td { color: var(--muted); }
tr:last-child td { border-bottom: 0; }

.formula { display: block; overflow-x: auto; padding: 14px 16px; border-radius: 10px; color: #204485; background: var(--blue-soft); font: 600 .86rem/1.5 var(--mono); }

form { margin: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; font-weight: 750; font-size: 1.05rem; }
label { display: block; margin-bottom: .45rem; font-weight: 670; }
input, select, textarea, button { font: inherit; }
input[type="number"], input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(29,29,31,.25);
  border-radius: 10px;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(53,104,237,.16); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-field small { display: block; margin-top: .4rem; color: var(--quiet); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.field-error { display: block; min-height: 1.4em; margin-top: .4rem; color: var(--red); font-size: .86rem; }

.calculator-result, .result-panel {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid rgba(53,104,237,.23);
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
}
.calculator-result { min-height: 152px; }
.calculator-result h3, .result-panel h3 { margin-bottom: .7rem; }
.calculator-result output, .result-panel output { display: block; color: #183d9d; font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 780; line-height: 1.1; letter-spacing: -.04em; }
.calculator-result p:last-child, .result-panel p:last-child { margin-bottom: 0; }

.checklist { display: grid; gap: 10px; margin-top: 20px; }
.checklist label, .check-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 520;
}
.checklist input[type="checkbox"] { width: 19px; height: 19px; margin: .18rem 0 0; accent-color: var(--blue); }
.checklist-score { margin: 18px 0 0; color: var(--blue-dark); font-weight: 730; }

.site-footer { margin-top: clamp(54px, 8vw, 100px); padding: 56px 0 30px; color: #c9ccda; background: #131726; }
.site-footer .brand { color: #fff; }
.footer-grid { display: grid; grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(160px, .8fr)); gap: 48px; }
.site-footer p { max-width: 420px; margin-top: 1rem; color: #969bad; font-size: .91rem; }
.footer-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 11px; }
.footer-nav strong, .footer-nav h2, .footer-nav h3 { margin: 0 0 4px; color: #fff; font: 700 .84rem/1.3 var(--sans); letter-spacing: 0; }
.footer-nav a { color: #d8dbe6; font-size: .9rem; }
.footer-nav a:hover { color: #fff; }
.legal-line { margin-top: 42px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); color: #7f8494; font-size: .78rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 940px) {
  .site-nav { display: none; }
  .mobile-nav { display: block; }
  .nav-row > .nav-cta { display: none; }
  .page-hero .shell::after { right: -110px; opacity: .6; }
  .grid-3, .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  :root { --pad: 20px; }
  h1 { font-size: clamp(2.35rem, 13.5vw, 4rem); }
  .grid-2, .grid-3, .related-grid, .form-row, .footer-grid { grid-template-columns: 1fr; }
  .page-hero { padding-top: 40px; }
  .page-hero .shell::after { width: 190px; height: 190px; right: -95px; top: 40px; }
  .hero-actions .button { width: 100%; }
  .card { padding: 22px; border-radius: 17px; }
  .cta-band { margin-inline: 0; border-radius: 0; }
  .footer-grid { gap: 32px; }
  .footer-nav { gap: 8px; }
  .footer-nav a { min-height: 42px; display: flex; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .mobile-nav, .hero-actions, .cta-band, .site-footer { display: none !important; }
  body { background: #fff; color: #000; }
  body::before { display: none; }
  .page-hero, .section { padding: 24px 0; }
  .card, .table-wrap { box-shadow: none; break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
}
