:root {
  color-scheme: light;
  --page: #f8f7fd;
  --paper: #fff;
  --ink: #1c1731;
  --muted: #5e586f;
  --line: #ded9ec;
  --violet: #522bd0;
  --violet-deep: #3e1cab;
  --lavender: #eee8ff;
  --lime: #d5ff9f;
  --panel: #201638;
  --frame: 1180px;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
  font-synthesis: none;
  line-height: 1.55;
  scroll-padding-top: 1.5rem;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
p, h1, h2, h3, dl, dd { margin: 0; }
a { color: var(--violet-deep); text-underline-offset: .22em; }
button, input { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 4px;
}
.frame { max-width: var(--frame); width: calc(100% - 6rem); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; padding: .65rem 1rem; background: white; transform: translateY(-180%); z-index: 20; }
.skip:focus { transform: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead { display: flex; gap: 1.25rem; justify-content: space-between; align-items: center; min-height: 76px; }
.brand { display: inline-flex; gap: .65rem; align-items: center; font-size: 1.2rem; font-weight: 800; letter-spacing: -.055em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-lab { color: var(--violet); }
.brand-mark { display: inline-flex; gap: 3px; width: 33px; height: 33px; padding: 8px; align-items: end; justify-content: center; border-radius: 10px; background: var(--violet); }
.brand-mark i { width: 4px; border-radius: 5px; background: var(--lime); height: 7px; }
.brand-mark i:nth-child(2) { height: 12px; }
.brand-mark i:nth-child(3) { height: 17px; }
.masthead nav, .footer-main nav { display: flex; align-items: center; gap: 1.65rem; flex-wrap: wrap; }
.masthead nav a, .footer-main nav a { color: var(--muted); font-size: .92rem; font-weight: 680; text-decoration: none; }
.masthead nav a:hover, .footer-main nav a:hover, .masthead nav a[aria-current] { color: var(--violet-deep); }
.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.footer-main { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 2rem; }
.footer-main p { font-size: .88rem; color: var(--muted); margin-top: .5rem; }

.home-hero {
  background: radial-gradient(ellipse at 79% 27%, #e3d7ff 0, transparent 55%), #f4f0ff;
  border-bottom: 1px solid #e4dbf3;
}
.hero-grid { display: grid; grid-template-columns: 1.18fr .82fr; gap: clamp(2.25rem, 6vw, 6rem); padding-block: clamp(4rem, 7.9vw, 7rem); align-items: center; }
.eyebrow { color: var(--violet-deep); font-size: .82rem; font-weight: 800; letter-spacing: .095em; text-transform: uppercase; }
.eyebrow span { display: inline-block; width: .55rem; height: .55rem; margin-right: .4rem; background: var(--violet); border-radius: 50%; vertical-align: .08em; }
h1, h2, h3, .tool-card-title { line-height: 1.09; letter-spacing: -.052em; }
.hero-copy h1 { font-size: clamp(3.1rem, 6.2vw, 6.2rem); font-weight: 800; margin: .9rem 0 1.1rem; }
.hero-copy em { font-style: normal; color: var(--violet); }
.hero-summary { max-width: 35ch; color: var(--muted); font-size: clamp(1.05rem, 1.65vw, 1.24rem); line-height: 1.55; }
.hero-actions, .form-actions, .calc-extras, .consent-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.hero-actions { margin-top: 1.7rem; }
.button {
  border-radius: 9px; display: inline-flex; min-height: 46px; justify-content: center; align-items: center;
  padding: .66rem 1.05rem; font-size: .94rem; font-weight: 750; line-height: 1.25;
  border: 1px solid transparent; text-decoration: none; text-align: center;
}
.button-primary { background: var(--violet); color: white; }
.button-primary:hover { background: var(--violet-deep); }
.button-secondary { background: var(--paper); color: var(--ink); border-color: #cfc7e3; }
.button-secondary:hover { border-color: var(--violet); color: var(--violet-deep); }
.button:disabled { opacity: .48; cursor: default; }

.hero-example {
  display: block; position: relative; min-width: 0; overflow: hidden; border-radius: 24px; text-decoration: none;
  background: var(--panel); color: #f6f3ff; padding: clamp(1.4rem, 3vw, 2.15rem);
  box-shadow: 0 24px 55px #4f2c863e;
}
.hero-example:hover { background: #281a45; }
.example-header, .example-footer { display: flex; justify-content: space-between; align-items: center; gap: .75rem; font-weight: 720; }
.example-header { font-size: .94rem; }
.example-pill { color: #dacaf9; background: #3e2d5b; border: 1px solid #594573; border-radius: 100px; padding: .22rem .58rem; font-size: .72rem; font-weight: 700; }
.example-amount { display: flex; flex-direction: column; padding-block: .65rem 1.05rem; color: #d8ceeb; }
.example-amount strong { color: white; font-size: clamp(3.6rem, 5.1vw, 5rem); letter-spacing: -.09em; line-height: 1.12; font-variant-numeric: tabular-nums; }
.example-amount strong span { color: var(--lime); font-size: .6em; padding-left: .08em; }
.example-amount > span { font-size: .88rem; }
.example-bars { display: grid; gap: .7rem; }
.example-bars > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .33rem .6rem; font-size: .85rem; }
.example-bars strong { font-variant-numeric: tabular-nums; }
.example-bars i {
  height: 8px; grid-column: 1 / -1; position: relative; overflow: hidden;
  display: block; border-radius: 10px; background: #47375e;
}
.example-bars i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--lime); }
.example-bars .bar-spend::after { width: 25%; background: #ac8ff7; }
.example-footer { border-top: 1px solid #514264; margin-top: 1.2rem; padding-top: .9rem; font-size: .88rem; }
.example-footer strong { color: var(--lime); font-size: 1.12rem; font-variant-numeric: tabular-nums; }

.tools-section { padding-block: 3.6rem 4.5rem; }
.section-heading { margin-bottom: 1.35rem; }
.section-heading h2 { font-size: clamp(1.8rem, 3vw, 2.65rem); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.tool-card {
  min-width: 0; min-height: 208px; padding: 1.22rem; border-radius: 15px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: .65rem;
}
.tool-card:hover { border-color: var(--violet); box-shadow: 0 8px 24px #35247512; }
.card-mark {
  border-radius: 8px; padding: .3rem .55rem; font-size: .77rem; font-weight: 820; letter-spacing: .06em;
  align-self: flex-start; display: inline-flex; color: #4b238c; background: #ede2fb;
}
.mark-cpm { color: #254f33; background: #dcf5d8; }
.mark-cpc { color: #244983; background: #e0edff; }
.mark-cvr { color: #763724; background: #ffede0; }
.tool-card-title { font-size: 1.3rem; font-weight: 790; }
.tool-card-summary { font-size: .92rem; line-height: 1.45; color: var(--muted); }
.tool-formula { margin-top: auto; padding-top: .65rem; border-top: 1px solid #ebe7f2; font-size: .8rem; font-weight: 690; color: #504367; }

.tool-page { padding-block: 1.75rem 4.5rem; }
.breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--muted); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.tool-intro { padding-block: 1.55rem 1.75rem; }
.tool-intro h1 { font-size: clamp(2.65rem, 5vw, 5rem); margin-block: .45rem .6rem; }
.tool-intro p { color: var(--muted); max-width: 63ch; font-size: 1.08rem; }
.calculator-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 1.1rem; margin-bottom: 1rem; }
.calc-form, .result-card { min-width: 0; border-radius: 18px; padding: clamp(1.15rem, 3vw, 2rem); }
.calc-form { background: var(--paper); border: 1px solid var(--line); }
.form-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.form-heading h2 { font-size: clamp(1.28rem, 2vw, 1.56rem); }
.text-button { color: var(--violet-deep); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: .2em; font-size: .9rem; font-weight: 700; text-align: left; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .95rem; }
.field { display: flex; flex-direction: column; gap: .28rem; }
.field label, .mode-selector legend { font-weight: 750; font-size: .95rem; }
.field small { line-height: 1.34; color: var(--muted); font-size: .81rem; }
.input-wrap { position: relative; }
.input-affix { position: absolute; left: .78rem; top: .68rem; color: var(--muted); pointer-events: none; }
.field input {
  width: 100%; min-height: 46px; background: #faf9fe; color: var(--ink);
  border: 1px solid #d4cce4; border-radius: 8px; padding: .6rem .75rem;
  font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums;
}
.input-affix + input { padding-left: 1.7rem; }
.mode-selector { margin: 0 0 1.05rem; padding: 0; border: 0; min-width: 0; }
.mode-selector legend { margin-bottom: .45rem; }
.mode-options { display: flex; flex-wrap: wrap; gap: .4rem; }
.mode-options label { position: relative; cursor: pointer; }
.mode-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-options span { display: block; border-radius: 8px; padding: .48rem .7rem; border: 1px solid var(--line); font-weight: 700; color: var(--muted); font-size: .87rem; }
.mode-options input:checked + span { color: var(--violet-deep); border-color: #a68ae9; background: var(--lavender); }
.mode-options input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 2px; }
.active-formula { color: var(--muted); font-size: .94rem; margin-block: .9rem 0; }
.active-formula strong { color: var(--ink); margin-right: .45rem; }
.form-actions { margin-top: 1.2rem; }
.form-error, .notice { margin-top: .85rem; padding: .65rem .8rem; border-radius: 8px; background: #fff0f0; color: #9c252b; font-size: .91rem; }
.notice { margin-bottom: 1rem; }

.result-card { background: var(--panel); color: white; display: flex; flex-direction: column; justify-content: center; gap: .18rem; }
.result-kicker { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: #cebbf0; }
.result-card h3 { font-size: 1.15rem; letter-spacing: -.025em; margin-top: .35rem; }
.result-value { color: var(--lime); font-weight: 790; font-size: clamp(2.3rem, 5.4vw, 4.35rem); letter-spacing: -.07em; line-height: 1.13; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.result-description { font-size: .92rem; color: #ddd1ed; }
.result-details { margin-top: .9rem; }
.result-details > div {
  border-top: 1px solid #4b3b65; display: flex; gap: .6rem; justify-content: space-between; align-items: baseline; padding-block: .47rem;
}
.result-details dt { font-size: .9rem; color: #e5daf4; }
.result-details dd { font-variant-numeric: tabular-nums; text-align: right; font-weight: 760; overflow-wrap: anywhere; }
.result-note, .result-stale { font-size: .87rem; color: #ecdfff; margin-top: .6rem; }
.calc-extras { margin-bottom: 2.4rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, .78fr); gap: clamp(1.3rem, 4vw, 3rem); align-items: start; }
.detail-grid h2, .faq h2, .related-tools h2, .article-page h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: .75rem; }
.detail-copy > p, .worked-example > p, .article-page p, .faq details p { color: var(--muted); }
.formula-list { margin-block: 1rem; border-top: 1px solid var(--line); }
.formula-list > div { display: grid; grid-template-columns: minmax(8rem, .9fr) minmax(0, 1.1fr); gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.formula-list dt { font-weight: 750; }
.formula-list dd { color: var(--muted); }
.source { font-size: .86rem; }
.worked-example { background: #eae4fd; border-radius: 14px; padding: 1.5rem; }
.worked-example .eyebrow { color: var(--violet-deep); margin-bottom: .5rem; }
.worked-example h2 { font-size: 1.45rem; }
.faq, .related-tools { margin-top: 2.7rem; }
.faq details { border-bottom: 1px solid var(--line); padding-block: .76rem; }
.faq summary { cursor: pointer; font-weight: 750; }
.faq details p { margin-top: .55rem; max-width: 75ch; }
.related-tools .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.article-page { min-height: 60vh; max-width: 790px; padding-block: clamp(2.75rem, 7vw, 5rem); }
.article-page h1 { margin-bottom: .9rem; font-size: clamp(2.6rem, 5.7vw, 4.45rem); }
.article-page p { margin-bottom: .75rem; }
.article-page .article-lead { font-size: 1.17rem; }
.article-page h2 { margin-top: 1.8rem; }
.consent { width: min(31rem, calc(100vw - 2rem)); border: 1px solid var(--line); border-radius: 15px; padding: 1.5rem; color: var(--ink); box-shadow: 0 20px 70px #2112394c; }
.consent::backdrop { background: #21163d6e; }
.consent h2 { font-size: 1.6rem; margin-bottom: .65rem; }
.consent p { color: var(--muted); margin-bottom: 1rem; }
.consent a { display: inline-block; margin-top: .8rem; font-size: .91rem; }

@media (max-width: 1000px) {
  .frame { width: calc(100% - 4rem); }
  .hero-grid { gap: 2.3rem; }
  .wide-only { display: none; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .frame { width: calc(100% - 2rem); }
  .masthead { min-height: 64px; }
  .masthead nav { gap: .85rem; }
  .masthead nav a { font-size: .86rem; }
  .hero-grid, .calculator-shell, .detail-grid { grid-template-columns: 1fr; }
  .hero-grid { padding-block: 2.7rem; gap: 2rem; }
  .hero-copy h1 { max-width: 13ch; }
  .tools-section { padding-block: 2.5rem 3rem; }
  .related-tools .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-main { flex-direction: column; align-items: flex-start; }
  .footer-main nav { gap: .65rem 1rem; }
}
@media (max-width: 425px) {
  .tool-grid, .related-tools .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: auto; }
  .fields { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: 3rem; }
  .brand { font-size: 1.09rem; gap: .45rem; }
  .brand-mark { width: 30px; height: 30px; }
  .masthead { gap: .55rem; }
  .masthead nav { gap: .45rem .7rem; }
}
