﻿/* ==========================================================================
   Calc — bright utility system: slate ink, indigo primary, teal accents.
   Category colour-coding, tabular results, zero dependencies.
   ========================================================================== */
@font-face {
  font-family: 'InterVar';
  src: url('../assets/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #ffffff;
  --panel: #f5f7fb;
  --panel-2: #eef2f9;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --indigo: #e8386d;
  --indigo-2: #ff4d7d;
  --indigo-soft: #fff0f4;
  --teal: #0d9488;
  --amber: #d97706;
  --rose: #e11d48;
  --green: #15803d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 32px -20px rgba(15, 23, 42, .35);
  --shadow-lg: 0 24px 60px -32px rgba(15, 23, 42, .55);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --nav: 68px;
  --wrap: 1160px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'InterVar', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--indigo); color: #fff; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { width: min(var(--wrap), calc(100% - 40px)); margin-inline: auto; }

/* nav */
.nav { position: sticky; top: 0; z-index: 60; height: var(--nav); display: flex; align-items: center; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav__in { display: flex; align-items: center; gap: 26px; width: min(var(--wrap), calc(100% - 40px)); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.brand__mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--indigo), var(--teal)); display: grid; place-items: center; color: #fff; font-family: var(--mono); font-size: 15px; font-weight: 700; }
.brand small { display: block; font-size: 9px; font-weight: 600; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.nav__links { display: flex; gap: 20px; }
.nav__links a { font-size: 14px; color: var(--ink-2); }
.nav__links a:hover { color: var(--indigo); }
.nav__right { margin-left: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 18px; border-radius: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line-2); background: #fff; color: var(--ink); transition: .16s; }
.btn:hover { border-color: var(--ink); }
.btn--primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn--primary:hover { background: var(--indigo-2); border-color: var(--indigo-2); box-shadow: 0 12px 24px -14px rgba(79, 70, 229, .9); }
.btn--sm { height: 36px; padding: 0 13px; font-size: 13px; }

/* hero */
.hero { padding: 54px 0 24px; text-align: center; background: radial-gradient(700px 340px at 50% -10%, var(--indigo-soft), transparent 70%); }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--indigo); font-weight: 600; }
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; margin-top: 12px; }
h1 em { font-style: normal; background: linear-gradient(90deg, var(--indigo), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 16px auto 0; max-width: 60ch; font-size: 1.02rem; }
.hero__stats { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-top: 24px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.hero__stats b { color: var(--ink); }

/* search */
.search { position: relative; max-width: 560px; margin: 26px auto 0; }
.search input { width: 100%; height: 54px; border-radius: 14px; border: 1.5px solid var(--line-2); padding: 0 18px 0 48px; font: inherit; font-size: 16px; background: #fff; box-shadow: var(--shadow); }
.search input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); }
.search svg { position: absolute; left: 17px; top: 17px; width: 20px; height: 20px; color: var(--muted); }

/* sections + cards */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -.025em; font-weight: 700; }
.section-head p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.link-more { font-size: 13px; font-weight: 600; color: var(--indigo); white-space: nowrap; }
.link-more:hover { text-decoration: underline; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: .16s; min-width: 0; }
.tile:hover { border-color: var(--indigo); transform: translateY(-2px); box-shadow: var(--shadow); }
.tile__ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--indigo-soft); color: var(--indigo); }
.tile__ico svg { width: 18px; height: 18px; }
.tile b { display: block; font-size: 14.5px; letter-spacing: -.01em; }
.tile span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

/* category tiles */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cat { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: #fff; transition: .18s; overflow: hidden; position: relative; }
.cat:hover { border-color: var(--cat, var(--indigo)); transform: translateY(-3px); box-shadow: var(--shadow); }
.cat__art { height: 108px; margin: -6px -6px 14px; border-radius: 12px; background: var(--cat-soft, var(--indigo-soft)); display: grid; place-items: center; }
.cat__art svg { width: 84px; height: 84px; }
.cat h3 { font-size: 17px; letter-spacing: -.02em; }
.cat p { font-size: 13px; color: var(--muted); margin-top: 5px; }
.cat__count { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .08em; margin-top: 10px; display: block; }

/* calc page */
.calc-head { padding: 30px 0 6px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.crumbs a:hover { color: var(--indigo); }
.page-title { font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -.03em; font-weight: 800; margin-top: 10px; }
.page-lead { color: var(--muted); margin-top: 8px; max-width: 66ch; }
#calc { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 16px; align-items: start; margin: 22px 0 8px; }
.calc-form { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 20px; display: grid; gap: 13px; box-shadow: var(--shadow); }
.field { display: grid; gap: 5px; position: relative; }
.field > label { font-size: 12.5px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.field .hint { font-weight: 400; font-size: 11px; color: var(--muted); }
.input { width: 100%; height: 46px; padding: 0 13px; border-radius: 10px; border: 1.5px solid var(--line-2); background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; }
.input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
.field .unit { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); pointer-events: none; }
.field:has(.unit) .input { padding-right: 58px; }
.calc-actions { display: flex; gap: 8px; margin-top: 2px; }
.calc-actions .btn { flex: 1; }
.calc-result { position: sticky; top: calc(var(--nav) + 16px); border-radius: 16px; padding: 24px; background: linear-gradient(160deg, #1e1b4b, #0f172a); color: #e2e8f0; box-shadow: var(--shadow-lg); }
.result-label { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #a5b4fc; }
.result-value { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin-top: 8px; color: #fff; font-variant-numeric: tabular-nums; word-break: break-word; }
.result-sub { font-size: 12.5px; color: #c7d2fe; margin-top: 6px; }
.result-rows { margin-top: 16px; border-top: 1px solid rgba(255, 255, 255, .14); }
.rrow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.rrow span { color: #a5b4fc; }
.rrow b { font-variant-numeric: tabular-nums; }
.result-note { margin-top: 12px; font-size: 11.5px; color: #c7d2fe; line-height: 1.55; }

/* prose + faq */
.prose { max-width: 760px; margin: 36px auto 0; }
.prose h2 { font-size: 1.25rem; margin-top: 26px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-2); font-size: 14.8px; line-height: 1.75; margin-top: 8px; }
.faq { max-width: 760px; margin: 24px auto 0; border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 15px 34px 15px 0; position: relative; font-size: 14.5px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 12px; font-family: var(--mono); font-size: 17px; color: var(--indigo); }
.faq details[open] summary::after { content: '−'; }
.faq .ans { padding: 0 26px 16px 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }

/* footer */
.footer { border-top: 1px solid var(--line); margin-top: 50px; padding: 38px 0 26px; background: var(--panel); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 26px; }
.footer p { color: var(--muted); font-size: 13px; margin-top: 10px; max-width: 36ch; }
.fcol h3 { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.fcol a { display: block; font-size: 13px; color: var(--ink-2); padding: 4px 0; }
.fcol a:hover { color: var(--indigo); }
.footer__bar { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); background: var(--ink); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 90; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  #calc { grid-template-columns: 1fr; }
  .calc-result { position: static; }
  .cats { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .nav__links { display: none; }
  .cats { grid-template-columns: 1fr; }
  .cats, .grid { gap: 10px; }
  .hero { padding-top: 34px; }
  .section { padding: 30px 0; }
  .footer__grid { grid-template-columns: 1fr; }
  .calc-form, .calc-result { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; } }
