:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-soft: #eef5f3;
  --ink: #17211f;
  --muted: #5f6f6a;
  --line: #dbe5e1;
  --accent: #0f766e;
  --accent-strong: #0b5e57;
  --accent-soft: #d9f2ed;
  --warn: #8a4b12;
  --error: #a31d1d;
  --shadow: 0 16px 40px rgba(19, 45, 39, 0.09);
  --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

a { color: var(--accent-strong); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: #083f3a; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 0.8rem;
  z-index: 20;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner,
.container,
.footer-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.9rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: white;
  background: var(--accent);
}

.site-nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
}

.site-nav a,
.footer-links a {
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
}

.site-nav a:hover,
.footer-links a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.home-hero,
.page-hero {
  background: linear-gradient(180deg, #ffffff 0%, #edf7f4 100%);
  border-bottom: 1px solid var(--line);
}

.home-hero { padding: 3rem 0 2.4rem; }
.page-hero.compact { padding: 2.2rem 0; }

.hero-grid {
  display: grid;
  gap: 1.4rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3 {
  line-height: 1.3;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4.2rem);
}

h2 { margin: 2rem 0 0.7rem; font-size: 1.45rem; }
h3 { margin: 0 0 0.45rem; font-size: 1.05rem; }

.lead {
  max-width: 720px;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.72rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.primary { background: var(--accent); color: #fff; }
.button.secondary { background: #fff; color: var(--accent-strong); }

.insight-panel,
.side-box,
.card,
.result-panel,
.calculator-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.insight-panel {
  padding: 1.2rem;
}

.insight-panel h2 { margin-top: 0; }
.insight-panel ol { padding-left: 1.2rem; margin-bottom: 1rem; }

.bar-chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 0.55rem;
  height: 120px;
  padding: 0.8rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.bar-chart span {
  display: block;
  min-height: 16px;
  background: var(--accent);
  border-radius: 6px 6px 2px 2px;
}

.intro-strip {
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  color: var(--warn);
}

.section-heading { margin: 2.5rem 0 1rem; }
.section-heading p { color: var(--muted); }

.card-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.card {
  padding: 1rem;
}

.card p { color: var(--muted); margin-bottom: 0; }

.content-layout {
  display: grid;
  gap: 1.4rem;
  padding: 2rem 0 3rem;
}

.content-main {
  min-width: 0;
}

.content-main.single {
  max-width: 820px;
  padding-bottom: 3rem;
}

.content-main p { max-width: 76ch; }

.content-side {
  min-width: 0;
}

.side-box {
  padding: 1rem;
}

.side-box h2 { margin-top: 0; font-size: 1.1rem; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th, td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th { width: 34%; background: #f2f7f5; }

.check-list,
.example-list,
.related-list,
.sitemap-list {
  padding-left: 1.2rem;
}

.check-list li,
.example-list li,
.related-list li,
.sitemap-list li {
  margin: 0.45rem 0;
}

.calculator-form {
  padding: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.9rem;
}

label span:first-child {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: 0.78rem 0.8rem;
  border: 1px solid #cbd8d4;
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}

.input-row em {
  flex: 0 0 auto;
  color: var(--muted);
  font-style: normal;
  font-size: 0.92rem;
}

.form-error {
  min-height: 1.4rem;
  color: var(--error);
  font-weight: 700;
}

.result-panel {
  padding: 1rem;
  overflow-wrap: anywhere;
}

.result-panel strong { color: var(--accent-strong); }

.copy-status {
  min-height: 1.4rem;
  color: var(--accent-strong);
  font-weight: 700;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.8rem 0.9rem;
  margin: 0.65rem 0;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 1.6rem 0;
}

.footer-inner {
  display: grid;
  gap: 1rem;
}

.fine-print {
  width: min(1120px, calc(100% - 32px));
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (min-width: 720px) {
  .header-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    align-items: center;
  }

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

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

@media (min-width: 980px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .content-side {
    position: sticky;
    top: 92px;
    align-self: start;
  }
}

@media (max-width: 420px) {
  .header-inner,
  .container,
  .footer-inner,
  .fine-print {
    width: min(100% - 24px, 1120px);
  }

  .button {
    width: 100%;
  }

  h1 {
    font-size: 2rem;
  }
}
