/* ==========================================================================
   base.css — 리셋 · 웹폰트 · 타이포그래피 · 레이아웃 유틸
   --------------------------------------------------------------------------
   웹폰트: Pretendard (SIL Open Font License 1.1 / 상업적 사용 무료)
   지금은 jsDelivr CDN 을 사용합니다. 나중에 외부 의존을 없애고 속도를
   더 올리려면 pretendard woff2 파일을 assets/fonts/ 에 넣고
   아래 @import 를 @font-face 로 교체하세요. (README 참고)
   ========================================================================== */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

/* ---------- 리셋 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  letter-spacing: -0.01em;
  word-break: keep-all;      /* 한글 단어 중간 줄바꿈 방지 */
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 타이포그래피 ---------- */
.display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); font-weight: 800; letter-spacing: -0.03em; }
.h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); font-weight: 700; letter-spacing: -0.028em; }
.h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); font-weight: 700; letter-spacing: -0.022em; }

.lead   { font-size: var(--fs-lead); color: var(--ink-soft); line-height: var(--lh-snug); }
.small  { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.muted  { color: var(--muted); }
.soft   { color: var(--ink-soft); }
.accent { color: var(--brand-accent-text); }
.nums   { font-variant-numeric: tabular-nums; }   /* 발전량 등 숫자 자릿수 정렬 */

/* 섹션 라벨 (SKT식 작은 카테고리 표기) */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-accent-text);
  margin-bottom: 14px;
}

/* ---------- 레이아웃 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--slim { max-width: var(--container-slim); }

.section { padding-block: var(--space-section); }
.section--soft { background: var(--bg-soft); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }

.section-head { max-width: 720px; margin-bottom: clamp(36px, 4vw, 56px); }
.section-head .lead { margin-top: 16px; }
.section-head--center { margin-inline: auto; text-align: center; }

/* 열 정의에 minmax(0, 1fr) 을 씁니다.
   그냥 1fr 은 minmax(auto, 1fr) 이라 자식의 min-content 가 열을 밀어내
   좁은 화면에서 가로 스크롤이 생깁니다. */
.grid { display: grid; gap: clamp(16px, 2vw, 24px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

.stack > * + * { margin-top: 16px; }
.flow > * + * { margin-top: clamp(20px, 3vw, 32px); }

/* 접근성 — 스크린리더 전용 */
.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;
}

/* 본문 시작으로 건너뛰기 링크 */
.skip-link {
  position: absolute; left: 16px; top: -100px;
  z-index: 200; padding: 12px 20px;
  background: var(--brand-primary); color: #fff;
  border-radius: var(--radius-sm); font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

/* ---------- 스크롤 등장 애니메이션 ----------
   숨김 처리는 `html.js` 안에서만 적용합니다.
   각 페이지 <head> 의 인라인 스크립트가 .js 클래스를 붙이므로,
   JS 가 차단·실패한 환경에서는 콘텐츠가 처음부터 그냥 보입니다.
   (숨겨진 채 영구히 안 보이는 사고 방지) */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 인쇄 ---------- */
@media print {
  .site-header, .mobile-bar, .cta-band, .site-footer { display: none !important; }
  body { font-size: 11pt; }
}
