/* Miay.P — "Midnight Neon"  ／ 深夜のネオン
   design contract: docs/design-contracts/2026-06-20-miay-p-site.md
   匿名性(rules/70): 本サイト固有のトークン・命名。他サイトと配色/構造/命名を揃えない。 */

:root {
  /* palette — charcoal base + magenta/violet neon + amber micro-glow */
  --ink:        #0c0a12;
  --ink-2:      #120e1c;
  --ink-3:      #1a1426;
  --veil:       #241a35;
  --line:       #2e2440;
  --haze:       #9a8fb5;
  --mist:       #c9c0dd;
  --text:       #ece8f6;
  --magenta:    #d6409f;
  --magenta-lo: #a83c86;
  --violet:     #8b5cf6;
  --cyan-edge:  #6ad7e6;   /* sparing cool edge, not dominant */
  --amber:      #f5b352;
  --glow-m:     rgba(214, 64, 159, 0.55);
  --glow-v:     rgba(139, 92, 246, 0.45);
  /* 白文字を AA(>=4.5:1) 確保する暗めボタングラデ(magenta/violet を暗くした版) */
  --btn-grad:   linear-gradient(120deg, #b3347e, #6f3fc0);

  --maxw: 1140px;
  --gap: clamp(1rem, 2.5vw, 1.75rem);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px -22px rgba(0,0,0,0.85);

  --font-jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font-disp: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-jp);
  color: var(--text);
  background: var(--ink);
  line-height: 1.85;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* ambient neon field */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(58vw 48vw at 18% -8%, var(--glow-m), transparent 60%),
    radial-gradient(52vw 44vw at 92% 4%, var(--glow-v), transparent 62%),
    radial-gradient(40vw 40vw at 60% 108%, rgba(106,215,230,0.18), transparent 60%),
    var(--ink);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120vw 120vh at 50% 30%, #000 30%, transparent 90%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* 日本語の改行最適化(漸進的強化・非対応ブラウザは無害フォールバック)
   行末の孤立1〜2文字や熟語/カタカナ語の語中分割を抑制する */
:lang(ja) { line-break: strict; word-break: auto-phrase; }
.bio, .song-story, .hero-lead, .interlude-sub, .lyric-note, .latest-body .sub, .track-title, .platform {
  text-wrap: pretty;
}
.section-title, .hero h1, .latest-body h3, .song-head h1, .interlude-quote {
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; }
/* sticky header(約69px)がアンカー遷移時に見出しを隠さないように */
#songs, #about, #listen { scroll-margin-top: 84px; }
.eyebrow {
  font-size: 0.72rem; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--magenta); font-weight: 700; margin: 0 0 0.7rem;
}
.section-title {
  font-size: clamp(1.45rem, 3.6vw, 2.1rem);
  font-weight: 800; letter-spacing: 0.04em; margin: 0 0 1.4rem;
  font-family: var(--font-disp);
}
.section-title span { color: var(--magenta); }

/* ───────── header ───────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem clamp(1rem, 3vw, 2rem);
  background: color-mix(in oklab, var(--ink) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: 0.14em; font-size: 1.06rem; }
.brand b { color: var(--magenta); }
.topnav { display: flex; gap: clamp(0.7rem, 2vw, 1.6rem); align-items: center; }
.topnav a { font-size: 0.9rem; color: var(--mist); padding: 0.3rem 0; position: relative; }
.topnav a:hover { color: var(--text); }
.topnav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--magenta), var(--violet)); transition: width .25s ease;
}
.topnav a:hover::after { width: 100%; }
.topnav .pill {
  background: var(--btn-grad);
  color: #fff; padding: 0.45rem 1rem; border-radius: 999px; font-weight: 700;
}
.topnav .pill::after { display: none; }
.langsw { display: inline-flex; align-items: center; gap: 0.1rem; margin-left: 0.2rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem; }
.langsw a, .langsw .lang-cur { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; padding: 0.22rem 0.55rem; border-radius: 999px; line-height: 1; }
.langsw a { color: var(--haze); }
.langsw a::after { display: none; }
.langsw a:hover { color: var(--text); }
.langsw .lang-cur { background: var(--btn-grad); color: #fff; }
.lyric-note { position: relative; color: var(--haze); font-size: 0.85rem; margin: -0.4rem 0 1.3rem; }

/* bilingual lyrics (JA | translation) */
.lyric-bi { position: relative; display: flex; flex-direction: column; gap: 0.15rem; }
.lyric-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 3vw, 2.4rem);
  align-items: baseline; padding: 0.18rem 0;
  min-width: 0; max-width: 100%;
}
.lyric-row .lr-ja, .lyric-row .lr-tr { margin: 0; font-size: 1.02rem; line-height: 1.95; min-width: 0; overflow-wrap: anywhere; line-break: auto; }
/* 日本語左列は文字単位折返し(禁則の長い分割不可セグメントでのはみ出し/クリップ防止)。英訳列は空白折返し。 */
.lyric-row .lr-ja { word-break: break-all; }
.lyric-row .lr-tr { word-break: normal; }
.lr-ja { color: var(--text); }
.lr-tr { color: var(--mist); }
.lr-romaji { color: var(--haze); font-style: italic; letter-spacing: 0.02em; }
.lyric-gap { height: 1rem; padding: 0; }
@media (max-width: 640px) {
  /* モバイルは grid をやめ block 化(各セルを行幅に確実に収め折返させる) */
  .lyric-row { display: block; padding: 0.12rem 0; }
  .lyric-row .lr-ja, .lyric-row .lr-tr { max-width: 100%; }
  .lyric-row .lr-ja { font-size: 0.96rem; line-height: 1.85; }
  .lyric-row .lr-tr { font-size: 0.9rem; line-height: 1.7; padding-left: 0.6rem; border-left: 2px solid var(--line); margin-top: 0.05rem; }
  .lyric-gap { height: 0.85rem; }
}

/* ───────── hero ───────── */
.hero {
  position: relative;
  padding: clamp(4.5rem, 13vw, 9rem) 0 clamp(3.5rem, 9vw, 6rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, var(--ink) 14%, rgba(12,10,18,0.55) 52%, rgba(12,10,18,0.32) 100%),
    linear-gradient(0deg, var(--ink) 2%, transparent 30%),
    url("/media/art/hero.jpg") center right / cover no-repeat;
}
.hero-inner { max-width: 760px; position: relative; }
.hero h1 {
  font-family: var(--font-disp);
  font-size: clamp(3rem, 13vw, 6.5rem);
  line-height: 0.96; margin: 0.4rem 0 1.1rem; font-weight: 900; letter-spacing: 0.02em;
  background: linear-gradient(96deg, #fff 8%, var(--magenta) 52%, var(--violet) 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 38px rgba(214,64,159,0.18);
}
.hero-lead {
  font-size: clamp(1rem, 2.4vw, 1.22rem); color: var(--mist);
  max-width: 38ch; margin: 0 0 2rem;
  text-shadow: 0 1px 14px rgba(0,0,0,0.65);
}
.hero .eyebrow { text-shadow: 0 1px 10px rgba(0,0,0,0.6); }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem; border-radius: 999px; font-weight: 700; font-size: 0.98rem;
  border: 1px solid transparent; transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
}
.btn-primary {
  background: var(--btn-grad); color: #fff;
  box-shadow: 0 12px 34px -12px var(--glow-m);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -14px var(--glow-m); }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { border-color: var(--magenta); transform: translateY(-2px); }

/* ───────── latest release ───────── */
.section { padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
.latest-card {
  display: grid; grid-template-columns: minmax(0, 280px) 1fr; gap: clamp(1.2rem, 4vw, 2.6rem);
  align-items: center;
  background: linear-gradient(150deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 2rem);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.latest-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(40% 80% at 100% 0%, var(--glow-v), transparent 70%);
}
.latest-cover { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.latest-cover img { width: 100%; height: 100%; object-fit: cover; }
.latest-body { position: relative; }
.badge {
  display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.2em;
  color: var(--ink); background: var(--amber); padding: 0.25rem 0.7rem; border-radius: 999px; margin-bottom: 0.8rem;
}
.latest-body h3 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0.2rem 0 0.4rem; font-weight: 800; }
.latest-body .sub { color: var(--haze); margin: 0 0 1.3rem; font-size: 0.95rem; }

/* ───────── song grid ───────── */
.grid-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.grid-head .count { color: var(--haze); font-size: 0.9rem; }
.track-grid {
  display: grid; gap: clamp(0.9rem, 2.2vw, 1.5rem);
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.track {
  display: block; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden; position: relative;
  transition: transform .22s ease, border-color .22s ease, box-shadow .25s ease;
}
.track:hover { transform: translateY(-4px); border-color: color-mix(in oklab, var(--magenta) 60%, var(--line)); box-shadow: 0 18px 40px -20px var(--glow-m); }
.track-cover { aspect-ratio: 1; position: relative; background: var(--veil); }
.track-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-cover::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease;
  background: linear-gradient(0deg, rgba(214,64,159,0.28), transparent 55%);
}
.track:hover .track-cover::after { opacity: 1; }
.track-meta { padding: 0.7rem 0.85rem 0.95rem; }
.track-title { font-weight: 700; font-size: 0.98rem; line-height: 1.4; }
.track-year { color: var(--haze); font-size: 0.78rem; margin-top: 0.2rem; }

/* ───────── about ───────── */
.about-grid { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: clamp(1.4rem, 4vw, 2.8rem); align-items: center; }
.about-figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; }
.about-figure::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px -20px var(--glow-v); }
.about-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-text { min-width: 0; }
.bio { color: var(--mist); font-size: 1.02rem; max-width: 60ch; }
.facts { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.fact { border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 1rem; font-size: 0.85rem; color: var(--mist); background: rgba(255,255,255,0.02); }
.fact b { color: var(--magenta); font-weight: 700; }

/* ───────── listen platforms ───────── */
.platforms { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.platform {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--ink-2); font-weight: 700; transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.platform:hover { border-color: var(--violet); transform: translateY(-2px); background: var(--ink-3); }
.platform .arrow { color: var(--haze); }

/* ───────── interlude band (dawn) ───────── */
.interlude {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(4rem, 12vw, 8rem) 1.4rem;
  display: grid; place-items: center; text-align: center;
}
.interlude::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--ink), transparent 30%, transparent 70%, var(--ink)),
              linear-gradient(0deg, rgba(12,10,18,0.55), rgba(12,10,18,0.55)),
              url("/media/art/dawn.jpg") center / cover no-repeat;
}
.interlude-inner { max-width: 32ch; }
.interlude-quote {
  font-family: var(--font-disp); font-weight: 800;
  font-size: clamp(1.4rem, 4.4vw, 2.4rem); line-height: 1.7; margin: 0 0 0.8rem;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 24px rgba(0,0,0,0.7);
}
.interlude-sub { color: var(--mist); font-size: clamp(0.92rem, 2.4vw, 1.05rem); margin: 0; text-shadow: 0 2px 18px rgba(0,0,0,0.8); }

/* ───────── section ambient backgrounds (subtle) ───────── */
#songs, #listen { position: relative; isolation: isolate; }
#songs::before, #listen::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-size: cover; background-position: center;
  opacity: 0.22;
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
#songs::before { background-image: url("/media/art/songs-bg.jpg"); opacity: 0.16; }
#listen::before { background-image: url("/media/art/listen-bg.jpg"); }

/* ───────── song detail page ───────── */
.song-hero { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: clamp(1.4rem, 4vw, 3rem); align-items: start; padding-top: clamp(1.5rem, 5vw, 3rem); }
.song-cover { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); position: sticky; top: 84px; }
.song-cover img { width: 100%; height: 100%; object-fit: cover; }
.song-head h1 { font-size: clamp(1.9rem, 5vw, 3rem); margin: 0.4rem 0 0.3rem; font-weight: 800; }
.song-head .romaji { color: var(--haze); font-size: 1rem; letter-spacing: 0.04em; margin: 0 0 1rem; }
.song-story { color: var(--mist); border-left: 2px solid var(--magenta); padding-left: 1.1rem; margin: 1.4rem 0; max-width: 60ch; }
.lyric-sheet {
  background: linear-gradient(160deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.3rem, 4vw, 2.4rem);
  margin-top: 1.6rem; position: relative; overflow: hidden;
}
.lyric-sheet::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 50% at 0% 0%, var(--glow-m), transparent 70%); opacity: .5; }
.lyric-body { position: relative; white-space: pre-wrap; font-size: 1.05rem; line-height: 2.2; color: var(--text); }
.song-listen { margin-top: 1.8rem; }
.backlink { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--haze); font-size: 0.9rem; margin-top: 0.4rem; }
.backlink:hover { color: var(--magenta); }

/* ───────── embedded players (song page) ───────── */
.player { margin-top: 2rem; }
.player .section-title { margin-bottom: 1rem; }
.player-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.ptab {
  appearance: none; cursor: pointer; font: inherit;
  background: var(--ink-2); color: var(--mist); border: 1px solid var(--line);
  padding: 0.55rem 1.1rem; border-radius: 999px; font-size: 0.9rem; font-weight: 700;
  min-height: 40px; transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.ptab:hover { border-color: var(--violet); color: var(--text); }
.ptab.is-active { background: var(--btn-grad); color: #fff; border-color: transparent; }
.player-panels { position: relative; }
.ppanel[hidden] { display: none; }
.ppanel iframe { width: 100%; border: 0; border-radius: var(--radius-sm); display: block; background: var(--ink-2); }
.embed-sp { height: 152px; }
.embed-ap { height: 175px; }
/* YouTube は 16:9 レスポンシブ枠(フレーム幅ズレ防止) */
.yt-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius-sm); }
@media (max-width: 480px) {
  .ptab { flex: 1 1 auto; text-align: center; padding: 0.55rem 0.6rem; }
}

/* ───────── footer ───────── */
.foot { border-top: 1px solid var(--line); margin-top: 3rem; padding: 2.4rem 0 3rem; color: var(--haze); }
.foot-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.foot .brand-sm { font-weight: 800; letter-spacing: 0.14em; color: var(--mist); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.foot-links a { font-size: 0.85rem; color: var(--haze); }
.foot-links a:hover { color: var(--magenta); }
.foot small { display: block; margin-top: 0.9rem; font-size: 0.78rem; color: #8b82a8; }

/* ───────── responsive ───────── */
@media (max-width: 720px) {
  .latest-card { grid-template-columns: 1fr; }
  .latest-cover { max-width: 240px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-figure { max-width: 320px; }
  /* タップ領域 >=44px 確保 */
  .topnav .pill { padding: 0.6rem 1.1rem; min-height: 44px; display: inline-flex; align-items: center; }
  .langsw { padding: 0.25rem; }
  .langsw a, .langsw .lang-cur { padding: 0.5rem 0.7rem; min-height: 40px; display: inline-flex; align-items: center; }
  .backlink { padding: 0.6rem 0.2rem; min-height: 44px; }
  .song-hero { grid-template-columns: 1fr; }
  .song-cover { position: static; max-width: 300px; }
  .topnav > a:not(.pill) { display: none; }
  .topnav { gap: 0.6rem; }
}
