:root {
  --orange: #ff6600;
  --orange-dark: #d95300;
  --ink: #111111;
  --ink-2: #262626;
  --muted: #686868;
  --line: #dedede;
  --soft: #f4f2ef;
  --paper: #ffffff;
  --cream: #fbfaf8;
  --danger: #a13022;
  --success: #1f6e43;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(17, 17, 17, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251,250,248,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(17,17,17,.07);
}
.header-inner, .section, .hero-grid, .footer-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}
.header-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { width: 184px; height: 58px; object-fit: contain; object-position: left center; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--orange); color: #fff; box-shadow: 0 10px 24px rgba(255,102,0,.18); }
.button-primary:hover { background: var(--orange-dark); }
.button-dark { background: var(--ink); color: #fff; }
.button-light { background: #fff; color: var(--ink); border-color: var(--line); }
.button-ghost { background: transparent; border-color: var(--line); }

.hero { background: var(--paper); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-grid {
  min-height: 610px;
  padding: 90px 0 82px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 70px;
  align-items: center;
}
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}
.eyebrow span { width: 22px; height: 3px; background: var(--orange); display: inline-block; border-radius: 99px; }
.eyebrow-light { color: #bdbdbd; }
.hero h1 {
  font-size: clamp(48px, 6vw, 76px);
  line-height: .98;
  letter-spacing: -.055em;
  margin: 0;
  max-width: 770px;
}
.hero h1 em { color: var(--orange); font-style: normal; }
.hero-copy { color: var(--muted); font-size: 19px; max-width: 720px; margin: 26px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.trust-row { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px 20px; color: #5b5b5b; font-size: 13px; font-weight: 750; }
.trust-row span::first-letter { color: var(--orange); }
.hero-panel {
  background: var(--ink);
  color: #fff;
  padding: 36px;
  min-height: 420px;
  border-radius: 28px;
  position: relative;
  box-shadow: 0 28px 55px rgba(17,17,17,.18);
  overflow: hidden;
}
.hero-panel::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  border: 48px solid rgba(255,102,0,.12);
  border-radius: 50%;
  right: -100px;
  top: -80px;
}
.hero-panel-label { color: #a9a9a9; font-size: 11px; font-weight: 900; letter-spacing: .15em; }
.hero-number { font-size: 110px; line-height: 1; color: var(--orange); font-weight: 950; letter-spacing: -.07em; margin-top: 12px; }
.hero-panel-title { font-size: 27px; line-height: 1.12; font-weight: 850; letter-spacing: -.03em; }
.hero-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #333; border: 1px solid #333; margin-top: 34px; }
.hero-mini-grid div { background: #181818; padding: 16px; display: grid; gap: 2px; }
.hero-mini-grid strong { font-size: 14px; }
.hero-mini-grid small { color: #aaa; }

.section { padding: 86px 0; }
.section-heading { display: flex; justify-content: space-between; gap: 40px; align-items: end; margin-bottom: 30px; }
.section-heading h2, .why-card h2, .engine-card h2 { margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.04; letter-spacing: -.04em; }
.section-heading p { color: var(--muted); max-width: 450px; margin: 0 0 4px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 25px;
  min-height: 245px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c9c9c9; }
.tool-card.featured { background: var(--ink); color: #fff; border-color: var(--ink); }
.tool-index { font-size: 11px; color: #949494; font-weight: 900; letter-spacing: .14em; }
.tool-icon {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #fff2e9; color: var(--orange); font-size: 20px; font-weight: 900; margin: 24px 0 16px;
}
.featured .tool-icon { background: var(--orange); color: #fff; }
.tool-card h3 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.tool-card p { color: var(--muted); font-size: 14px; margin: 10px 0 22px; }
.featured p { color: #b9b9b9; }
.tool-card .tool-link { margin-top: auto; font-size: 13px; font-weight: 850; color: var(--orange); }

.why-section { padding-top: 0; }
.why-card { background: var(--ink); color: #fff; border-radius: 30px; padding: 54px; display: grid; grid-template-columns: 1fr .9fr; gap: 70px; }
.why-copy p { color: #b9b9b9; font-size: 17px; max-width: 570px; }
.why-points { border-top: 1px solid #333; }
.why-points > div { padding: 20px 0; display: grid; grid-template-columns: 42px 1fr; gap: 14px; border-bottom: 1px solid #333; }
.why-points b { color: var(--orange); font-size: 12px; }
.why-points span { display: grid; gap: 3px; }
.why-points small { color: #aaa; }

.engine-section { padding-top: 0; }
.engine-card { border: 1px solid var(--line); background: #fff; border-radius: 30px; padding: 48px; display: grid; grid-template-columns: 1fr auto; gap: 60px; align-items: center; }
.engine-card p { color: var(--muted); max-width: 720px; }
.engine-actions { display: grid; gap: 16px; justify-items: start; min-width: 220px; }
.text-link { color: var(--ink); font-weight: 800; font-size: 14px; }

footer { background: #fff; border-top: 1px solid var(--line); }
.footer-inner { min-height: 150px; display: grid; grid-template-columns: 150px 1fr 1.4fr; align-items: center; gap: 24px; }
.footer-inner img { width: 140px; }
.footer-copy { display: grid; gap: 3px; }
.footer-copy span, footer p { color: var(--muted); font-size: 12px; }
footer p { text-align: right; margin: 0; }

body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.64); padding: 22px; overflow: auto;
}
.tool-modal {
  width: min(1180px, 100%);
  margin: 0 auto;
  background: var(--cream);
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(0,0,0,.3);
  overflow: hidden;
}
.modal-topbar { background: var(--ink); color: #fff; padding: 28px 34px; display: flex; align-items: center; justify-content: space-between; }
.modal-topbar h2 { margin: 2px 0 0; font-size: 30px; letter-spacing: -.035em; }
.modal-kicker { color: #9c9c9c; font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.icon-button { border: 1px solid #3c3c3c; background: #1d1d1d; color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 27px; cursor: pointer; line-height: 1; }
.tool-layout { display: grid; grid-template-columns: 1fr .82fr; }
.tool-form { padding: 34px; background: #fff; }
.form-intro { color: var(--muted); margin-bottom: 20px; max-width: 720px; }
.global-settings { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 18px; background: var(--soft); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field span { font-size: 12px; font-weight: 850; color: #343434; }
.field small { color: #848484; font-size: 11px; margin-top: -2px; }
.field input, .field select {
  width: 100%; border: 1px solid #cfcfcf; background: #fff; min-height: 50px; padding: 0 13px; border-radius: 12px; outline: none; color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,102,0,.1); }
.field-input-wrap { position: relative; }
.field-input-wrap input { padding-right: 54px; }
.field-suffix { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: #8a8a8a; font-size: 12px; font-weight: 800; pointer-events: none; }
.compact-field { grid-template-columns: 90px minmax(0, 180px); align-items: center; gap: 10px; }
.compact-field select { min-height: 42px; }
.form-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.results-panel { background: #efede9; border-left: 1px solid var(--line); padding: 34px; min-height: 610px; }
.results-empty { min-height: 500px; display: grid; place-content: center; text-align: center; max-width: 340px; margin: auto; }
.results-icon { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 18px; margin: 0 auto 18px; color: var(--orange); background: #fff; font-weight: 900; font-size: 28px; }
.results-empty h3 { font-size: 24px; margin: 0; }
.results-empty p { color: var(--muted); }
.result-status { color: var(--orange); font-size: 10px; font-weight: 950; letter-spacing: .16em; }
.primary-result-label { color: #555; font-size: 13px; font-weight: 750; margin-top: 24px; }
.primary-result { font-size: clamp(42px, 6vw, 66px); line-height: 1; font-weight: 950; letter-spacing: -.055em; margin-top: 7px; word-break: break-word; }
.primary-result-note { color: var(--muted); font-size: 13px; margin-top: 9px; }
.result-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.metric { border: 1px solid #d7d4cf; background: #fff; border-radius: 15px; padding: 15px; }
.metric span { color: #777; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.metric strong { display: block; font-size: 19px; margin-top: 3px; }
.result-insight { margin-top: 18px; border-left: 4px solid var(--orange); background: #fff; padding: 16px 18px; border-radius: 0 14px 14px 0; font-size: 13px; }
.result-insight.warning { border-color: var(--danger); }
.result-insight.good { border-color: var(--success); }
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.formula-note { padding: 18px 34px 24px; color: #747474; font-size: 11px; background: #fff; border-top: 1px solid var(--line); }
.formula-note strong { color: #343434; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 28px; transform: translate(-50%, 18px); background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 18px; font-size: 13px; font-weight: 750; opacity: 0; pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 45px; padding: 65px 0; }
  .hero-panel { min-height: auto; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .why-card { grid-template-columns: 1fr; gap: 40px; }
  .engine-card { grid-template-columns: 1fr; gap: 20px; }
  .tool-layout { grid-template-columns: 1fr; }
  .results-panel { border-left: 0; border-top: 1px solid var(--line); min-height: auto; }
  .results-empty { min-height: 280px; }
  .footer-inner { grid-template-columns: 120px 1fr; padding: 28px 0; }
  footer p { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 620px) {
  .header-inner, .section, .hero-grid, .footer-inner { width: min(100% - 28px, 1180px); }
  .header-inner { min-height: 72px; }
  .brand img { width: 138px; height: 46px; }
  .header-actions .button-ghost, .header-actions .button-dark { padding: 0 13px; min-height: 40px; font-size: 12px; }
  .hero-grid { padding: 48px 0 50px; }
  .hero h1 { font-size: 47px; }
  .hero-copy { font-size: 16px; }
  .hero-actions { display: grid; }
  .hero-actions .button { width: 100%; }
  .hero-panel { padding: 28px; border-radius: 22px; }
  .hero-number { font-size: 86px; }
  .section { padding: 58px 0; }
  .section-heading { display: grid; gap: 12px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 218px; }
  .why-card, .engine-card { padding: 30px 24px; border-radius: 22px; }
  .modal-backdrop { padding: 0; }
  .tool-modal { border-radius: 0; min-height: 100vh; }
  .modal-topbar { padding: 19px 18px; position: sticky; top: 0; z-index: 2; }
  .modal-topbar h2 { font-size: 23px; }
  .tool-form, .results-panel { padding: 22px 18px; }
  .fields { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .form-actions { display: grid; }
  .form-actions .button { width: 100%; }
  .result-metrics { grid-template-columns: 1fr 1fr; }
  .primary-result { font-size: 48px; }
  .formula-note { padding: 17px 18px 24px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-inner img { width: 160px; }
}

@media print {
  body { background: #fff; }
  .site-header, .hero, .tools-section, .why-section, .engine-section, footer, .modal-topbar .icon-button, .tool-form, .formula-note, .result-actions, .modal-backdrop::before { display: none !important; }
  .modal-backdrop { position: static !important; display: block !important; padding: 0; background: #fff; }
  .tool-modal { box-shadow: none; width: 100%; border-radius: 0; }
  .modal-topbar { display: block !important; background: #fff; color: #111; padding: 0 0 20px; }
  .tool-layout { display: block; }
  .results-panel { background: #fff; border: 0; padding: 0; }
  .results-content { display: block !important; }
}
