/* ================================================================
   BroWon LP — Monochrome Amusement Park
   デザイン要素:
     - グレイン層 (bg-pattern)
     - スキャンライン (Hero)
     - SVG コーナーフレームアニメーション
     - V字カット / 右スラッシュ / 左スラッシュ の3種セクション区切り
     - ラインドロー → コンテンツフェードイン (スクロール連動)
     - フィーチャーカード スタッガー
================================================================ */

/* ── FONT ──────────────────────────────────────────────────── */
@font-face {
  font-family: 'BestTenFont';
  src: url('/assets/fonts/BestTen-DOT.woff2') format('woff2'),
    url('/assets/fonts/BestTen-DOT.woff') format('woff');
  font-weight: 100 900;
  font-display: swap;
}

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  --bg: #050505;
  /* ページ背景（最暗） */
  --s-bg: #111111;
  /* セクション背景 */
  --s-alt: #0c0c0c;
  /* セクション背景（代替） */
  --text: #eeeeee;
  --muted: #717171;
  --line: rgba(255, 255, 255, 0.16);
  --frame: rgba(255, 255, 255, 0.65);
  --font: 'BestTenFont', 'Noto Sans JP', system-ui, sans-serif;
  --max: 1160px;
}

/* ── RESET ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

/* ================================================================
   GRAIN LAYER
   bg-pattern.jpg を mix-blend-mode: screen + 低 opacity で重ね
   ページ全体に印刷物のような質感を付加する
================================================================ */
.grain {
  position: fixed;
  inset: 0;
  background: url('/assets/images/bg-pattern.jpg') center / cover no-repeat;
  opacity: 0.055;
  mix-blend-mode: screen;
  z-index: 9000;
  pointer-events: none;
  will-change: transform;
  /* GPU レイヤー昇格 */
}

/* ================================================================
   LOADING OVERLAY
================================================================ */
#loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 10000;
  transition: opacity .5s ease, visibility .5s;
  visibility: visible;
  opacity: 1;
}

#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ld-inner {
  text-align: center;
  width: min(300px, 82vw);
}

.ld-logo-img {
  display: block;
  width: min(52px, 12vw);
  /* ← サイズ調整はここ（元テキストとほぼ同じ高さ） */
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin: 0 auto 28px;
  animation: ld-coin 1.8s linear infinite;
}

@keyframes ld-coin {
  from {
    transform: perspective(300px) rotateY(0deg);
  }

  to {
    transform: perspective(300px) rotateY(360deg);
  }
}

.ld-bar {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 10px;
}

.ld-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 180ms linear;
}

.ld-pct {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 2px;
}

/* ================================================================
   HERO
================================================================ */
.hero {
  position: relative;
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  /* ── V字カット ────────────────────────────────────────────
     下辺: 左端88% → 中央100% → 右端88% の V字
     次セクションとの境界が三角形になる
     (ページ背景 var(--bg) が三角の隙間に見える)
  ───────────────────────────────────────────────────────── */
  clip-path: polygon(0 0, 100% 0, 100% 88%, 50% 100%, 0 88%);
  padding-bottom: 14vh;
  /* カット分のコンテンツ保護 */
}

/* 仮ビジュアル（実素材は hero-bg の background を差し替え） */
.hero-bg {
  position: absolute;
  inset: 0;
  background: #181818;
  z-index: 0;
}

/* ── スキャンライン ─────────────────────────────────────────
   横1pxの繰り返しグラデーションで CRT/レトロモニター質感
──────────────────────────────────────────────────────────── */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      rgba(0, 0, 0, .055) 0px,
      rgba(0, 0, 0, .055) 1px,
      transparent 1px,
      transparent 4px);
  z-index: 2;
  pointer-events: none;
}

/* ================================================================
   CORNER FRAME (SVG)
   pathLength="1" で正規化 → stroke-dashoffset 0→1 でラインを描画
================================================================ */
.corner-frame {
  position: absolute;
  top: 30px;
  left: 30px;
  width: calc(100% - 60px);
  height: calc(100% - 60px);
  z-index: 8;
  pointer-events: none;
}

/* デフォルト: すべて非表示 */
.cf {
  fill: none;
  stroke: var(--frame);
  stroke-width: 1.5;
  /* vector-effect="non-scaling-stroke" で常に 1.5px */
  stroke-linecap: square;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  /* 完全非表示 */
}

/* 遅延: コーナーごとに 0.15s ずつ後からアニメーション */
.cf--tl {
  --cf-delay: 0.05s;
}

.cf--tr {
  --cf-delay: 0.20s;
}

.cf--bl {
  --cf-delay: 0.35s;
}

.cf--br {
  --cf-delay: 0.50s;
}

/* hero.is-ready が付いたとき発火 */
.hero.is-ready .cf {
  animation: cf-draw .45s cubic-bezier(.4, 0, .2, 1) var(--cf-delay, 0s) both;
}

@keyframes cf-draw {
  from {
    stroke-dashoffset: 1;
  }

  to {
    stroke-dashoffset: 0;
  }
}

/* ── HERO CONTENT ───────────────────────────────────────────── */
.hero-content {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 0 6vw;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
}

/* コーナーフレームが描き終わるタイミング（0.95s）後に表示 */
.hero.is-ready .hero-content {
  opacity: 1;
  transform: none;
  transition-delay: .80s;
}

.hero-eyebrow {
  /* font-size は PC / スマホ それぞれのメディアクエリで設定 */
  letter-spacing: 3px;
  color: #000;
  -webkit-text-stroke: 5px #fff;
  paint-order: stroke fill;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(38px, 8vw, 84px);
  line-height: 1.2;
  letter-spacing: .06em;
  margin-bottom: 22px;
  font-weight: 700;
}

/* .hero-sub {
  color: #000;
  -webkit-text-stroke: 5px #fff;
  paint-order: stroke fill;
  letter-spacing: 2px;
} */

/* ── ロゴ画像 ───────────────────────────────────────────────
   幅・位置はここで調整する
   - max-width: ロゴの最大幅（vw 単位で画面幅に合わせることも可）
   - margin: 上下の余白
──────────────────────────────────────────────────────────── */
.hero-logo {
  display: block;
  max-width: min(480px, 70vw);
  /* ← ロゴの最大幅 */
  width: 100%;
  height: auto;
  margin: 0 auto 22px;
  /* ← 下の余白（eyebrow との間隔） */
}

/* ================================================================
   SECTIONS — 共通
================================================================ */
.sec {
  position: relative;
  width: 100%;
  background: var(--s-bg);
}

.sec-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px 5vw 80px;
}

/* スプリットレイアウト */
.sec-inner--split {
  display: flex;
  align-items: center;
  gap: 5vw;
}

.sec-inner--flip {
  flex-direction: row-reverse;
}

.split-img,
.split-text {
  flex: 1 1 0;
  min-width: 0;
}

/* ── REVEAL BAR ─────────────────────────────────────────────
   Intersection Observer で .is-visible が付いたとき
   幅0 → 100% にアニメーション。コンテンツより先に描画される。
──────────────────────────────────────────────────────────── */
.reveal-bar {
  display: block;
  height: 1px;
  background: var(--line);
  width: 0;
  transition: width .65s cubic-bezier(.4, 0, .2, 1);
}

.js-reveal.is-visible .reveal-bar {
  width: 100%;
}

/* ── コンテンツ共通フェードイン ──────────────────────────── */
/* reveal-bar の後 (.55s 遅延) に各要素が順にフェードイン */

.sec-heading {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}

.js-reveal.is-visible .sec-heading {
  opacity: 1;
  transform: none;
  transition-delay: .60s;
}

.sec-desc {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}

.js-reveal.is-visible .sec-desc {
  opacity: 1;
  transform: none;
  transition-delay: .75s;
}

.split-img {
  position: relative;
  opacity: 0;
  transform: translateX(-18px);
  transition: opacity .55s ease, transform .55s ease;
}

.sec-inner--flip .split-img {
  transform: translateX(18px);
}

.js-reveal.is-visible .split-img {
  opacity: 1;
  transform: none;
  transition-delay: .60s;
}

/* ── SECTION HEADINGS ───────────────────────────────────────── */
.sec-heading {
  font-size: clamp(17px, 2.5vw, 26px);
  letter-spacing: 5px;
  margin-bottom: 28px;
  font-weight: 700;
  text-transform: uppercase;
}

.bk {
  color: var(--muted);
  margin: 0 3px;
  font-weight: 400;
}

.sec-desc {
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 2;
  color: var(--muted);
}

/* ================================================================
   SECTION VARIANTS & CLIP-PATHS
================================================================ */

/* CATCH: ページ背景と同色 → シームレスなテキストセクション */
.sec--catch {
  background: var(--bg);
  text-align: center;
}

/* WORLD: 右上がりスラッシュカット ─────────────────────────
   下辺: 左端100% → 右端92% (右が上がる斜線)
   カットした部分に var(--bg) ページ背景が見える
──────────────────────────────────────────────────────────── */
.sec--world {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 92%);
  padding-bottom: 12vh;
  /* カット分の余白 */
}

/* FEATURES: 左上がりスラッシュカット ──────────────────────
   下辺: 左端92% → 右端100% (左が上がる斜線、WORLD と逆)
──────────────────────────────────────────────────────────── */
.sec--features {
  background: var(--s-alt);
  clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
  padding-bottom: 12vh;
}

.sec--cast {
  background: var(--s-bg);
}

.sec--schedule {
  background: var(--bg);
}

/* ================================================================
   CATCH SECTION
================================================================ */
.catch-main {
  font-size: clamp(18px, 3.2vw, 30px);
  line-height: 1.9;
  letter-spacing: .04em;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}

.catch-note {
  font-size: clamp(11px, 1.3vw, 13px);
  color: var(--muted);
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity .5s ease .75s;
}

.js-reveal.is-visible .catch-main {
  opacity: 1;
  transform: none;
  transition-delay: .60s;
}

.js-reveal.is-visible .catch-note {
  opacity: 1;
}

/* ================================================================
   HERO BACKGROUND IMAGE
================================================================ */
.hero-bg {
  position: absolute;
  inset: 0;
  background: #181818;
  /* 画像読み込み前のフォールバック色 */
  z-index: 0;
  overflow: hidden;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ================================================================
   CONTENT IMAGES
================================================================ */
.sec-img {
  display: block;
  width: 100%;
  height: auto;
}

.sec-img--square {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ================================================================
   DOT FRAME (ドット枠線)
   画像の周囲に破線の装飾フレームを追加
================================================================ */
.dot-frame {
  position: absolute;
  inset: -10px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

/* ================================================================
   FEATURES GRID
================================================================ */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 0;
}

/* スタッガーアニメーション: カードが順番にフェードイン */
.feat-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s ease, transform .45s ease;
}

.sec--features.is-visible .feat-card:nth-child(1) {
  opacity: 1;
  transform: none;
  transition-delay: .70s;
}

.sec--features.is-visible .feat-card:nth-child(2) {
  opacity: 1;
  transform: none;
  transition-delay: .85s;
}

.sec--features.is-visible .feat-card:nth-child(3) {
  opacity: 1;
  transform: none;
  transition-delay: 1.00s;
}

.feat-title {
  font-size: clamp(13px, 1.5vw, 15px);
  margin: 14px 0 8px;
  letter-spacing: 1px;
}

.feat-desc {
  font-size: clamp(11px, 1.2vw, 13px);
  color: var(--muted);
  line-height: 1.75;
}

/* ================================================================
   SCHEDULE
================================================================ */
.sched {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}

.js-reveal.is-visible .sched {
  opacity: 1;
  transform: none;
  transition-delay: .75s;
}

.sched-row {
  display: flex;
  align-items: baseline;
  gap: 28px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sched-row:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sched-row dt {
  width: 6.5em;
  flex-shrink: 0;
  color: var(--muted);
  font-size: clamp(12px, 1.3vw, 14px);
  letter-spacing: 1px;
}

.sched-row dd {
  font-size: clamp(13px, 1.5vw, 15px);
}

.ext-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--text);
  opacity: .75;
  transition: opacity .2s;
}

.ext-link:hover {
  opacity: 1;
}

/* ================================================================
   FOOTER
================================================================ */
.footer {
  background: var(--bg);
  text-align: center;
  padding: 36px 20px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 3px;
}

/* ================================================================
   RESPONSIVE
================================================================ */

/* ── PC（769px 以上）Hero 調整 ─────────────────────────────
   位置変更はここを編集する
     justify-content : hero 内のブロックの横位置
       flex-start = 左寄せ / center = 中央 / flex-end = 右寄せ
     padding-left     : 左端からの距離（"左1/3" は 8vw 前後が目安）
     max-width        : コンテンツブロックの最大幅
   ロゴサイズ変更は .hero-logo の max-width を編集する
──────────────────────────────────────────────────────────── */
@media (min-width: 769px) {
  .hero {
    justify-content: flex-start;
    /* ← 左寄せ */
  }

  .hero-content {
    text-align: left;
    /* ← テキストも左揃え */
    padding-left: 8vw;
    /* ← 左端からの距離（ここで横位置調整） */
    padding-right: 0;
    max-width: 55%;
    /* ← ブロック幅の上限 */
  }

  .hero-logo {
    max-width: min(960px, 42vw);
    /* ← ロゴ幅 */
    margin-left: 0;
  }

  /* ── PC: eyebrow / sub のサイズ調整はここ ── */
  .hero-eyebrow {
    font-size: 18px;
  }

  /* ← PC サイズ */
  .hero-sub {
    font-size: 26px;
  }

  /* ← PC サイズ */
}

@media (max-width: 768px) {

  /* ── スマホ: Hero コンテンツの縦位置 ──────────────────────
     align-items で上下の基準を決め、padding-bottom で微調整する
       flex-end   = 下寄せ（padding-bottom で上げ具合を調整）
       center     = 中央
       flex-start = 上寄せ
  ────────────────────────────────────────────────────────── */
  .hero {
    align-items: flex-end;
    /* ← 下寄せ */
  }

  .hero-content {
    padding-bottom: 0vh;
    /* ← 下端からの距離（大きくするほど上に移動） */
    padding-left: 6vw;
    padding-right: 6vw;
  }

  /* ── スマホ: ロゴ幅 ── */
  .hero-logo {
    max-width: min(340px, 92vw);
    /* ← スマホ時のロゴ最大幅 */
    margin-left: 0;
  }

  /* ── スマホ: eyebrow / sub のサイズ調整はここ ── */
  .hero-eyebrow {
    font-size: 13px;
  }

  .hero-sub {
    font-size: 16px;
  }

  /* スプリットレイアウトを縦積みに */
  .sec-inner--split,
  .sec-inner--flip {
    flex-direction: column !important;
  }

  /* フィーチャーグリッドを1列に */
  .feat-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  /* モバイルでスラッシュカットは見た目が悪いため無効化 */
  .sec--world,
  .sec--features {
    clip-path: none;
    padding-bottom: 0;
  }

  /* Heroのコーナーフレームを内側に */
  .corner-frame {
    top: 16px;
    left: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
  }
}

/* ================================================================
   REDUCED MOTION (アクセシビリティ)
   アニメーションを無効化し、すべての要素を即時表示
================================================================ */
@media (prefers-reduced-motion: reduce) {

  .cf,
  .hero-content,
  .sec-heading,
  .sec-desc,
  .split-img,
  .feat-card,
  .catch-main,
  .catch-note,
  .sched,
  .reveal-bar {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
    width: 100% !important;
  }
}