/* =====================================================================
   WAVES — 下北沢の中古レコード & カセット
   tokens.css — shared design foundation (palette / type / motion / base)
   Riso-zine アート方向：クリーム地に墨・クラインブルー・フルオロピンクの
   3版が意図的に刷りズレする紙面。Syne × Zen Kaku Gothic Antique × Space Mono。
   Pages link ONLY this file for shared styles.
   ===================================================================== */

:root {
  /* ── Palette (concept) ─────────────────────────────── */
  --riso-cream: #f2e9d8;   /* リソ・クリーム  紙面のベース */
  --sumi-ink:   #16130f;   /* 墨インク        本文・見出し主色 */
  --klein-blue: #2333cc;   /* クライン・リソブルー ベタ面 */
  --fluoro-pink:#ff4d7d;   /* フルオロ・ピンク  針/強調/波のスパイク */
  --fog-gray:   #8f8a7e;   /* フォグ・グレー   メタ・キャプション */

  --color-bg: var(--riso-cream);
  --color-fg: var(--sumi-ink);
  --color-surface: var(--klein-blue);
  --color-on-surface: var(--riso-cream);
  --color-accent: var(--fluoro-pink);
  --color-muted: var(--fog-gray);
  --color-hairline: rgba(22, 19, 15, 0.16);
  --color-hairline-light: rgba(242, 233, 216, 0.28);

  /* ── Fluid type scale ──────────────────────────────── */
  --step--1: clamp(0.8rem, 0.76rem + 0.2vw, 0.92rem);
  --step-0:  clamp(1rem, 0.95rem + 0.28vw, 1.15rem);
  --step-1:  clamp(1.3rem, 1.08rem + 1vw, 2rem);
  --step-2:  clamp(1.9rem, 1.3rem + 2.5vw, 3.4rem);
  --step-3:  clamp(2.8rem, 1.5rem + 5vw, 5.6rem);
  --step-display: clamp(3.4rem, 9vw, 11.5rem);
  --step-mega: clamp(4.4rem, 13vw, 15rem);

  /* ── Font stacks ───────────────────────────────────── */
  --font-display: "Syne", "Zen Kaku Gothic Antique", sans-serif;
  --font-body: "Zen Kaku Gothic Antique", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* ── Spacing scale (fluid) ─────────────────────────── */
  --space-1: clamp(0.5rem, 0.42rem + 0.35vw, 0.75rem);
  --space-2: clamp(0.85rem, 0.7rem + 0.6vw, 1.25rem);
  --space-3: clamp(1.4rem, 1.1rem + 1.2vw, 2.25rem);
  --space-4: clamp(2.2rem, 1.7rem + 2vw, 3.75rem);
  --space-5: clamp(3.5rem, 2.6rem + 3.6vw, 6rem);
  --space-6: clamp(5.5rem, 4rem + 6vw, 9.5rem);
  --space-7: clamp(8rem, 6rem + 9vw, 15rem);
  --space-8: clamp(12rem, 9rem + 14vw, 22rem);

  --gutter: clamp(1rem, 0.6rem + 1.6vw, 2.4rem);
  --page-inline: clamp(1.25rem, 5vw, 6rem);
  --shell-max: 1900px;

  /* ── Motion tokens ─────────────────────────────────── */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-power4: cubic-bezier(0.165, 0.84, 0.44, 1);
  --ease-inout-power4: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-1: 0.4s;
  --dur-2: 0.8s;
  --dur-3: 1.1s;

  color-scheme: light;
}

/* =====================================================================
   1. RESET (self-authored, no @import)
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100%; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; background: none; border: none; }
button { cursor: pointer; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { font-weight: inherit; font-size: inherit; }
:where(svg) { fill: currentColor; }

/* =====================================================================
   2. BASE ELEMENTS
   ===================================================================== */
html { scroll-behavior: auto; }

body {
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--step-0);
  line-height: 1.9;
  letter-spacing: 0.02em;
  overflow-x: clip;
  position: relative;
}

/* Japanese body: full-width metrics, generous leading */
p { max-width: 62ch; }
p.jp-lead { font-size: var(--step-1); line-height: 1.8; letter-spacing: 0.01em; }

/* Display headings mapped onto scale */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
h1 { font-size: var(--step-display); }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-2); font-weight: 700; }

/* Japanese headline treatment */
.jp-head {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: 0.01em;
  text-transform: none;
  font-feature-settings: "palt" 1;
  word-break: keep-all;
}

.mono, .label, .cat {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}
.mono--num { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

/* Links: underline drawn in from the left */
a:not(.plain) {
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--color-accent), var(--color-accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  transition: background-size 0.45s var(--ease-out-expo);
  padding-bottom: 0.05em;
}
a:not(.plain):hover,
a:not(.plain):focus-visible { background-size: 100% 2px; }

strong, .accent-word { color: var(--color-accent); font-weight: inherit; }

/* Selection in accent */
::selection { background: var(--color-accent); color: var(--color-bg); }
::-moz-selection { background: var(--color-accent); color: var(--color-bg); }

/* Focus visible — designed */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Themed thin scrollbar */
html { scrollbar-width: thin; scrollbar-color: var(--color-muted) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-muted); border-radius: 0; border: 2px solid var(--color-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--color-fg); }

/* =====================================================================
   3. GRAIN OVERLAY (no extra markup) — inline SVG feTurbulence
   ===================================================================== */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-repeat: repeat;
  background-size: 240px 240px;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22240%22 height=%22240%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.8%22 numOctaves=%224%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23n)%22 opacity=%220.6%22/%3E%3C/svg%3E');
}

/* =====================================================================
   4. LAYOUT UTILITIES
   ===================================================================== */
.container {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--page-inline);
}
.bleed { width: 100%; }
.inset { padding-inline: var(--page-inline); }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--space-3);
}

/* Column-span helpers (asymmetric use encouraged) */
.col-1-7 { grid-column: 1 / 8; }
.col-8-12 { grid-column: 8 / 13; }
.col-1-6 { grid-column: 1 / 7; }
.col-7-12 { grid-column: 7 / 13; }
.col-2-9 { grid-column: 2 / 10; }
.col-full { grid-column: 1 / -1; }

.stack > * + * { margin-top: var(--space-3); }
.silence { height: var(--space-7); }
.silence--lg { height: var(--space-8); }

/* Hairline rules */
.hairline { border: 0; height: 1px; background: var(--color-hairline); width: 100%; }
.hairline--light { background: var(--color-hairline-light); }
.ruled-top { border-top: 1px solid var(--color-hairline); }
.ruled-bottom { border-bottom: 1px solid var(--color-hairline); }

/* Solid surface panel (Klein-blue beta面) */
.panel {
  background: var(--color-surface);
  color: var(--color-on-surface);
  --color-hairline: var(--color-hairline-light);
}
.panel ::selection { background: var(--color-accent); color: var(--color-surface); }

/* Oversized index numbers (棚っぽい档案感) */
.index-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-3);
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}
.index-num--sm {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--color-muted);
  letter-spacing: 0.14em;
}

/* Outlined display type as ornament */
.stroke-type {
  color: transparent;
  -webkit-text-stroke: 1px var(--color-fg);
  text-stroke: 1px var(--color-fg);
}

/* Giant background word */
.ghost-word {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-fg);
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
  line-height: 0.8;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

/* Vertical-rl spine label (レコードの背表紙) */
.vlabel {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: var(--step--1);
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   5. COMPONENTS
   ===================================================================== */

/* Buttons — magnetic host, left-drawn underline */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--step--1);
  padding: 0.9em 1.4em;
  border: 1px solid currentColor;
  color: var(--color-fg);
  background: transparent;
  min-height: 44px;
  transition: color 0.4s var(--ease-out-expo), background-color 0.4s var(--ease-out-expo);
  will-change: transform;
}
.btn:hover, .btn:focus-visible { background: var(--color-fg); color: var(--color-bg); }
.btn--accent { border-color: var(--color-accent); color: var(--color-accent); }
.btn--accent:hover, .btn--accent:focus-visible { background: var(--color-accent); color: var(--color-bg); }
.btn__arrow { transition: transform 0.4s var(--ease-out-expo); }
.btn:hover .btn__arrow { transform: translateX(0.35em); }

/* Record-jacket panel (designed jacket) */
.jacket {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-surface);
  color: var(--color-on-surface);
  overflow: hidden;
  display: grid;
  place-content: center;
  will-change: transform;
}
.jacket--cream { background: var(--color-bg); color: var(--color-fg); border: 1px solid var(--color-hairline); }
.jacket--ink { background: var(--color-fg); color: var(--color-bg); }

/* Header / nav — mix-blend difference so it reads over any scene */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--page-inline);
  mix-blend-mode: difference;
  color: #fff;
  transition: padding 0.5s var(--ease-out-expo);
}
.site-header.scrolled { padding-block: var(--space-1); }
.site-header a { color: inherit; }
.site-nav { display: flex; gap: clamp(1rem, 2vw, 2.4rem); align-items: center; }
.site-nav a { font-family: var(--font-mono); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: var(--step--1); }
.site-nav a[aria-current="page"]::before { content: "● "; color: var(--color-accent); }
.brandmark { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); letter-spacing: -0.02em; text-transform: uppercase; }

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle { display: none; }

/* =====================================================================
   6. MARQUEE (pure CSS)
   ===================================================================== */
.marquee {
  --marquee-dur: 28s;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--color-hairline);
  border-bottom: 1px solid var(--color-hairline);
  padding-block: var(--space-2);
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  will-change: transform;
  animation: marquee-scroll var(--marquee-dur) linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-2);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.marquee-item .jp { font-family: var(--font-body); font-weight: 700; text-transform: none; letter-spacing: 0.02em; }
.marquee-item .sep { color: var(--color-accent); }
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =====================================================================
   7. SIGNATURE — GROOVE LINE host
   ===================================================================== */
.groove-line {
  position: fixed;
  left: 0; right: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}
.groove-line svg { width: 100%; height: 100%; overflow: visible; }
.groove-line .groove-path { fill: none; stroke: var(--color-fg); stroke-width: 1.5; opacity: 0.5; }
.groove-line .groove-needle { fill: var(--color-accent); }
.groove-line[data-groove-quiet] .groove-path { opacity: 0.28; stroke-width: 1; }

/* =====================================================================
   8. CUSTOM CURSOR (pointer:fine only) — the 針
   ===================================================================== */
.cursor, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 10000;
  pointer-events: none;
  border-radius: 50%;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
  mix-blend-mode: difference;
}
.cursor { width: 8px; height: 8px; background: var(--color-accent); mix-blend-mode: normal; }
.cursor-ring {
  width: 40px; height: 40px;
  border: 1px solid #fff;
  transition: width 0.3s var(--ease-out-expo), height 0.3s var(--ease-out-expo), opacity 0.3s ease;
}
.cursor-ring.is-hover { width: 66px; height: 66px; border-color: var(--color-accent); mix-blend-mode: normal; }
body.has-cursor, body.has-cursor a, body.has-cursor button, body.has-cursor [data-hover] { cursor: none; }
@media (pointer: coarse) { .cursor, .cursor-ring { display: none !important; } }

/* =====================================================================
   9. PRELOADER
   ===================================================================== */
body.is-loading { overflow: hidden; height: 100vh; }
#preloader {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: var(--color-surface);
  color: var(--color-on-surface);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--page-inline);
  will-change: transform;
}
#preloader .pre-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-mega);
  line-height: 0.82;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
#preloader .pre-count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
#preloader .pre-count::after { content: "%"; font-size: 0.5em; margin-left: 0.15em; }

/* =====================================================================
   10. REVEAL PRIMITIVES (initial hidden states; JS animates)
   ===================================================================== */
[data-reveal] { will-change: transform, opacity; }
.split-line { display: block; overflow: hidden; }
.split-word { display: inline-block; overflow: hidden; vertical-align: top; }
.split-char { display: inline-block; will-change: transform; }
.clip-reveal { will-change: clip-path; }

/* Accessibility helper */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Full-viewport hero */
.scene--full { min-height: 100svh; }

/* =====================================================================
   11. RESPONSIVE — designed breakpoints
   ===================================================================== */
@media (max-width: 1024px) {
  .grid-12 { row-gap: var(--space-2); }
  .col-1-7, .col-1-6, .col-2-9 { grid-column: 1 / -1; }
  .col-8-12, .col-7-12 { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body { line-height: 1.85; }
  .grid-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .marquee-item { font-size: var(--step-1); }
  /* JP vertical labels crowd small screens — flatten to short horizontal */
  .vlabel {
    writing-mode: horizontal-tb;
    letter-spacing: 0.14em;
  }
  .site-nav { gap: 1rem; }
  .ghost-word { opacity: 0.05; }
  .silence { height: var(--space-6); }
}

@media (max-width: 480px) {
  .grid-12 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #preloader { flex-direction: column; align-items: flex-start; gap: var(--space-3); justify-content: flex-end; }
}

/* Large-screen: gutters and silence breathe wider */
@media (min-width: 1800px) {
  :root { --gutter: 2.6rem; }
}

/* =====================================================================
   12. REDUCED MOTION — neutralize CSS animation
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track { animation: none !important; transform: none !important; }
  .cursor, .cursor-ring { display: none !important; }
  [data-reveal], .split-char, .clip-reveal { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .groove-line .groove-path { opacity: 0.4 !important; }
}
