:root {
  --ink: #182027;
  --muted: #63707a;
  --paper: #f4f2ed;
  --cream: #e9e5db;
  --line: #d6d2c8;
  --orange: #ef5b2a;
  --blue: #1f77b4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-variant-numeric: tabular-nums;
}
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }

main {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 11%, rgba(239, 91, 42, .08), transparent 23rem),
    var(--paper);
}

.site-header {
  width: min(1440px, calc(100% - 64px));
  height: 76px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand { color: inherit; text-decoration: none; font-size: 19px; font-weight: 800; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 36px; aspect-ratio: 1; display: grid; place-items: center; background: var(--ink); color: white; border-radius: 50%; font: 20px Georgia, serif; }
.formula { display: flex; align-items: center; gap: 13px; font: 700 18px Georgia, serif; }
.formula span:first-child { color: var(--blue); }
.formula span:nth-of-type(2) { color: var(--orange); }
.formula span:last-child { color: #e9a137; }
.formula i { font: normal 13px Arial, sans-serif; color: #98a0a5; }
.version { justify-self: end; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .13em; }

.hero {
  width: min(1320px, calc(100% - 64px));
  min-height: 330px;
  margin: auto;
  padding: 72px 4% 50px;
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 64px;
  align-items: center;
}
.eyebrow { margin: 0 0 17px; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .2em; }
h1 { margin: 0; max-width: 850px; font-size: clamp(48px, 5.4vw, 78px); line-height: .98; letter-spacing: -.065em; }
h1 em { color: var(--orange); font: italic 400 .86em Georgia, serif; letter-spacing: -.04em; }
.intro { max-width: 680px; margin: 28px 0 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.hero-equation { width: 230px; height: 230px; margin: auto; border-radius: 50%; border: 1px solid #c7c1b5; position: relative; display: grid; place-items: center; color: var(--orange); font: 700 58px Georgia, serif; }
.hero-equation::before, .hero-equation::after { content: ""; position: absolute; inset: 15px; border-radius: 50%; border: 1px solid #ded9cf; }
.hero-equation::after { inset: 45px; background: linear-gradient(145deg, #fff, #d8d4cb); box-shadow: 12px 15px 28px #cac5bb, inset 4px 4px 6px #fff; }
.hero-equation > * { z-index: 1; }
.hero-equation > span { position: absolute; top: 43px; }
.hero-equation div { display: flex; width: 100px; justify-content: space-around; padding-top: 56px; border-top: 2px solid var(--ink); color: var(--ink); font: 700 34px Georgia, serif; }

.control-strip {
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto;
  padding: 21px 25px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.1fr 190px;
  gap: 28px;
  align-items: end;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .55);
  border-radius: 18px 18px 0 0;
}
.control-group > label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 10px; background: #e8e5de; }
.segmented.compact { grid-template-columns: repeat(2, 1fr); }
.segmented button { min-height: 43px; padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.segmented button b { font: 700 18px Georgia, serif; }
.segmented button span { font-size: 12px; }
.segmented button.active { background: var(--ink); color: #fff; box-shadow: 0 5px 12px rgba(24, 32, 39, .14); }
.series-select select { width: 100%; height: 51px; padding: 0 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; }
.mains-values .segmented button { flex-direction: column; gap: 1px; }
.mains-values .segmented button b { font: 700 14px Arial, sans-serif; }
.mains-values .segmented button span { font-size: 9px; letter-spacing: .08em; }

.project-strip {
  width: min(1320px, calc(100% - 64px));
  margin: 16px auto;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 24px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.58);
}
.project-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.project-fields label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.project-fields input { width: 100%; height: 45px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; }
.project-fields input:focus { outline: 3px solid rgba(31,119,180,.18); border-color: var(--blue); }
.data-actions { display: flex; gap: 8px; }
.data-actions button { min-height: 45px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; font-size: 12px; font-weight: 700; }
.data-actions .primary-action { border-color: var(--ink); background: var(--ink); color: white; }
.data-actions button:hover { border-color: var(--orange); }
.data-status { grid-column: 1 / -1; min-height: 16px; margin: 0; color: var(--muted); font-size: 11px; }

.calculator {
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto 70px;
  padding: 55px 36px 0;
  background: #ebe8e1;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 25px 65px rgba(38, 43, 45, .08);
}
.dial-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: center;
}
.dial-card { min-width: 0; }
.dial-heading { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 16px; }
.dial-heading .symbol { font: 700 30px Georgia, serif; }
.dial-heading b, .dial-heading small { display: block; }
.dial-heading b { font-size: 13px; }
.dial-heading small { margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.operator { color: #a19d94; text-align: center; font: 400 35px Georgia, serif; }
.operator.equals { color: var(--orange); }

.dial {
  width: min(100%, 340px);
  aspect-ratio: 1;
  margin: auto;
  border-radius: 50%;
  position: relative;
  touch-action: none;
  cursor: grab;
  outline: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 57%, rgba(255,255,255,.8) 57.3% 58%, transparent 58.3%),
    linear-gradient(145deg, #f9f8f4, #d7d3ca);
  border: 1px solid #c9c4ba;
  box-shadow: inset 3px 3px 8px #fff, inset -5px -5px 12px #c7c2b8, 0 10px 24px rgba(45, 49, 50, .1);
}
.dial:focus-visible { box-shadow: 0 0 0 4px rgba(31,119,180,.25), inset 3px 3px 8px #fff; }
.dial-output { cursor: default; background: radial-gradient(circle at 50% 50%, rgba(239,91,42,.04) 0 57%, rgba(255,255,255,.8) 57.3% 58%, transparent 58.3%), linear-gradient(145deg, #fff8f4, #d8d2ca); }
.ticks { position: absolute; inset: 0; border-radius: 50%; }
.ticks i { position: absolute; left: calc(50% - 1px); top: 3%; width: 1px; height: 4.5%; background: #7f8585; transform-origin: 1px 1044%; }
.ticks i.major { width: 2px; height: 7%; background: var(--ink); transform-origin: 1px 688%; }
.tick-label { position: absolute; z-index: 2; min-width: 37px; text-align: center; color: #555e62; font-size: clamp(8px, .82vw, 11px); transform: translate(-50%, -50%); pointer-events: none; }
.minor-label { opacity: .6; font-size: clamp(7px, .72vw, 9px); }
.knob-shadow { position: absolute; inset: 22%; border-radius: 50%; box-shadow: 4px 9px 18px rgba(25,30,32,.28); }
.knob { position: absolute; inset: 23%; border-radius: 50%; background: repeating-conic-gradient(#252b2e 0 3deg, #4a5051 3deg 5deg); box-shadow: inset 0 0 0 8px #252a2c, inset 0 0 0 11px #555b5c; pointer-events: none; }
.knob-cap { position: absolute; inset: 14%; border-radius: 50%; background: conic-gradient(from 42deg, #aeb2b1, #f6f7f6, #9da1a1, #e9eae9, #aeb2b1); box-shadow: inset 0 0 9px #fff, 0 2px 8px #111; }
.pointer { position: absolute; z-index: 3; width: 4px; height: 28%; left: calc(50% - 2px); top: 8%; background: var(--dial-accent); border-radius: 4px; box-shadow: 0 0 6px rgba(255,255,255,.6); }
.dial-readout { position: absolute; z-index: 5; left: 50%; top: 52%; transform: translate(-50%, -50%); width: 48%; text-align: center; pointer-events: none; }
.dial-readout strong { display: block; font-size: clamp(15px, 1.45vw, 22px); letter-spacing: -.04em; }
.dial-readout span { display: block; margin-top: 5px; color: #60686b; font-size: clamp(7px, .65vw, 9px); text-transform: uppercase; letter-spacing: .05em; }

.result-bar {
  margin: 45px -36px 0;
  min-height: 112px;
  padding: 24px 36px;
  background: var(--ink);
  color: white;
  border-radius: 0 0 17px 17px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  align-items: center;
}
.result-bar > div { padding: 0 28px; border-right: 1px solid #3e464b; }
.result-bar > div:first-child { padding-left: 0; }
.result-bar > div:last-child { border: 0; }
.result-bar span, .result-bar small { display: block; color: #9ea7ac; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.result-bar strong { display: block; margin: 7px 0 6px; font-size: clamp(19px, 2vw, 28px); letter-spacing: -.04em; }
.power-result strong { color: #f5b540; }
.series-result strong { color: #ff855e; }

.application-panel {
  width: min(1220px, calc(100% - 64px));
  margin: 0 auto 70px;
}
.panel-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 30px; }
.panel-heading h2 { margin: 0; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.04em; }
.application-tabs { padding: 4px; background: #e4e0d7; border-radius: 9px; }
.application-tabs button { border: 0; padding: 10px 18px; background: transparent; border-radius: 6px; cursor: pointer; font-size: 12px; }
.application-tabs button.active { color: white; background: var(--ink); }
.heater-layout { display: grid; grid-template-columns: 1.45fr .75fr; gap: 24px; }
.heater-copy, .safety-card, .general-layout { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.55); padding: 32px; }
.round-icon { display: grid; place-items: center; width: 48px; aspect-ratio: 1; margin-bottom: 18px; color: var(--orange); background: #fff0e9; border-radius: 50%; font: 25px Georgia, serif; }
.heater-copy h3, .general-layout h3 { margin: 0 0 9px; font-size: 21px; }
.heater-copy > p, .general-layout p { margin: 0; color: var(--muted); line-height: 1.55; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 25px; }
.preset-grid button { min-height: 68px; padding: 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; text-align: left; transition: .18s ease; }
.preset-grid button:hover { border-color: var(--orange); transform: translateY(-2px); box-shadow: 0 6px 14px rgba(44,47,48,.08); }
.preset-grid b, .preset-grid span { display: block; }
.preset-grid b { color: var(--orange); font-size: 16px; }
.preset-grid span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.safety-card { color: white; background: var(--ink); border-color: var(--ink); }
.safety-label { color: #aab1b5; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.safety-card > strong { display: block; margin: 8px 0 20px; color: #f5b540; font-size: 37px; }
.safety-card dl { margin: 0; border-top: 1px solid #3c454a; }
.safety-card dl div { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #3c454a; }
.safety-card dt { color: #aab1b5; }
.safety-card dd { margin: 0; font-weight: 700; }
.safety-card p { margin: 20px 0 0; color: #aab1b5; font-size: 11px; line-height: 1.6; }
.general-layout { display: grid; grid-template-columns: .8fr 1.5fr; gap: 45px; align-items: center; }
.neighbor-values { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.neighbor-values div { padding: 25px 10px; border: 1px solid var(--line); border-right: 0; background: #fff; }
.neighbor-values div:first-child { border-radius: 10px 0 0 10px; }
.neighbor-values div:last-child { border-radius: 0 10px 10px 0; border-right: 1px solid var(--line); }
.neighbor-values .selected { background: var(--orange); color: white; border-color: var(--orange); }
.neighbor-values span, .neighbor-values b { display: block; }
.neighbor-values span { margin-bottom: 8px; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; opacity: .65; }

.knowledge {
  width: min(1220px, calc(100% - 64px));
  margin: 0 auto 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.knowledge article { padding: 35px 35px 10px 0; }
.knowledge .number { color: var(--orange); font: italic 18px Georgia, serif; }
.knowledge h3 { margin: 13px 0 12px; font-size: 16px; }
.knowledge p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

footer {
  padding: 40px max(32px, calc((100% - 1320px) / 2));
  color: #b4babd;
  background: #12191e;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  font-size: 11px;
}
footer div b, footer div span { display: block; }
footer div b { margin-bottom: 6px; color: white; font-size: 17px; }
footer nav { display: flex; gap: 20px; }
footer a { color: #d3d8da; text-decoration: none; }
footer > span { justify-self: end; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr 230px; }
  .hero-equation { width: 190px; height: 190px; }
  .control-strip { grid-template-columns: 1fr 1fr; }
  .project-strip { grid-template-columns: 1fr; }
  .data-actions { justify-content: flex-start; }
  .series-select { grid-column: 1 / -1; }
  .dial-grid { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .dial-grid .dial-card.output { width: auto; margin-top: 0; }
  .dial { max-width: 330px; }
  .result-bar { grid-template-columns: 1fr 1fr; }
  .result-bar > div:nth-child(2) { border: 0; }
  .series-result { grid-column: 1 / -1; padding: 20px 0 0 !important; margin-top: 20px; border-top: 1px solid #3e464b !important; }
  .heater-layout { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr auto; }
  footer nav { order: 3; grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .site-header, .hero, .control-strip, .project-strip, .calculator, .application-panel, .knowledge { width: calc(100% - 28px); }
  .site-header { grid-template-columns: 1fr auto; }
  .formula { display: none; }
  .hero { min-height: auto; padding: 48px 6px 36px; grid-template-columns: 1fr; }
  .hero-equation { display: none; }
  h1 { font-size: 48px; }
  .control-strip { padding: 16px; grid-template-columns: 1fr; gap: 18px; }
  .project-strip { padding: 16px; }
  .project-fields { grid-template-columns: 1fr; }
  .data-actions { display: grid; grid-template-columns: 1fr; }
  .series-select { grid-column: auto; }
  .segmented button { padding: 6px 4px; }
  .segmented button span { display: none; }
  .calculator { padding: 36px 14px 0; }
  .dial-grid { display: block; }
  .dial-card { max-width: 360px; margin: auto; }
  .dial-grid .dial-card.output { width: auto; }
  .operator { margin: 18px 0; }
  .dial { width: min(100%, 330px); }
  .tick-label { font-size: 9px; }
  .minor-label { font-size: 7px; }
  .dial-readout strong { font-size: 18px; }
  .result-bar { margin: 35px -14px 0; padding: 22px; grid-template-columns: 1fr; }
  .result-bar > div { padding: 15px 0; border-right: 0; border-bottom: 1px solid #3e464b; }
  .result-bar > div:first-child { padding-top: 0; }
  .series-result { grid-column: auto; margin: 0; border-top: 0 !important; }
  .panel-heading { display: block; }
  .application-tabs { display: inline-flex; margin-top: 20px; }
  .heater-copy, .safety-card, .general-layout { padding: 24px; }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .general-layout { grid-template-columns: 1fr; }
  .neighbor-values { grid-template-columns: 1fr; }
  .neighbor-values div, .neighbor-values div:last-child { border: 1px solid var(--line); border-bottom: 0; border-radius: 0; }
  .neighbor-values div:first-child { border-radius: 9px 9px 0 0; }
  .neighbor-values div:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 9px 9px; }
  .knowledge { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; }
  footer > span { justify-self: start; }
  footer nav { grid-column: auto; flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
