:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef8f6;
  --surface-warm: #fff8ed;
  --text: #1c2430;
  --text-muted: #5c6778;
  --border: #d9e0e8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #dff5f1;
  --blue: #2563eb;
  --amber: #b7791f;
  --danger: #b42318;
  --success: #167a48;
  --shadow: 0 18px 45px rgba(28, 36, 48, 0.09);
  --shadow-soft: 0 10px 24px rgba(28, 36, 48, 0.07);
  --radius: 8px;
  --header-height: 72px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121416;
  --surface: #1b1f24;
  --surface-soft: #152724;
  --surface-warm: #2a2418;
  --text: #f1f5f4;
  --text-muted: #b5c0c6;
  --border: #333b43;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-soft: #143b36;
  --blue: #7aa7ff;
  --amber: #f4bf59;
  --danger: #ff8b7f;
  --success: #6ee7a8;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 18px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
}

body.nav-open {
  overflow: hidden;
}

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

img,
svg {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: var(--header-height);
  padding: 0 40px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--text);
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  line-height: 1;
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.theme-toggle,
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.theme-toggle:hover,
.nav-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.nav-toggle {
  display: none;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.hero {
  min-height: 520px;
  display: flex;
  align-items: center;
  padding: 78px 40px;
  background-image:
    linear-gradient(90deg, rgba(246, 247, 249, 0.96) 0%, rgba(246, 247, 249, 0.9) 37%, rgba(246, 247, 249, 0.48) 70%, rgba(246, 247, 249, 0.22) 100%),
    url("../assets/hero-utility-workspace.png");
  background-position: center;
  background-size: cover;
}

[data-theme="dark"] .hero {
  background-image:
    linear-gradient(90deg, rgba(18, 20, 22, 0.96) 0%, rgba(18, 20, 22, 0.88) 40%, rgba(18, 20, 22, 0.58) 72%, rgba(18, 20, 22, 0.35) 100%),
    url("../assets/hero-utility-workspace.png");
}

.hero-content {
  width: min(720px, 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 800;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  max-width: 820px;
  font-size: 3rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.hero-copy,
.page-hero p {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 1.08rem;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 750;
  line-height: 1.2;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #ffffff;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent-strong);
}

.button-secondary {
  background: var(--surface);
  color: var(--accent-strong);
  border-color: var(--border);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--accent);
}

.button-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.button-ghost:hover,
.button-ghost:focus-visible {
  color: var(--text);
  border-color: var(--text-muted);
}

.search-panel,
.content-section,
.page-hero,
.article-section,
.feature-detail-grid,
.trust-strip,
.calculator-layout {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.search-panel {
  margin-top: 34px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.search-panel.narrow {
  margin-top: 24px;
}

.search-box {
  display: block;
  margin-top: 16px;
}

.search-box input {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.content-section {
  padding: 70px 0 0;
}

.content-section.muted {
  margin-top: 70px;
  padding: 52px 0;
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.content-section.muted > .section-heading,
.content-section.muted > .feature-list {
  width: min(1180px, calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  margin-bottom: 26px;
}

.section-heading.compact {
  margin-bottom: 0;
}

.section-heading h2,
.article-section h2,
.calculator-copy h2,
.info-card h2 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.section-heading p,
.calculator-copy p,
.info-card p,
.article-section p {
  color: var(--text-muted);
}

.section-heading p {
  max-width: 760px;
  margin: 10px 0 0;
}

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

.tool-card,
.info-card,
.calculator-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.tool-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  outline: none;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 900;
  line-height: 1;
}

.tool-card:nth-child(3n) .card-icon {
  background: color-mix(in srgb, var(--blue) 16%, transparent);
  color: var(--blue);
}

.tool-card:nth-child(4n) .card-icon {
  background: color-mix(in srgb, var(--amber) 18%, transparent);
  color: var(--amber);
}

.tool-card h3 {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.35;
}

.tool-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 650;
}

.feature-list a:hover,
.feature-list a:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  outline: none;
}

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

.trust-strip div {
  min-height: 128px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.trust-strip strong,
.trust-strip span {
  display: block;
}

.trust-strip strong {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.trust-strip span {
  color: var(--text-muted);
}

.page-hero {
  padding: 74px 0 28px;
}

.article-section {
  padding: 30px 0 74px;
}

.article-section h2 {
  margin-top: 34px;
}

.article-section h2:first-child {
  margin-top: 0;
}

.article-section p {
  max-width: 900px;
  margin: 12px 0 0;
}

.notice-text {
  display: inline-block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-warm);
  color: var(--text);
}

.feature-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 28px 0 24px;
}

.info-card {
  padding: 24px;
}

.info-card p {
  margin: 12px 0 16px;
}

.info-card a {
  color: var(--accent-strong);
  font-weight: 800;
}

.calculator-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 34px 0 80px;
}

.calculator-nav {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  max-height: calc(100vh - var(--header-height) - 32px);
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.calculator-nav strong {
  margin-bottom: 4px;
}

.calculator-nav a {
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 650;
}

.calculator-nav a:hover,
.calculator-nav a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.calculator-stack {
  display: grid;
  gap: 18px;
}

.calculator-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  gap: 24px;
  padding: 28px;
}

.calculator-section:target {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.calculator-copy p {
  margin: 12px 0 0;
}

.calculator-form {
  display: grid;
  gap: 18px;
}

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

.calculator-form label {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-weight: 700;
}

.calculator-form label.full {
  display: grid;
}

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

.calculator-form textarea {
  min-height: 190px;
  resize: vertical;
}

.calculator-form input:focus,
.calculator-form select:focus,
.calculator-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.check-label {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 44px;
  padding-top: 28px;
}

.check-label input {
  width: 18px;
  height: 18px;
  min-height: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-panel {
  min-height: 64px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
}

.result-panel:empty::before {
  content: "계산 결과가 여기에 표시됩니다.";
  color: var(--text-muted);
}

.result-panel.is-error {
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
}

.result-panel.is-success {
  border-style: solid;
}

.result-title {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 850;
}

.result-value {
  display: block;
  margin: 2px 0 10px;
  color: var(--accent-strong);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.25;
}

.result-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.result-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  padding-bottom: 6px;
}

.result-note {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.empty-state {
  margin: 14px 0 0;
  color: var(--danger);
  font-weight: 750;
}

.is-hidden-by-search {
  display: none !important;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: start;
  padding: 36px 40px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.site-footer p {
  max-width: 640px;
  margin: 10px 0 0;
  color: var(--text-muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
}

.site-footer nav a {
  color: var(--text-muted);
  font-weight: 700;
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: var(--accent-strong);
  outline: none;
}

.copyright {
  grid-column: 1 / -1;
  font-size: 0.92rem;
}

@media (max-width: 1040px) {
  .site-header {
    padding: 0 24px;
    gap: 12px;
  }

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

  .calculator-layout {
    grid-template-columns: 1fr;
  }

  .calculator-nav {
    position: static;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
  }

  .calculator-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    grid-template-columns: auto auto auto;
    justify-content: space-between;
    padding: 0 18px;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    display: none;
    grid-template-columns: 1fr;
    justify-content: start;
    gap: 0;
    padding: 14px 18px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-nav a {
    padding: 13px 8px;
  }

  .hero {
    min-height: 490px;
    padding: 58px 24px;
    background-position: center right 28%;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 2.2rem;
  }

  .search-panel,
  .content-section,
  .page-hero,
  .article-section,
  .feature-detail-grid,
  .trust-strip,
  .calculator-layout {
    width: min(100% - 32px, 1180px);
  }

  .content-section.muted > .section-heading,
  .content-section.muted > .feature-list {
    width: min(100% - 32px, 1180px);
  }

  .feature-detail-grid,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: 1fr;
    padding: 32px 24px;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .logo span:last-child {
    font-size: 0.98rem;
  }

  .hero {
    min-height: 510px;
    background-position: center right 20%;
  }

  .hero-copy,
  .page-hero p {
    font-size: 1rem;
  }

  .hero-actions,
  .form-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

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

  .tool-card {
    min-height: auto;
  }

  .calculator-section,
  .search-panel,
  .info-card {
    padding: 20px;
  }

  .calculator-nav {
    padding: 12px;
  }

  .result-list li {
    display: grid;
    gap: 2px;
  }
}
