/* ============ Enhanced Base Styles ============ */
:root {
  --bg-primary: #f6f8fc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef2fb;
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-border: rgba(19, 41, 90, 0.08);
  --card-inner-border: rgba(19, 41, 90, 0.04);
  --text-primary: #1e2433;
  --text-secondary: #5b6276;
  --text-tertiary: #8a90a8;
  --accent-primary: #3366ff;
  --accent-secondary: #1ac6a6;
  --accent-gradient: linear-gradient(135deg, #4c7dff 0%, #1ac6a6 100%);
  --accent-glow: rgba(76, 125, 255, 0.25);
  --shadow-light: rgba(21, 52, 98, 0.08);
  --shadow-medium: rgba(21, 52, 98, 0.15);
  --shadow-heavy: rgba(21, 52, 98, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(19, 41, 90, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

/* Background accents */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(76, 125, 255, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(26, 198, 166, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(255, 199, 107, 0.2) 0%, transparent 50%);
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(15, 38, 80, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 38, 80, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

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

/* ============ Enhanced Layout ============ */
.app-main {
  padding: 100px 60px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.app-grid {
  display: block;
}

/* Enhanced Cards */
.app-info, .app-testers {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 60px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 
    0 15px 45px var(--shadow-light),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.app-info::before, .app-testers::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.app-testers {
  margin-top: 40px;
}

/* Enhanced Header */
.app-header {
  display: flex;
  align-items: center;
  margin-bottom: 48px;
  gap: 32px;
  position: relative;
}

.app-icon-large {
  width: 100px;
  height: 100px;
  border-radius: 28px;
  background: #fff center/cover no-repeat;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  background-image: url('../appIcon/6.png');
  position: relative;
  overflow: hidden;
}

.app-icon-large::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

.app-title h1 {
  margin: 0 0 12px;
  font-size: 3.2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  letter-spacing: -0.02em;
  position: relative;
}

.app-title p {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.5;
  font-family: 'JetBrains Mono', monospace;
}

/* Enhanced Description */
.app-description {
  margin-bottom: 40px;
}

.app-description p {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
  text-align: justify;
}

/* Enhanced Button */

.app-cta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 32px;
}

.cta-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(19, 41, 90, 0.08);
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: 0 18px 35px -24px rgba(19, 41, 90, 0.25);
}

.cta-card .cta-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(30, 36, 51, 0.65);
}

.cta-content.desktop-inline {
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.desktop-inline .cta-note {
  text-align: left;
  margin-top: 10px;
}

.cta-card.primary-cta {
  background: linear-gradient(135deg, rgba(76, 125, 255, 0.12), rgba(26, 198, 166, 0.12));
  border: 1px solid rgba(76, 125, 255, 0.35);
  box-shadow: 0 25px 55px -25px rgba(76, 125, 255, 0.45);
  position: relative;
}

.cta-card.primary-cta .cta-badge {
  position: absolute;
  top: -14px;
  left: 24px;
  right: auto;
}

.cta-card.secondary-cta {
  position: relative;
}

.cta-card.secondary-cta .cta-label {
  position: absolute;
  top: -14px;
  left: 24px;
  padding: 4px 12px;
  font-size: 0.8rem;
  border-radius: 999px;
  background: rgba(30, 36, 51, 0.12);
  color: rgba(30, 36, 51, 0.7);
  border: 1px solid rgba(30, 36, 51, 0.2);
}

.cta-content {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.cta-content.qr-inline {
  flex-wrap: nowrap;
  justify-content: space-between;
}

.cta-content.desktop-inline {
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
}

.cta-content.qr-inline .qr-card {
  text-align: center;
}

@media (max-width: 640px) {
  .cta-content.qr-inline {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
  }

  .cta-content.qr-inline .qr-card {
    text-align: center;
  }

  .cta-content.desktop-inline {
    flex-direction: column;
    gap: 16px;
  }
}

.cta-button-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
}

.cta-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  background: #ff9d42;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 12px rgba(255, 157, 66, 0.3);
  z-index: 1;
}

.cta-button-wrap:not(.recommended) .cta-badge {
  display: none;
}

.qr-card {
  margin: 0;
  text-align: center;
}

.qr-card img,
.qr-image {
  width: 200px;
  height: 200px;
  border-radius: 16px;
  border: 1px solid rgba(19, 41, 90, 0.1);
  box-shadow: 0 12px 30px rgba(19, 41, 90, 0.1);
}

.desktop-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 16px;
  border: 1px solid rgba(19, 41, 90, 0.1);
  box-shadow: 0 12px 30px rgba(19, 41, 90, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  background: rgba(19, 41, 90, 0.02);
}

.cta-content.desktop-inline .qr-card {
  margin: 0;
}

.app-store-btn, .web-app-btn {
  display: inline-flex;
  align-items: center;
  padding: 20px 40px;
  text-decoration: none;
  border-radius: 16px;
  font-weight: 600;
  font-size: 1.05rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  width: 100%;
  justify-content: center;
}

.app-store-btn {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 8px 32px var(--accent-glow), 0 2px 16px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.iphone-btn {
  justify-content: center;
  position: relative;
}

.web-app-btn {
  background: #fff;
  color: var(--accent-primary);
  border: 1px solid rgba(51, 102, 255, 0.3);
  box-shadow: 0 6px 20px rgba(51, 102, 255, 0.12);
}

.web-app-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(51, 102, 255, 0.18);
}

.app-store-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s;
}

.app-store-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 16px 48px var(--accent-glow),
    0 4px 24px rgba(0, 0, 0, 0.3);
}

.app-store-btn:hover::before {
  left: 100%;
}

.app-store-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ============ Enhanced Carousel ============ */
.screenshots-section {
  margin: 60px 0 0;
}

.screenshots-note {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(30, 36, 51, 0.7);
}

.speech-bubble {
  position: relative;
  background: #fff;
  border: 1px solid rgba(19, 41, 90, 0.18);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(19, 41, 90, 0.12);
  --arrow-left: 120px;
}

.bubble-arrow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bubble-arrow::before,
.bubble-arrow::after {
  content: '';
  position: absolute;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
}

.bubble-arrow::before {
  top: -28px;
  left: calc(var(--arrow-left) - 20px);
  border-bottom: 22px solid rgba(19, 41, 90, 0.18);
}

.bubble-arrow::after {
  top: -26px;
  left: calc(var(--arrow-left) - 18px);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 20px solid #fff;
}

.image-carousel {
  max-width: 100%;
  margin: 0;
  position: relative;
}

.carousel-container {
  position: relative;
  display: flex;
  align-items: center;
  background: transparent;
  border-radius: 24px;
  padding: 0;
  box-shadow: none;
}

.carousel-images {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  height: 520px;
  background: transparent;
  box-shadow: none;
  border: none;
}

.carousel-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.95);
}

.carousel-image.active {
  opacity: 1;
  filter: brightness(1);
}

.carousel-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 20px var(--shadow-light),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: relative;
  overflow: hidden;
}

.carousel-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.4s;
  border-radius: 50%;
}

.carousel-btn:hover {
  transform: scale(1.1);
  box-shadow: 
    0 8px 32px var(--shadow-medium),
    0 0 20px var(--accent-glow);
}

.carousel-btn:hover::before {
  opacity: 0.8;
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-tertiary);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.indicator::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.4s;
}

.indicator.active {
  background: var(--accent-primary);
  transform: scale(1.4);
  box-shadow: 0 0 12px var(--accent-glow);
}

.indicator:hover::before {
  opacity: 0.5;
}

/* ============ Enhanced Testers Section ============ */
.app-testers h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 32px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  position: relative;
}

.app-testers h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.testers-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.testers-list li {
  margin: 0 0 20px;
  font-size: 1.1rem;
  line-height: 1.6;
  position: relative;
  padding-left: 24px;
}

.testers-list li::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-size: 0.8rem;
  transition: transform 0.3s;
}

.testers-list a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  position: relative;
}

.testers-list a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.testers-list a:hover {
  color: var(--text-primary);
  transform: translateX(4px);
}

.testers-list a:hover::after {
  width: 100%;
}

.testers-list li:hover::before {
  transform: translateX(4px);
}

/* Enhanced Home Button */
.home-btn-container {
  text-align: center;
  margin-top: 60px;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  padding: 18px 36px;
  background: var(--glass-bg);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 16px;
  font-weight: 600;
  font-size: 1.1rem;
  border: 1px solid var(--accent-primary); /* ボーダーもアクセントカラーに */
  box-shadow: 
    0 8px 32px var(--accent-glow), /* 影を強調 */
    0 2px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.home-btn::before {
  content: none; /* ホバー時の効果は不要になったので削除 */
}

.home-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 16px 48px var(--accent-glow), /* ホバー時の影をさらに強調 */
    0 4px 24px rgba(0, 0, 0, 0.3);
}

.home-btn:hover::before {
  opacity: 0; /* ホバー時の::beforeのopacityも削除 */
}

/* ============ Enhanced Responsive Design ============ */
@media (max-width: 1200px) {
  .app-main { padding: 80px 40px; }
  .app-grid { gap: 60px; }
  .carousel-images { height: 460px; }
}

@media (max-width: 1024px) {
  .carousel-images { height: 400px; }
  .app-title h1 { font-size: 2.8rem; }
}

@media (max-width: 768px) {
  .app-main { padding: 40px 24px; }
  .app-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .app-info, .app-testers { padding: 40px; }
  .app-header {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  .app-icon-large { width: 80px; height: 80px; }
  .app-title h1 { font-size: 2.4rem; }
  .carousel-images { height: 320px; }
  .carousel-btn { width: 52px; height: 52px; font-size: 18px; }
}

@media (max-width: 480px) {
  .app-main { padding: 24px 16px; }
  .app-info, .app-testers {
    padding: 32px;
    border-radius: 28px;
  }
  .app-title h1 { font-size: 2rem; }
  .app-description p { font-size: 1.1rem; }
  .app-store-btn { padding: 16px 32px; font-size: 1rem; }
  .carousel-images { height: 280px; }
  .carousel-btn { width: 48px; height: 48px; font-size: 16px; }
  .indicator { width: 8px; height: 8px; }
}

/* Accessibility enhancements */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  body::after {
    animation: none;
  }
}

/* Focus styles for better accessibility */
.carousel-btn:focus-visible,
.indicator:focus-visible,
.app-store-btn:focus-visible,
.home-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
