/* Fonts (next/font is unavailable in registry modules) — load via @import.
   layout.tsx used IBM_Plex_Sans_KR (--font-plex) + Black_Han_Sans (--font-numeral). */
@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=IBM+Plex+Sans+KR:wght@400;500;700&display=swap');

:root {
  --font-plex: 'IBM Plex Sans KR';
  --font-numeral: 'Black Han Sans';
}

:root {
  --spruce: #2f6e6a;
  --spruce-deep: #1e4a47;
  --spruce-soft: #e4efed;
  --spruce-tint: #f0f6f5;
  --spruce-line: #cde0dd;
  --ink: #15302e;
  --ink-soft: #45615e;
  --muted: #7c9794;
  --paper: #ffffff;
  --bg: #f3f8f7;
  --accent: #e0a13a;
  --accent-deep: #b97f23;
  --accent-soft: #fbedd2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 44px rgba(30, 74, 71, 0.12);
  --shadow-soft: 0 10px 26px rgba(30, 74, 71, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 100% -10%, rgba(47, 110, 106, 0.1), transparent 32rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-plex), ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.014em;
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-deep);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 30;
  background: var(--spruce-deep);
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

/* ============ Persistent header: brand + STEP/progress motif (not nav links) ============ */
.site-header {
  background: linear-gradient(180deg, var(--spruce-tint), var(--paper));
  border-bottom: 1px solid var(--spruce-line);
}

.site-header-inner {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--spruce-soft);
  color: var(--spruce);
  border: 1px solid var(--spruce-line);
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.brand-text strong {
  display: block;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--spruce-deep);
}

.brand-text small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.progress-motif {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}

.progress-label {
  color: var(--spruce-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.progress-track {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-node {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-node:not(:last-child)::after {
  content: "";
  width: 28px;
  height: 2px;
  margin: 0 12px;
  background: var(--spruce-line);
}

.progress-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.progress-name {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
}

/* ============ Main width ============ */
main {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

.article-shell {
  width: min(840px, calc(100% - 48px));
}

/* ============ Lead (home) ============ */
.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 56px;
  align-items: center;
  padding: 72px 0 56px;
}

.lead h1 {
  font-size: clamp(2rem, 3.4vw, 3.05rem);
  line-height: 1.26;
}

.lead-lede {
  max-width: 30rem;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.78;
}

.legend-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.legend-strip li {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 150px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--spruce-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.legend-num {
  font-family: var(--font-numeral), system-ui, sans-serif;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--accent);
}

.legend-body strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--spruce-deep);
}

.legend-body small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.lead-cover {
  min-height: clamp(280px, 30vw, 400px);
  border-radius: 22px;
  border: 1px solid var(--spruce-line);
  background:
    linear-gradient(180deg, rgba(30, 74, 71, 0.05), rgba(30, 74, 71, 0.22)),
    url("/images/spruceguide-lead.jpg") center / cover no-repeat,
    linear-gradient(150deg, #cfe3e0 0%, #e9f1ee 52%, #f3ece0 100%);
  box-shadow: var(--shadow);
}

/* ============ Section heading ============ */
.band-heading {
  margin-bottom: 30px;
}

.band-heading h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
}

.band-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

/* ============ Guided paths (signature: vertical numbered step-paths) ============ */
.paths {
  padding: 30px 0 60px;
}

.path-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.path {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.42fr);
  gap: 40px;
  background: var(--paper);
  border: 1px solid var(--spruce-line);
  border-radius: var(--radius);
  padding: 34px 38px;
  box-shadow: var(--shadow-soft);
}

.path-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.path-index {
  font-family: var(--font-numeral), system-ui, sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  color: var(--accent-deep);
}

.path-chip {
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--spruce-soft);
  color: var(--spruce-deep);
  font-size: 0.74rem;
  font-weight: 700;
}

.path-head h3 {
  margin: 14px 0 0;
  font-size: 1.42rem;
  line-height: 1.34;
}

.path-head h3 a:hover {
  color: var(--spruce);
}

.path-head > p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
  line-height: 1.68;
}

.path-count {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.path-cta {
  margin-top: auto;
  padding-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--spruce-deep);
  font-weight: 700;
}

.path-cta::after {
  content: "→";
  transition: transform 0.16s ease;
}

.path-cta:hover::after {
  transform: translateX(4px);
}

.path-steps {
  position: relative;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.path-steps::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--spruce-line) 100%);
}

.path-step {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 12px 0;
}

.step-num {
  position: relative;
  z-index: 1;
  flex: none;
  width: 40px;
  text-align: center;
  font-family: var(--font-numeral), system-ui, sans-serif;
  font-size: 1.85rem;
  line-height: 1;
  color: var(--accent);
}

.step-label {
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 500;
  line-height: 1.5;
}

/* ============ Prep band (identity: 준비물) ============ */
.prep {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 44px;
  align-items: center;
  margin: 8px 0 56px;
  padding: 44px;
  background: var(--spruce-tint);
  border: 1px solid var(--spruce-line);
  border-radius: 22px;
}

.prep-intro h2 {
  font-size: clamp(1.55rem, 2.5vw, 2rem);
}

.prep-intro p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  line-height: 1.72;
}

.prep-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prep-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--spruce-line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.5;
}

.prep-marker {
  flex: none;
  font-family: var(--font-numeral), system-ui, sans-serif;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.home-disclosure {
  margin: 0 0 64px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ============ Footer (persistent) ============ */
.site-footer {
  border-top: 1px solid var(--spruce-line);
  background: var(--spruce-tint);
}

.footer-inner {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 54px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.footer-brand strong {
  font-size: 1.1rem;
  color: var(--spruce-deep);
}

.footer-desc {
  margin: 14px 0 12px;
  max-width: 34rem;
  color: var(--ink-soft);
  line-height: 1.66;
  font-size: 0.95rem;
}

.footer-note {
  display: inline-block;
  margin: 0;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--spruce-soft);
  color: var(--spruce-deep);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ============ Article: step-by-step ============ */
.article-shell {
  padding: 34px 0 80px;
}

.path-return {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.path-return::before {
  content: "←";
  color: var(--accent-deep);
}

.path-return:hover {
  color: var(--spruce-deep);
}

.guide {
  background: var(--paper);
  border: 1px solid var(--spruce-line);
  border-radius: 22px;
  padding: clamp(28px, 5vw, 54px);
  box-shadow: var(--shadow-soft);
}

.guide-tagline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.guide-cat {
  color: var(--spruce-deep);
  font-size: 0.82rem;
  font-weight: 700;
}

.guide-head h1 {
  margin: 16px 0 0;
  font-size: clamp(1.8rem, 3.2vw, 2.55rem);
  line-height: 1.3;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Quick conclusion: bold, direct callout (identity: 단정하고 직접적인) */
.quick-take {
  margin: 30px 0 6px;
  padding: 26px 28px;
  background: var(--spruce-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.quick-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.quick-kicker::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.quick-take p {
  margin: 0;
  color: #eef6f4;
  font-size: 1.08rem;
  line-height: 1.74;
}

/* The step path: each <h2> in injected content becomes a numbered step on a connector rail */
.article-content {
  margin-top: 34px;
  color: #233e3b;
  font-size: 1.06rem;
  line-height: 1.86;
}

.article-content.step-path {
  position: relative;
  counter-reset: step;
  padding-left: 72px;
}

.article-content.step-path::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 8px;
  bottom: 18px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--spruce-line) 90%);
}

.article-content.step-path > p:first-child {
  margin-top: 0;
  color: var(--ink-soft);
}

.article-content.step-path h2 {
  counter-increment: step;
  position: relative;
  margin: 46px 0 16px;
  font-size: clamp(1.32rem, 2.3vw, 1.6rem);
  line-height: 1.36;
}

.article-content.step-path h2::before {
  content: counter(step);
  position: absolute;
  left: -72px;
  top: -6px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-numeral), system-ui, sans-serif;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(224, 161, 58, 0.36);
}

.article-content p {
  margin: 0 0 18px;
}

.article-content a {
  color: var(--spruce-deep);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 11px;
}

.article-content ul li {
  position: relative;
  padding-left: 28px;
  color: var(--ink-soft);
  line-height: 1.62;
}

.article-content ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.34em;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--spruce);
  border-bottom: 2px solid var(--spruce);
  transform: rotate(-45deg);
}

.article-content blockquote {
  margin: 26px 0;
  padding: 20px 26px;
  border-left: 4px solid var(--accent);
  background: var(--spruce-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--spruce-deep);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.7;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.96rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--spruce-line);
}

.article-content th,
.article-content td {
  border-bottom: 1px solid var(--spruce-line);
  border-right: 1px solid var(--spruce-line);
  padding: 13px 15px;
  text-align: left;
  vertical-align: top;
}

.article-content th:last-child,
.article-content td:last-child {
  border-right: 0;
}

.article-content tbody tr:last-child td {
  border-bottom: 0;
}

.article-content th {
  background: var(--spruce-soft);
  color: var(--spruce-deep);
  font-weight: 700;
}

/* Closing checklist */
.closing-check {
  margin-top: 44px;
  padding: 26px 28px;
  background: var(--accent-soft);
  border: 1px solid #f0dcae;
  border-radius: var(--radius);
}

.closing-check h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.55rem);
}

.closing-note {
  margin: 8px 0 16px;
  color: var(--ink-soft);
}

.check-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding: 13px 16px 13px 44px;
  background: var(--paper);
  border: 1px solid #f0dcae;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.5;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 1.15em;
  width: 13px;
  height: 8px;
  border-left: 2.5px solid var(--accent-deep);
  border-bottom: 2.5px solid var(--accent-deep);
  transform: rotate(-45deg);
}

/* FAQ */
.faq-section {
  margin-top: 44px;
}

.faq-section h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  margin-bottom: 8px;
}

.faq-section details {
  border-bottom: 1px solid var(--spruce-line);
  padding: 16px 0;
}

.faq-section summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
}

.faq-section summary::-webkit-details-marker {
  display: none;
}

.faq-section summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  color: var(--accent-deep);
  font-weight: 800;
}

.faq-section details[open] summary::before {
  content: "–";
}

.faq-section details p {
  margin: 10px 0 0 1.2em;
  color: var(--ink-soft);
  line-height: 1.74;
}

/* Source note */
.source-note {
  margin-top: 36px;
  padding: 22px 24px;
  background: var(--spruce-tint);
  border: 1px dashed var(--spruce-line);
  border-radius: var(--radius);
}

.source-note h2 {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  margin-bottom: 8px;
}

.source-note p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.74;
}

.guide-foot {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--spruce-line);
}

.next-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--spruce-deep);
  font-weight: 700;
}

.next-link::after {
  content: "→";
}

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .lead {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 48px 0 40px;
  }

  .lead-cover {
    order: -1;
    min-height: 220px;
  }

  .path {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .path-cta {
    margin-top: 4px;
  }

  .prep {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px;
  }
}

@media (max-width: 720px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .progress-motif {
    align-items: flex-start;
  }

  .progress-name {
    display: none;
  }

  .legend-strip li {
    flex: 1 1 100%;
  }
}

@media (max-width: 560px) {
  .article-content.step-path {
    padding-left: 56px;
  }

  .article-content.step-path::before {
    left: 17px;
  }

  .article-content.step-path h2::before {
    left: -56px;
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .article-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
