/* ===========================================================
   Luna Herbtea LP v5 — SHELL
   モバイルファースト。PCで「モバイルカラム＋固定サイドナビ＋
   スクロール連動で変化する背景」を再現。
   tokens-v3.css の後に読み込む（パレット流用）
   =========================================================== */

/* ---- canvas palette (PC余白の背景・スクロール連動) ---- */
:root {
  --canvas: #ece3d4;          /* 初期キャンバス色（JSが上書き）*/
  --canvas-ink: #6b6052;      /* キャンバス上の文字 */
  --col-w: 440px;             /* モバイルカラムの最大幅（PC時）*/
}

/* 固定背景層（全面）。PCでは余白に見える */
.canvas-bg {
  position: fixed; inset: 0; z-index: 0;
  background: var(--canvas);
  transition: background-color 1.1s cubic-bezier(.45,0,.2,1);
}

/* スクロールコンテナ（プレビュー/実ブラウザ双方で確実に動く） */
html, body { height: 100%; margin: 0; }
.app {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app::-webkit-scrollbar { display: none; }
/* キャンバスの薄いテクスチャ＆大きなボタニカルの気配 */
.canvas-bg::after {
  content: ""; position: absolute; inset: 0; opacity: .05;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyMDAnIGhlaWdodD0nMjAwJz48ZmlsdGVyIGlkPSdnZic+PGZlVHVyYnVsZW5jZSB0eXBlPSdmcmFjdGFsTm9pc2UnIGJhc2VGcmVxdWVuY3k9JzAuOCcgbnVtT2N0YXZlcz0nMicgc3RpdGNoVGlsZXM9J3N0aXRjaCcvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnIGZpbHRlcj0ndXJsKCNnZiknLz48L3N2Zz4=");
  mix-blend-mode: multiply;
}

/* ---- モバイルカラム（全コンテンツの器）---- */
.phone {
  position: relative; z-index: 2;
  width: 100%;
  margin: 0 auto;
  background: var(--paper);
  overflow: clip;
}

/* ---- 固定サイドパネル（PCのみ。モバイルは非表示）---- */
.side { display: none; }

/* ===========================================================
   MOBILE（〜1023px）: カラム＝全幅。サイドは隠す。
   =========================================================== */

/* ===========================================================
   DESKTOP（≥1024px）: カラムを中央に浮かせ、左右の余白に演出
   =========================================================== */
@media (min-width: 1024px) {
  body { background: transparent; }

  .phone {
    max-width: var(--col-w);
    min-height: 100vh;
    box-shadow: 0 0 0 1px rgba(120,108,92,.06), 0 40px 90px rgba(74,58,42,.16);
  }

  .side { display: block; position: fixed; top: 0; bottom: 0; z-index: 5; color: var(--canvas-ink); }

  /* ----- 左：ロゴ＋ナビ ----- */
  .side-left {
    left: 0; width: calc((100vw - var(--col-w)) / 2);
    max-width: 340px; min-width: 230px;
    padding: 40px 38px;
    display: flex; flex-direction: column; justify-content: space-between;
  }
  .side-left .sl-brand { display: flex; align-items: center; gap: 12px; }
  .side-left .sl-brand .moon-mark { color: var(--olive); }
  .side-left .sl-brand .moon-mark svg { width: 40px; height: 40px; }
  .side-left .sl-brand .wm { font-family: var(--font-latin); font-weight: 600; font-size: 22px; letter-spacing: .07em; color: var(--olive); line-height: 1.05; }
  .side-left .sl-brand .wm sup { font-size: .45em; }
  .side-left .sl-brand .wm .jp { display: block; font-family: var(--font-gothic); font-size: 8.5px; letter-spacing: .26em; color: var(--canvas-ink); margin-top: 3px; opacity: .8; }

  /* nav */
  .snav { display: grid; gap: 2px; margin: 30px 0; }
  .snav a {
    position: relative; display: flex; align-items: center; gap: 14px;
    padding: 9px 0; text-decoration: none; color: var(--canvas-ink);
    font-family: var(--font-gothic); font-weight: 500; font-size: 13px; letter-spacing: .06em;
    opacity: .62; transition: opacity .3s ease, color .3s ease, transform .3s ease;
  }
  .snav a .idx { font-family: var(--font-latin); font-style: italic; font-size: 13px; opacity: .6; width: 22px; }
  .snav a .ln { position: relative; }
  .snav a .ln::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -3px; height: 1px; background: var(--olive); transition: right .35s cubic-bezier(.45,0,.2,1); }
  .snav a:hover { opacity: 1; color: var(--olive); }
  .snav a.active { opacity: 1; color: var(--olive); transform: translateX(4px); }
  .snav a.active .idx { opacity: 1; color: var(--pink-deep); }
  .snav a.active .ln::after { right: 0; }

  .side-left .sl-foot { font-size: 11px; letter-spacing: .04em; line-height: 1.9; }
  .side-left .sl-foot .lbl { text-transform: uppercase; letter-spacing: .3em; font-size: 9px; opacity: .6; display: block; margin-bottom: 6px; }
  .side-left .sl-foot a { color: var(--canvas-ink); text-decoration: none; border-bottom: 1px solid rgba(107,96,82,.25); }
  .side-left .sl-foot a:hover { color: var(--olive); }
  .sns { display: flex; gap: 14px; margin-top: 16px; }
  .sns a { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(107,96,82,.3); display: flex; align-items: center; justify-content: center; color: var(--canvas-ink); transition: background-color .3s, color .3s, border-color .3s; }
  .sns a svg { width: 14px; height: 14px; }
  .sns a:hover { background: var(--olive); color: #fff; border-color: var(--olive); }

  /* ----- 右：縦組みセクション名＋大きな番号 ----- */
  .side-right {
    right: 0; width: calc((100vw - var(--col-w)) / 2);
    max-width: 340px; min-width: 230px; overflow: hidden;
    padding: 40px 38px;
    display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between;
  }
  .side-right .sr-top { text-align: right; }
  .side-right .sr-label {
    writing-mode: vertical-rl; text-orientation: mixed;
    font-family: var(--font-gothic); font-weight: 500; font-size: 13px; letter-spacing: .42em;
    text-transform: uppercase; color: var(--canvas-ink); height: 220px;
    border-top: 1px solid rgba(107,96,82,.3); padding-top: 18px; opacity: .85;
    transition: opacity .4s ease;
  }
  .side-right .sr-num {
    font-family: var(--font-latin); font-weight: 600; font-style: italic; font-size: 96px;
    line-height: .8; color: var(--olive); opacity: .14; margin-bottom: -6px;
    transition: opacity .4s ease;
  }
  .side-right .sr-num .tot { font-size: 30px; opacity: .8; }
  .side-right .sr-scroll { writing-mode: vertical-rl; font-family: var(--font-latin); font-style: italic; font-size: 12px; letter-spacing: .2em; color: var(--canvas-ink); opacity: .6; display: flex; align-items: center; gap: 12px; }
  .side-right .sr-scroll::after { content: ""; width: 1px; height: 46px; background: currentColor; opacity: .5; }

  /* スクロール進捗（カラム左端の細いバー） */
  .scroll-prog { position: fixed; left: 0; top: 0; height: 2px; background: var(--pink); z-index: 50; width: 0; }
}

/* 超ワイド: カラム少しゆったり */
@media (min-width: 1500px) {
  :root { --col-w: 468px; }
  .side-left, .side-right { max-width: 400px; }
}

/* ===========================================================
   ANIMATIONS（控えめ）
   =========================================================== */
/* KV スライドショー */
.kv { position: absolute; inset: 0; z-index: 0; }
.kv .kv-slide {
  position: absolute; inset: 0; opacity: 0;
  background-size: cover; background-position: center;
  animation: kvfade 24s infinite; transform: scale(1.04);
}
.kv .kv-slide:nth-child(1) { animation-delay: 0s; }
.kv .kv-slide:nth-child(2) { animation-delay: 6s; }
.kv .kv-slide:nth-child(3) { animation-delay: 12s; }
.kv .kv-slide:nth-child(4) { animation-delay: 18s; }
@keyframes kvfade {
  0% { opacity: 0; transform: scale(1.04); }
  4% { opacity: 1; }
  21% { opacity: 1; transform: scale(1.10); }
  27% { opacity: 0; }
  100% { opacity: 0; }
}

/* 浮遊するボタニカル */
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(3deg); } }
.float { animation: floaty 7s ease-in-out infinite; }
.float.slow { animation-duration: 11s; }

/* reveal（v3 と同じ挙動。ここでも定義して独立化）*/
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .kv .kv-slide { animation: none; opacity: 1; }
  .kv .kv-slide:not(:first-child) { display: none; }
  .float { animation: none; }
}
