/* DayScore — 정적 콘텐츠 페이지 공통 스타일.
   Flutter 앱과 동일한 미니멀 슬레이트/스카이 팔레트, Noto Sans KR. */

:root {
  --primary: #2D6CDF;
  --primary-soft: rgba(45, 108, 223, 0.08);
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-alt: #EFF2F7;
  --text: #0F1B2D;
  --text-secondary: #5A6477;
  --text-tertiary: #98A2B3;
  --border: #E4E8EF;
  --grade-good: #4DABF7;
  --grade-excellent: #12B886;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header / 상단 네비게이션 ─────────────────────────── */
header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
}
header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.3px;
}
header .brand:hover { text-decoration: none; }
header .brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-block;
  vertical-align: middle;
  /* SVG가 로딩 실패할 경우의 폴백 — 그라데이션 배경 + "D" 글자 */
  background: linear-gradient(135deg, var(--grade-excellent), var(--grade-good));
  color: white; font-size: 14px; font-weight: 800;
  text-align: center; line-height: 32px;
}
header .brand-mark[src] { background: transparent; }
header nav {
  margin-left: auto;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
header nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}
header nav a.active { color: var(--primary); font-weight: 700; }
header nav a:hover { color: var(--primary); text-decoration: none; }

/* ── Article / 본문 카드 ─────────────────────────────── */
main { padding: 36px 0 60px; }
article {
  background: var(--surface);
  border-radius: 20px;
  padding: 36px 40px;
  box-shadow: 0 1px 3px rgba(15, 27, 45, 0.04), 0 8px 28px rgba(15, 27, 45, 0.04);
}
article > h1 {
  font-size: 30px;
  margin: 0 0 6px;
  letter-spacing: -0.6px;
  font-weight: 800;
}
article .lead {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0 0 28px;
}
article h2 {
  font-size: 20px;
  margin: 32px 0 10px;
  letter-spacing: -0.3px;
  font-weight: 700;
}
article h3 {
  font-size: 16px;
  margin: 22px 0 6px;
  font-weight: 700;
}
article p { margin: 12px 0; color: var(--text); }
article ul, article ol { padding-left: 22px; }
article li { margin: 6px 0; }
article hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

/* 강조 박스 */
.callout {
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  padding: 14px 16px;
  border-radius: 8px;
  margin: 18px 0;
  font-size: 14px;
  color: var(--text);
}

/* 사이드 정보 (작은 카드) */
.meta-card {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Footer ─────────────────────────────────────────── */
footer.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 20px 36px;
}
footer.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  color: var(--text-tertiary);
  font-size: 13px;
}
footer.site-footer .footer-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
footer.site-footer a {
  color: var(--text-secondary);
}
footer.site-footer .copyright {
  margin-left: auto;
}

/* 공공누리 출처 표시 블록 — 법적 의무 충족용. 모든 페이지 공통. */
.attribution {
  margin-top: 22px;
  padding: 18px 20px;
  background: var(--surface-alt);
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: block;
}
.attribution .attribution-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 13px;
}
.attribution .kogl-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.2px;
}
.attribution .kogl-badge::before {
  content: "KOGL";
  font-size: 9px;
  background: var(--primary);
  color: white;
  border-radius: 3px;
  padding: 1px 4px;
  margin-right: 2px;
}
.attribution p { margin: 6px 0; }
.attribution ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.attribution li { margin: 2px 0; }
.attribution a { color: var(--text-secondary); text-decoration: underline; }
.attribution a:hover { color: var(--primary); }

/* ── Visibility 토글 (모바일/데스크톱 분기) ─────────────── */
/* 기본(<1024): 모바일 시각으로 동작 */
.desktop-only { display: none; }
.mobile-only  { display: block; }
/* footer.mobile-only는 flex로 펼쳐져야 정렬이 맞음 */
footer.site-footer .footer-nav.mobile-only { display: flex; }

/* ── 모바일 축약 ─────────────────────────────────────── */
@media (max-width: 600px) {
  article { padding: 26px 22px; }
  article > h1 { font-size: 26px; }
  header.site-header .container { gap: 12px; padding: 12px 16px; }
  header nav { gap: 14px; }
  header nav a { font-size: 13px; }
  /* 모바일에서는 헤더 CTA 숨김 (공간 부족) */
  header .header-cta { display: none; }
  footer.site-footer .copyright { margin-left: 0; width: 100%; }
}

/* ────────────────────────────────────────────────────────
   데스크톱 (≥ 1024px) — PC 전용 레이아웃
   웹사이트(PC)와 앱(모바일)은 별개 UI/UX. 데스크톱은:
   - 가로폭 1100px 컨테이너로 sections 활용
   - 섹션별 multi-column 그리드
   - 큰 hero 타이포 + 우측 디바이스 목업
   - 마우스 hover 인터랙션 강화
──────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  body { font-size: 16px; }

  /* 컨테이너 — 데스크톱은 1100px (정적 페이지 article은 별도 760px 유지) */
  .container { max-width: 1100px; padding: 0 32px; }

  /* 헤더 — 우측 끝에 CTA 버튼 추가 가능. nav 간격 확장 */
  header.site-header .container { padding: 16px 32px; gap: 36px; }
  header .brand { font-size: 19px; gap: 10px; }
  header .brand-mark { width: 36px; height: 36px; line-height: 36px; }
  header nav { gap: 28px; }
  header nav a { font-size: 14.5px; transition: color 0.15s ease; }

  /* 헤더 우측 CTA (있을 경우) */
  header .header-cta {
    background: var(--primary);
    color: white !important;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700 !important;
    font-size: 13.5px !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  header .header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(45, 108, 223, 0.30);
  }

  /* 정적 페이지 article — 컨테이너가 넓어져도 가독성을 위해 760px 고정 */
  article { max-width: 760px; margin: 0 auto; padding: 48px 56px; }
  article > h1 { font-size: 36px; }
  article h2 { font-size: 22px; margin-top: 40px; }
  main { padding: 56px 0 80px; }

  /* 푸터 — 데스크톱에서는 다단 정렬, 출처 블록도 더 넓은 폭 */
  footer.site-footer { padding: 40px 32px 48px; }
  footer.site-footer .container { padding: 0; }
  .attribution { padding: 22px 26px; font-size: 13px; }
}

/* ────────────────────────────────────────────────────────
   index.html (랜딩페이지) 전용 — 데스크톱 멀티컬럼 레이아웃
──────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  /* HERO — 2-col grid, 큰 타이포, 우측 illustration */
  .hero { padding: 90px 32px 110px; }
  .hero .container {
    grid-template-columns: 1.3fr 1fr;
    gap: 64px;
    max-width: 1100px;
  }
  .hero h1 { font-size: 56px; line-height: 1.12; letter-spacing: -1.6px; }
  .hero p { font-size: 17px; max-width: 580px; }
  .hero .eyebrow { font-size: 14px; }
  .hero .cta { padding: 14px 26px; font-size: 15px; }
  .hero .hero-icon { width: 220px; height: 220px; justify-self: end; }

  /* HERO 통계 strip (데스크톱에서만 노출) */
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 36px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }
  .hero-stats .stat { color: white; }
  .hero-stats .stat-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.6px;
    line-height: 1.1;
  }
  .hero-stats .stat-label {
    display: block;
    font-size: 12.5px;
    opacity: 0.78;
    letter-spacing: 0.4px;
    margin-top: 4px;
  }
  @media (max-width: 1023px) { .hero-stats { display: none; } }

  /* APP SECTION — 좌측 설명 + 우측 phone-frame Flutter */
  .app-section { padding: 80px 32px; }
  .app-section .container {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 64px;
    align-items: center;
    max-width: 1100px;
  }
  .app-section .section-title { font-size: 32px; margin-bottom: 12px; }
  .app-section .section-lead { font-size: 16px; line-height: 1.7; max-width: 480px; }

  /* phone-frame: Flutter 앱을 디바이스 목업으로 둘러싸 모바일 앱 의도 시각화 */
  #flutter-host {
    width: 380px !important;
    max-width: none !important;
    height: 760px !important;
    min-height: 760px !important;
    border-radius: 38px !important;
    border: 12px solid #1a1f2e;
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.04),
      0 30px 70px rgba(15, 27, 45, 0.22),
      0 12px 24px rgba(15, 27, 45, 0.10);
    margin: 0;
    justify-self: center;
  }
  #flutter-host::before {
    /* 폰 상단 노치/스피커 흉내 */
    content: "";
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    width: 100px; height: 22px;
    background: #1a1f2e;
    border-radius: 0 0 14px 14px;
    z-index: 5;
  }

  /* 앱 섹션의 하이라이트 리스트 */
  .app-highlights {
    list-style: none;
    padding: 0;
    margin: 24px 0 28px;
    display: grid;
    gap: 14px;
  }
  .app-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text);
    font-size: 15px;
  }
  .app-highlights .check {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--grade-excellent);
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800;
    margin-top: 1px;
  }

  /* FEATURES — 4-col grid */
  .features-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; max-width: 1100px; }
  .feature-card { padding: 28px 24px 26px; transition: transform 0.18s ease, box-shadow 0.18s ease; }
  .feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(15, 27, 45, 0.08);
  }
  .feature-card .icon-box { width: 44px; height: 44px; font-size: 22px; }
  .feature-card h3 { font-size: 17px; }
  .section { padding: 80px 32px; }
  .section-title { font-size: 30px; }
  .section-lead { font-size: 16px; }

  /* HOW SECTION — 3-col 그대로 유지하되 카드 더 풍성하게 */
  .how-row { grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1100px; }
  .how-card { padding: 26px 26px 28px; }
  .how-card h4 { font-size: 19px; }
  .how-card p { font-size: 14.5px; }

  /* TRUST SECTION — 데스크톱에서도 카드는 760px 유지 (가독성) */
  .trust-card { padding: 36px 44px; }
  .trust-card h2 { font-size: 22px; }
  .trust-card p { font-size: 14.5px; }
  .trust-card .source-item { padding: 12px 16px; font-size: 14px; }

  /* FOOTER 다단 — 데스크톱에서 nav | data-sources | copyright 가로 배치 */
  /* 데스크톱에서 mobile-only 숨기고 desktop-only 노출 */
  .desktop-only { display: block; }
  .mobile-only  { display: none !important; }
  footer.site-footer .footer-grid.desktop-only {
    display: grid;
    grid-template-columns: 1.2fr 1.6fr 1fr;
    gap: 48px;
    align-items: start;
  }
  footer.site-footer .footer-col h4 {
    font-size: 13px;
    color: var(--text);
    margin: 0 0 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
  }
  footer.site-footer .footer-col a {
    display: block;
    margin: 6px 0;
    font-size: 13.5px;
  }
  footer.site-footer .footer-col-desc {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
  }
  footer.site-footer .footer-bottom.desktop-only {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    color: var(--text-tertiary);
    font-size: 12.5px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }
  /* 데스크톱에서는 footer 안의 모바일용 attribution 블록 숨김 (footer-grid에 통합됨) */
  footer.site-footer .attribution { display: none; }
}

/* 1280px 이상 — 컨테이너 살짝 더 확장 */
@media (min-width: 1280px) {
  .container { max-width: 1180px; }
  .hero h1 { font-size: 62px; }
  .hero .container, .app-section .container { max-width: 1180px; }
  .features-grid, .how-row { max-width: 1180px; }
}
