/* ======================================================================
   Seitaro Arai — Unified Stylesheet
   Path: /in/css/theme.css
   Purpose: Animations / Motion prefs / Cookie banner / Z-index contexts / Utilities
   Notes:
   - All media queries are consolidated at the bottom (1200 / 920 / 768 + prefers-*).
   - Shorthand removed for maintainability.
   ====================================================================== */


/* ======================================================================
   01) Intro Animations (FadeUp)
   - 初回表示時に上にスライドしつつフェードイン
   ====================================================================== */

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

.is-ready .hero-title {
  animation-name: fadeUp;
  animation-duration: 0.7s;
  animation-timing-function: ease-out;
  animation-delay: 0.1s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

.is-ready .hero-sub {
  animation-name: fadeUp;
  animation-duration: 0.7s;
  animation-timing-function: ease-out;
  animation-delay: 0.28s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

.is-ready .chips {
  animation-name: fadeUp;
  animation-duration: 0.7s;
  animation-timing-function: ease-out;
  animation-delay: 0.46s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}


/* ======================================================================
   02) Section Reveal Utility
   - ビューポート進入時に段階的に表示（JSで .in を付与）
   ====================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(14px);

  transition-property: opacity, transform;
  transition-duration: 0.6s;
  transition-timing-function: ease;
  transition-delay: 0s;
}

.reveal.in {
  opacity: 1;
  transform: none;
}


/* ======================================================================
   03) Cookie Banner (固定フッター型)
   - サイト下部に固定表示されるクッキーバナー
   ====================================================================== */

#cookie-banner {
  position: fixed;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;

  z-index: 99999;

  background-color: rgba(255, 255, 255, 0.96);
  background-image: none;
  background-repeat: no-repeat;
  background-position: 0% 0%;
  background-size: auto;

  border-top-width: 1px;
  border-right-width: 0;
  border-bottom-width: 0;
  border-left-width: 0;
  border-top-style: solid;
  border-right-style: none;
  border-bottom-style: none;
  border-left-style: none;
  border-top-color: #e0e0e0;

  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.08);

  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);

  animation-name: slideUp;
  animation-duration: 0.5s;
  animation-timing-function: ease-out;
  animation-delay: 0s;
  animation-iteration-count: 1;
  animation-fill-mode: both;
}

.cookie-inner {
  max-width: var(--max);

  /* 中央寄せ */
  margin-top: 0;
  margin-right: auto;
  margin-bottom: 0;
  margin-left: auto;

  /* 余白 */
  padding-top: 14px;
  padding-right: 20px;
  padding-bottom: 12px;
  padding-left: 20px;

  /* レイアウト */
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;

  /* 折返し・間隔 */
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 12px;
}

.cookie-text {
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;

  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: auto;

  min-width: 220px;

  font-size: 13.5px;
  line-height: 1.6;
  color: #333333;
}

.cookie-text a {
  color: #1e3248;
  text-decoration-line: underline;
  text-decoration-thickness: auto;
  text-decoration-style: solid;
  text-underline-offset: auto;
}

.cookie-text a:hover {
  opacity: 0.7;
}

.cookie-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;

  column-gap: 8px;
  row-gap: 0;

  flex-shrink: 0;
}

.cookie-actions .btn {
  cursor: pointer;

  /* 余白 */
  padding-top: 6px;
  padding-right: 14px;
  padding-bottom: 6px;
  padding-left: 14px;

  /* 見た目（pill） */
  border-top-left-radius: 999px;
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
  border-bottom-left-radius: 999px;

  /* フォント */
  font-size: 13px;
  line-height: 1.2;
}

.cookie-actions .btn.small {
  background-color: #ffffff;
  background-image: none;
  color: #333333;

  border-top-width: 1px;
  border-right-width: 1px;
  border-bottom-width: 1px;
  border-left-width: 1px;
  border-top-style: solid;
  border-right-style: solid;
  border-bottom-style: solid;
  border-left-style: solid;
  border-top-color: #cccccc;
  border-right-color: #cccccc;
  border-bottom-color: #cccccc;
  border-left-color: #cccccc;
}

.cookie-actions .btn.btn-primary {
  background-color: #1e3248; /* 既存値維持。tokensへ寄せる場合は--blue等に調整 */
  background-image: none;
  color: #ffffff;

  border-top-width: 1px;
  border-right-width: 1px;
  border-bottom-width: 1px;
  border-left-width: 1px;
  border-top-style: solid;
  border-right-style: solid;
  border-bottom-style: solid;
  border-left-style: solid;
  border-top-color: #1e3248;
  border-right-color: #1e3248;
  border-bottom-color: #1e3248;
  border-left-color: #1e3248;
}

.cookie-actions .btn.btn-primary:hover {
  opacity: 0.9;
}

.cookie-actions .btn:hover {
  filter: brightness(0.97);
}


/* ======================================================================
   04) SlideUp Keyframes (Cookie banner in)
   ====================================================================== */

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0%);
    opacity: 1;
  }
}


/* ======================================================================
   05) Stacking Contexts
   - ヒーロー背景がヘッダー層を跨がないようにZ順管理
   ====================================================================== */

.hero,
.hero-bg,
.hero-scrim,
.hero-inner {
  position: relative;
}

.hero-bg,
.hero-scrim {
  z-index: 0;
}

.hero-inner {
  z-index: 10;
}

/* Header / Drawer の層定義（他CSSのz-indexと整合が必要） */
.site-header {
  z-index: 3000;
}

.drawer-backdrop {
  z-index: 3500;
}

.drawer {
  z-index: 4000;
}


/* ======================================================================
   06) MEDIA QUERIES (Consolidated at bottom)
   - 幅基準は 1200 / 920 / 768 を採用
   - 動作環境（prefers-*）もここで集約
   ====================================================================== */

/* < 1200px — 必要に応じて追記 */
@media (max-width: 1200px) {
  /* theme レベルの 1200px 未満の調整があればここに追記 */
}

/* < 920px — Cookieレイアウト等の段組変更に使用可 */
@media (max-width: 920px) {
  /* 必要に応じて theme レベルの調整を追加 */
}

/* < 768px — Cookie バナーの縦積みなど */
@media (max-width: 768px) {
  .cookie-inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;

    text-align: center;

    column-gap: 10px;
    row-gap: 10px;

    padding-top: 14px;
    padding-right: 16px;
    padding-bottom: 14px;
    padding-left: 16px;
  }

  .cookie-actions {
    justify-content: center;
  }
}

/* 環境設定：動作を最小化（全幅共通） */
@media (prefers-reduced-motion: reduce) {
  .hero-title,
  .hero-sub,
  .chips {
    opacity: 1;
    transform: none;

    animation-name: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 0 !important;
    animation-fill-mode: none !important;
  }

  .net-arc {
    animation-name: none !important;
    animation-duration: 0s !important;
  }
}
