:root {
  color-scheme: light;
  --bg: #f3f7f6;
  --surface: #ffffff;
  --ink: #17312e;
  --muted: #5f716e;
  --line: #d7e2df;
  --primary: #0f766e;
  --primary-dark: #0b5d57;
  --accent: #e4f3f0;
  --error: #b42318;
  --shadow: 0 18px 45px rgba(22, 57, 52, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #e8f4f1 0, var(--bg) 30rem);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

.site-header,
main,
footer {
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
}

.site-header {
  padding-block: 1.25rem;
}

.brand {
  color: var(--primary-dark);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.calculator-section {
  padding: 2rem 0 3.5rem;
}

.intro {
  max-width: 43rem;
  margin-bottom: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--primary);
  font-weight: 750;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.intro > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.calculator-card {
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

form,
.results {
  padding: 1.5rem;
}

.field + .field {
  margin-top: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #aebfbb;
  border-radius: 0.75rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

input {
  width: 100%;
  min-width: 0;
  height: 3.25rem;
  border: 0;
  outline: 0;
  padding: 0 0.9rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
}

.input-wrap span {
  padding-right: 1rem;
  color: var(--muted);
  font-weight: 700;
}

.field-hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.error-message {
  min-height: 1.6rem;
  margin: 0.8rem 0 0.5rem;
  color: var(--error);
  font-weight: 650;
}

button {
  width: 100%;
  min-height: 3.35rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

button:hover {
  background: var(--primary-dark);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #f4b740;
  outline-offset: 3px;
}

.results {
  background: var(--ink);
  color: white;
}

.results-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.results h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

#result-status {
  color: #b7ceca;
  font-size: 0.8rem;
}

dl {
  margin: 0;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.result-row dt {
  color: #c8d8d5;
}

.result-row dd {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: right;
}

.result-row.featured dd {
  color: #75e1d2;
  font-size: clamp(1.45rem, 5vw, 2rem);
}

.guide {
  max-width: 48rem;
  margin: 0 auto;
  padding: 3.5rem 0;
}

.guide section + section {
  margin-top: 3rem;
}

.guide h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.guide p {
  margin-bottom: 0;
  color: #3e5551;
}

footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (min-width: 48rem) {
  .calculator-section {
    padding-top: 3.5rem;
  }

  .calculator-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  form,
  .results {
    padding: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
