/* 欧文の Jost（latin、太さ 300〜400 の可変）は自サイトから配る。和文の Zen Kaku Gothic New は Google Fonts */
@font-face {
    font-family: "Jost";
    font-weight: 300 400;
    font-display: swap;
    src: url("../assets/fonts/jost-latin.woff2") format("woff2");
}

:root {
    --black: #050506;
    --ink: #e8e6e3;
    --muted: #a3a1a8;
    /* 黒真珠の虚彩色。見出しのグラデーションとリンクの下線に使う */
    --nacre: linear-gradient(100deg, #f4f1ec 0%, #b9c7d6 22%, #d8c4dd 40%, #f4f1ec 55%, #c3d6cc 72%, #e6d9c4 88%, #f4f1ec 100%);
    /* 欧文は Jost Light（見出し・曲名・リンク）、和文は Zen Kaku Gothic New（本文） */
    --en: "Jost", "Zen Kaku Gothic New", sans-serif;
    --sans: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
    --gutter: clamp(16px, 4vw, 56px);
    /* レイアウトのグリッド: 左右の --gutter の内側を 12 列に割り、列の間は 16px */
    --gap: 16px;
}

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

html {
    background: var(--black);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    /* 2 画面構成。縦スクロールは 1 画面ずつ止める */
    scroll-snap-type: y mandatory;
}

body {
    margin: 0;
}

a {
    color: inherit;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 写真は画面に固定する。lvh はアドレスバーが縮んだときに下が空かないように */
.photo {
    position: fixed;
    z-index: -2;
    top: 0;
    left: 0;
    width: 100%;
    height: 100lvh;
    object-fit: cover;
    object-position: 45% 40%;
    filter: contrast(1.08) brightness(0.85);
}

/* 縦長の画面では、歌う Vela と奥の SOZEN OTSUBO の間（写真の横 65% あたり）を中央に寄せる */
@media (orientation: portrait) {
    .photo {
        object-position: 68% 40%;
    }
}

/* 写真に当たる真珠の光とゆらぎ。マウスの位置（--px, --py）は js/pearl.js が <html> に入れ、光（.sheen）とゆらぎ（.lens）が受け継ぐ。
   どちらも写真のすぐ上、文字の下敷き（body::before）の下に置き、<html> に .pearl-on が付いている間だけ出す */
@property --px {
    syntax: "<length>";
    inherits: true;
    initial-value: 50vw;
}

@property --py {
    syntax: "<length>";
    inherits: true;
    initial-value: 50vh;
}

:root {
    /* 光とゆらぎは少し遅れてマウスを追う */
    transition: --px 0.35s ease-out, --py 0.35s ease-out;
}

/* ゆらぎ: 写真をもう 1 枚重ね、SVG のフィルタ（index.html の #warp）でゆがめてぼかし、マウスの周りの円だけを見せる */
.photo.lens {
    filter: url(#warp) contrast(1.08) brightness(0.9);
    -webkit-mask-image: radial-gradient(circle 22vmax at var(--px) var(--py), #000 0 30%, transparent 70%);
    mask-image: radial-gradient(circle 22vmax at var(--px) var(--py), #000 0 30%, transparent 70%);
    opacity: 0;
    transition: opacity 0.8s ease;
}

/* 光: 白い芯とピンク・ミント・青がにじむ光をスクリーンで重ね、写真の明るいところを真珠層のように色づける */
.sheen {
    position: fixed;
    z-index: -2;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle 34vmax at var(--px) var(--py),
        rgb(255 250 245 / 0.22) 0,
        rgb(255 170 214 / 0.3) 16%,
        rgb(255 220 170 / 0.18) 28%,
        rgb(150 240 205 / 0.26) 40%,
        rgb(160 175 255 / 0.24) 54%,
        rgb(215 160 255 / 0.12) 64%,
        transparent 76%);
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.pearl-on .lens,
.pearl-on .sheen {
    opacity: 1;
}

/* 上端と下側を暗くして、写真の上でも文字を読めるようにする */
body::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(5, 5, 6, 0.55) 0, rgba(5, 5, 6, 0) 18%),
        linear-gradient(180deg, rgba(5, 5, 6, 0) 35%, rgba(5, 5, 6, 0.75) 70%, rgba(5, 5, 6, 0.92) 100%);
    pointer-events: none;
}

.links {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px var(--gutter);
}

.links ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem 1.75rem;
}

.links a {
    font-family: var(--en);
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-decoration: none;
    background: var(--nacre) left bottom / 0 1px no-repeat;
    transition: background-size 0.3s;
}

.links a:hover,
.links a:focus-visible {
    background-size: 100% 1px;
}

/* 1 画面目は写真の左下にタイトルと紹介だけ、2 画面目は左下にジャケットだけを置く */
.intro,
.releases {
    min-height: 100svh;
    padding: 72px var(--gutter) clamp(24px, 6svh, 56px);
    scroll-snap-align: start;
    /* 中身の幅を 12 列で割るため、100cqw を「余白の内側の幅」として使う */
    container-type: inline-size;
    --col: calc((100cqw - 11 * var(--gap)) / 12);
}

.intro {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

h1 {
    /* Jost の B（太さ 400）は字の左に 0.08em の余白があるので、その分だけ左へ出して字の形を余白の線にそろえる */
    margin: 0 0 0 -0.08em;
    font-family: var(--en);
    font-weight: 400;
}

/* 真珠の照りの強さ。0 → 1 をなめらかに変えるため、数値として登録する */
@property --shine {
    syntax: "<number>";
    inherits: false;
    initial-value: 0;
}

.pearl {
    /* 横幅と高さの小さい方に合わせ、低い画面でもワン画面に収める */
    font-size: clamp(2.4rem, min(10vw, 14svh), 8.5rem);
    line-height: 0.95;
    letter-spacing: 0.08em;
    /* ホバーの照りが文字の上だけで出るように、箱を文字の幅に縮める */
    width: fit-content;
    --mx: 50%;
    --my: 50%;
    /* 上の層: マウスの位置（--mx, --my、js/pearl.js が入れる）に出る白い照りと、その周りの真珠層の虹色（ピンク・ミント・青）。
       中の層: 照りが目立つよう、ホバー中だけ文字全体を少し沈める。下の層: 流れる真珠層の色 */
    background:
        radial-gradient(circle 1.6em at var(--mx) var(--my),
            rgb(255 255 255 / calc(0.98 * var(--shine))) 0,
            rgb(255 250 244 / calc(0.9 * var(--shine))) 10%,
            rgb(255 205 232 / calc(0.75 * var(--shine))) 24%,
            rgb(206 240 226 / calc(0.6 * var(--shine))) 40%,
            rgb(196 212 255 / calc(0.5 * var(--shine))) 58%,
            transparent 80%),
        linear-gradient(rgb(5 5 6 / calc(0.4 * var(--shine))) 0 0),
        var(--nacre);
    background-size: 100% 100%, 100% 100%, 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 calc(0.18em * var(--shine)) rgb(216 196 221 / calc(0.35 * var(--shine))));
    animation: nacre 14s linear infinite;
    transition: --shine 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (hover: hover) {
    .pearl:hover {
        --shine: 1;
    }
}

@keyframes nacre {
    to {
        background-position: 0 0, 0 0, 300% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pearl {
        animation: none;
    }
}

/* 紹介文は 5 列分の幅（縦長の画面では 12 列分） */
.about {
    max-width: calc(5 * var(--col) + 4 * var(--gap));
    margin: clamp(12px, 2.5vh, 24px) 0 0;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

/* ジャケットは、高さの上限（--jacket-max）を超えない範囲で列の境目にぴったり収まるいちばん大きな幅。最大 --jacket-cols 列 */
.releases {
    --jacket-cols: 4;
    --jacket-max: 58svh;
    --jacket: calc(min(round(down, var(--jacket-max) + var(--gap), var(--col) + var(--gap)), var(--jacket-cols) * (var(--col) + var(--gap))) - var(--gap));
    display: grid;
    align-content: end;
    justify-content: start;
    background: rgba(5, 5, 6, 0.6);
}

.slides,
.pager {
    width: var(--jacket);
}

/* 横スクロールのスナップで 1 曲ずつ止める。スクロールバーは隠し、送りは下のボタンかスワイプで */
.slides {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.slides::-webkit-scrollbar {
    display: none;
}

.slides li {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

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

.releases a {
    display: block;
    text-decoration: none;
}

.releases img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    background: #111;
}

.releases .title,
.releases .meta {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-family: var(--en);
    letter-spacing: 0.06em;
    /* 送りの途中は js/releases.js が --caption を下げて曲名を消す */
    opacity: var(--caption, 1);
}

.releases .title {
    margin-top: 0.6rem;
    font-size: 1rem;
    line-height: 1.3;
}

.releases .meta {
    font-size: 0.7rem;
    color: var(--muted);
}

/* 曲名と同じ段の右側に「‹ 1 / 5 ›」を重ねる */
.pager {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: -2.3rem;
    font-family: var(--en);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.pager[hidden] {
    display: none;
}

/* ボタンが出ているときは、曲名がボタンの下に潜らないよう右を空ける */
.releases:has(.pager:not([hidden])) :is(.title, .meta) {
    padding-right: 6.5rem;
}

.pager button {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid rgba(232, 230, 227, 0.3);
    border-radius: 50%;
    background: rgba(5, 5, 6, 0.4);
    color: var(--ink);
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.2s;
}

.pager button:hover:not(:disabled),
.pager button:focus-visible {
    border-color: var(--ink);
}

.pager button:disabled {
    opacity: 0.3;
    cursor: default;
}

@media (orientation: portrait) {
    .releases {
        --jacket-cols: 12;
        --jacket-max: 52svh;
    }

    .about {
        max-width: none;
    }
}

/* 著作権表記。文言と文字の大きさ・字間は sozenium.com のフッターにそろえる。2 画面目の下の余白に、ジャケットと同じ左の線で置く */
body {
    position: relative;
}

.footer {
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: 12px;
}

.footer p {
    margin: 0;
    font-family: var(--en);
    font-size: 0.625rem;
    line-height: 1.6;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.notfound {
    min-height: 100svh;
    display: grid;
    grid-template-columns: auto;
    align-content: center;
    justify-content: center;
    justify-items: center;
    gap: 1rem;
    text-align: center;
}
