:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f0e8;
  color: #111714;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(17, 23, 20, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 23, 20, .055) 1px, transparent 1px),
    #f3f0e8;
  background-size: 32px 32px;
}

main {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(28px, 7vw, 88px) 0;
}

h1 {
  margin: 0;
  padding: clamp(24px, 4vw, 36px) clamp(24px, 5vw, 48px);
  border-bottom: 2px solid #111714;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: -.04em;
}

.calculator {
  overflow: hidden;
  border: 2px solid #111714;
  border-radius: 20px;
  background: #fbfaf6;
  box-shadow: 8px 8px 0 #111714;
}

.source,
.hours {
  padding: clamp(24px, 5vw, 48px);
}

.source {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(150px, auto);
  align-items: center;
  gap: 16px;
  background: #111714;
  color: #f3f0e8;
}

label {
  font-weight: 750;
  letter-spacing: -.02em;
}

.salary-input {
  display: flex;
  align-items: baseline;
  min-width: 0;
  border-bottom: 2px solid #b8f34a;
}

.salary-input span {
  color: #b8f34a;
  font-size: clamp(1.8rem, 6vw, 3.75rem);
  font-weight: 800;
}

input,
select {
  min-width: 0;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
}

input:focus-visible,
select:focus-visible {
  outline: 3px solid #b8f34a;
  outline-offset: 3px;
}

.salary-input input {
  width: 100%;
  padding: 0 10px;
  outline-offset: 0;
  background: transparent;
  color: #f3f0e8;
  font-size: clamp(2.1rem, 7vw, 4.5rem);
  letter-spacing: -.05em;
}

.source select {
  padding: 13px 36px 13px 14px;
  background: #2a322e;
  color: #f3f0e8;
}

.hours {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 2px solid #111714;
}

.hours-control {
  display: flex;
  gap: 8px;
}

.hours input,
.hours select {
  padding: 12px 14px;
  border: 2px solid #111714;
  background: #fff;
  color: #111714;
}

.hours input { width: 92px; }

.results {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.results div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: clamp(18px, 3vw, 30px);
  border-right: 1px solid #c7c6bd;
}

.results div:last-child { border-right: 0; }

.results span {
  color: #59605c;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.results strong {
  overflow: hidden;
  font-size: clamp(1.05rem, 2.5vw, 1.55rem);
  letter-spacing: -.04em;
  text-overflow: ellipsis;
}

@media (max-width: 700px) {
  .source { grid-template-columns: 1fr; }
  .source label { margin-bottom: -8px; }
  .hours { align-items: stretch; flex-direction: column; }
  .hours-control { display: grid; grid-template-columns: 90px 1fr; }
  .results { grid-template-columns: 1fr 1fr; }
  .results div { border-bottom: 1px solid #c7c6bd; }
  .results div:nth-child(2n) { border-right: 0; }
  .results div:last-child { grid-column: 1 / -1; border-bottom: 0; }
}

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