/* ============================================================
   わんぽ — Website Styles (2026)
   ============================================================ */

/* ----- 1. Design Tokens (CSS Custom Properties) ------------ */
:root {
  /* Colors */
  --color-primary: #007AFF;
  --color-secondary: #34C759;
  --color-cta: #007AFF;
  --color-text: #1D1D1F;
  --color-text-secondary: #6E6E73;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F0F5FF;
  --color-footer-bg: #1D1D1F;
  --color-footer-text: #A1A1A6;
  --color-border: #E5E5EA;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  --gradient-cta: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: 7rem;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Header height */
  --header-height: 64px;
}

/* ----- 2. Reset & Base ------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  word-break: normal;
  line-break: strict;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ----- 3. Typography --------------------------------------- */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
}

/* ----- 4. Layout ------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

section {
  padding: var(--space-xl) 0;
}

/* ----- 5. Components --------------------------------------- */

/* --- Site Header (Glass Morphism) --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

@supports (backdrop-filter: blur(20px)) {
  .site-header {
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
}

@supports not (backdrop-filter: blur(20px)) {
  .site-header {
    background: rgba(255, 255, 255, 0.96);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.desktop-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.lang-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: color 0.2s, border-color 0.2s;
}

.lang-link:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* --- Mobile Menu Toggle (Hamburger) --- */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md) 0;
  box-shadow: var(--shadow-md);
}

@supports (backdrop-filter: blur(20px)) {
  .mobile-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 12px var(--space-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  transition: background-color 0.2s;
}

.mobile-nav a:hover {
  background-color: var(--color-bg-alt);
}

.mobile-nav .lang-link {
  display: inline-block;
  margin: 12px var(--space-md) 0;
}

/* --- Hero Section --- */
.hero {
  padding-top: calc(var(--header-height) + var(--space-xl));
  padding-bottom: var(--space-xl);
  background: var(--gradient-hero);
  color: #FFFFFF;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.hero-text h1 {
  color: #FFFFFF;
  margin-bottom: var(--space-md);
}

.hero-text p {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  opacity: 0.92;
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.hero-image {
  display: flex;
  justify-content: center;
}

.hero-image img {
  max-height: 560px;
  width: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* --- App Store Badge (CTA Button) --- */
.app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background-color: var(--color-cta);
  color: #FFFFFF;
  font-size: 1.0625rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.app-store-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 122, 255, 0.4);
}

.app-store-badge svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.app-store-badge--white {
  background-color: #FFFFFF;
  color: var(--color-cta);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.app-store-badge--white:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

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

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-xl);
}

.section-header p {
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
  margin-top: var(--space-sm);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.feature-card {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  margin-bottom: var(--space-sm);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--color-primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card h3 {
  margin-bottom: var(--space-xs);
}

.feature-card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- Feature Showcase (Alternating) --- */
.feature-showcase {
  background-color: var(--color-bg);
}

.feature-showcase--alt {
  background-color: var(--color-bg-alt);
}

.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.showcase-grid--reverse .showcase-text {
  order: 2;
}

.showcase-grid--reverse .showcase-image {
  order: 1;
}

.showcase-text h2 {
  margin-bottom: var(--space-sm);
}

.showcase-text p {
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.showcase-image {
  display: flex;
  justify-content: center;
}

.showcase-image img,
.showcase-image video {
  max-height: 480px;
  width: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.showcase-image video {
  background: #000;
}

/* --- Screenshot Gallery (Scroll Snap) --- */
.gallery-section {
  background-color: var(--color-bg-alt);
  overflow: hidden;
}

.screenshot-gallery {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-md);
  scrollbar-width: none;
}

.screenshot-gallery::-webkit-scrollbar {
  display: none;
}

.screenshot-gallery-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.screenshot-gallery-item img {
  height: 420px;
  width: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* --- Free Badge --- */
.free-badge {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.01em;
}

/* --- Comparison Table (2-column) --- */
.comparison-section {
  background-color: var(--color-bg-alt);
}

.comparison-table-wrapper {
  max-width: 800px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  line-height: 1.6;
}

.comparison-table thead th {
  font-weight: 600;
  font-size: 0.9375rem;
  padding-bottom: 1rem;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  width: 25%;
  font-weight: 600;
  color: var(--color-text);
}

.comparison-table .col-other {
  width: 37.5%;
  color: var(--color-text-secondary);
}

.comparison-table .col-app {
  width: 37.5%;
  background-color: rgba(0, 122, 255, 0.07);
  color: var(--color-text);
  font-weight: 500;
}

.comparison-table .col-app-head {
  background-color: rgba(0, 122, 255, 0.07);
  color: var(--color-primary);
  font-weight: 700;
}

/* --- FAQ Accordion --- */
.faq-section {
  background-color: var(--color-bg);
}

.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
}

.faq-accordion-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-md) 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  line-height: 1.4;
}

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

.faq-question-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-left: var(--space-sm);
  transition: transform 0.3s;
}

.faq-accordion-item.is-open .faq-question-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-answer-inner {
  padding-bottom: var(--space-md);
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* --- CTA Section --- */
.cta-section {
  background: var(--gradient-cta);
  color: #FFFFFF;
  text-align: center;
}

.cta-section h2 {
  color: #FFFFFF;
  margin-bottom: var(--space-sm);
}

.cta-section p {
  font-size: 1.125rem;
  opacity: 0.92;
  margin-bottom: var(--space-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Site Footer (Dark) --- */
.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: var(--space-xl) 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.footer-brand .logo {
  font-size: 1.25rem;
  display: inline-block;
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-col h4 {
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.footer-col ul li {
  margin-bottom: var(--space-xs);
}

.footer-col a {
  font-size: 0.875rem;
  color: var(--color-footer-text);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #FFFFFF;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-md);
  text-align: center;
  font-size: 0.8125rem;
}

/* --- Content Page (Privacy / Support) --- */
.content-page {
  padding-top: calc(var(--header-height) + var(--space-xl));
  padding-bottom: var(--space-xl);
}

.content-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.content-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: var(--space-lg);
  color: var(--color-primary);
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content-section {
  margin-bottom: var(--space-lg);
}

.content-section h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.content-section h3 {
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.content-section p,
.content-section ul,
.content-section ol {
  margin-bottom: var(--space-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  word-break: normal;
  line-break: strict;
  overflow-wrap: break-word;
}

.content-section ul,
.content-section ol {
  padding-left: 1.25rem;
}

.content-section ul {
  list-style: disc;
}

.content-section ol {
  list-style: decimal;
}

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

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

/* --- FAQ Item --- */
.faq-item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.faq-item p,
.faq-item ul,
.faq-item ol {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-xs);
}

.faq-item ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.faq-item ol {
  list-style: decimal;
  padding-left: 1.25rem;
}

/* --- Contact Info --- */
.contact-info {
  margin-bottom: var(--space-md);
}

.feedback {
  margin-top: var(--space-md);
}

.feedback h3 {
  margin-bottom: var(--space-xs);
}

/* ----- 6. Utilities ---------------------------------------- */

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- 7. Media Queries ------------------------------------ */

/* Tablet */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  section {
    padding: var(--space-lg) 0;
  }

  /* Header */
  .desktop-nav {
    display: none;
  }

  .header-actions .lang-link {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Hero */
  .hero {
    padding-top: calc(var(--header-height) + var(--space-lg));
    padding-bottom: var(--space-lg);
    text-align: center;
  }

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

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
    max-width: 480px;
  }

  .hero-image img {
    max-height: 400px;
  }

  /* Showcase */
  .showcase-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }

  .showcase-grid--reverse .showcase-text {
    order: 1;
  }

  .showcase-grid--reverse .showcase-image {
    order: 2;
  }

  .showcase-image img,
  .showcase-image video {
    max-height: 380px;
  }

  /* Screenshot Gallery */
  .screenshot-gallery-item img {
    height: 340px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .footer-brand {
    margin-bottom: var(--space-sm);
  }

  /* Content Page */
  .content-page {
    padding-top: calc(var(--header-height) + var(--space-lg));
  }
}

/* Mobile Small */
@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .feature-card {
    padding: var(--space-md) var(--space-sm);
  }

  .hero-image img {
    max-height: 320px;
  }

  .screenshot-gallery-item img {
    height: 280px;
  }
}
