.row{ display:flex; }
.row--wrap{ flex-wrap:wrap; }
.row--center{ align-items:center; }
.row--between{ justify-content:space-between; }

.gap-6{ gap:6px; }
.gap-8{ gap:8px; }
.gap-10{ gap:10px; }
.gap-12{ gap:12px; }

.mt-10{ margin-top:10px; }
.mt-14{ margin-top:14px; }
.mb-0{ margin-bottom:0; }

.list{ margin:10px 0 0; padding-left:18px; }

/* ========= Sticky footer + page layout ========= */
html, body { height: 100%; }

body{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* main이 남는 높이를 먹어서 footer를 아래로 밀어냄 */
.site-main{
  flex: 1 0 auto;
  display: flex;          /* 자식(.page)이 높이를 채울 수 있게 */
  align-items: stretch;
}

.footer{ flex-shrink: 0; }
.page{ width: 100%; }

/* ========= Page centered: middle vertical + horizontal ========= */
.page--centered{
  flex: 1 0 auto;
  display: flex;
  align-items: center;          /* 세로 중앙 */
  justify-content: center;      /* 가로 중앙 */
  padding: 24px 0;              /* 위아래 숨쉴 공간 */
}

/* 기본 중앙 정렬 (안내/텍스트) */
.page--centered > .stack{
  width: 100%;
  max-width: 840px;
}

/* 넓은 안내/가이드 페이지 (how-it-works, support) */
.page--wide > .stack{
  max-width: 1040px;
}

/* 아주 넓은 구조(필요 시) */
.page--xwide > .stack{
  max-width: 1200px;
}

/* 폼 전용 (signup, login) */
.page--narrow > .stack{
  max-width: 480px;
}

.self-center{
    align-self: center;
}

/* ========= Home hero: 3-slide static ========= */
.hero{
  display: grid;
  gap: 10px;
}

/* 카드 묶음 */
.hero__slides{
  display: grid;
  gap: 12px;
}

/* 각 슬라이드 카드 */
.hero__slide{
  position: relative;
  overflow: hidden;
}

/* 시각적 리듬: 텍스트 줄수 달라도 높이 안정 */
.hero__slide .stack{
  min-height: 160px;
}

/* eyebrow */
.hero__eyebrow{
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .95;
}

/* 타이틀/설명 간격 */
.hero__title{ margin: 6px 0 0; }
.hero__desc{ margin: 0; }

/* CTA 슬라이드 강조(“현재 슬라이드” 느낌) */
.hero__slide--cta{
  border-color: rgba(114,195,147,.55);
  background:
    radial-gradient(900px 220px at 15% -20%, rgba(114,195,147,.16), transparent 55%),
    radial-gradient(900px 220px at 85% 0%, rgba(46,125,98,.12), transparent 55%),
    var(--surface);
}

/* CTA 보조 문구/버튼 간격 */
.hero__ctaHint{ margin: 2px 0 0; }
.hero__cta{ margin-top: 10px; }

/* 도트(기능 없음, “슬라이드 인디케이터” 역할만) */
.hero__dots{
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 4px 0 0;
  opacity: .9;
}
.hero__dot{
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(102,112,133,.55);
}
.hero__dot--active{
  width: 18px;
  background: rgba(114,195,147,.95);
}

/* Responsive: Desktop slide preview */
/* ===== Desktop: "슬라이드 미리보기" 느낌 ===== */
@media (min-width: 980px){
  .hero__slides{
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  /* 1~2번 슬라이드는 미리보기처럼 살짝 톤 다운 */
  .hero__slide:not(.hero__slide--cta){
    opacity: .92;
  }

  /* CTA는 전체 폭으로 크게 */
  .hero__slide--cta{
    grid-column: 1 / -1;
  }

  /* CTA는 더 넉넉하게 */
  .hero__slide--cta .stack{
    min-height: 190px;
  }
}

/* ===== Wide desktop: 카드가 너무 길게 퍼지면 중앙 정렬감 유지 ===== */
@media (min-width: 1200px){
  .hero__slide .stack{
    padding-left: 26px;
    padding-right: 26px;
  }
}

/* muted text link (CTA의 3번째 옵션) */
.link{
  text-decoration: none;
}
.link:hover{
  text-decoration: underline;
}

.link--muted{
  color: var(--muted);
  align-self: center; /* 버튼 줄에서 수평 정렬 */
}

/* ========= Home Hero: single-card slider (JS-enhanced) ========= */
/* Base layout */
.hero.hero--single{
  display: grid;
  gap: 12px;
}

.heroCard{
  padding: 0; /* 카드 내부에서 섹션별 패딩으로 컨트롤 */
  overflow: hidden;
}

.heroCard__viewport{
  display: flex;
  align-items: flex-start;         /* 요구사항: 수직 중앙 */
  padding: 22px 20px;
  min-height: 220px;
}

.heroPanel{
  width: 100%;
}

.heroPanel.is-active{
  /* hook only (no heavy styles) */
}

@media (min-width: 980px){
  .heroCard__viewport{
    min-height: 320px;         /* 요구사항 */
    padding: 28px 28px;
  }
}

/* bottom chrome */
.heroChrome{
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-top: 1px solid var(--border);  /* divider */
  background: var(--surface-2);
}

.heroPrev,
.heroNext{
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  height: 36px;
  cursor: pointer;
}

.heroPrev:hover,
.heroNext:hover{
  filter: brightness(1.03);
}

.heroPrev:focus-visible,
.heroNext:focus-visible,
.heroDot:focus-visible{
  outline: 2px solid color-mix(in srgb, var(--brand), transparent 35%);
  outline-offset: 2px;
}

.heroDots{
  display: flex;
  justify-content: center; /* 도트 중앙 */
  align-items: center;
  gap: 8px;
}

.heroDot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted), transparent 55%);
  padding: 0;
  cursor: pointer;
}

.heroDot.is-active{
  width: 22px;
  background: color-mix(in srgb, var(--brand), transparent 10%);
  border-color: color-mix(in srgb, var(--brand), transparent 40%);
}

/* JS-enhanced: Animation + visibility control */
/* when is-js class is present, apply transitions */
.hero--single.is-js .heroCard__viewport{
  /* 기존 viewport 패딩/정렬을 유지해서 '비어보임' 방지 */
  position: relative;
}

/* hidden 패널은 display:none 처리(SSR/JS 모두 일관) */
.hero--single.is-js .heroPanel[hidden]{
  display: none !important;
}

/* 활성 패널만 보이고, 진입 애니메이션만 줌 */
.hero--single.is-js .heroPanel.is-active{
  animation: heroFadeUp 220ms ease;
}

@keyframes heroFadeUp{
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* reduce motion: 전환/모션 완전 비활성화 */
@media (prefers-reduced-motion: reduce){
  .hero--single.is-js .heroPanel.is-active{
    animation: none;
  }
}

/* ===== Hero content enrichment ===== */
.heroMeta{
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

/* 배지 */
.heroBadges{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* bullet */
.heroBullets{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.heroBullets li::before{
  content: "•";
  margin-right: 6px;
  color: var(--brand);
}

/* 카드가 비어 보이지 않게 만드는 아주 옅은 배경 레이어 */
.heroCard::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 220px at 20% -10%, rgba(114,195,147,.10), transparent 55%),
    radial-gradient(800px 220px at 80% 0%, rgba(46,125,98,.08), transparent 55%);
  pointer-events: none;
}

/* ========= Hero slide variants ========= */
/* Base: accent line on left (all variants) */
.heroPanel{
  position: relative;
  padding-left: 14px;
}
.heroPanel::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 40px;
  border-radius: 2px;
  opacity: .9;
  pointer-events: none;
}

/* Variant: connect (green accent) */
.heroPanel[data-variant="connect"]::before{
  background: rgba(114,195,147,.9);
}
.heroPanel[data-variant="connect"] .badge{
  background: rgba(114,195,147,.12);
  color: #2e7d62;
}

/* Variant: efficiency (blue accent) */
.heroPanel[data-variant="efficiency"]::before{
  background: rgba(80,120,160,.9);
}
.heroPanel[data-variant="efficiency"] .badge{
  background: rgba(80,120,160,.12);
  color: #355a7a;
}

/* Variant: cta (brand accent, + typography override) */
.heroPanel[data-variant="cta"]::before{
  background: var(--brand);
}
.heroPanel[data-variant="cta"] .hero__title{
  letter-spacing: -.01em; /* variant override: typography enhance */
}

@media (max-width: 820px){
  .footer__group--biz{ display:none; }
}

@media (max-width: 820px){
  .footer__linklist{
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }
}

.footer__details > summary{ cursor: pointer; }
@media (min-width: 821px){
  .footer__details{ display:block; }
  .footer__details[open]{ /* 데스크탑에서는 상관 없음 */ }
}
@media (max-width: 820px){
  .footer__details{ width:100%; }
}

/* ===== Legal pages (Terms/Privacy) ===== */
.h3{ font-size: 15px; line-height: 1.35; margin: 0; }

.legal h2{ margin-top: 18px; }
.legal h3{ margin-top: 12px; color: var(--text); opacity: .95; }
.legal p, .legal li{ line-height: 1.85; }
.legal p{ margin: 0; }
.legal ul{ margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.legal hr{ border:0; border-top:1px solid var(--border); margin: 16px 0; }

/* 목차 */
.legal__toc{ border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.legal__toc > summary{ list-style: none; }
.legal__toc > summary::-webkit-details-marker{ display:none; }
.legal__toc ul{ margin-top: 10px; }
@media (min-width: 980px){
  .legal__toc ul{ grid-template-columns: 1fr 1fr; column-gap: 16px; }
}

/* ===== Mobile footer compact ===== */
@media (max-width: 820px){
  /* 비즈니스 링크 그룹 숨김 (원하면 display:none -> details로 교체 가능) */
  .footer__group--biz{ display:none; }

  /* 정책 링크는 가로로 짧게 */
  .footer__group .footer__linklist{
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }
}


/* ==========================================================================
   Footer (mobile compressed via <details>)
   ========================================================================== */
.footer__details{
  border: 1px solid var(--footer-border);
  border-radius: 12px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--footer-bg), #fff 6%);
}

.footer__details > summary{
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
  color: var(--footer-text);
}

.footer__details > summary::-webkit-details-marker{ display:none; }

.footer__details > summary:after{
  content: "▾";
  opacity: .8;
  transform: translateY(-1px);
}

.footer__details[open] > summary:after{
  content: "▴";
}

.footer__details .footer__linklist{
  margin-top: 8px;
}

/* Desktop: details looks like normal group (no box) */
@media (min-width: 821px){
  .footer__details{
    border: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }
  .footer__details > summary:after{ content:""; }
}

/* ==========================================================================
   Print styles (legal pages)
   - Makes Terms/Privacy printable (A4 friendly)
   - Removes dark backgrounds/gradients, keeps typography clean
   ========================================================================== */
@media print{
  /* Reset backgrounds/colors for print */
  html, body{
    background: #fff !important;
    color: #000 !important;
  }
  body{
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide global nav/footer on print */
  .nav, .footer{ display:none !important; }

  /* Expand container to full width */
  .container{ width: 100% !important; margin: 0 !important; }

  /* Remove card chrome */
  .card{
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  /* Legal typography */
  .legal{
    font-size: 11.5pt;
    line-height: 1.55;
  }
  .legal h1, .legal .h1{ font-size: 18pt !important; margin: 0 0 10pt !important; }
  .legal h2, .legal .h2{ font-size: 13pt !important; margin: 14pt 0 6pt !important; }
  .legal h3{ font-size: 11.5pt !important; margin: 10pt 0 4pt !important; }

  /* Avoid awkward page breaks */
  h1, h2, h3{ break-after: avoid-page; page-break-after: avoid; }
  p, li{ orphans: 3; widows: 3; }
  ul, ol{ break-inside: avoid; page-break-inside: avoid; }

  /* Hide table-of-contents UI if present */
  .legal-toc, details.legal-toc{ display:none !important; }

  /* Links: show URL in print */
  a[href^="http"]:after, a[href^="https"]:after{
    content: " (" attr(href) ")";
    font-size: 9pt;
  }
  a{ color:#000 !important; text-decoration: underline !important; }
}

/* =========================================================
   Mobile nav (details dropdown)
   - Desktop: 기존 nav__links 표시
   - Mobile: nav__links 숨기고 details 메뉴 표시
   ========================================================= */

/* iOS Safari 텍스트 자동 확대 방지 (로고 과대 표시 방지) */
html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.nav__brand{
  font-size: 16px;
  line-height: 1;
}

/* 모바일 메뉴 기본은 숨김(데스크탑용) */
.nav__mobile{ display:none; }

@media (max-width: 520px){
  /* 데스크탑 링크 숨김 */
  .nav__links--desktop{ display:none; }

  /* 모바일 메뉴 표시 */
  .nav__mobile{
    display:block;
    position: relative;
  }

  /* summary 기본 삼각형 제거 */
  .nav__mobile > summary{
    list-style: none;
  }
  .nav__mobile > summary::-webkit-details-marker{
    display:none;
  }

  /* summary를 버튼처럼 */
  .nav__mobile_btn{
    cursor: pointer;
    user-select: none;
    border-radius: 999px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 14px;
    line-height: 1.2;
  }

  /* 패널 */
  .nav__mobile_panel{
    position: absolute;
    right: 0;
    top: 40px;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 50;
  }

  .nav__mobile_panel a{
    display:block;
    padding: 10px 10px;
    border-radius: 10px;
    text-decoration: none;
  }
  .nav__mobile_panel a:hover{
    background: rgba(114,195,147,.14);
  }

  .nav__mobile_divider{
    height: 1px;
    background: color-mix(in srgb, var(--border), transparent 35%);
    margin: 6px 6px;
  }

  .nav__mobile_logout{
    margin: 8px 6px 4px;
  }
  .nav__mobile_logout .btn{
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   Mobile nav UX polish (hamburger + open state)
   ========================================================= */

@media (max-width: 520px){
  /* 햄버거 버튼처럼 보이게 */
  .nav__mobile_btn{
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  /* summary 텍스트를 아이콘화(☰) */
  .nav__mobile_btn::before{
    content: "☰";
    font-size: 16px;
    line-height: 1;
    opacity: .95;
  }

  /* 기본 "메뉴" 글자는 공간 절약을 위해 숨김(원하면 주석 처리) */
  .nav__mobile_btn{
    font-size: 0; /* 텍스트 숨김 */
  }
  .nav__mobile_btn::before{
    font-size: 16px; /* 아이콘만 보이게 */
  }

  /* 열렸을 때 버튼 강조 */
  .nav__mobile[open] .nav__mobile_btn{
    outline: none;
    border-color: rgba(114,195,147,.70);
    background: rgba(114,195,147,.14);
  }

  /* 패널이 너무 화면 밖으로 튀는 것 방지 */
  .nav__mobile_panel{
    max-width: calc(100vw - 24px);
  }
}

/* =========================================================
   Mobile nav overlay + scroll lock helpers
   ========================================================= */

/* 스크롤 잠금용 클래스 (JS가 body에 토글) */
body.is-locked{
  overflow: hidden;
  touch-action: none;
}

/* 모바일에서만 overlay/패널 UX 적용 */
@media (max-width: 520px){
  /* overlay는 JS가 <div class="nav__overlay">로 body에 삽입 */
  .nav__overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    z-index: 45;
  }

  /* 기존 패널은 absolute였는데 overlay 위에 자연스럽게 떠야 하므로 fixed 권장 */
  .nav__mobile_panel{
    position: fixed;
    right: 12px;
    top: 56px;               /* 헤더 높이에 맞춰 적당히 */
    min-width: 220px;
    max-width: calc(100vw - 24px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 50;
  }

  /* 패널 내부 링크 터치 영역 강화 */
  .nav__mobile_panel a{
    padding: 11px 12px;
  }
}

/* =========================================================
   Nav visibility rules (desktop vs mobile)
   - Desktop: 기존 nav 링크만 보임
   - Mobile: details 메뉴만 보임
   ========================================================= */

/* 기본값: 데스크탑 */
.nav__links--desktop{ display:flex; }
.nav__mobile{ display:none; }

/* 모바일 */
@media (max-width: 520px){
  .nav__links--desktop{ display:none; }
  .nav__mobile{ display:block; }
}