/* =========================================
   1. Variables & Base Setup
   ========================================= */
:root {
  --bg-color: #0f0f11;
  --card-bg: #1c1c1e;
  --text-main: #f5f5f7;
  --text-sub: #86868b;
  --accent-gold: #ffce00;
  --accent-gold-hover: #e6b800;
  --accent-red: #dd0000;
  --accent-blue: #43b1e1;
  --accent-green: #3ee8ac;

  --radius: 20px;
  --transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-float: 0 18px 40px rgba(0, 0, 0, 0.55);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* --- Utilities --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 100px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-align: center;
}

.btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent-gold);
  color: #000;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* =========================================
   2. Header & Navigation
   ========================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 0;
  z-index: 100;
  background: rgba(15, 15, 17, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.logo span {
  color: var(--accent-gold);
}

/* =========================================
   3. Hero Section (Index)
   ========================================= */
.hero {
  padding: 160px 0 80px;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #fff 0%, #aaa 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  color: var(--text-sub);
  max-width: 700px;
  margin: 0 auto;
}

/* =========================================
   3-2. Hero Detail Layout (Single LP)
   ========================================= */
.hero-detail {
  padding: 140px 0 60px;
}

.hero-detail .hero-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 40px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.06),
      transparent 55%
    ),
    linear-gradient(135deg, #141416 0%, #050608 60%, #020305 100%);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
}

.hero-copy {
  max-width: 560px;
  text-align: center;
  flex: 1;
}

.hero-app-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  justify-content: center;
}

.hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
  font-size: 0.9rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--text-sub);
  margin: 24px auto;
  line-height: 1.8;
}

@media (min-width: 900px) {
  .hero-detail .hero-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }
  .hero-copy {
    text-align: left;
  }
  .hero-app-meta {
    justify-content: flex-start;
  }
}

/* App Store Badge */
.download-buttons {
  margin-top: 30px;
  display: flex;
  justify-content: center;
}
@media (min-width: 900px) {
  .download-buttons {
    justify-content: flex-start;
  }
}

.app-badge {
  display: inline-flex;
  align-items: center;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 10px 20px;
  color: #fff;
  font-weight: bold;
  gap: 10px;
}
.app-badge:hover {
  background: #222;
  border-color: #fff;
}
.micro-copy {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

/* =========================================
   4. Mockup & Carousel (CSS Scroll Snap)
   ========================================= */
.device-mockup {
  margin: 0 auto;
  width: 280px;
  height: 560px;
  background: #000;
  border-radius: 40px;
  border: 8px solid #333;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  /* Floating Animation */
  animation: float 6s ease-in-out infinite;
}

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

/* Scroll Snap Carousel Implementation */
.carousel-inner {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.carousel-inner::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.carousel-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
}

.screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 32px; /* Inner radius matching mockup */
}

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 10px;
  border-radius: 20px;
}
.dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transition: background 0.3s;
}
.dot.active {
  background: var(--accent-gold);
  transform: scale(1.2);
}

/* =========================================
   5. Bento Grid & Features
   ========================================= */
.features {
  padding: 100px 0;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 30px;
  text-align: center;
  font-weight: 800;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 50px;
}
.bento-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.bento-item:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-card);
}
.bento-icon {
  font-size: 2rem;
  margin-bottom: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bento-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.bento-desc {
  color: var(--text-sub);
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .bento-large {
    grid-column: span 2;
  }
  .bento-tall {
    grid-row: span 2;
  }
}

/* =========================================
   6. Portal Page: Filter & Grid
   ========================================= */
.filter-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 40px 0 60px;
}
.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-sub);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 24px;
  border-radius: 50px;
  transition: var(--transition);
  font-weight: 600;
  font-size: 0.95rem;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--text-main);
  color: #000;
  border-color: var(--text-main);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

/* --- App Card UX Upgrade --- */
.app-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative; /* Context for stretched link */
  text-align: center;
  height: 100%;
}

.app-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.app-icon {
  width: 100px;
  height: 100px;
  border-radius: 22px;
  margin-bottom: 20px;
  background: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  object-fit: cover;
}

.app-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  width: 100%;
}

.app-cat {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.app-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
  color: #fff;
  min-height: 3.2em; /* 2.3行分確保 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.app-desc {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin-bottom: 20px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* Card Actions */
.app-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  position: relative;
  z-index: 2; /* Bring buttons above the stretched link if needed, but we want card clickable */
}

/* UX Trick: Make whole card clickable for the "Details" link, keep Store link separate */
.app-card-link::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.app-actions .btn {
  width: 100%;
  position: relative;
  z-index: 2; /* Buttons must be clickable independently */
}

/* Filter Animations */
.app-card.hidden {
  display: none;
}
.app-card.fade-in-filter {
  animation: fadeInFilter 0.5s ease forwards;
}

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

/* =========================================
   7. Common Layouts (Lists, Sections)
   ========================================= */
.lp-section {
  padding: 80px 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}
.pill {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #ddd;
}

.two-col {
  display: grid;
  gap: 40px;
}
@media (min-width: 900px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.check-list li {
  margin-bottom: 10px;
  padding-left: 24px;
  position: relative;
}
.check-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--accent-gold);
}

/* SEO Text Section */
.seo-section {
  max-width: 800px;
  margin: 60px auto;
  background: rgba(255, 255, 255, 0.02);
  padding: 40px;
  border-radius: 20px;
}
.seo-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--text-main);
}
.seo-section h3 {
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 10px;
  color: #fff;
}
.seo-section p {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-bottom: 10px;
}

/* =========================================
   8. Sticky CTA
   ========================================= */
#stickyCta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(20, 20, 22, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 16px 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}
#stickyCta.visible {
  transform: translateY(0);
}

.sticky-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.sticky-cta-text strong {
  display: block;
  font-size: 1rem;
}
.sticky-cta-text span {
  font-size: 0.8rem;
  color: var(--text-sub);
  display: none;
}

@media (min-width: 600px) {
  .sticky-cta-text span {
    display: inline;
  }
}

/* =========================================
   9. Footer & Animations
   ========================================= */
footer {
  padding: 80px 0;
  text-align: center;
  color: var(--text-sub);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  background: #050505;
}
.footer-links a {
  margin: 0 12px;
}
.footer-links a:hover {
  color: var(--text-main);
  text-decoration: underline;
}
.copyright {
  margin-top: 20px;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Fade In Observer */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.shadow-pulse {
  animation: pulse-gold 2s infinite;
}
@keyframes pulse-gold {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 206, 0, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 206, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 206, 0, 0);
  }
}
