/* ==========================================================================
   DriveLog — 브랜드 테마 (drive-log-flutter 앱 테마와 동기화)
   라이트: lightBackground #FAF7F8 / primary sunsetPink #E0457B
   다크:   darkBackground #121016 / darkSurface #1E1B24
   히어로 그라데이션: 앱 스플래시 sunsetGradient (#E8546B → #E0457B → #FF9E45)
   다크 히어로: sunsetGradientDim (#8C2F3E → #7A2849 → #A86530)
   ========================================================================== */

:root {
  color-scheme: light;

  /* 브랜드 원색 */
  --navy: #1a1a4b;
  --pink: #e0457b;
  --coral: #e8546b;
  --orange: #ff9e45;

  /* 시맨틱 팔레트 — 라이트 */
  --bg: #faf7f8;
  --surface: #ffffff;
  --ink: #221e24;
  --text-soft: #3a353d;
  --muted: #6e6772;
  --border: #ece4e8;
  --accent: var(--pink);
  --accent-text: #c2325f;
  --badge-bg: #d13b70;

  /* 히어로 그라데이션 (앱 sunsetGradient) */
  --hero-1: var(--coral);
  --hero-2: var(--pink);
  --hero-3: var(--orange);

  --card-shadow: 0 6px 24px rgba(26, 26, 75, 0.07);
  --img-ring: rgba(26, 26, 75, 0.08);

  --toggle-bg: rgba(255, 255, 255, 0.85);
  --toggle-border: rgba(26, 26, 75, 0.12);

  /* 테마 토글 아이콘: 라이트에선 달, 다크에선 해 */
  --show-sun: none;
  --show-moon: block;
}

/* 시스템 다크 (수동으로 light를 고르지 않았을 때) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #121016;
    --surface: #1e1b24;
    --ink: #f3eef2;
    --text-soft: #d9d2dc;
    --muted: #a79fad;
    --border: #2e2937;
    --accent: var(--pink);
    --accent-text: #ee6b95;
    --badge-bg: #e0457b;

    /* 앱 sunsetGradientDim — 야간 눈부심 완화 톤 */
    --hero-1: #8c2f3e;
    --hero-2: #7a2849;
    --hero-3: #a86530;

    --card-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --img-ring: rgba(255, 255, 255, 0.14);

    --toggle-bg: rgba(30, 27, 36, 0.85);
    --toggle-border: rgba(255, 255, 255, 0.16);

    --show-sun: block;
    --show-moon: none;
  }
}

/* 수동 다크 (토글) */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #121016;
  --surface: #1e1b24;
  --ink: #f3eef2;
  --text-soft: #d9d2dc;
  --muted: #a79fad;
  --border: #2e2937;
  --accent: var(--pink);
  --accent-text: #ee6b95;
  --badge-bg: #e0457b;

  --hero-1: #8c2f3e;
  --hero-2: #7a2849;
  --hero-3: #a86530;

  --card-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --img-ring: rgba(255, 255, 255, 0.14);

  --toggle-bg: rgba(30, 27, 36, 0.85);
  --toggle-border: rgba(255, 255, 255, 0.16);

  --show-sun: block;
  --show-moon: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Pretendard", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: background-color 0.25s ease, border-color 0.25s ease,
    transform 0.15s ease;
}
.theme-toggle:hover { transform: scale(1.06); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle .icon-sun { display: var(--show-sun); }
.theme-toggle .icon-moon { display: var(--show-moon); }

/* Header */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 24px;
  z-index: 10;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

/* Hero — 앱 스플래시와 동일한 선셋 그라데이션 */
.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  background: linear-gradient(180deg, var(--hero-1) 0%, var(--hero-2) 55%, var(--hero-3) 100%);
  color: #fff;
}
.hero-inner { max-width: 720px; }
.hero h1 {
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 18px rgba(26, 26, 75, 0.18);
}
.hero-sub {
  margin-top: 22px;
  font-size: clamp(15px, 2.4vw, 19px);
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 10px rgba(26, 26, 75, 0.16);
}
.store-buttons {
  margin-top: 36px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.store-badge {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-decoration: none;
  transition: background 0.2s ease;
}
.store-badge:hover {
  background: rgba(255, 255, 255, 0.32);
}

/* Features */
.features {
  max-width: 1000px;
  margin: 0 auto;
  padding: 88px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 26px;
  box-shadow: var(--card-shadow);
  transition: background-color 0.25s ease, border-color 0.25s ease,
    transform 0.2s ease;
}
.feature:hover { transform: translateY(-3px); }
.feature-emoji { font-size: 38px; line-height: 1; }
.feature h3 {
  margin: 16px 0 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.feature p {
  color: var(--muted);
  font-size: 15px;
}
.soon {
  font-size: 12px;
  font-weight: 700;
  background: var(--badge-bg);
  color: #fff;
  padding: 2px 9px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

/* CTA */
.cta {
  text-align: center;
  padding: 40px 24px 96px;
}
.cta h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.cta p {
  margin-top: 10px;
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}
.site-footer nav {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.site-footer a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}
.site-footer a:hover { color: var(--accent-text); }
.copyright {
  color: var(--muted);
  font-size: 13px;
}

/* Legal pages */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 100px 24px 80px;
}
.legal h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.legal .updated {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.legal h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 32px 0 10px;
}
.legal p, .legal li {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 8px;
}
.legal ul { padding-left: 20px; }
.legal a { color: var(--accent-text); }
.back-link {
  display: inline-block;
  margin-top: 44px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 30px;
  color: var(--accent-text);
  background: var(--surface);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.back-link:hover { border-color: var(--accent-text); }
