/* ========================================
   カカクロ - Design System
   節約・お得感・賢い買い物を表現する暖色系デザイン
   ======================================== */

/* CSS Variables - Design Tokens */
:root {
  /* Primary - Orange (節約、お得感、親しみやすさ) */
  --color-primary: #E88C40;
  --color-primary-light: #F5BA7D;
  --color-primary-dark: #C26B26;

  /* Secondary - Green (安心感、信頼性) */
  --color-secondary: #3D8C6B;
  --color-secondary-light: #6BBA99;
  --color-secondary-dark: #29664D;

  /* Accent - Gold (価値、賢い選択) */
  --color-accent: #D9A640;
  --color-accent-light: #F2D173;

  /* Semantic */
  --color-best-price: #339966;
  --color-highest-price: #CC4D4D;
  --color-sale: #E6404D;

  /* Neutral */
  --color-text: #1a1a1a;
  --color-text-secondary: #666666;
  --color-text-muted: #999999;
  --color-background: #F2F2F7;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F5F5F5;
  --color-border: #E5E5EA;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', 'Hiragino Sans', sans-serif;
  --font-family-rounded: -apple-system, BlinkMacSystemFont, 'SF Pro Rounded', 'Helvetica Neue', sans-serif;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3rem;
  --text-5xl: 4rem;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 40px;
  --space-3xl: 64px;
  --space-4xl: 80px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #E88C40, #C26B26);
  --gradient-primary-hover: linear-gradient(135deg, #F5BA7D, #E88C40);
  --gradient-secondary: linear-gradient(180deg, #3D8C6B, #29664D);
  --gradient-hero: linear-gradient(160deg, #3D8C6B 0%, #29664D 50%, #1F4D3A 100%);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Container */
  --container-max: 1200px;
  --container-padding: 20px;
}

/* ========================================
   Reset & Base
   ======================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ========================================
   Layout
   ======================================== */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ========================================
   Header
   ======================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background var(--transition-base);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-family-rounded);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  transition: transform var(--transition-fast);
}

.logo:hover {
  transform: scale(1.02);
  color: var(--color-text);
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: none;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
}

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

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
  position: relative;
  padding: calc(60px + var(--space-3xl)) 0 var(--space-3xl);
  background: var(--gradient-hero);
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 150%;
  background: radial-gradient(ellipse, rgba(232, 140, 64, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--color-background), transparent);
  pointer-events: none;
}

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

.hero-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.app-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--space-xl);
  border-radius: 22%;
  box-shadow: var(--shadow-xl), 0 0 60px rgba(232, 140, 64, 0.3);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero h1 {
  font-family: var(--font-family-rounded);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: var(--space-lg);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.8s ease-out;
}

.hero .tagline {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
  animation: fadeInUp 0.8s ease-out 0.1s backwards;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .hero {
    padding: calc(60px + var(--space-4xl)) 0 var(--space-4xl);
  }

  .app-icon {
    width: 140px;
    height: 140px;
  }

  .hero h1 {
    font-size: var(--text-4xl);
  }

  .hero .tagline {
    font-size: var(--text-xl);
  }

  .hero-buttons {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  .hero h1 {
    font-size: var(--text-5xl);
  }
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-2xl);
  border-radius: var(--radius-xl);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(232, 140, 64, 0.4);
}

.btn-primary:hover {
  background: var(--gradient-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(232, 140, 64, 0.5);
  color: #FFFFFF;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  background: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--color-text);
}

.btn-icon {
  width: 20px;
  height: 20px;
}

/* Coming Soon Badge */
.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-2xl);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
}

.coming-soon-badge.light {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary-dark);
  border: none;
  box-shadow: var(--shadow-md);
  animation: none;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
}

/* ========================================
   Features Section
   ======================================== */

.features {
  padding: var(--space-3xl) 0;
  background: var(--color-background);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-label {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: rgba(232, 140, 64, 0.1);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
}

.section-title {
  font-family: var(--font-family-rounded);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .section-title {
    font-size: var(--text-3xl);
  }
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

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

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(232, 140, 64, 0.2);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: var(--space-lg);
  transition: transform var(--transition-base);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
}

.feature-icon.primary {
  background: rgba(232, 140, 64, 0.12);
}

.feature-icon.secondary {
  background: rgba(61, 140, 107, 0.12);
}

.feature-icon.accent {
  background: rgba(217, 166, 64, 0.12);
}

.feature-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ========================================
   How It Works Section
   ======================================== */

.how-it-works {
  padding: var(--space-3xl) 0;
  background: var(--color-surface);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  max-width: 800px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: var(--space-xl);
  align-items: flex-start;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  color: #FFFFFF;
  font-family: var(--font-family-rounded);
  font-size: var(--text-xl);
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(232, 140, 64, 0.3);
}

.step-content h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.step-content p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ========================================
   Stats Section
   ======================================== */

.stats {
  padding: var(--space-3xl) 0;
  background: var(--color-background);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-value {
  font-family: var(--font-family-rounded);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

@media (min-width: 768px) {
  .stat-value {
    font-size: var(--text-3xl);
  }
}

/* ========================================
   Screenshots Section
   ======================================== */

.screenshots {
  padding: var(--space-3xl) 0;
  background: var(--color-surface);
  overflow: hidden;
}

.screenshots-scroll {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.screenshots-scroll::-webkit-scrollbar {
  display: none;
}

.screenshots-scroll img {
  flex-shrink: 0;
  width: 220px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  scroll-snap-align: center;
  transition: transform var(--transition-base);
}

.screenshots-scroll img:hover {
  transform: scale(1.02);
}

@media (min-width: 768px) {
  .screenshots-scroll img {
    width: 260px;
  }
}

/* ========================================
   CTA Section
   ======================================== */

.cta {
  padding: var(--space-3xl) 0;
  background: var(--gradient-primary);
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.cta .container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.cta h2 {
  font-family: var(--font-family-rounded);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: var(--space-md);
}

.cta p {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta .btn-secondary {
  background: #FFFFFF;
  color: var(--color-primary-dark);
}

.cta .btn-secondary:hover {
  background: #FFFFFF;
  color: var(--color-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
  .cta h2 {
    font-size: var(--text-3xl);
  }
}

/* ========================================
   Footer
   ======================================== */

.footer {
  padding: var(--space-2xl) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
  list-style: none;
}

.footer-links a {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

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

.copyright {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ========================================
   Utility Classes
   ======================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   Animations - Intersection Observer Ready
   ======================================== */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Page Content Offset (for fixed header)
   ======================================== */

main {
  padding-top: 0;
}

/* ========================================
   Legal Pages (Privacy, Terms)
   ======================================== */

.legal-hero {
  background: var(--gradient-hero);
  padding: calc(60px + var(--space-3xl)) var(--space-lg) var(--space-3xl);
  text-align: center;
  color: #FFFFFF;
}

.legal-hero h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.legal-hero .last-updated {
  font-size: var(--text-sm);
  opacity: 0.8;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.legal-content section {
  margin-bottom: var(--space-2xl);
}

.legal-content h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-primary);
}

.legal-content h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin: var(--space-lg) 0 var(--space-sm);
}

.legal-content p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.legal-content ul {
  margin: var(--space-md) 0;
  padding-left: var(--space-xl);
}

.legal-content li {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-sm);
}

.legal-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.legal-content a:hover {
  color: var(--color-primary-dark);
}

@media (min-width: 768px) {
  .legal-hero {
    padding: var(--space-4xl) var(--space-xl);
  }

  .legal-hero h1 {
    font-size: var(--text-3xl);
  }

  .legal-content {
    padding: var(--space-3xl) var(--space-xl);
  }
}
