:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --panel: #ffffff;
  --panel-soft: #f0ebe2;
  --text: #1f2428;
  --muted: #626a70;
  --line: #d9d2c7;
  --brand: #126b5f;
  --brand-strong: #0b4e45;
  --accent: #d36b31;
  --focus: #238d7f;
  --shadow: 0 16px 40px rgba(31, 36, 40, 0.10);
}

:root.dark {
  color-scheme: dark;
  --bg: #151817;
  --panel: #202523;
  --panel-soft: #2a302e;
  --text: #f2f4ef;
  --muted: #b9c0ba;
  --line: #3c4541;
  --brand: #73d3c3;
  --brand-strong: #a2eadf;
  --accent: #f0a15f;
  --focus: #91e6d8;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.30);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(211, 107, 49, 0.10), transparent 34rem),
    linear-gradient(180deg, var(--bg) 0%, var(--panel-soft) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}

.nav {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 14px 20px;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  align-items: center;
  background: var(--brand);
  border-radius: 6px;
  color: var(--panel);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.nav-links {
  align-items: center;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.94rem;
  padding: 8px 11px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--panel);
  color: var(--text);
}

.floating-controls,
.language-floating {
  align-items: center;
  display: grid;
  position: fixed;
  right: 18px;
  z-index: 40;
}

.floating-controls {
  top: 18px;
}

.language-floating {
  bottom: 18px;
}

.theme-toggle {
  align-items: center;
  background: #1f2937;
  border: 1px solid #334155;
  border-radius: 999px;
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  width: 76px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.theme-toggle {
  gap: 4px;
  justify-content: space-between;
  padding: 4px;
  position: relative;
}

.theme-icon {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  line-height: 1;
  position: relative;
  width: 30px;
  z-index: 2;
}

.theme-knob {
  background: #0f172a;
  border-radius: 50%;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.26);
  height: 30px;
  left: 4px;
  position: absolute;
  top: 4px;
  transition: transform 180ms ease;
  width: 30px;
  z-index: 1;
}

.theme-toggle[data-theme-state="dark"] .theme-knob {
  transform: translateX(38px);
}

.theme-toggle[data-theme-state="light"] .theme-icon.sun,
.theme-toggle[data-theme-state="dark"] .theme-icon.moon {
  color: #e5e7eb;
}

.theme-toggle[data-theme-state="light"] .theme-icon.moon,
.theme-toggle[data-theme-state="dark"] .theme-icon.sun {
  color: #94a3b8;
}

.language-wrap {
  position: relative;
}

.language-toggle {
  align-items: center;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 760;
  gap: 7px;
  min-height: 38px;
  justify-content: center;
  min-width: 112px;
  padding: 7px 12px;
  backdrop-filter: blur(14px);
}

.language-current {
  align-items: center;
  display: inline-flex;
  font-size: 0.92rem;
  justify-content: center;
  white-space: nowrap;
}

.language-caret {
  color: var(--muted);
  font-size: 0.78rem;
}

.language-menu {
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  gap: 8px;
  grid-template-columns: 1fr;
  max-height: min(520px, calc(100vh - 120px));
  min-width: 170px;
  overflow-y: auto;
  padding: 10px;
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  backdrop-filter: blur(14px);
}

.language-wrap.open .language-menu {
  display: grid;
}

.language-option {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 720;
  min-height: 32px;
  justify-content: flex-start;
  padding: 6px 9px;
  width: 100%;
}


.language-option:hover,
.language-option[aria-pressed="true"] {
  background: color-mix(in srgb, var(--brand) 16%, var(--panel));
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}

.theme-toggle:focus-visible,
.language-toggle:focus-visible,
.language-option:focus-visible,
.calculator input:focus-visible,
.calculator select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 2px;
}

.container {
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 20px;
}

.hero {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  padding: 48px 20px 30px;
}

.eyebrow {
  color: var(--brand-strong);
  font-size: 0.88rem;
  font-weight: 750;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 4.7rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

h3 {
  font-size: 1.05rem;
}

.lead {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 62ch;
}

.hero-actions,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  align-items: center;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 8px;
  color: white;
  display: inline-flex;
  font-weight: 760;
  gap: 9px;
  min-height: 44px;
  padding: 10px 14px;
}

.button.secondary {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

.visual-panel {
  align-self: stretch;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--brand) 18%, var(--panel)), var(--panel)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  min-height: 330px;
  overflow: hidden;
  padding: 18px;
}

.mini-dashboard {
  display: grid;
  gap: 12px;
}

.mini-row,
.stat-tile {
  background: color-mix(in srgb, var(--panel) 74%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.mini-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
}

.mini-value {
  color: var(--brand-strong);
  font-size: 1.45rem;
  font-weight: 850;
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.stat-tile span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
}

.stat-tile strong {
  display: block;
  font-size: 1.3rem;
  margin-top: 2px;
}

.section {
  padding: 42px 0;
}

.section-head {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head p {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 65ch;
}

.tool-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
  min-height: 164px;
  padding: 18px;
  transition: transform 160ms ease, border-color 160ms ease;
}

.tool-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.tool-card p {
  color: var(--muted);
  margin: 10px 0 16px;
}

.tool-card .linkline {
  color: var(--brand-strong);
  font-weight: 780;
}

.page-hero {
  padding: 42px 20px 18px;
}

.page-hero h1 {
  max-width: 16ch;
}

.layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 320px;
  padding-bottom: 42px;
}

.calculator,
.content-block,
.ad-slot {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calculator {
  box-shadow: var(--shadow);
  padding: 22px;
}

.calc-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 720;
}

.calculator input,
.calculator select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}

.result-box {
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: 8px;
  margin-top: 18px;
  padding: 18px;
}

.result-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
}

.result-value {
  color: var(--brand-strong);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 860;
  line-height: 1.1;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.formula {
  color: var(--muted);
  margin: 10px 0 0;
}

.content-block {
  margin-top: 18px;
  padding: 22px;
}

.content-block p,
.content-block li {
  color: var(--muted);
}

.content-block ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.ad-slot {
  align-items: center;
  color: var(--muted);
  display: flex;
  justify-content: center;
  min-height: 280px;
  padding: 18px;
  position: sticky;
  text-align: center;
  top: 86px;
}

.ad-slot.inline {
  margin: 18px 0;
  min-height: 120px;
  position: static;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 28px 0 34px;
}

.footer-inner {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 900px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ad-slot {
    position: static;
  }
}

@media (max-width: 680px) {
  .nav {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
  }

  .hero {
    padding-top: 34px;
  }

  .tool-grid,
  .calc-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .footer-inner,
  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .floating-controls {
    right: 14px;
    top: 14px;
    transform: none;
  }

  .language-floating {
    right: 14px;
    bottom: 14px;
  }

  .language-menu {
    bottom: calc(100% + 8px);
  }
}
