/* laboratory-top.css — SAZANAMI MUSIC LAB · TOP · 研究所 */

:root {
  --ink: #1a1a1a;
  --paper: #ffffff;
  --warm: #f6f1e6;
  --accent: #1E90FF;
  --muted: rgba(26, 26, 26, .55);
  --hairline: rgba(20, 20, 20, .12);
}

body.sml-calm {
  --ink: #1a1a1a;
  --paper: #ffffff;
  --warm: #f6f1e6;
  --accent: #15b0c7;
  --muted: rgba(26, 26, 26, .55);
  --hairline: rgba(20, 20, 20, .12);
}

body.sml-vivid {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --warm: #f3ecdc;
  --accent: #0047E0;
  --muted: rgba(10, 10, 10, .55);
  --hairline: rgba(10, 10, 10, .14);
}

body.sml-mono {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --warm: #f0ede5;
  --accent: #2a2a2a;
  --muted: rgba(10, 10, 10, .5);
  --hairline: rgba(10, 10, 10, .16);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #f0eee9;
}

body {
  font-family: "Noto Serif JP", serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

/* hover transitions on buttons */
button {
  transition: opacity .2s ease, transform .15s ease;
}

button:hover {
  opacity: 0.88;
}

/* drift wave keyframe */
@keyframes sml-drift {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes sml-progress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* ── closing CTA — dramatic dark panel ──────────────────── */
@keyframes sml-cta-glow {
  0%,
  100% {
    opacity: .45;
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    opacity: .82;
    transform: translate(-50%, -50%) scale(1.12);
  }
}

.sml-cta-close .sml-cta-actions button {
  transition: transform .28s cubic-bezier(.2, .7, .3, 1),
    box-shadow .3s ease, opacity .25s ease;
}

.sml-cta-close .sml-cta-actions button:hover {
  transform: translateY(-3px);
  opacity: 1;
}

.sml-cta-close .sml-cta-actions button:first-child:hover {
  box-shadow: 0 20px 52px -18px var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .sml-cta-glow-layer {
    animation: none !important;
  }
}

/* ── hero — cinematic full-bleed seascape ───────────────── */
@keyframes sml-hero-rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sml-hero-zoom {
  from {
    transform: scale(1.06);
  }

  to {
    transform: scale(1.16);
  }
}

@keyframes sml-hero-cue {
  0% {
    transform: scaleY(0);
    transform-origin: top;
    opacity: 0;
  }

  40% {
    opacity: 1;
  }

  100% {
    transform: scaleY(1);
    transform-origin: top;
    opacity: 0;
  }
}

.sml-hero-rise {
  animation: sml-hero-rise .95s cubic-bezier(.2, .7, .3, 1) both;
}

.sml-hero-zoom {
  animation: sml-hero-zoom 30s ease-in-out infinite alternate;
  transform-origin: center;
  will-change: transform;
}

.sml-hero-cue {
  animation: sml-hero-cue 2.2s ease-in-out infinite;
}

/* hero CTA — hover micro-interactions */
.sml-hero-cta button {
  position: relative;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2, .7, .3, 1),
    box-shadow .35s ease, opacity .25s ease,
    background .25s ease, border-color .25s ease, color .25s ease;
}

/* the sweeping shine streak */
.sml-hero-cta button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 85%;
  height: 100%;
  background: linear-gradient(105deg,
      transparent 0%, rgba(255, 255, 255, .15) 35%,
      rgba(255, 255, 255, .85) 50%,
      rgba(255, 255, 255, .15) 65%, transparent 100%);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 2;
}

.sml-hero-cta button span {
  position: relative;
  z-index: 1;
  display: inline-block;
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.sml-hero-cta button:hover {
  transform: translateY(-4px) scale(1.035);
  opacity: 1;
}

.sml-hero-cta button:hover::before {
  animation: sml-shine .85s cubic-bezier(.25, .6, .35, 1);
}

.sml-hero-cta button:hover span:last-child {
  transform: translateX(5px);
}

/* primary (accent-filled) — lift + strong glow */
.sml-hero-cta button:first-child:hover {
  box-shadow: 0 18px 46px -12px var(--accent),
    0 0 22px -4px var(--accent);
}

/* ghost (outlined) — fills toward accent */
.sml-hero-cta button:last-child:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(21, 176, 199, .1);
  box-shadow: 0 12px 34px -16px var(--accent);
}

@keyframes sml-shine {
  from {
    left: -130%;
  }

  to {
    left: 130%;
  }
}

/* library panel — same micro-interactions as the hero CTAs
   (lift + shine sweep + arrow slide) */
.sml-lib-panel {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -18px rgba(30, 144, 255, .5);
  transition: transform .3s cubic-bezier(.2, .7, .3, 1),
    box-shadow .35s ease, border-color .25s ease, background .25s ease;
}

.sml-lib-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 85%;
  height: 100%;
  background: linear-gradient(105deg,
      transparent 0%, rgba(255, 255, 255, .15) 35%,
      rgba(255, 255, 255, .85) 50%,
      rgba(255, 255, 255, .15) 65%, transparent 100%);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 2;
}

.sml-lib-panel>span {
  position: relative;
  z-index: 1;
}

.sml-lib-panel>span:last-child {
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.sml-lib-panel:hover {
  transform: translateY(-3px);
  border-color: var(--accent) !important;
  background: rgba(30, 144, 255, .1) !important;
  box-shadow: 0 18px 40px -16px var(--accent);
}

.sml-lib-panel:hover::before {
  animation: sml-shine .85s cubic-bezier(.25, .6, .35, 1);
}

.sml-lib-panel:hover>span:last-child {
  transform: translateX(5px);
}

@media (prefers-reduced-motion: reduce) {

  .sml-hero-rise,
  .sml-hero-zoom,
  .sml-hero-cue {
    animation: none !important;
  }

  .sml-hero-rise {
    opacity: 1;
  }

  .sml-hero-cta button:hover {
    transform: none;
  }

  .sml-hero-cta button:hover span:last-child {
    transform: none;
  }

  .sml-hero-cta button:hover::before {
    animation: none !important;
  }

  .sml-lib-panel:hover {
    transform: none;
  }

  .sml-lib-panel:hover>span:last-child {
    transform: none;
  }

  .sml-lib-panel:hover::before {
    animation: none !important;
  }
}

#root {
  width: 100%;
  min-height: 100vh;
}

body.sml-site {
  background: var(--paper);
  overflow-x: hidden;
  /* 日本語を文節単位で折り返す（対応ブラウザ）。語の途中で
     不自然に改行されるのを防ぐ。未対応環境は従来動作にフォールバック。 */
  word-break: auto-phrase;
  /* 端の泣き別れ（孤立した1文字など）を減らす */
  text-wrap: pretty;
}

/* 絶対に内部で改行させたくない語句を包む（例: 「瀬戸内の音楽研究所」）。
   幅が足りなければ語句ごと次行へ送られ、途中では割れない。 */
.sml-phrase {
  display: inline-block;
}

/* レイアウト用の強制改行。狭い幅では無効化して自然な折り返しに任せる。 */
@media (max-width: 600px) {
  br.sml-br-wide {
    display: none;
  }
}

.sml-site [id] {
  scroll-margin-top: 88px;
}

/* ナビ・フッターのページ内リンクをなめらかに */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
