/* ============================== */
/* TrailFusion AI - Shared Design System */
/* Used across all pages for unified UI  */
/* ============================== */

:where([class^="ri-"])::before { content: "\f3c2"; }

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html { scroll-behavior: smooth; }

body {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  background: #FFFBF2;
  color: #1F2E4D;
  overflow-x: hidden;
}

/* ============================== */
/* グラフィカルな背景パターン */
/* ============================== */
.dot-pattern {
  background-image: radial-gradient(circle, rgba(31,46,77,0.12) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}
.grid-pattern {
  background-image:
    linear-gradient(rgba(31,46,77,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,46,77,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}
.noise {
  position: relative;
}
.noise::after {
  content:'';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ============================== */
/* アニメーション */
/* ============================== */
@keyframes float { 0%,100%{ transform: translateY(0) rotate(var(--r,0deg)); } 50%{ transform: translateY(-14px) rotate(var(--r,0deg)); } }
@keyframes floatSlow { 0%,100%{ transform: translateY(0) rotate(var(--r,0deg)); } 50%{ transform: translateY(-22px) rotate(var(--r,0deg)); } }
@keyframes wiggle { 0%,100%{ transform: rotate(-4deg); } 50%{ transform: rotate(4deg); } }
@keyframes spinSlow { from{ transform: rotate(0deg); } to{ transform: rotate(360deg); } }
@keyframes marquee { from{ transform: translateX(0); } to{ transform: translateX(-50%); } }
@keyframes popIn { 0%{ transform: scale(0.6); opacity:0; } 60%{ transform: scale(1.08); opacity:1; } 100%{ transform: scale(1); } }
@keyframes bounce-soft { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-8px); } }
@keyframes gradientShift { 0%,100%{ background-position: 0% 50%; } 50%{ background-position: 100% 50%; } }

.float { animation: float 4s ease-in-out infinite; }
.float-slow { animation: floatSlow 6s ease-in-out infinite; }
.wiggle { animation: wiggle 2.8s ease-in-out infinite; transform-origin: center; }
.spin-slow { animation: spinSlow 18s linear infinite; }
.pop-in { animation: popIn 0.7s cubic-bezier(0.25,1.5,0.5,1) both; }
.bounce-soft { animation: bounce-soft 2s ease-in-out infinite; }
.gradient-animated {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }

/* ============================== */
/* タイポグラフィ */
/* ============================== */
.display-xl {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.accent-font { font-family: 'Archivo Black', sans-serif; letter-spacing: -0.01em; }
.hand-font { font-family: 'Caveat', cursive; }

.text-stroke {
  -webkit-text-stroke: 2px #1F2E4D;
  color: transparent;
}
.text-outline-white {
  -webkit-text-stroke: 2px #ffffff;
  color: transparent;
}

.gradient-text {
  background: linear-gradient(120deg, #FF6B5B 0%, #E85A9A 45%, #4ECDC4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================== */
/* ステッカー & バッジ */
/* ============================== */
.sticker {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  font-weight: 800;
  font-size: 0.85rem;
  border: 2.5px solid #1F2E4D;
  border-radius: 999px;
  background: #FFD84D;
  box-shadow: 4px 4px 0 #1F2E4D;
  transform: rotate(-2deg);
}
.sticker-coral { background: #FF6B5B; color: #fff; }
.sticker-ocean { background: #4ECDC4; color: #1F2E4D; }
.sticker-peach { background: #FFB3BA; color: #1F2E4D; }
.sticker-grass { background: #7DD87A; color: #1F2E4D; }
.sticker-sky { background: #A5E3F5; color: #1F2E4D; }
.sticker-berry { background: #E85A9A; color: #fff; }
.sticker-navy { background: #1F2E4D; color: #FFD84D; }

.badge-round {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: #FFD84D;
  color: #1F2E4D;
  border: 3px solid #1F2E4D;
  box-shadow: 6px 6px 0 #1F2E4D;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
}

/* ============================== */
/* ボタン */
/* ============================== */
.btn-chunky {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  background: #1F2E4D;
  color: #fff;
  border: 3px solid #1F2E4D;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 5px 5px 0 #FFD84D;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.btn-chunky:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 #FFD84D;
}
.btn-chunky:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 #FFD84D;
}
.btn-chunky-coral { background: #FF6B5B; box-shadow: 5px 5px 0 #1F2E4D; }
.btn-chunky-coral:hover { box-shadow: 7px 7px 0 #1F2E4D; }
.btn-chunky-ocean { background: #4ECDC4; color: #1F2E4D; box-shadow: 5px 5px 0 #1F2E4D; }
.btn-chunky-ocean:hover { box-shadow: 7px 7px 0 #1F2E4D; }
.btn-chunky-sun { background: #FFD84D; color: #1F2E4D; box-shadow: 5px 5px 0 #1F2E4D; }
.btn-chunky-sun:hover { box-shadow: 7px 7px 0 #1F2E4D; }
.btn-chunky-white { background: #fff; color: #1F2E4D; box-shadow: 5px 5px 0 #1F2E4D; }
.btn-chunky-white:hover { box-shadow: 7px 7px 0 #1F2E4D; }

/* ============================== */
/* カード */
/* ============================== */
.card-chunky {
  background: #fff;
  border: 3px solid #1F2E4D;
  border-radius: 28px;
  box-shadow: 8px 8px 0 #1F2E4D;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.card-chunky:hover {
  transform: translate(-3px, -3px);
  box-shadow: 11px 11px 0 #1F2E4D;
}
.card-chunky-flat {
  background: #fff;
  border: 3px solid #1F2E4D;
  border-radius: 28px;
  box-shadow: 8px 8px 0 #1F2E4D;
}

/* ============================== */
/* 波ディバイダー */
/* ============================== */
.wave-divider {
  display: block;
  width: 100%;
  height: 60px;
}

/* ============================== */
/* フェードイン */
/* ============================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-stagger.visible > *:nth-child(1) { opacity:1; transform:translateY(0); transition-delay:0.05s; }
.reveal-stagger.visible > *:nth-child(2) { opacity:1; transform:translateY(0); transition-delay:0.15s; }
.reveal-stagger.visible > *:nth-child(3) { opacity:1; transform:translateY(0); transition-delay:0.25s; }
.reveal-stagger.visible > *:nth-child(4) { opacity:1; transform:translateY(0); transition-delay:0.35s; }
.reveal-stagger.visible > *:nth-child(5) { opacity:1; transform:translateY(0); transition-delay:0.45s; }
.reveal-stagger.visible > *:nth-child(6) { opacity:1; transform:translateY(0); transition-delay:0.55s; }
.reveal-stagger.visible > *:nth-child(7) { opacity:1; transform:translateY(0); transition-delay:0.65s; }
.reveal-stagger.visible > *:nth-child(8) { opacity:1; transform:translateY(0); transition-delay:0.75s; }

/* ============================== */
/* ビデオコントロールを非表示 */
/* ============================== */
video::-webkit-media-controls { display: none !important; }
video::-webkit-media-controls-overlay-play-button { display: none !important; }

/* ============================== */
/* ポラロイド */
/* ============================== */
.polaroid {
  background: #fff;
  padding: 10px 10px 40px;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(31,46,77,0.18);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.polaroid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

/* ============================== */
/* スクロールトップ */
/* ============================== */
#scrollToTop {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #FFD84D;
  color: #1F2E4D;
  border: 3px solid #1F2E4D;
  box-shadow: 4px 4px 0 #1F2E4D;
  display: grid; place-items: center;
  font-size: 1.5rem;
  opacity: 0; visibility: hidden;
  transition: all 0.3s ease;
  z-index: 40;
  cursor: pointer;
}
#scrollToTop.show { opacity: 1; visibility: visible; }
#scrollToTop:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #1F2E4D; }

/* ============================== */
/* ハイライトアンダーライン */
/* ============================== */
.highlight {
  background: linear-gradient(180deg, transparent 60%, #FFD84D 60%);
  padding: 0 0.15em;
}
.highlight-coral {
  background: linear-gradient(180deg, transparent 60%, #FFB3BA 60%);
  padding: 0 0.15em;
}
.highlight-ocean {
  background: linear-gradient(180deg, transparent 60%, #A5E3F5 60%);
  padding: 0 0.15em;
}
.highlight-grass {
  background: linear-gradient(180deg, transparent 60%, #7DD87A 60%);
  padding: 0 0.15em;
}

/* カスタム入力 */
.input-chunky {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 2.5px solid #1F2E4D;
  border-radius: 16px;
  background: #fff;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease;
}
.input-chunky:focus {
  outline: none;
  box-shadow: 4px 4px 0 #FFD84D;
  transform: translate(-1px,-1px);
}

/* ナビの下線 */
.nav-item {
  position: relative;
  padding: 0.5rem 0;
  font-weight: 700;
  transition: color 0.2s ease;
}
.nav-item::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 3px;
  background: #FFD84D;
  border-radius: 2px;
  transition: width 0.25s ease;
}
.nav-item:hover::after,
.nav-item[aria-current="page"]::after { width: 100%; }
.nav-item[aria-current="page"] { color: #FF6B5B; }

/* 角を丸めたモバイルナビボタン */
.mobile-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 2px solid #1F2E4D;
  transition: transform 0.15s ease;
}
.mobile-pill:active { transform: scale(0.94); }

/* ヒーローの大きな丸ステッカー回転 */
.rotating-disc {
  width: 180px; height: 180px;
  border-radius: 50%;
  background: #FFD84D;
  border: 3px solid #1F2E4D;
  box-shadow: 8px 8px 0 #1F2E4D;
  display: grid; place-items: center;
}
@media (max-width: 768px) {
  .rotating-disc { width: 120px; height: 120px; }
}

/* 統計の巨大数字 */
.stat-num {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

/* ============================== */
/* セクション見出しブロック */
/* ============================== */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 2px solid #1F2E4D;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-weight: 800;
  font-size: 0.85rem;
  color: #1F2E4D;
}

/* ============================== */
/* テーブル（chunky） */
/* ============================== */
.table-chunky {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 3px solid #1F2E4D;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 6px 6px 0 #1F2E4D;
}
.table-chunky th {
  background: #1F2E4D;
  color: #FFD84D;
  font-weight: 800;
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.table-chunky td {
  padding: 0.85rem 1rem;
  border-top: 2px solid rgba(31,46,77,0.12);
  vertical-align: top;
  font-weight: 500;
}
.table-chunky tr:nth-child(even) td { background: #FFFBF2; }
.table-chunky tr:hover td { background: #FFF4D4; }

/* ============================== */
/* アコーディオン (details/summary) */
/* ============================== */
.acc-chunky {
  background: #fff;
  border: 3px solid #1F2E4D;
  border-radius: 20px;
  box-shadow: 5px 5px 0 #1F2E4D;
  overflow: hidden;
}
.acc-chunky > summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #FFFBF2;
  transition: background 0.2s ease;
}
.acc-chunky > summary::-webkit-details-marker { display: none; }
.acc-chunky > summary:hover { background: #FFF4D4; }
.acc-chunky > summary::after {
  content: '\\002B';
  font-size: 1.25rem;
  font-weight: 900;
  width: 32px; height: 32px;
  border: 2px solid #1F2E4D;
  border-radius: 999px;
  background: #FFD84D;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.acc-chunky[open] > summary::after {
  content: '\\2212';
  background: #FF6B5B;
  color: #fff;
}
.acc-chunky > .acc-body { padding: 1.25rem; border-top: 2px solid rgba(31,46,77,0.12); }

/* ============================== */
/* 共通コンテンツ用 prose */
/* ============================== */
.prose-tf {
  color: #1F2E4D;
  line-height: 1.75;
}
.prose-tf h2 {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 900;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}
.prose-tf h3 {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  margin: 1.75rem 0 0.75rem;
}
.prose-tf p { margin: 0.75rem 0; }
.prose-tf ul, .prose-tf ol { padding-left: 1.5rem; margin: 0.75rem 0; }
.prose-tf li { margin: 0.35rem 0; }
.prose-tf a {
  color: #FF6B5B;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.prose-tf strong { color: #1F2E4D; font-weight: 800; }

/* ============================== */
/* AI 生成画像レイヤー */
/* ============================== */
.ai-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}
.ai-bg-tile {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  background-size: 480px;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.ai-mask-soft {
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, #000 35%, transparent 75%);
}
.ai-frame {
  border: 3px solid #1F2E4D;
  border-radius: 28px;
  box-shadow: 8px 8px 0 #1F2E4D;
  overflow: hidden;
  background: #fff;
}
.ai-blob {
  position: absolute;
  pointer-events: none;
  filter: blur(2px);
  opacity: 0.55;
  mix-blend-mode: multiply;
}

/* ============================== */
/* Reduced motion */
/* ============================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
}
