/* ==========================================================================
   Prhyzmica — official site
   design lineage: "blue" (2014) — pale watercolor, indigo #273059,
   thin rules, dashed separators, small type, vertical text, slashed logotype
   ========================================================================== */

:root {
  --font-en: "Space Grotesk", "Helvetica Neue", sans-serif;
  --font-jp: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-min: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --spectrum: linear-gradient(90deg, #6ec3f4, #7ad0d4, #b3e0a6, #f4dc8a, #f4a98a, #e98ab8, #a98af4);
  --max: 1080px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

:root[data-theme="day"] {
  --bg: #f3f5f7;
  --ink: #1f2747;
  --ink-soft: rgba(31, 39, 71, .76);
  --ink-faint: rgba(31, 39, 71, .50);
  --line: rgba(39, 48, 89, .30);
  --line-dash: rgba(39, 48, 89, .42);
  --panel: rgba(255, 255, 255, .72);
  --panel-solid: #fff;
  --accent: #273059;
  --accent-contrast: #fff;
  --shadow: 0 12px 40px rgba(39, 48, 89, .12);
}

:root[data-theme="night"] {
  --bg: #0a0e20;
  --ink: #edf0fa;
  --ink-soft: rgba(237, 240, 250, .74);
  --ink-faint: rgba(237, 240, 250, .46);
  --line: rgba(237, 240, 250, .26);
  --line-dash: rgba(237, 240, 250, .38);
  --panel: rgba(16, 21, 46, .66);
  --panel-solid: #131836;
  --accent: #aebbf0;
  --accent-contrast: #0a0e20;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  /* ネイティブのスクロールバーは出さない。
     現在位置は上端のスペクトル進捗ラインが担う */
  scrollbar-width: none;
}

::-webkit-scrollbar { display: none; } /* 旧Safari向け */

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-jp);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: .02em;
  transition: background-color .8s, color .8s;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-contrast); }

a { color: inherit; }

/* ===== generative background ===== */

#visual {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

/* ===== scroll progress (homage to blue's top line) ===== */

.progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  z-index: 100;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--spectrum);
}

/* ===== header ===== */

.site-head {
  position: fixed;
  top: 3px; left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  z-index: 90;
  pointer-events: none;
}

.site-head > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-en);
  font-size: 14px;
  letter-spacing: .14em;
}

/* diamond mark — jacket motif */
.brand-mark {
  width: 9px; height: 9px;
  border: 1.5px solid var(--accent);
  transform: rotate(45deg);
  transition: background .3s, transform .6s var(--ease);
}

.brand:hover .brand-mark {
  background: var(--accent);
  transform: rotate(225deg);
}

.site-nav {
  display: flex;
  align-items: center;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 4px;
}

.site-nav a {
  display: block;
  padding: 6px 14px;
  border-left: 1px dashed var(--line-dash); /* blue's nav separators */
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: .1em;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background .25s, color .25s;
}

.site-nav a:first-child { border-left: 0; }

.site-nav a:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

.theme-toggle {
  margin-left: 4px;
  padding: 5px 12px;
  border: 0;
  border-left: 1px dashed var(--line-dash);
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-en);
  font-size: 12px;
  cursor: pointer;
  transition: color .25s;
}

.theme-toggle:hover { color: var(--ink); }

.tt-sep { margin: 0 4px; opacity: .4; }

:root[data-theme="day"] .tt-day { color: var(--ink); }
:root[data-theme="day"] .tt-night { opacity: .35; }
:root[data-theme="night"] .tt-night { color: var(--ink); }
:root[data-theme="night"] .tt-day { opacity: .35; }

/* ===== BGM toggle ===== */

.sound-toggle {
  position: relative;
  width: 34px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .3s, border-color .3s;
}

.sound-toggle:hover { color: var(--ink); }

/* off = 淡く沈んだ音符 / on = アクセント色で揺れる音符 */
.st-icon {
  display: block;
  font-size: 20px;
  line-height: 1;
  opacity: .5;
  transition: opacity .3s;
}

.sound-toggle.is-on { color: var(--accent); border-color: var(--accent); }

.sound-toggle.is-on .st-icon { opacity: 1; }

/* 再生中は音符がゆっくり揺れる */
.sound-toggle.is-on .st-icon { animation: note-sway 2.4s ease-in-out infinite; }

@keyframes note-sway {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50% { transform: rotate(6deg) translateY(-1px); }
}

/* アクセス直後のきらめき: 音符がスペクトルの色を巡り、淡い光がまたたく */
.sound-toggle.glimmer .st-icon {
  opacity: 1;
  animation: glimmer-hue 3.6s linear infinite;
}

.sound-toggle.glimmer::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 2px;
  animation: glimmer-pulse 2.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glimmer-hue {
  0%, 100% { color: #4a9fe0; }
  18% { color: #3fb8a8; }
  36% { color: #b89a2f; }
  54% { color: #e0734a; }
  72% { color: #c84a8a; }
  88% { color: #7a5ae0; }
}

@keyframes glimmer-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(169, 138, 244, 0); }
  50% { box-shadow: 0 0 13px 1px rgba(169, 138, 244, .4); }
}

/* ===== hero ===== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 96px 8vw 120px;
}

.logotype {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 0 0 28px;
  font-family: var(--font-en);
  font-weight: 300;
  font-size: clamp(26px, 9vw, 110px);
  letter-spacing: .02em;
  line-height: 1.1;
  white-space: nowrap;
}

.logotype .lt {
  opacity: 0;
  transform: translateY(.4em);
  animation: lt-in 1s var(--ease) forwards;
}

/* slashes between letters — jacket's "b/l/u/e" typography */
.logotype .sl {
  width: 1px;
  height: .82em;
  margin: 0 .18em;
  background: var(--ink);
  opacity: 0;
  transform: rotate(24deg) scaleY(0);
  transform-origin: bottom;
  animation: sl-in .7s var(--ease) forwards;
  align-self: center;
}

@keyframes lt-in { to { opacity: 1; transform: none; } }
@keyframes sl-in { to { opacity: .55; transform: rotate(24deg) scaleY(1); } }

.hero-copy {
  margin: 0 0 10px;
  font-size: clamp(17px, 2.4vw, 22px);
  font-weight: 500;
  letter-spacing: .22em;
}

.hero-sub {
  margin: 0 0 32px;
  max-width: 34em;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.hero-genres {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink-faint);
}

.hero-genres span { position: relative; padding: 0 14px; }
.hero-genres span:first-child { padding-left: 0; }

.hero-genres span + span::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 1px; height: .9em;
  background: var(--line-dash);
  transform: translateY(-50%) rotate(24deg);
}

.hero-genres span:hover { color: var(--ink); transition: color .3s; }

/* vertical copy — blue's verticalBox lineage */
.hero-vertical {
  position: absolute;
  right: 7vw;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  writing-mode: vertical-rl;
  font-family: var(--font-min);
  font-size: clamp(15px, 1.8vw, 20px);
  letter-spacing: .5em;
  color: var(--ink-soft);
  border-right: 1px solid var(--line);
  padding-right: 18px;
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 8vw;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--ink-faint);
  text-decoration: none;
}

.cue-line {
  width: 56px;
  height: 1px;
  background: var(--ink-faint);
  transform-origin: left;
  animation: cue 2.4s var(--ease) infinite;
}

@keyframes cue {
  0% { transform: scaleX(0); }
  45% { transform: scaleX(1); transform-origin: left; }
  46% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* ===== sections ===== */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px 24px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 40px;
}

.sec-no {
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--ink-faint);
}

.sec-no::after {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-left: 14px;
  border: 1px solid var(--ink-faint);
  transform: rotate(45deg) translateY(-1px);
}

.sec-head h2 {
  margin: 0;
  font-family: var(--font-en);
  font-weight: 300;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: .06em;
}

.sec-jp {
  margin-left: 16px;
  font-family: var(--font-jp);
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--ink-soft);
}

/* translucent panel — blue's rgba(255,255,255,.8) verticalBox */
.panel {
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 36px 40px;
  transition: background-color .8s;
}

.panel p { margin: 0 0 1.2em; }
.panel p:last-child { margin-bottom: 0; }

.lead { font-size: 16.5px; }

.panel em { font-style: normal; border-bottom: 1px dashed var(--line-dash); }

.en {
  color: var(--ink-faint);
  font-family: var(--font-en);
  font-size: 12.5px;
  letter-spacing: .04em;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 28px 0 0;
  border-top: 1px dashed var(--line-dash);
  padding-top: 24px;
}

.stat {
  flex: 1 1 120px;
  border-left: 1px dashed var(--line-dash);
  padding: 0 22px;
}

.stat:first-child { border-left: 0; padding-left: 0; }

.stat dt {
  font-family: var(--font-en);
  font-size: 10.5px;
  letter-spacing: .22em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.stat dd {
  margin: 2px 0 0;
  font-family: var(--font-en);
  font-weight: 300;
  font-size: 34px;
}

/* ===== discography ===== */

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 28px 22px;
}

.album {
  display: block;
  text-decoration: none;
}

.album figure {
  position: relative;
  margin: 0 0 10px;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 2px 14px rgba(20, 26, 56, .14);
}

.album img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  transition: transform .7s var(--ease), filter .4s;
}

/* spectral dispersion on hover — prism behavior */
.album figure::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--spectrum);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease);
}

.album:hover figure::after,
.album:focus-visible figure::after { transform: scaleX(1); }

.album:hover img,
.album:focus-visible img {
  transform: scale(1.045);
  filter: drop-shadow(3px 0 0 rgba(255, 90, 140, .35)) drop-shadow(-3px 0 0 rgba(80, 190, 255, .35));
}

.album-title {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .04em;
}

.album-year {
  display: block;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--ink-faint);
}

.note {
  margin-top: 40px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.note a { text-decoration-color: var(--line-dash); text-underline-offset: 3px; }
.note a:hover { color: var(--accent); }

/* ===== works ===== */

.works-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px dashed var(--line-dash);
}

.work {
  display: grid;
  grid-template-columns: minmax(160px, 280px) 1fr auto;
  gap: 8px 28px;
  align-items: baseline;
  padding: 22px 4px;
  border-bottom: 1px dashed var(--line-dash);
  transition: background .3s, padding .3s;
}

.work:hover { background: var(--panel); padding-left: 14px; }

.work-client {
  font-size: 15.5px;
  font-weight: 500;
}

.work-client a {
  text-decoration: none;
  background-image: var(--spectrum);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size .45s var(--ease);
}

.work-client a:hover { background-size: 100% 1.5px; }

.work-desc {
  color: var(--ink-soft);
  font-size: 13px;
}

.work-tag {
  font-family: var(--font-en);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* ===== youtube ===== */

.yt-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
  gap: 28px;
  align-items: start;
}

.yt-facade {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #000;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.yt-facade img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .92;
  transition: opacity .3s, transform .8s var(--ease);
}

.yt-facade:hover img { opacity: 1; transform: scale(1.03); }

.yt-play {
  position: absolute;
  top: 50%; left: 50%;
  width: 64px; height: 64px;
  transform: translate(-50%, -50%) rotate(45deg); /* diamond play button */
  border: 1.5px solid #fff;
  background: rgba(10, 14, 32, .45);
  backdrop-filter: blur(4px);
  transition: background .3s, transform .5s var(--ease);
}

.yt-play::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  background: #fff;
  /* ボックスは菱形中心に固定し回転軸ずれを防ぐ。三角の光学センタリングは座標側で */
  clip-path: polygon(30% 12%, 86% 50%, 30% 88%);
  transform: translate(-50%, -50%) rotate(-45deg);
  transition: transform .5s var(--ease);
}

.yt-facade:hover .yt-play {
  background: rgba(10, 14, 32, .7);
  transform: translate(-50%, -50%) rotate(225deg);
}

.yt-facade:hover .yt-play::after { transform: translate(-50%, -50%) rotate(-225deg); }

.yt-label {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  padding: 24px 16px 12px;
  background: linear-gradient(transparent, rgba(5, 8, 20, .8));
  color: #fff;
  font-size: 12.5px;
  letter-spacing: .08em;
  text-align: left;
}

.yt-facade iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-text .small { font-size: 12.5px; color: var(--ink-soft); }
.yt-text a { text-decoration-color: var(--line-dash); text-underline-offset: 3px; }

/* ===== contact cards ===== */

.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .14em;
}

.card h3::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 12px;
  border: 1px solid var(--accent);
  transform: rotate(45deg) translateY(-2px);
}

.card p { font-size: 13px; color: var(--ink-soft); }

.btn {
  display: inline-block;
  margin-top: 6px;
  padding: 9px 22px;
  border: 1px solid var(--accent);
  border-radius: 1px;
  font-size: 12.5px;
  letter-spacing: .12em;
  text-decoration: none;
  color: var(--ink);
  transition: background .3s, color .3s;
}

.btn:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* ===== footer ===== */

.site-foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px 56px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}

.foot-links a {
  position: relative;
  padding: 2px 16px;
  font-family: var(--font-en);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color .25s;
}

.foot-links a:hover { color: var(--ink); }

.foot-links a + a::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 1px; height: .9em;
  background: var(--line-dash);
  transform: translateY(-50%) rotate(24deg);
}

.piano-hint {
  margin: 0 0 8px;
  font-size: 11.5px;
  color: var(--ink-faint);
}

#noteName {
  display: inline-block;
  min-width: 3em;
  margin-left: 8px;
  font-family: var(--font-en);
  color: var(--accent);
  transition: opacity .6s;
}

.copyright {
  margin: 0;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--ink-faint);
}

/* ===== reveal on scroll ===== */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* stagger inside grids */
.album-grid .reveal:nth-child(3n+2) { transition-delay: .08s; }
.album-grid .reveal:nth-child(3n+3) { transition-delay: .16s; }

/* ===== responsive ===== */

@media (max-width: 860px) {
  .hero-vertical { display: none; }

  .site-head { padding: 10px 12px; }
  .brand-name { display: none; }

  .site-nav { overflow-x: auto; max-width: calc(100vw - 104px); }
  .site-nav a { padding: 6px 10px; font-size: 11px; }

  .hero { padding: 80px 6vw 110px; }
  .scroll-cue { left: 6vw; }

  .section { padding: 64px 18px; }
  .panel { padding: 26px 22px; }

  .yt-wrap { grid-template-columns: 1fr; }

  .work { grid-template-columns: 1fr; gap: 4px; }
  .work-tag { justify-self: start; }

  .album-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 20px 14px; }
}

/* ===== reduced motion ===== */

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

  .logotype .lt, .logotype .sl {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .logotype .sl { transform: rotate(24deg); opacity: .55; }

  .cue-line { animation: none; transform: none; }

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

  .album img, .yt-facade img, .yt-play, .brand-mark { transition: none; }

  .sound-toggle.is-on .st-icon { animation: none; }
}
