/* ===== ANOKOE UI v0.23 — Layered Background System =====
 * 多層背景：①ノイズ ②放射スポット ③斜めグラデ ④軽パララックス
 * Reduced Motion時は静止。AA対比維持。
 */

:root {
  /* Background layer colors (Dトーン深い藍) */
  --bg-dtone-dark: #0A0E1A;     /* Deep navy base */
  --bg-dtone-mid: #141B2E;      /* Mid tone */
  --bg-spot: radial-gradient(ellipse 800px 600px at 50% 30%, 
                              rgba(0, 87, 255, 0.08), 
                              transparent 76%); /* 70% → 76% (+6%) */
  
  --bg-grad-1: rgba(0, 215, 127, 0.04);  /* Subtle green tint */
  --bg-grad-2: rgba(0, 87, 255, 0.06);   /* Blue accent */
  
  --bg-noise-alpha: 0.02;       /* Subtle noise overlay */
  --bg-blur: 60px;              /* Spotlight blur radius */
  
  /* 8-bit noise pattern (data URI for performance) */
  --noise-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ===== Dトーン背景適用（.bg-dtone クラスで有効化） ===== */
.bg-dtone,
.bg-dtone body {
  background-color: var(--bg-dtone-dark);
  background-image: 
    var(--noise-pattern),           /* Layer 1: Subtle noise */
    var(--bg-spot),                 /* Layer 2: Radial spotlight */
    linear-gradient(135deg,         /* Layer 3: Diagonal gradient */
      var(--bg-grad-1) 0%,
      transparent 50%,
      var(--bg-grad-2) 100%
    );
  background-size: 
    200px 200px,                    /* Noise tile size */
    100% 100%,                      /* Spotlight full cover */
    100% 100%;                      /* Gradient full cover */
  background-position:
    0 0,
    center top,
    center center;
  background-attachment:
    scroll,
    fixed,                          /* Spotlight fixed (parallax effect) */
    scroll;
  background-repeat:
    repeat,
    no-repeat,
    no-repeat;
  
  /* Override token defaults for dark background */
  --ink: #F0F2F5;
  --bg: var(--bg-dtone-dark);
  --surface: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.12);
}

/* ===== Reduced Motion: 静止背景 ===== */
@media (prefers-reduced-motion: reduce) {
  .bg-dtone,
  .bg-dtone body {
    background-attachment: scroll, scroll, scroll;  /* Remove parallax */
    animation: none !important;
    transition: none !important;
  }
}

/* ===== High contrast adjustments ===== */
@media (prefers-contrast: high) {
  .bg-dtone,
  .bg-dtone body {
    --bg-noise-alpha: 0;           /* Remove noise for clarity */
    --bg-spot: none;               /* Simplify background */
  }
}

/* ===== Hero section background enhancement ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    160deg,
    rgba(0, 87, 255, 0.12) 0%,
    transparent 60%,
    rgba(0, 215, 127, 0.08) 100%
  );
  border-bottom: 1px solid var(--line);
  padding: clamp(48px, 8vw, 96px) var(--safe-pad);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -25%;
  width: 150%;
  height: 200%;
  background: radial-gradient(
    ellipse 600px 400px at 50% 50%,
    rgba(0, 87, 255, 0.17), /* 0.15 → 0.17 (+0.02) */
    transparent 76% /* 70% → 76% */
  );
  pointer-events: none;
  z-index: 0;
}

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

/* Reduced Motion: Static hero */
@media (prefers-reduced-motion: reduce) {
  .hero::before {
    display: none;
  }
}

/* ===== Hero content layout ===== */
.hero__content {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.hero__title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: var(--fw-heading);
  margin: 0 0 12px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: var(--fw-body);
  color: color-mix(in oklab, var(--ink) 75%, transparent);
  margin: 0 0 32px;
  line-height: 1.6;
}

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

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  font-size: 0.85rem;
  color: color-mix(in oklab, var(--ink) 70%, transparent);
  backdrop-filter: blur(8px);
}

.hero__badge-icon {
  font-size: 1rem;
}

/* ===== Mini Hero (for /listen/ page) ===== */
.hero--mini {
  padding: 32px var(--safe-pad);
  text-align: left;
}

.hero--mini .hero__content {
  max-width: 720px;
  text-align: left;
}

.hero--mini .hero__title {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin-bottom: 8px;
}

.hero--mini .hero__subtitle {
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.hero--mini .hero__actions {
  justify-content: flex-start;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 640px) {
  .hero {
    padding: 40px 20px;
  }
  
  .hero__title {
    font-size: 1.75rem;
  }
  
  .hero__subtitle {
    font-size: 0.95rem;
  }
  
  .hero__actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero__actions > * {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Glass effect utilities (for cards on Dトーン bg) ===== */
.glass-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* No backdrop-filter support fallback */
@supports not (backdrop-filter: blur(12px)) {
  .glass-card {
    background: rgba(20, 27, 46, 0.85);
  }
}
