/* ============================================
   RhythmGuard Landing Page
   Design tokens mirror /theme/index.ts
   ============================================ */

/* TsangerJinKai calligraphy font for Chinese headings */
@font-face {
  font-family: 'TsangerJinKai';
  src: url('fonts/TsangerJinKai02-W04.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #B87D5B;
  --color-primary-light: #D4A982;
  --color-primary-dark: #8B5E3C;

  --color-secondary: #7BA39E;
  --color-secondary-light: #A8C8C3;
  --color-secondary-dark: #5B8580;

  --color-bg: #FDF8F4;
  --color-surface: #FFFFFF;
  --color-surface-warm: #FAF0E8;
  --color-surface-calm: #F0F6F5;

  --color-text: #3D3229;
  --color-text-secondary: #7A6E63;
  --color-text-muted: #B5A99D;
  --color-text-on-primary: #FFFFFF;

  --color-border: #EDE5DC;
  --color-border-light: #F5EFE8;
  --shadow-soft: 0 2px 8px rgba(61, 50, 41, 0.08);
  --shadow-medium: 0 4px 16px rgba(61, 50, 41, 0.08);
  --shadow-card: 0 1px 6px rgba(61, 50, 41, 0.08);
  --shadow-elevated: 0 8px 32px rgba(61, 50, 41, 0.12);

  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;
  --sp-xxxl: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont,
                 'Segoe UI', Roboto, sans-serif;
  --font-family-zh: 'TsangerJinKai', 'Noto Serif SC', 'STSong', serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

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

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

/* ----- HEADER ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 248, 244, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
}

.nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--sp-md) var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.nav-logo img { object-fit: contain; }

.nav-brand {
  font-family: var(--font-family-zh);
  font-size: 18px;
  font-weight: normal;
  letter-spacing: 1px;
  color: var(--color-text);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: var(--sp-lg);
}

.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-secondary);
  transition: color 0.3s ease;
}

.nav-links a:hover { color: var(--color-primary); }

/* ----- HERO ----- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-xxxl) var(--sp-lg);
  position: relative;
  overflow: hidden;
}

.hero-content { position: relative; z-index: 1; }

.hero-icon-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-xl);
}

.hero-icon {
  position: relative;
  z-index: 1;
  object-fit: contain;
}

.hero-pulse-ring {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid var(--color-primary-light);
  animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.25); opacity: 0.1; }
}

.hero-title {
  font-family: var(--font-family-zh);
  font-size: 48px;
  font-weight: normal;
  letter-spacing: 2px;
  color: var(--color-text);
  margin-bottom: var(--sp-xs);
}

.hero-subtitle-en {
  font-size: 18px;
  font-weight: 300;
  color: var(--color-text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--sp-xl);
}

.hero-tagline {
  font-family: var(--font-family-zh);
  font-size: 20px;
  font-weight: normal;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-lg);
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-xxl);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.badge-ios {
  background-color: var(--color-surface-warm);
  color: var(--color-primary-dark);
}

.badge-watch {
  background-color: var(--color-surface-calm);
  color: var(--color-secondary-dark);
}

.app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  background-color: var(--color-text);
  color: var(--color-text-on-primary);
  border-radius: var(--radius-md);
  padding: 10px 24px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: var(--shadow-soft);
}

.app-store-btn:hover { transform: scale(0.98); opacity: 0.9; }

.app-store-icon { flex-shrink: 0; }

.app-store-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.app-store-label {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  line-height: 1;
}

.app-store-name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.hero-decoration {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  border: 1px solid var(--color-border-light);
  opacity: 0.5;
  pointer-events: none;
}

.hero-decoration::before,
.hero-decoration::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--color-border-light);
}

.hero-decoration::before { top: 10%; left: 10%; right: 10%; bottom: 10%; }
.hero-decoration::after { top: 25%; left: 25%; right: 25%; bottom: 25%; }

/* ----- SCREENSHOTS ----- */
.screenshots {
  padding: var(--sp-xxxl) 0;
  background-color: var(--color-surface);
  overflow: hidden;
}

.screenshots .section-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

/* Marquee wrapper with soft fade edges */
.marquee-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: var(--sp-xl) 0;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
}

/* Infinite scrolling track */
.marquee-track {
  display: flex;
  gap: var(--sp-xl);
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
}

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

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

/* Individual screenshot items */
.screenshot-item {
  flex: 0 0 auto;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.5s ease;
  will-change: transform;
}

.screenshot-item:hover {
  transform: translateY(-8px) scale(1.02);
}

.screenshot-item img {
  height: 520px;
  width: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  transition: box-shadow 0.5s ease;
}

.screenshot-item:hover img {
  box-shadow: 0 16px 48px rgba(61, 50, 41, 0.18);
}

/* ----- FEATURES ----- */
.features {
  padding: var(--sp-xxxl) var(--sp-lg);
  background-color: var(--color-bg);
}

.section-container {
  max-width: 960px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-family-zh);
  font-size: 32px;
  font-weight: normal;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: var(--sp-xs);
  color: var(--color-text);
}

.section-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-muted);
  text-align: center;
  letter-spacing: 1px;
  margin-bottom: var(--sp-xxl);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-xl);
}

.feature-card {
  text-align: center;
  padding: var(--sp-xl) var(--sp-lg);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.feature-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.feature-card:nth-child(2) { transition-delay: 0.1s; }
.feature-card:nth-child(3) { transition-delay: 0.2s; }

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

.feature-image-wrapper {
  width: 140px;
  height: 140px;
  margin: 0 auto var(--sp-lg);
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--color-surface-warm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-image-calm { background-color: var(--color-surface-calm); }

.feature-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
}

.feature-title {
  font-family: var(--font-family-zh);
  font-size: 22px;
  font-weight: normal;
  color: var(--color-text);
  margin-bottom: var(--sp-xs);
}

.feature-title-en {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
  margin-bottom: var(--sp-md);
}

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

/* ----- PHILOSOPHY ----- */
.philosophy {
  padding: var(--sp-xxxl) var(--sp-lg);
  background-color: var(--color-surface);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xxl);
  align-items: center;
}

.philosophy-image-col {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.philosophy-image-col.visible {
  opacity: 1;
  transform: translateX(0);
}

.philosophy-image {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-medium);
}

.philosophy-text-col {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}

.philosophy-text-col.visible {
  opacity: 1;
  transform: translateX(0);
}

.philosophy-point {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.philosophy-point.visible {
  opacity: 1;
  transform: translateY(0);
}

.philosophy-point:nth-child(2) { transition-delay: 0.1s; }
.philosophy-point:nth-child(3) { transition-delay: 0.2s; }

.philosophy-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.philosophy-point strong {
  font-size: 18px;
  font-weight: 500;
  display: block;
  margin-bottom: var(--sp-xs);
}

.philosophy-point p {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.philosophy-quote {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--color-border-light);
}

.quote-zh {
  font-family: var(--font-family-zh);
  font-size: 18px;
  font-weight: normal;
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.quote-en {
  font-size: 14px;
  font-weight: 300;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-top: var(--sp-sm);
  font-style: italic;
}

/* ----- PRIVACY HIGHLIGHT ----- */
.privacy-highlight {
  padding: var(--sp-xxl) var(--sp-lg);
  background-color: var(--color-bg);
}

.privacy-card {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: var(--sp-xxl) var(--sp-xl);
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border-light);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.privacy-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.privacy-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--color-surface-calm);
  color: var(--color-secondary);
  margin-bottom: var(--sp-lg);
}

.privacy-title {
  font-family: var(--font-family-zh);
  font-size: 22px;
  font-weight: normal;
  color: var(--color-text);
  margin-bottom: var(--sp-sm);
}

.privacy-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-lg);
}

.privacy-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
  transition: opacity 0.3s ease;
}

.privacy-link:hover { opacity: 0.7; }

/* ----- FOOTER ----- */
.site-footer {
  padding: var(--sp-xxl) var(--sp-lg);
  background-color: var(--color-surface-warm);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-container {
  max-width: 960px;
  margin: 0 auto;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
}

.footer-icon { border-radius: var(--radius-sm); }

.footer-name { font-size: 16px; font-weight: 500; }
.footer-name-en { font-weight: 300; color: var(--color-text-muted); }

.footer-tagline {
  font-family: var(--font-family-zh);
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-lg);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-lg);
}

.footer-links a {
  font-size: 14px;
  color: var(--color-text-secondary);
  transition: color 0.3s ease;
}

.footer-links a:hover { color: var(--color-primary); }

.footer-copyright {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-sm);
}

.footer-disclaimer {
  font-size: 11px;
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ----- ARTICLE / PRIVACY PAGE ----- */
.article-page {
  padding: 120px var(--sp-lg) var(--sp-xxxl);
  background-color: var(--color-bg);
}

.article-container {
  max-width: 720px;
  margin: 0 auto;
}

.article-title {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.5px;
  color: var(--color-text);
  margin-bottom: var(--sp-xs);
}

.article-subtitle {
  font-size: 16px;
  font-weight: 300;
  color: var(--color-text-muted);
  letter-spacing: 1px;
  margin-bottom: var(--sp-sm);
}

.article-meta {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-xxl);
}

.article-section {
  margin-bottom: var(--sp-xl);
}

.article-section h2 {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--sp-sm);
}

.article-section p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-sm);
}

.article-section ul {
  list-style: none;
  margin-bottom: var(--sp-md);
}

.article-section li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text-secondary);
  padding-left: var(--sp-lg);
  position: relative;
}

.article-section li::before {
  content: '';
  position: absolute;
  left: var(--sp-sm);
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-primary-light);
}

.article-section strong {
  color: var(--color-text);
  font-weight: 500;
}

.article-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: var(--sp-xxl) 0;
}

.article-link {
  color: var(--color-primary);
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.article-link:hover { opacity: 0.7; }

/* ----- ORIGIN PAGE ----- */
.origin-hero {
  padding-top: 64px; /* header height */
  background-color: var(--color-bg);
}

.origin-hero img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

.article-page--origin {
  padding-top: var(--sp-xxl);
}

.article-page--origin .article-title {
  font-size: 40px;
  margin-bottom: var(--sp-xs);
}

.origin-body {
  margin-top: var(--sp-xl);
}

.origin-body p {
  font-size: 17px;
  line-height: 2;
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-lg);
  text-align: justify;
}

.origin-body p:first-child {
  font-size: 20px;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.8;
}

.origin-closing {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--color-border-light);
  font-style: italic;
  color: var(--color-primary-dark) !important;
}

/* ----- NAV ACTIVE ----- */
.nav-active {
  color: var(--color-primary) !important;
  font-weight: 500 !important;
}

/* ----- PRODUCT SUMMARY (visually hidden, accessible to AI crawlers and screen readers) ----- */
.product-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- FAQ ----- */
.faq {
  padding: var(--sp-xxxl) var(--sp-lg);
  background-color: var(--color-surface);
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.faq-item {
  background-color: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.faq-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.faq-item:nth-child(2) { transition-delay: 0.05s; }
.faq-item:nth-child(3) { transition-delay: 0.1s; }
.faq-item:nth-child(4) { transition-delay: 0.15s; }
.faq-item:nth-child(5) { transition-delay: 0.2s; }
.faq-item:nth-child(6) { transition-delay: 0.25s; }
.faq-item:nth-child(7) { transition-delay: 0.3s; }

.faq-question {
  padding: var(--sp-lg) var(--sp-xl);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.3s ease;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
  content: '+';
  font-size: 20px;
  font-weight: 300;
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-left: var(--sp-md);
  transition: transform 0.3s ease;
}

.faq-item[open] .faq-question::after {
  content: '-';
}

.faq-question:hover { color: var(--color-primary); }

.faq-answer {
  padding: 0 var(--sp-xl) var(--sp-lg);
}

.faq-answer p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-sm);
}

.faq-answer ul {
  list-style: none;
  margin-bottom: var(--sp-md);
}

.faq-answer li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text-secondary);
  padding-left: var(--sp-lg);
  position: relative;
}

.faq-answer li::before {
  content: '';
  position: absolute;
  left: var(--sp-sm);
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-primary-light);
}

.faq-answer strong {
  color: var(--color-text);
  font-weight: 500;
}

/* ----- FOOTER META ----- */
.footer-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: var(--sp-sm);
}

/* ----- RESPONSIVE ----- */
@media (max-width: 768px) {
  .hero-title { font-size: 36px; }
  .hero-tagline { font-size: 18px; }
  .features-grid { grid-template-columns: 1fr; gap: var(--sp-lg); }
  .philosophy-grid { grid-template-columns: 1fr; text-align: center; }
  .philosophy-image { max-width: 240px; }
  .philosophy-point { justify-content: center; }
  .section-title { font-size: 28px; }
  .nav-links { display: none; }

  .screenshot-item img {
    height: 420px;
  }

  .marquee-track {
    gap: var(--sp-lg);
    animation-duration: 35s;
  }
}

@media (max-width: 480px) {
  .hero { min-height: 90vh; padding: var(--sp-xxl) var(--sp-md); }
  .hero-title { font-size: 32px; }
  .hero-icon { width: 88px; height: 88px; }
  .hero-pulse-ring { width: 108px; height: 108px; }
  .feature-image-wrapper { width: 120px; height: 120px; }
  .feature-image { width: 100px; height: 100px; }

  .screenshot-item img {
    height: 360px;
  }

  .marquee-track {
    gap: var(--sp-md);
    animation-duration: 30s;
  }

  .privacy-card {
    padding: var(--sp-xl) var(--sp-lg);
  }
}
