:root {
  --background: #fff;
  --text: #202320;
  --muted: #737873;
  --border: #e5e8e5;
  --surface: #f6f7f6;
  --accent: #FF5C00;
  --accent-dark: #d44e00;
  --accent-soft: #f0ae88;
  --shadow: 0 24px 70px rgba(25, 35, 27, 0.08);
  --radius: 24px;
  --max-width: 960px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  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 { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.site-header { border-bottom: 1px solid var(--border); }

.nav {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { font-weight: 750; letter-spacing: -0.035em; }
.brand span, .eyebrow { color: var(--accent); }

.home-link {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 160ms ease;
}
.home-link:hover { color: var(--text); }

.hero { padding-block: clamp(72px, 12vw, 120px) clamp(52px, 8vw, 82px); }

.eyebrow {
  margin: 0 0 18px;
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 720;
}

h1 span { color: #a1a6a1; }

.intro {
  max-width: 540px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.calculator-section { padding-bottom: clamp(84px, 12vw, 132px); }

.calculator-card {
  max-width: 680px;
  padding: clamp(22px, 5vw, 44px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 40px;
  background: #e9ece9;
  border-radius: 14px;
}

.mode-button {
  padding: 11px 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-weight: 650;
}

.mode-button.is-active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 2px 8px rgba(25, 35, 27, 0.07);
}

.field-group { margin: 0 0 28px; padding: 0; border: 0; }
.field-group > label, legend { display: block; margin-bottom: 10px; font-size: 0.86rem; font-weight: 680; }
.legend-note { color: var(--muted); font-weight: 500; }

.input-with-unit {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-with-unit:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.input-with-unit input {
  min-width: 0;
  width: 100%;
  padding: 15px 17px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 1.03rem;
  font-weight: 620;
}

.input-with-unit span { padding-right: 17px; color: var(--muted); font-size: 0.9rem; }

.presets { margin: -10px 0 30px; }
.field-hint { display: block; margin-bottom: 9px; color: var(--muted); font-size: 0.68rem; font-weight: 720; letter-spacing: 0.11em; text-transform: uppercase; }
.preset-list { display: flex; flex-wrap: wrap; gap: 8px; }

.preset {
  padding: 8px 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid #dfe3df;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 650;
}
.preset:hover, .preset.is-active { color: var(--accent-dark); background: var(--accent-soft); border-color: #fabc49; }

.time-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time-inputs--two { grid-template-columns: repeat(2, 1fr); }

.time-inputs label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.time-inputs input {
  width: 100%;
  padding: 14px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: 0;
  font-size: 1rem;
  font-weight: 620;
}
.time-inputs input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.primary-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  color: #fff;
  background: var(--text);
  border: 0;
  border-radius: 13px;
  font-weight: 680;
  transition: background 160ms ease, transform 160ms ease;
}
.primary-button:hover { background: #303630; }
.primary-button:active { transform: translateY(1px); }

.form-error { min-height: 1.4em; margin: 9px 2px 0; color: #b23b32; font-size: 0.8rem; }

.result {
  margin-top: 26px;
  padding-top: 30px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.result-label { margin: 0 0 7px; color: var(--muted); font-size: 0.72rem; font-weight: 720; letter-spacing: 0.11em; text-transform: uppercase; }
.result-value { margin: 0; font-size: clamp(2.8rem, 9vw, 4.8rem); line-height: 1; letter-spacing: -0.06em; font-weight: 720; }
.result-value span { color: var(--accent); font-size: 0.31em; letter-spacing: -0.02em; }
.result-note { margin: 13px 0 0; color: var(--muted); font-size: 0.86rem; }

.site-footer { border-top: 1px solid var(--border); }
.footer-content { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 0.82rem; }

[hidden] { display: none !important; }

@media (max-width: 620px) {
  .shell { width: min(calc(100% - 28px), var(--max-width)); }
  .nav { min-height: 68px; }
  .hero { padding-top: 68px; }
  h1 { font-size: clamp(2.75rem, 15vw, 4.2rem); }
  .calculator-card { border-radius: 20px; box-shadow: none; }
  .time-inputs { gap: 8px; }
  .footer-content { min-height: 110px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 4px; }
}

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