@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,650;9..144,750&display=swap');

:root {
  color-scheme: light;
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  color: #102a43;
  background: #f7f9fc;
  --ink: #102a43;
  --muted: #52677a;
  --paper: #ffffff;
  --line: #d8e2ec;
  --control-line: #7b8ea3;
  --blue: #155eef;
  --blue-dark: #0b4cd4;
  --accent: #d9e8ff;
  --wash: #eaf2ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
a { color: var(--blue-dark); text-underline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
header { border-bottom: 1px solid var(--line); background: rgba(247, 249, 252, .94); }
.nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 1.25rem; font-weight: 800; letter-spacing: -.035em; text-decoration: none; }
.brand span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: var(--accent); color: var(--blue-dark); font-family: Georgia, serif; }
nav { display: flex; gap: 24px; }
nav a { color: var(--ink); font-weight: 650; text-decoration: none; }
main { padding-block: 60px 92px; }
.hero { max-width: 850px; margin-bottom: 48px; }
.home-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(46px, 7vw, 86px) clamp(24px, 6vw, 68px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background-color: rgba(255, 255, 255, .88);
  background-image:
    linear-gradient(rgba(21, 94, 239, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 94, 239, .05) 1px, transparent 1px),
    linear-gradient(rgba(21, 94, 239, .085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 94, 239, .085) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
  box-shadow: 0 18px 45px rgba(16, 42, 67, .06);
}
.eyebrow { margin: 0 0 14px; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .14em; line-height: 1.3; text-transform: uppercase; }
h1, h2 { font-family: 'Fraunces', Georgia, serif; letter-spacing: -.04em; }
h1 { max-width: 920px; margin: 0 0 20px; font-size: clamp(2.65rem, 7vw, 5.8rem); line-height: .98; }
.tool-hero h1 { font-size: clamp(2.5rem, 6vw, 4.8rem); }
h2 { margin: 0 0 16px; font-size: clamp(1.65rem, 3.5vw, 2.55rem); line-height: 1.08; }
p { color: var(--muted); line-height: 1.72; }
.lede { max-width: 720px; margin: 0 0 28px; font-size: clamp(1.08rem, 2vw, 1.3rem); }
.primary-link { display: inline-flex; align-items: center; gap: 10px; padding: 14px 19px; border-radius: 10px; background: var(--blue); color: white; font-weight: 750; text-decoration: none; }
.primary-link:hover { background: var(--blue-dark); }
.tool-section { scroll-margin-top: 24px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 26px; }
.section-heading > p { max-width: 450px; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.card { position: relative; min-height: 158px; padding: 25px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.card:hover { border-color: #8eb3e8; box-shadow: 0 12px 30px rgba(16, 42, 67, .08); transform: translateY(-2px); }
.card strong { display: block; margin: 0 42px 9px 0; font-family: 'Fraunces', Georgia, serif; font-size: 1.35rem; letter-spacing: -.025em; }
.card span:not(.card-arrow) { color: var(--muted); line-height: 1.55; }
.card-arrow { position: absolute; top: 22px; right: 23px; color: var(--blue); font-size: 1.35rem; }
.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin-top: 58px; border: 1px solid var(--line); border-radius: 15px; background: var(--line); }
.trust-strip div { display: grid; gap: 4px; padding: 26px; background: var(--wash); }
.trust-strip strong { font-family: 'Fraunces', Georgia, serif; font-size: 2rem; }
.trust-strip span { color: var(--muted); font-size: .92rem; }
.breadcrumbs { align-items: center; gap: 9px; margin-bottom: 42px; color: var(--muted); font-size: .9rem; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .7fr); gap: 22px; align-items: start; }
.calculator, .formula-card { border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.calculator { padding: clamp(20px, 4vw, 36px); box-shadow: 0 12px 36px rgba(17, 38, 31, .06); }
.formula-card { position: sticky; top: 22px; padding: 28px; background: var(--wash); }
.formula-card h2 { font-size: clamp(1.4rem, 2.3vw, 2rem); overflow-wrap: anywhere; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
label { display: grid; gap: 8px; color: var(--ink); font-weight: 700; }
input, select { width: 100%; min-height: 51px; border: 1px solid var(--control-line); border-radius: 10px; padding: 12px 14px; background: white; color: var(--ink); font: inherit; }
input:focus, select:focus { border-color: var(--blue); outline: 3px solid var(--blue); outline-offset: 2px; }
.actions { display: flex; gap: 10px; margin-top: 24px; }
button { min-height: 48px; border: 0; border-radius: 10px; padding: 12px 19px; background: var(--blue); color: white; font: inherit; font-weight: 800; cursor: pointer; }
button:hover { background: var(--blue-dark); }
.secondary-button, .share-button { border: 1px solid var(--control-line); background: white; color: var(--ink); }
.secondary-button:hover, .share-button:hover { background: var(--wash); }
.result { min-height: 116px; margin-top: 24px; border-radius: 13px; padding: 22px; background: var(--wash); }
.result-label { margin: 0 0 8px; color: var(--blue); font-size: .75rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.result strong { display: block; font-family: 'Fraunces', Georgia, serif; font-size: clamp(1.5rem, 4vw, 2.35rem); line-height: 1.15; overflow-wrap: anywhere; }
.result ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0 0; padding: 0; list-style: none; }
.result ul li { padding: 7px 10px; border-radius: 8px; background: white; color: var(--muted); font-size: .9rem; }
.result ol { margin: 18px 0 0; padding-left: 22px; }
.result ol li { margin-top: 8px; color: var(--muted); line-height: 1.55; }
.result[data-state="error"] { background: #fff1f0; color: #9b1c1c; }
.result[data-state="error"] .result-label { color: #9b1c1c; }
.share-button { margin-top: 18px; min-height: 40px; padding: 8px 13px; font-size: .88rem; }
.explanation { max-width: 780px; margin-top: 70px; }
.related { margin-top: 70px; }
.ad-slot { min-height: 110px; margin: 58px auto; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 12px; background: var(--wash); color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.ad-slot[data-active="false"] { display: none; }
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); }
.prose h2 { margin-top: 46px; }
footer { border-top: 1px solid var(--line); padding-block: 42px; }
.footer-grid { display: flex; justify-content: space-between; gap: 38px; }
.footer-grid p { margin-bottom: 0; }
.footer-grid nav { flex-wrap: wrap; align-content: flex-start; }
.footer-brand { font-size: 1.05rem; }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1120px); }
  .nav { min-height: 66px; }
  .nav nav a:first-child { display: none; }
  main { padding-block: 42px 68px; }
  .home-hero { padding: 38px 20px 44px; border-radius: 18px; }
  .grid, .tool-layout { grid-template-columns: 1fr; }
  .section-heading, .footer-grid { align-items: start; flex-direction: column; }
  .formula-card { position: static; }
  .trust-strip { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .fields { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .nav nav { gap: 12px; font-size: .88rem; }
  .actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
