/* 系 / 観測記録 v2 — quiet paper room. */
:root {
  --paper: #e8e0d1;      /* 古い紙のクリーム */
  --paper-hi: #f1ebe0;
  --beige: #b8aa95;      /* 褪せたベージュ */
  --brown: #8b7967;      /* 乾いた茶色 */
  --pencil: #5f5d57;     /* 鉛筆の灰（本文コントラスト用に僅かに濃く） */
  --ink: #353733;        /* 暗い緑灰 */
  --line: rgba(53, 55, 51, .16);
  --focus: #353733;
  --serif: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Yu Gothic UI", "Yu Gothic", "Hiragino Sans", "Noto Sans JP", "Meiryo", sans-serif;
  --player-h: 84px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  /* very faint paper fibre; never under text strong enough to hurt contrast */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .33 0 0 0 0 .3 0 0 0 0 .25 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  font-family: var(--sans); font-size: 16px; line-height: 1.8; letter-spacing: .02em;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper-hi); padding: 8px 14px; z-index: 50; text-decoration: none; }
.skip:focus { top: 12px; }

/* header / footer */
.site-header, .site-footer {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  max-width: 1180px; margin: 0 auto; padding: 22px clamp(18px, 4vw, 40px);
}
.brand { font-family: var(--serif); font-size: 1.35rem; text-decoration: none; letter-spacing: .08em; }
.brand span { font-family: var(--sans); font-size: .78rem; letter-spacing: .2em; color: var(--pencil); }
.site-header nav a { text-decoration: none; font-size: .95rem; padding: 6px 2px; border-bottom: 1px solid transparent; }
.site-header nav a:hover, .site-header nav a[aria-current] { border-color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); font-size: .82rem; color: var(--pencil); padding-top: 18px; padding-bottom: 28px; margin-top: 56px; }
.site-footer a { text-decoration: none; }

.kicker { margin: 0 0 6px; font-size: .8rem; letter-spacing: .22em; color: var(--pencil); }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.3rem, 6vw, 3.6rem); letter-spacing: .14em; line-height: 1.3; margin: 0; }
.meta-line { margin: 10px 0 0; color: var(--pencil); font-size: .92rem; }
.meta-line span + span { margin-left: .3em; }
.label { font-size: .78rem; font-weight: 500; letter-spacing: .24em; color: var(--pencil); margin: 0 0 10px; }

.listen {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 26px;
  min-height: 48px; padding: 0 22px 0 16px; border: 1px solid var(--ink); border-radius: 999px;
  background: transparent; text-decoration: none; cursor: pointer; font-size: 1rem; letter-spacing: .08em;
  transition: background .25s, color .25s;
}
.listen:hover { background: var(--ink); color: var(--paper-hi); }
.listen-mark { font-size: .7rem; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper-hi); padding-left: 2px; }
.listen:hover .listen-mark { background: var(--paper-hi); color: var(--ink); }

/* ---------- home ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }
.cover { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.5fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding: clamp(24px, 6vw, 72px) 0 40px; }
.desk {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(10px, 1.6vw, 20px);
  padding: clamp(14px, 2.4vw, 30px); background: rgba(184, 170, 149, .22); border: 1px solid var(--line);
}
.piece { position: relative; display: block; background: var(--paper-hi); padding: 5px; box-shadow: 1px 2px 3px rgba(53, 55, 51, .18); transition: transform .3s; }
.piece img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: saturate(.92); }
.piece-no { position: absolute; right: 4px; bottom: -18px; font-size: .68rem; color: var(--pencil); letter-spacing: .1em; opacity: 0; transition: opacity .3s; }
.piece:hover, .piece:focus-visible { transform: translateY(-3px) rotate(0deg) !important; }
.piece:hover .piece-no, .piece:focus-visible .piece-no { opacity: 1; }
.piece-01 { transform: rotate(-1.4deg); } .piece-02 { transform: rotate(1deg) translateY(6px); } .piece-03 { transform: rotate(-.5deg); }
.piece-04 { transform: rotate(1.8deg) translateY(-4px); } .piece-05 { transform: rotate(-1.9deg); } .piece-06 { transform: rotate(.6deg) translateY(5px); }
.piece-07 { transform: rotate(-.8deg); } .piece-08 { transform: rotate(1.3deg); } .piece-09 { transform: rotate(-1.2deg) translateY(-3px); }
.piece-10 { transform: rotate(.9deg); } .piece-11 { transform: rotate(-2.2deg) translateY(4px); grid-column: span 1; } .piece-12 { transform: rotate(.5deg); }
.piece-13 { transform: rotate(-1deg) translateY(2px); }
/* HENKO: one shadow falls toward the light. */
.piece-12 { box-shadow: -2px -2px 3px rgba(53, 55, 51, .16); }

.home-list { max-width: 720px; padding: 24px 0 0; }
.home-list h2 { font-size: .78rem; font-weight: 500; letter-spacing: .24em; color: var(--pencil); margin: 0 0 8px; }
.toc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.toc a { display: grid; grid-template-columns: 2.6em 1fr auto; gap: 12px; align-items: baseline; padding: 13px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .2s; }
.toc a:hover { background: rgba(184, 170, 149, .2); }
.toc-no, .toc-time { font-variant-numeric: tabular-nums; color: var(--pencil); font-size: .88rem; }
.toc-title { font-size: 1.05rem; }
.toc-title small, .t-title small { display: block; font-size: .74rem; color: var(--pencil); letter-spacing: .08em; }
.toc-error { padding: 16px 4px; color: var(--pencil); }

/* ---------- album ---------- */
.album { padding-bottom: calc(var(--player-h) + 16px); }
.album-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px 24px; padding: clamp(18px, 4vw, 44px) 0 30px; border-bottom: 1px solid var(--line); }
.album-head .listen { margin-top: 0; }
.room { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); padding-top: 30px; align-items: start; }

.track-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.track button {
  width: 100%; display: grid; grid-template-columns: 2.4em 1fr auto auto; gap: 10px; align-items: baseline;
  min-height: 52px; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  text-align: left; cursor: pointer; transition: background .2s;
}
.track button:hover { background: rgba(184, 170, 149, .2); }
.t-no, .t-time { font-variant-numeric: tabular-nums; color: var(--pencil); font-size: .88rem; }
.t-title { font-size: 1rem; }
.state { font-size: .72rem; color: var(--brown); letter-spacing: .1em; }
.track.is-current button { background: rgba(184, 170, 149, .28); }
.track.is-current .t-no { color: var(--ink); }
.track.is-playing .t-no::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); margin-right: 6px; vertical-align: middle; }

.detail { display: grid; grid-template-columns: minmax(180px, 320px) minmax(0, 1fr); grid-template-areas: "obj head" "lyr lyr"; gap: 28px 40px; align-items: end; }
.specimen { margin: 0; grid-area: obj; }
.detail-head { grid-area: head; padding-bottom: 34px; }
.lyrics { grid-area: lyr; }
.specimen-stage {
  --tilt: 0deg; position: relative; background: var(--paper-hi); padding: 8px 8px 8px;
  transform: rotate(var(--tilt)); box-shadow: 2px 4px 8px rgba(53, 55, 51, .2), 0 0 0 1px rgba(53, 55, 51, .06);
  transition: opacity .35s ease, transform .5s ease;
}
.specimen-stage.swap { opacity: 0; }
.specimen-stage img { width: 100%; height: auto; }
/* HENKO: the shadow disagrees with the room's light. */
.specimen-stage[data-quirk="henko"] { box-shadow: -3px -4px 9px rgba(53, 55, 51, .18), 0 0 0 1px rgba(53, 55, 51, .06); }
/* ISO: the mount has a second outline, slightly out of phase. */
.specimen-stage[data-quirk="iso"]::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(53, 55, 51, .22); transform: translate(5px, -3px) rotate(.6deg); pointer-events: none; }
.specimen figcaption { display: flex; gap: 10px; margin-top: 16px; font-size: .78rem; color: var(--pencil); letter-spacing: .14em; }

.detail-head { min-width: 0; }
.detail-no { margin: 0; font-size: .82rem; color: var(--pencil); font-variant-numeric: tabular-nums; letter-spacing: .14em; }
.detail-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.45; margin: 4px 0 0; letter-spacing: .06em; overflow-wrap: anywhere; }
.detail-sub { margin: 4px 0 0; font-size: .82rem; letter-spacing: .12em; color: var(--pencil); }
.detail-meta { margin: 6px 0 0; color: var(--pencil); font-size: .88rem; font-variant-numeric: tabular-nums; }

.lyrics { min-width: 0; border-top: 1px solid var(--line); padding-top: 18px; }
.lyrics-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.lyrics-bar .label { margin: 0; }
.lyrics-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lyrics-tabs button { white-space: nowrap; border: 0; background: transparent; padding: 6px 14px; min-height: 36px; border-radius: 999px; font-size: .82rem; cursor: pointer; color: var(--pencil); }
.lyrics-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper-hi); }
.lyrics-body { font-family: var(--serif); font-weight: 500; font-size: 1.06rem; line-height: 2.05; letter-spacing: .06em; overflow-wrap: anywhere; }
.stanza { margin: 0 0 1.5em; }
.section-tag { display: block; font-family: var(--sans); font-weight: 400; font-size: .72rem; letter-spacing: .14em; color: var(--brown); line-height: 1.6; margin-bottom: .2em; }
.lyrics-none { color: var(--pencil); font-family: var(--sans); font-size: .9rem; }

.later { margin-top: 48px; padding: 18px 0; border-top: 1px solid var(--line); color: var(--pencil); font-size: .88rem; }
.later p { margin: 0; }

/* ---------- common player ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; min-height: var(--player-h);
  display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr) auto; gap: 8px 24px; align-items: center;
  padding: 10px clamp(14px, 3vw, 32px) calc(10px + env(safe-area-inset-bottom));
  background: rgba(241, 235, 224, .96); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(53, 55, 51, .06);
  backdrop-filter: blur(6px);
}
.player-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-now img { width: 44px; height: 44px; object-fit: cover; background: var(--beige); flex: none; }
.player-title { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.player-title span { font-size: .72rem; color: var(--pencil); font-variant-numeric: tabular-nums; }
.player-title strong { font-weight: 500; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.controls { display: flex; align-items: center; gap: 6px; flex: none; }
.ctl { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: var(--ink); }
.ctl:hover { background: rgba(184, 170, 149, .35); }
.ctl svg { width: 20px; height: 20px; fill: currentColor; }
.ctl-play { width: 50px; height: 50px; background: var(--ink); color: var(--paper-hi); }
.ctl-play:hover { background: #24261f; }
.ctl-play svg { width: 22px; height: 22px; }
.timeline { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.time { font-size: .8rem; color: var(--pencil); font-variant-numeric: tabular-nums; min-width: 2.8em; text-align: center; }
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; width: 100%; min-width: 0; height: 28px; cursor: pointer; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: var(--beige); border-radius: 2px; }
input[type=range]::-moz-range-track { height: 3px; background: var(--beige); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: var(--ink); border: 0; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 0; }
.player-side { display: flex; align-items: center; gap: 18px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--pencil); cursor: pointer; min-height: 44px; white-space: nowrap; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.volume { display: inline-flex; align-items: center; gap: 6px; color: var(--pencil); }
.volume svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.volume input { width: 96px; }
.player-msg { grid-column: 1 / -1; margin: 0; font-size: .78rem; color: var(--brown); min-height: 0; }
.player-msg:empty { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .room { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); }
  .detail { grid-template-columns: 1fr; grid-template-areas: "obj" "head" "lyr"; gap: 22px; }
  .specimen { max-width: 300px; }
  .detail-head { padding-bottom: 0; }
}
@media (max-width: 980px) { .volume { display: none; } }
@media (max-width: 760px) {
  .cover { grid-template-columns: 1fr; }
  .desk { grid-template-columns: repeat(4, 1fr); }
  .room { grid-template-columns: 1fr; }
  .specimen { max-width: 260px; margin: 0 auto; }
  .detail-head { text-align: center; }
  :root { --player-h: 128px; }
  .player { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding-top: 8px; }
  .player-main { grid-column: 1 / -1; grid-row: 2; flex-direction: column-reverse; gap: 0; align-items: stretch; }
  .controls { justify-content: center; }
  .player-side { grid-column: 2; grid-row: 1; }
  .track button { grid-template-columns: 2.2em 1fr auto; }
  .state { display: none; }
}
@media (max-width: 380px) {
  .desk { grid-template-columns: repeat(3, 1fr); }
  .toggle span { font-size: .74rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .ctl-play, .listen-mark { forced-color-adjust: auto; }
}
