/* ==========================================================================
   home.css — 홈 전용 스타일 (Agent B)
   토큰·공용 컴포넌트(.wrap .band .chip .card .grid .btn 등)는 app.css 소유.
   여기에는 홈에서만 쓰는 블록만 둔다. 모바일 우선.
   ========================================================================== */

/* ── 히어로 ─────────────────────────────────────────────────────────── */

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
  padding-top: clamp(36px, 6vw, 72px);
  padding-bottom: clamp(40px, 6vw, 76px);
}

.guide-hero__kicker {
  margin: 0;
  color: var(--terracotta-deep);
  font-size: 14px;
  font-weight: 800;
}

.guide-hero__copy h1 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: clamp(1.9rem, 4.4vw, 3.15rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.guide-hero__copy .lede {
  max-width: 56ch;
  margin: 18px 0 0;
}

.guide-hero__situations {
  margin-top: clamp(22px, 3vw, 30px);
}

.guide-hero__situations-label {
  margin: 0 0 10px;
  color: var(--body);
  font-size: 13px;
  font-weight: 800;
}

.guide-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(22px, 3vw, 30px);
}

.guide-hero__visual {
  position: relative;
}

.guide-hero__visual figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--paper-edge);
  box-shadow: var(--shadow-2);
}

.guide-hero__visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.guide-hero__badge {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: min(240px, calc(100% - 28px));
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--card);
  box-shadow: var(--shadow-2);
}

.guide-hero__badge strong {
  color: var(--sage-deep);
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.guide-hero__badge span {
  color: var(--body); /* --muted는 12.5px에서 4.1:1로 AA 미달 */
  font-size: 12.5px;
  line-height: 1.45;
}

@media (min-width: 900px) {
  .guide-hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  }

  .guide-hero__visual figure,
  .guide-hero__visual img {
    min-height: 440px;
  }
}

/* ── 처음 오셨나요? — 가이드북 차례 ─────────────────────────────────── */

.starter {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(22px, 3.5vw, 44px);
}

.starter__intro h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.starter__intro p {
  max-width: 40ch;
  margin: 12px 0 0;
  color: var(--body);
  line-height: 1.65;
}

.starter__toc {
  margin: 0;
  padding: clamp(6px, 1vw, 10px) 0;
  list-style: none;
}

.starter__toc li + li {
  border-top: 1px solid var(--line-soft);
}

.starter__toc a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 4px;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r-xs);
}

.starter__num {
  flex: none;
  color: var(--terracotta);
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.starter__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.starter__topic {
  color: var(--body); /* band--warm 위 --muted는 3.7:1 — AA 미달이라 --body */
  font-size: 12.5px;
  font-weight: 700;
}

.starter__text strong {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  font-weight: 750;
  line-height: 1.4;
}

.starter__toc a:hover .starter__text strong {
  color: var(--sage-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.starter__leader {
  flex: 1 1 24px;
  min-width: 24px;
  border-bottom: 2px dotted var(--line);
  transform: translateY(-4px);
}

.starter__min {
  flex: none;
  color: var(--body);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
  .starter {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    align-items: start;
  }
}

/* ── 주제 4카드 ─────────────────────────────────────────────────────── */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(16px, 2.2vw, 24px);
}

.topic-card {
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2.4vw, 26px);
  border-radius: var(--r-md);
  background: var(--card-warm);
  border: 1px solid var(--line-soft);
  transition: border-color 0.2s var(--ease);
}

.topic-card:hover {
  border-color: var(--sage);
}

.topic-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topic-card__head h3 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.015em;
}

.topic-card__head a {
  color: var(--ink);
  text-decoration: none;
}

.topic-card__head a:hover {
  color: var(--sage-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topic-card__desc {
  margin: 10px 0 0;
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.6;
}

.topic-card .link-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.topic-card__more {
  margin-top: auto;
  padding-top: 16px;
  font-size: 14px;
  font-weight: 700;
}

/* ── 글 링크 리스트 (주제 카드·상황 카드 공용) ───────────────────────── */

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list li + li {
  margin-top: 9px;
}

.link-list a {
  display: block;
  position: relative;
  padding-left: 16px;
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.5;
  text-decoration: none;
}

.link-list a::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
}

.link-list a:hover {
  color: var(--sage-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 상황별 빠른 찾기 ───────────────────────────────────────────────── */

/* 항목 수가 다른 12개 카드가 행 높이를 강제로 맞추면 빈 공간이 크게 남는다.
   multicol 기반 masonry로 각 카드가 내용 높이만 차지하게 한다(280px = 기존 grid 최소폭 유지). */
.situation-grid {
  columns: 280px;
  column-gap: clamp(16px, 2.2vw, 24px);
}

.situation {
  break-inside: avoid;
  margin-bottom: clamp(16px, 2.2vw, 24px);
  padding: clamp(18px, 2.4vw, 24px);
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line-soft);
  scroll-margin-top: 90px;
}

.situation:target {
  border-color: var(--terracotta);
}

.situation h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.015em;
}

.situation__blurb {
  margin: 8px 0 0;
  color: var(--body); /* 흰 카드 위 --muted 4.1:1 — 13.5px 본문형이라 --body */
  font-size: 13.5px;
  line-height: 1.55;
}

.situation .link-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

/* ── 마미챗 이야기 ──────────────────────────────────────────────────── */

.story {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
}

.story__copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.story__copy p {
  max-width: 58ch;
  margin: 16px 0 0;
  color: var(--body);
  line-height: 1.75;
}

.story__promises {
  padding: clamp(20px, 2.6vw, 28px);
  border-radius: var(--r-md);
  background: var(--card-warm);
  border: 1px solid var(--line-soft);
}

.story__promises h3 {
  margin: 0;
  color: var(--sage-deep);
  font-size: 1rem;
}

.story__promises ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.story__promises li {
  position: relative;
  padding-left: 30px;
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.6;
}

.story__promises li + li {
  margin-top: 13px;
}

.story__promises li strong {
  color: var(--ink);
}

.story__promises li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.5 10.5l3 3 6-6.5" fill="none" stroke="%234E6B4C" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>')
    center / 14px no-repeat,
    var(--sage-soft);
}

@media (min-width: 900px) {
  .story {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    align-items: start;
  }
}

/* ── 마무리 회수 블록 ───────────────────────────────────────────────── */

.home-cta {
  text-align: center;
}

.home-cta h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.home-cta__actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.home-cta__topics {
  justify-content: center;
  margin-top: 16px;
}

/* ── 접근성·모션 ────────────────────────────────────────────────────── */

.guide-hero a:focus-visible,
.starter__toc a:focus-visible,
.link-list a:focus-visible,
.topic-card a:focus-visible {
  outline: 3px solid var(--terracotta-deep);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .topic-card {
    transition: none;
  }
}
