:root {
  color-scheme: light;
  --red: #d93434;
  --red-dark: #b82424;
  --ink: #172432;
  --muted: #5f6f7d;
  --line: #e6edf3;
  --soft: #f7fafc;
  --blue: #0f5da8;
  --blue-soft: #eaf4ff;
  --sun: #f4d35e;
  --shadow: 0 18px 42px rgba(23, 36, 50, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #ffffff;
  line-height: 1.65;
}

a {
  color: var(--blue);
  font-weight: 850;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(217, 52, 52, 0.18);
  outline-offset: 3px;
}

.public-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(15, 93, 168, 0.08), transparent 32%),
    #ffffff;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 10px clamp(16px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
}

.brand img {
  width: clamp(118px, 15vw, 184px);
  height: 56px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 10px 22px rgba(15, 93, 168, 0.12));
}

.nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f1f5f8;
}

.nav a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.nav a:hover,
.nav a.active {
  background: #ffffff;
  color: var(--red);
}

.header-cta,
.cta,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff !important;
  text-decoration: none;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  padding: 12px 18px;
  box-shadow: none;
}

.header-cta:hover,
.cta:hover,
button:hover {
  background: var(--red-dark);
}

main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 42px) clamp(16px, 4vw, 34px) 64px;
}

.hero {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 5vw, 54px) 0 clamp(24px, 5vw, 60px);
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(15, 93, 168, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 93, 168, 0.035) 1px, transparent 1px),
    #ffffff;
  background-size: 28px 28px, 28px 28px, auto;
  color: var(--ink);
  box-shadow: none;
}

.hero .brand {
  display: none;
}

.kicker {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fde9e6;
  color: var(--red);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1 {
  max-width: 880px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 7vw, 74px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 44px 0 12px;
  color: var(--ink);
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

p {
  margin: 0 0 14px;
  max-width: 820px;
  color: var(--muted);
  font-weight: 650;
}

.hero p {
  max-width: 760px;
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 750;
}

.cta-row,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 6px;
}

.secondary-cta {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 900;
}

.grid,
.steps,
.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.card,
.calculator,
.table-wrap,
.note,
.formula,
.step {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: none;
}

.card,
.formula,
.step {
  border-top: 4px solid var(--red);
}

.card strong,
.step strong,
.formula strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 17px;
}

.calculator {
  margin-top: 18px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfdce8;
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.result {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #f8fbff;
}

.result span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.result strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
  margin-top: 4px;
}

.positive {
  color: #18735d !important;
}

.warning {
  color: #9a6500 !important;
}

.negative {
  color: #b83b35 !important;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f7fafc;
  font-size: 13px;
}

ul {
  padding-left: 22px;
}

li {
  margin-bottom: 8px;
  color: var(--muted);
}

.note {
  border-left: 5px solid var(--red);
  background: #fffaf9;
}

footer {
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .header-cta {
    min-height: 40px;
    padding-inline: 13px;
  }

  .brand img {
    width: 126px;
    height: 48px;
  }

  h1 {
    font-size: clamp(36px, 12vw, 54px);
  }

  .cta,
  button {
    width: 100%;
  }

  table {
    min-width: 620px;
  }
}
