/* ============================================================
   CommuterWeather — Site Styles
   Color palette from app's WeatherBackgroundView clear-sunny-daytime:
   TL #297AE0  TR #4799F5  BL #8CC7F5  BR #ADDBFA
   ============================================================ */

/* --- Reset & Custom Properties --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:   #297AE0;
  --blue-2: #4799F5;
  --blue-3: #8CC7F5;
  --blue-4: #ADDBFA;

  --indigo: #5856D6;
  --orange: #FF9500;
  --cyan:   #32ADE6;
  --pink:   #FF2D55;
  --purple: #AF52DE;
  --yellow: #FFD60A;
  --red:    #FF3B30;
  --gray:   #8E8E93;
  --teal:   #30B0C7;

  --text-primary:   #1C1C1E;
  --text-secondary: #3C3C43;
  --text-tertiary:  #8E8E93;
  --bg:             #FFFFFF;
  --bg-secondary:   #F2F2F7;
  --separator:      rgba(60, 60, 67, 0.12);

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR",
    "Helvetica Neue", Arial, sans-serif;

  --max-w: 1100px;
  --section-pad: 80px 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text-primary:   #F2F2F7;
    --text-secondary: rgba(235,235,245,0.80);
    --text-tertiary:  rgba(235,235,245,0.38);
    --bg:             #1C1C1E;
    --bg-secondary:   #2C2C2E;
    --separator:      rgba(255,255,255,0.10);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.30), 0 1px 2px rgba(0,0,0,.20);
    --shadow-md: 0 4px 16px rgba(0,0,0,.40), 0 2px 4px rgba(0,0,0,.20);
  }
}

:root[data-theme="dark"] {
  --text-primary:   #F2F2F7;
  --text-secondary: rgba(235,235,245,0.80);
  --text-tertiary:  rgba(235,235,245,0.38);
  --bg:             #1C1C1E;
  --bg-secondary:   #2C2C2E;
  --separator:      rgba(255,255,255,0.10);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.30), 0 1px 2px rgba(0,0,0,.20);
  --shadow-md: 0 4px 16px rgba(0,0,0,.40), 0 2px 4px rgba(0,0,0,.20);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }


/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-header { background: rgba(28,28,30,0.85); }
}
:root[data-theme="dark"] .site-header { background: rgba(28,28,30,0.85); }

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.logo-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.nav-link {
  font-size: 15px;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.lang-switcher {
  margin-left: auto;
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-option {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.lang-option:hover { background: var(--bg-secondary); color: var(--text-primary); }
.lang-option.active { color: var(--blue); font-weight: 600; }


/* --- Theme Toggle --- */
.theme-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s, color 0.15s;
  margin-left: 4px;
}

.theme-toggle:hover {
  background: var(--separator);
  color: var(--text-primary);
}

/* Default (light): show moon */
.theme-icon-light { display: none; }
.theme-icon-dark  { display: inline; }

/* Dark mode: show sun */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-light { display: inline; }
  :root:not([data-theme="light"]) .theme-icon-dark  { display: none; }
}
:root[data-theme="dark"]  .theme-icon-light { display: inline; }
:root[data-theme="dark"]  .theme-icon-dark  { display: none; }
:root[data-theme="light"] .theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-dark  { display: inline; }


/* --- Hero --- */
.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  padding: 80px 24px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 0% 0%,   #297AE0 0%, transparent 55%),
    radial-gradient(ellipse at 100% 0%,  #4799F5 0%, transparent 55%),
    radial-gradient(ellipse at 0% 100%,  #8CC7F5 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%,#ADDBFA 0%, transparent 55%),
    #5A90E8;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  color: #fff;
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.hero-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.hero-tagline {
  font-size: clamp(17px, 3vw, 22px);
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: clamp(15px, 2vw, 17px);
  opacity: 0.85;
  line-height: 1.7;
  margin-bottom: 40px;
}

.app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  text-decoration: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.app-store-badge:hover {
  background: rgba(255,255,255,0.32);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.badge-icon { font-size: 20px; }

/* App Store badge images — used after official App Store launch */
.app-store-badge-link {
  display: inline-block;
  transition: transform 0.15s, opacity 0.15s;
}
.app-store-badge-link:hover { transform: translateY(-2px); opacity: 0.88; }
.app-store-badge-img { height: 48px; width: auto; display: block; }


/* --- Section Commons --- */
.section-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-pad);
}

.section-title {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.7;
}


/* --- Features Grid --- */
.features { background: var(--bg); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.feature-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 16px;
  line-height: 1;
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.feature-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
}


/* --- Advice Badges --- */
.advice-section {
  background: var(--bg-secondary);
  padding-top: 0;
}

.advice-section .section-container {
  padding-bottom: 40px;
}

.badges-scroll-outer {
  overflow: hidden;
  padding: 0 0 48px;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.badges-track {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: badge-scroll 32s linear infinite;
}

.badges-track:hover { animation-play-state: paused; }

@keyframes badge-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-emoji { font-size: 18px; line-height: 1; }

.badge-blue   { background: rgba( 41,122,224, 0.12); color: #1558B0; }
.badge-indigo { background: rgba( 88, 86,214, 0.12); color: #3634A3; }
.badge-orange { background: rgba(255,149,  0, 0.12); color: #C25200; }
.badge-cyan   { background: rgba( 50,173,230, 0.12); color: #1A7896; }
.badge-pink   { background: rgba(255, 45, 85, 0.12); color: #C70039; }
.badge-purple { background: rgba(175, 82,222, 0.12); color: #8428C3; }
.badge-yellow { background: rgba(255,214, 10, 0.15); color: #8B6000; }
.badge-red    { background: rgba(255, 59, 48, 0.12); color: #C10B00; }
.badge-gray   { background: rgba(142,142,147, 0.15); color: #4C4C52; }


/* --- Download CTA --- */
.download-section {
  background: linear-gradient(135deg, #297AE0, #4799F5 60%, #8CC7F5);
  color: #fff;
}

.download-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: left;
}

.download-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.download-text { flex: 1; min-width: 180px; }

.download-title {
  font-size: 22px;
  font-weight: 700;
}

.download-subtitle {
  font-size: 15px;
  opacity: 0.85;
  margin-top: 4px;
}


/* --- Footer --- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--separator);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-nav { display: flex; gap: 4px; }

.footer-link {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 4px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.footer-link:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.05);
}


/* --- Legal Pages --- */
.legal-page {
  min-height: calc(100vh - 60px - 80px);
}

.legal-container {
  max-width: 740px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.legal-content h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal-content .legal-date {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-bottom: 40px;
}

.legal-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 40px 0 12px;
  color: var(--text-primary);
}

.legal-content p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.legal-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.legal-content li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 6px;
}

.legal-content a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* --- Responsive --- */
@media (max-width: 640px) {
  :root { --section-pad: 56px 20px; }

  .header-inner { padding: 0 16px; gap: 12px; }
  .site-nav { display: none; }
  .logo-name { font-size: 15px; }

  .hero { min-height: 520px; padding: 64px 20px; }
  .hero-icon { width: 80px; height: 80px; border-radius: 18px; }

  .features-grid { grid-template-columns: 1fr; }

  .download-inner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .download-text { min-width: unset; width: 100%; }
  .download-title { font-size: 20px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }

  .lang-switcher { gap: 1px; }
  .lang-option { font-size: 12px; padding: 4px 6px; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
