:root {
  color-scheme: light;
  --ink: #101622;
  --muted: #526071;
  --dim: #aab8ca;
  --line: #dce2eb;
  --paper: #f3f5f9;
  --white: #fff;
  --accent: #005dc4;
  --accent-dark: #004a9c;
  --blue-wash: #eaf3ff;
  --radius: 1.4rem;
  --shadow: 0 8px 34px #1c3c6510;
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 4.6rem; }
body { margin: 0; background: var(--white); color: var(--ink); }
a { color: var(--accent-dark); text-underline-offset: .2em; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #006de4; outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 5rem, 76rem); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: .5rem; left: .5rem; transform: translateY(-200%); padding: .5rem 1rem; background: var(--white); z-index: 4; }
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #0b0e14f2;
  border-bottom: 1px solid #ffffff1c;
  color: #f6f8fc;
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 3.55rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.2rem; }
.brand { display: inline-flex; align-items: center; justify-self: start; gap: .58rem; color: inherit; text-decoration: none; font-size: 1.01rem; font-weight: 700; letter-spacing: -.025em; }
.brand img { flex: none; }
.header-inner nav { display: flex; align-items: center; gap: clamp(.9rem, 3.4vw, 2.65rem); }
.header-inner nav a { color: #d6e0ef; font-size: .82rem; font-weight: 580; text-decoration: none; white-space: nowrap; }
.header-inner nav a:hover { color: white; }
.site-header :focus-visible, .hero :focus-visible { outline-color: #9cd5ff; }
.nav-badge { display: inline-flex; align-items: center; gap: .42rem; justify-self: end; color: #d8e9ff; font-size: .72rem; font-weight: 650; white-space: nowrap; }
.nav-badge span { width: .42rem; height: .42rem; border-radius: 50%; background: #79c8ff; box-shadow: 0 0 11px #79c8ff8c; }

.hero { display: grid; justify-items: center; overflow: hidden; background: #000; color: #f6f8ff; text-align: center; }
.hero-copy { position: relative; z-index: 1; padding-top: clamp(2.6rem, 5vw, 4.1rem); }
.eyebrow { margin: 0 0 .55rem; color: var(--accent-dark); font-size: .7rem; font-weight: 720; letter-spacing: .13em; text-transform: uppercase; }
.hero-kicker { color: #9bc7fc; margin-bottom: .95rem; }
h1, h2, h3, h4, p { overflow-wrap: break-word; }
h1 { margin: 0; font-size: clamp(2.8rem, 6.5vw, 5.8rem); font-weight: 720; letter-spacing: -.071em; line-height: .98; }
h1 span { color: #88bcff; background: linear-gradient(105deg, #d1e9ff 4%, #8cc8ff 42%, #559bfb 90%); background-clip: text; -webkit-text-fill-color: transparent; }
.hero-intro { max-width: 40rem; margin: 1.2rem auto 1.42rem; color: #bdc8d8; font-size: clamp(.99rem, 1.6vw, 1.24rem); line-height: 1.45; }
.primary-link, .calculate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding: .58rem 1.12rem;
  border: 1px solid transparent;
  border-radius: 2rem;
  background: var(--accent);
  color: white;
  font-size: .87rem;
  font-weight: 690;
  text-decoration: none;
  transition: background-color .18s ease, box-shadow .18s ease;
}
.primary-link { min-height: 2.95rem; padding-inline: 1.18rem; background: #0867d8; box-shadow: 0 0 22px #2c7ff93b; }
.primary-link:hover, .calculate:hover { background: var(--accent-dark); }
.hero-visual { width: min(100%, 64rem); margin: -.35rem 0 .2rem; aspect-ratio: 2.62; overflow: hidden; }
.hero-visual img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }

.sizing { padding-block: clamp(2.7rem, 5.9vw, 4.8rem); }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.45rem; }
h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 725; line-height: 1.03; letter-spacing: -.057em; }
.section-note { max-width: 25rem; margin: 0 0 .15rem; color: var(--muted); font-size: .89rem; }
.featured-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.featured-tool {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .38rem;
  min-height: 11.4rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid #dfe7f3;
  border-radius: 1.2rem;
  background: linear-gradient(155deg, #f9fbff 30%, #edf4ff);
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.featured-tool:nth-child(2) { background: linear-gradient(155deg, #f9fbff 30%, #eff1ff); }
.featured-tool:nth-child(3) { background: linear-gradient(155deg, #f9fbff 30%, #e9f5fa); }
.featured-tool:nth-child(4) { background: linear-gradient(155deg, #f9fbff 30%, #eef0fb); }
.featured-tool:hover { transform: translateY(-3px); border-color: #b6d4fc; box-shadow: 0 10px 28px #1b4a7c15; }
.featured-icon { display: grid; place-items: center; width: 2.65rem; height: 2.65rem; margin-bottom: .55rem; border-radius: .75rem; background: #ddebff; color: #0054ad; }
.featured-icon svg { width: 1.34rem; height: 1.34rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.featured-tool:nth-child(2) .featured-icon { background: #e4e7ff; color: #363f9f; }
.featured-tool:nth-child(3) .featured-icon { background: #d8eff7; color: #12627f; }
.featured-tool:nth-child(4) .featured-icon { background: #e6e9fc; color: #444d9d; }
.featured-title { font-size: 1.08rem; line-height: 1.22; letter-spacing: -.022em; font-weight: 730; }
.featured-copy { color: var(--muted); font-size: .84rem; line-height: 1.44; }
.featured-arrow { position: absolute; inset: 1.05rem 1.05rem auto auto; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border: 1px solid #c9daef; border-radius: 50%; color: var(--accent-dark); font-size: .94rem; }

.library-band { padding-block: clamp(2.7rem, 5.9vw, 4.8rem); background: var(--paper); border-block: 1px solid #e7ebf2; }
.library-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; color: var(--muted); font-size: .77rem; font-weight: 640; }
.metric-badge { padding: .33rem .65rem; border: 1px solid #c6dafa; border-radius: 2rem; background: var(--blue-wash); color: var(--accent-dark); white-space: nowrap; }
.workspace { display: grid; grid-template-columns: minmax(15.5rem, .73fr) minmax(0, 2.27fr); align-items: start; gap: 1.15rem; }
.directory, .calculator { background: var(--white); border: 1px solid #e0e6ef; border-radius: var(--radius); box-shadow: var(--shadow); }
.directory { padding: 1rem; }
.search { display: flex; align-items: center; gap: .55rem; padding: .64rem .73rem; background: var(--paper); color: var(--muted); border: 1px solid #dbe3ef; border-radius: .77rem; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search svg { flex: none; }
.search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .86rem; }
.search input::placeholder { color: var(--muted); }
.category { margin-top: 1rem; }
.category h3 { margin: 0 0 .35rem; padding-inline: .48rem; color: var(--muted); font-size: .66rem; font-weight: 710; letter-spacing: .09em; text-transform: uppercase; }
.category-list { display: grid; gap: .13rem; }
.tool-option { display: flex; align-items: center; gap: .57rem; width: 100%; min-height: 2.48rem; padding: .43rem .53rem; border: 1px solid transparent; border-radius: .66rem; background: transparent; color: var(--ink); font-size: .83rem; font-weight: 620; line-height: 1.27; text-align: left; }
.tool-option:hover { background: var(--paper); }
.tool-option[aria-current="true"] { border-color: #c8ddff; background: var(--blue-wash); color: var(--accent-dark); font-weight: 710; }
.tool-number { flex: none; color: var(--muted); font-size: .64rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.search-status { margin: .8rem .25rem .25rem; color: var(--muted); font-size: .8rem; }

.calculator { min-width: 0; padding: clamp(1.1rem, 2.85vw, 2.2rem); }
.calculator-header { margin-bottom: 1.4rem; }
.calculator-header .eyebrow { display: inline-flex; margin-bottom: .66rem; padding: .25rem .58rem; border: 1px solid #d7e7ff; border-radius: 2rem; background: #f0f6ff; color: var(--accent-dark); font-size: .64rem; letter-spacing: .08em; }
.calculator-header h3 { width: fit-content; margin: 0; font-size: clamp(1.7rem, 3.2vw, 2.6rem); font-weight: 725; line-height: 1.1; letter-spacing: -.049em; }
.calculator-header > p:last-child { max-width: 63ch; margin: .48rem 0 0; color: var(--muted); font-size: .94rem; }
.calculator-body { display: grid; grid-template-columns: minmax(0, 1.24fr) minmax(0, .76fr); align-items: start; gap: clamp(1rem, 2vw, 1.55rem); }
.form-title, .results h4 { margin: 0 0 .6rem; font-size: .7rem; font-weight: 720; letter-spacing: .1em; text-transform: uppercase; }
.form-title { color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem .65rem; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: .32rem; font-size: .8rem; font-weight: 665; line-height: 1.3; }
.field-control { display: flex; align-items: stretch; background: #f7f9fd; border: 1px solid #d0dceb; border-radius: .72rem; }
.field-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field-control:has([aria-invalid="true"]) { border-color: #ac3029; }
.field-control input { width: 100%; min-width: 0; min-height: 2.75rem; padding: .5rem .64rem; border: 0; outline: 0; border-radius: inherit; background: transparent; color: var(--ink); font-size: .99rem; font-variant-numeric: tabular-nums; }
.field-unit { display: grid; place-items: center; flex: none; padding: .38rem .52rem; border-left: 1px solid #e1e8f2; border-radius: 0 .68rem .68rem 0; background: #edf2fa; color: var(--muted); font-size: .68rem; font-weight: 620; white-space: nowrap; }
.field-hint { margin: .3rem 0 0; color: var(--muted); font-size: .72rem; line-height: 1.43; }
.form-error { margin: .68rem 0 0; color: #9a3023; font-size: .83rem; font-weight: 650; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; margin-top: 1.15rem; }
.reset { min-height: 2.75rem; padding: .5rem .65rem; border: 1px solid transparent; border-radius: 2rem; background: transparent; color: var(--accent-dark); font-size: .81rem; font-weight: 670; }
.reset:hover { background: var(--blue-wash); }

.results { padding: 1rem 1.05rem; border: 1px solid #24446d; border-radius: 1rem; background: radial-gradient(ellipse at 110% 0%, #143968, transparent 75%), #0b1425; box-shadow: 0 8px 24px #10233e21; color: #f1f7ff; }
.results h4 { margin-bottom: .25rem; color: #badcff; }
.result-status { margin: 0; color: #b4c2d5; font-size: .74rem; }
.results dl { margin: .4rem 0 0; }
.results dl:empty { display: none; }
.result-row { padding: .56rem 0; border-bottom: 1px solid #abcaff28; }
.result-row:last-child { border: 0; padding-bottom: .1rem; }
.result-row dt { color: #c5d5e8; font-size: .72rem; }
.result-row dd { margin: .04rem 0 0; color: #ecf6ff; font-size: 1.24rem; font-variant-numeric: tabular-nums; font-weight: 680; letter-spacing: -.018em; line-height: 1.17; overflow-wrap: anywhere; }
.result-row:first-child dd { color: #9fd0ff; font-size: clamp(1.38rem, 2.5vw, 2rem); }
.result-unit { color: #c3d9ef; font-size: .73rem; font-weight: 610; letter-spacing: 0; white-space: nowrap; }

.method { margin-top: 1.45rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.method summary { width: fit-content; color: var(--ink); font-size: .88rem; font-weight: 715; cursor: pointer; }
.method-body { margin-top: .64rem; }
.formula { margin: 0; padding: .78rem .85rem; border: 1px solid #e1e8f3; border-radius: .7rem; background: #f4f7fc; color: #172d4b; font: .8rem/1.52 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes { margin: .66rem 0 .4rem; color: var(--muted); font-size: .81rem; white-space: pre-line; }
.method a { font-size: .79rem; font-weight: 660; overflow-wrap: anywhere; }
.about { display: grid; grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); align-items: start; gap: 1rem 4rem; padding-block: clamp(2.8rem, 5.9vw, 4.6rem); }
.about h2 { font-size: clamp(1.75rem, 3.3vw, 2.8rem); }
.about-copy { color: var(--muted); font-size: .94rem; }
.about-copy p { margin: 0; }
.about-copy p + p { margin-top: .66rem; }
.site-footer { background: #0b0e14; color: #c6d1df; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding-block: 1.25rem; font-size: .8rem; }
.site-footer a { color: #d9eaff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 65rem) {
  .wrap { width: calc(100% - 3rem); }
  .calculator-body { grid-template-columns: 1fr; }
  .results dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem .78rem; }
  .result-row, .result-row:last-child { padding: .34rem 0; border: 0; }
}
@media (max-width: 53rem) {
  .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured-tool { min-height: 9.9rem; }
}
@media (max-width: 46rem) {
  .wrap { width: calc(100% - 2rem); }
  .header-inner { grid-template-columns: auto 1fr; min-height: 3.38rem; gap: .7rem; }
  .header-inner nav { justify-content: end; gap: clamp(.55rem, 2.8vw, 1rem); }
  .header-inner nav a { font-size: .75rem; }
  .nav-badge { display: none; }
  .hero-copy { padding-top: 2.5rem; }
  .hero-intro { max-width: 31ch; }
  .hero-visual { aspect-ratio: 2.1; margin-top: .22rem; }
  .section-header { align-items: start; flex-direction: column; gap: .65rem; margin-bottom: 1.12rem; }
  .workspace, .about { grid-template-columns: 1fr; }
  .workspace { gap: .85rem; }
  .category-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 28rem) {
  .brand img { width: 1.65rem; height: 1.65rem; }
  .header-inner nav a:last-child { display: none; }
  .featured-grid { gap: .58rem; }
  .featured-tool { min-height: 9.5rem; padding: .85rem .75rem; }
  .featured-icon { width: 2.3rem; height: 2.3rem; margin-bottom: .31rem; }
  .featured-arrow { inset: .85rem .72rem auto auto; width: 1.45rem; height: 1.45rem; font-size: .8rem; }
  .featured-title { font-size: .95rem; }
  .featured-copy { font-size: .77rem; }
  .footer-detail { display: none; }
}
@media (max-width: 22.5rem) {
  .fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
