/* ===========================================================================
   AETHER Template 01 — prmpt / Scroll Archive
   依存ゼロ（React・GSAP・Motion 不使用）。差し替えは :root のトークンのみ。
   =========================================================================== */

:root {
  /* ── 色（この演出は「明→黒→明」の3層と mix-blend-mode: exclusion が前提） ── */
  --ae-hero-bg:   #ffffff;    /* ヒーロー背景（動画ロード前に見える色） */
  --ae-panel-bg:  #000000;   /* せり上がる黒パネル */
  --ae-outro-bg:  #ffffff;   /* 末尾の白オーバーレイ */
  --ae-ui:        #ffffff;         /* オーバーレイUIの色（exclusion 前提＝白推奨） */
  --ae-cta-bg:    #ffffff;     /* CTAピルの地色 */

  /* ── タイポ ── */
  --ae-font: "Inter Tight", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* ── 余白 ── */
  --ae-edge:    16px;   /* モバイルの画面端 */
  --ae-edge-lg: 32px;   /* デスクトップの画面端 */
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--ae-hero-bg); }

.ae {
  position: relative;
  display: block;
  user-select: none;
  background: var(--ae-hero-bg);
  min-height: 500vh;              /* JSが実測値で上書きする */
  font-family: var(--ae-font);
  font-weight: 500;
}
.ae.ae-has-cursor { cursor: none; }

/* ── 動画コンテナ ───────────────────────────────────────────── */
.ae-canvas {
  position: fixed;
  left: 0; top: 220px;
  width: 100vw; height: calc(100vh - 220px);
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}
@media (min-width: 1024px) {
  .ae-canvas { inset: 0; top: 0; width: 100%; height: 100%; }
}
.ae-canvas video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ── 黒パネル（ギャラリー） ─────────────────────────────────── */
.ae-panel {
  position: fixed; inset: 0;
  background: var(--ae-panel-bg);
  z-index: 10;
  overflow: hidden;
  transform: translateY(100vh);
}
.ae-wrap {
  width: 100%;
  padding: min(400px, 40vh) 4vw 0;
}
.ae-grid { display: grid; gap: 16px; }
.ae-cell { aspect-ratio: 2 / 3; }
.ae-card {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  will-change: transform;
  transform: scale(0);
}
.ae-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ae-tail { height: 60vh; }

/* 列数はブレークポイントで3レイアウトを出し分ける（JSが2/3/4列を生成） */
.ae-grid[data-cols="2"],
.ae-grid[data-cols="3"] { display: none; }
.ae-grid[data-cols="4"] { display: grid; }
@media (max-width: 1023.98px) {
  .ae-grid[data-cols="4"] { display: none; }
  .ae-grid[data-cols="3"] { display: grid; }
}
@media (max-width: 639.98px) {
  .ae-grid[data-cols="3"] { display: none; }
  .ae-grid[data-cols="2"] { display: grid; }
}

/* ── 白オーバーレイ（アウトロ） ─────────────────────────────── */
.ae-overlay {
  position: fixed; inset: 0;
  background: var(--ae-outro-bg);
  z-index: 12;
  opacity: 0;
  pointer-events: none;
}

/* ── オーバーレイUI 共通 ───────────────────────────────────── */
.ae-ui {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  mix-blend-mode: exclusion;   /* 明背景でも黒背景でも文字が視認できる仕掛け */
  color: var(--ae-ui);
}
.ae-ui a { color: inherit; text-decoration: none; pointer-events: auto; }

/* ロゴ */
.ae-logo { left: var(--ae-edge); top: var(--ae-edge); width: 124px; }
.ae-logo svg, .ae-logo img { width: 100%; height: auto; display: block; }
@media (min-width: 640px)  { .ae-logo { width: 266px; } }
@media (min-width: 1024px) { .ae-logo { left: var(--ae-edge-lg); top: var(--ae-edge-lg); width: 355px; } }

/* キャプション */
.ae-caption {
  left: var(--ae-edge); top: 118px;
  width: calc(100vw - 32px);
  margin: 0;
  font-size: 12px; line-height: 140%; letter-spacing: -0.04em;
}
@media (min-width: 640px)  { .ae-caption { top: 180px; width: calc(50vw - 48px); } }
@media (min-width: 1024px) { .ae-caption { left: var(--ae-edge-lg); top: 244px; width: 692px; } }

/* ナビ */
.ae-nav {
  right: var(--ae-edge); top: var(--ae-edge);
  height: 30px;
  display: flex; align-items: center; justify-content: flex-end; gap: 20px;
}
@media (min-width: 1024px) {
  .ae-nav { right: var(--ae-edge-lg); top: var(--ae-edge-lg); width: 330px; justify-content: space-between; gap: 50px; }
}
.ae-nav__left { font-size: 15px; text-transform: uppercase; display: none; }
@media (min-width: 640px) { .ae-nav__left { display: inline; } }
.ae-nav__group { display: flex; align-items: center; gap: 20px; }
@media (min-width: 1024px) { .ae-nav__group { gap: 50px; } }
.ae-nav__burger { width: 24px; height: 24px; }
@media (min-width: 1024px) { .ae-nav__burger { width: 30px; height: 30px; } }
.ae-nav__right { font-size: 13px; white-space: nowrap; }
@media (min-width: 1024px) { .ae-nav__right { font-size: 15px; } }

/* 情報ブロック */
.ae-info {
  left: 0; right: 0; bottom: 48px;
  display: flex; flex-direction: column; align-items: center;
}
@media (min-width: 1024px) {
  .ae-info { left: auto; right: var(--ae-edge-lg); bottom: 80px; width: 330px; }
}
.ae-info-inner { display: flex; flex-direction: column; align-items: center; width: 252px; }
@media (min-width: 1024px) { .ae-info-inner { width: 100%; } }
.ae-info__top { display: flex; flex-direction: column; align-items: flex-start; width: 252px; margin-bottom: 12px; }
@media (min-width: 1024px) { .ae-info__top { width: 100%; margin-bottom: 32px; } }
.ae-info__circle { width: 20px; height: 20px; }
@media (min-width: 1024px) { .ae-info__circle { width: 30px; height: 30px; } }
.ae-symbol {
  font-size: 10px; letter-spacing: -0.04em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
@media (min-width: 1024px) { .ae-symbol { font-size: 15px; } }
.ae-info__lead {
  font-size: 20px; line-height: 100%; text-align: center;
  letter-spacing: -0.04em; text-transform: uppercase;
}
@media (min-width: 1024px) { .ae-info__lead { font-size: 30px; } }
.ae-info__big {
  font-size: 60px; line-height: 100%; text-align: center; letter-spacing: -0.04em;
}
@media (min-width: 1024px) { .ae-info__big { font-size: 80px; } }

/* CTA（ピル） */
.ae-cta {
  left: var(--ae-edge); right: var(--ae-edge); bottom: 60px; height: 100px;
  background: var(--ae-cta-bg); border-radius: 1335px;
  display: flex; align-items: center; justify-content: center;
  transform-origin: right bottom; transform: scale(0);
}
@media (min-width: 1024px) {
  .ae-cta { left: auto; right: var(--ae-edge-lg); bottom: var(--ae-edge-lg); width: 330px; height: 174px; }
}
.ae-cta a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.ae-cta span {
  font-size: 72px; letter-spacing: -0.04em;
  color: var(--ae-ui); mix-blend-mode: exclusion;
}
@media (min-width: 1024px) { .ae-cta span { font-size: 110px; } }

/* フッター */
.ae-footer {
  left: var(--ae-edge); bottom: 24px;
  display: flex; align-items: center; gap: 32px;
  opacity: 0;
  font-size: 11px; letter-spacing: -0.02em; text-transform: uppercase;
}
@media (min-width: 1024px) { .ae-footer { bottom: var(--ae-edge-lg); gap: 80px; font-size: 13px; } }

/* カスタムカーソル */
.ae-cursor {
  position: fixed; left: 0; top: 0; z-index: 50;
  pointer-events: none;
  transform: translate(-50%, -50%);
  mix-blend-mode: exclusion;
  color: var(--ae-ui);
}

/* ── 登場アニメーション（段階遅延） ───────────────────────── */
@keyframes ae-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ae-fade { from { opacity: 0; } to { opacity: 1; } }
.ae-logo, .ae-nav, .ae-caption { animation: ae-rise .6s cubic-bezier(.25,.1,.25,1) both; }
.ae-info { animation: ae-fade .6s cubic-bezier(.25,.1,.25,1) both; }
.ae-logo    { animation-delay: 0s; }
.ae-nav     { animation-delay: .15s; }
.ae-caption { animation-delay: .3s; }
.ae-info    { animation-delay: .45s; }

/* ── モーション低減 ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ae-card { will-change: auto; }
  .ae-logo, .ae-nav, .ae-caption, .ae-info { animation: none; }
}
