/* ============================================================
   DIRECTION D: PERSONAL DIGITAL WORLD (個人電脳領域)
   Rules over boxes. Each tab owns one osu!lazer colour (--accent).
   Glass (liquidglass/WebGL) on two things only: the Discord card
   and the tab lens. Motion only under [data-motion="on"].
   ============================================================ */

@font-face { font-family: 'Torus Pro'; src: url('/assets/fonts/TorusPro-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Torus Pro'; src: url('/assets/fonts/TorusPro-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Torus Pro'; src: url('/assets/fonts/TorusPro-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Torus Pro'; src: url('/assets/fonts/TorusPro-Heavy.woff2') format('woff2'); font-weight: 900; font-display: swap; }
/* Absolute URLs on purpose: liquidglass resolves font URLs against the page,
   so fontsource's relative ./files/ paths 404 inside the glass */
@font-face { font-family: 'Maple Mono'; src: url('https://cdn.jsdelivr.net/npm/@fontsource/maple-mono@5.3.0/files/maple-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Maple Mono'; src: url('https://cdn.jsdelivr.net/npm/@fontsource/maple-mono@5.3.0/files/maple-mono-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

/* Registered so tab changes can interpolate the colour */
@property --accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #66ccff;
}

:root {
  /* osu!lazer OsuColour */
  --osu-blue: #66ccff;
  --osu-purple: #8c66ff;
  --osu-lime: #b2ff66;
  --osu-pink: #ff66aa;
  --osu-yellow: #ffcc22;
  --osu-red: #ff6666;

  /* osu!lazer OsuColour.ForRank */
  --rank-ss: #de31ae;
  --rank-s: #02b5c3;
  --rank-a: #88da20;
  --rank-b: #e3b130;
  --rank-c: #ff8e5d;
  --rank-d: #ff5a5a;

  --accent: var(--osu-blue);

  --bg-canvas: #080b12;
  --bg-surface: #0e1422;
  --bg-surface-elevated: #141c2e;

  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);

  --text-main: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --text-bright: #ffffff;

  /* Discord status (semantic, not accents) */
  --status-online: #10b981;
  --status-idle: #fbbf24;
  --status-dnd: #f43f5e;

  --font-sans: 'Torus Pro', 'Zen Kaku Gothic New', system-ui, sans-serif;
  --font-mono: 'Maple Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-glass: 14px;
}

html[data-tab="about"]       { --accent: var(--osu-blue); }
html[data-tab="projects"]    { --accent: var(--osu-purple); }
html[data-tab="workstation"] { --accent: var(--osu-lime); }
html[data-tab="rhythm"]      { --accent: var(--osu-pink); }
html[data-tab="lore"]        { --accent: var(--osu-yellow); }

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

html { color-scheme: dark; }

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: color-mix(in oklab, var(--accent) 40%, transparent); }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text-bright); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--text-main);
}

.mono-dim {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

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

.site-canvas {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px 64px;
  overflow-x: clip; /* glass backings overhang the 16px phone gutter; on body Chromium ignores clip */
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============================================================
   STATUS RAIL + ANIMATIONS SWITCH
   ============================================================ */
.top-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-secondary);
}

.top-status-bar > :first-child {
  color: var(--text-bright);
  margin-right: auto;
}

.motion-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font: inherit;
  color: var(--text-secondary);
  cursor: pointer;
}

.motion-switch:hover { color: var(--text-bright); }

.switch-track {
  position: relative;
  width: 26px;
  height: 14px;
  border-radius: 7px;
  background: var(--border-medium);
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-main);
}

.motion-switch[aria-checked="true"] .switch-track { background: var(--accent); }
.motion-switch[aria-checked="true"] .switch-thumb { transform: translateX(12px); background: var(--bg-canvas); }

/* ============================================================
   GLASS
   Fallback look is plain CSS; once liquidglass is running the root
   gets .lg-on and the WebGL canvas replaces it.
   ============================================================ */

/* Page-coloured layer the shader refracts (its scene starts white).
   Overhangs by the library's 20px shadow pad; the 32px section gaps
   keep it off neighbouring content. */
.glass-backing {
  position: absolute;
  inset: -20px;
  background: var(--bg-canvas);
  pointer-events: none;
}

.presence.glass {
  background: rgba(14, 20, 34, 0.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.lg-on > .presence.glass {
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: transparent;
}

@media (prefers-reduced-transparency: reduce) {
  .presence.glass {
    background: var(--bg-surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ============================================================
   MASTHEAD
   ============================================================ */
.site-masthead {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: end;
  min-height: 250px;
}

.masthead-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kana-rubi {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.site-title {
  font-size: clamp(2.6rem, 6vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-bright);
}

.site-manifesto {
  margin-top: 10px;
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 58ch;
}

/* Vivlos stands behind the Discord card. She overhangs the masthead
   bottom by --art-sink and is clipped there; JS moves the clip with
   her when she swaps outfits. Must stay a direct child of #masthead
   so liquidglass draws her live (no stale snapshot). */
.vivlos-art {
  --art-sink: 90px;
  position: absolute;
  z-index: 0;
  right: 50px;
  bottom: calc(-1 * var(--art-sink));
  height: 360px;
  width: auto;
  clip-path: inset(0 0 var(--art-sink) 0);
  pointer-events: none;
  user-select: none;
}

.presence {
  position: relative;
  z-index: 2;
  border-radius: var(--radius-glass);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.presence-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.presence .mono-dim { color: var(--text-secondary); }

.presence-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-main);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.online { background: var(--status-online); }
.status-dot.idle { background: var(--status-idle); }
.status-dot.dnd { background: var(--status-dnd); }

.presence-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-small {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.presence-meta { min-width: 0; }

.activity-title-text,
.activity-sub-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-title-text {
  font-weight: 700;
  color: var(--text-bright);
}

.activity-sub-text {
  font-size: 0.85rem;
  color: var(--text-main);
}

.presence-spotify {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.presence-spotify[hidden] { display: none; }

.spotify-info-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.spotify-bar-track {
  height: 2px;
  background: var(--border-medium);
}

.spotify-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--status-online);
}

/* ============================================================
   TABS + GLASS LENS
   Labels never change colour (the shader keeps a snapshot of them);
   the lens alone marks the active tab.
   ============================================================ */
.archive-nav {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 172px));
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-medium);
}

.nav-tab:nth-of-type(1) { --tab: var(--osu-blue); }
.nav-tab:nth-of-type(2) { --tab: var(--osu-purple); }
.nav-tab:nth-of-type(3) { --tab: var(--osu-lime); }
.nav-tab:nth-of-type(4) { --tab: var(--osu-pink); }
.nav-tab:nth-of-type(5) { --tab: var(--osu-yellow); }

.nav-tab {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  padding: 10px 8px 13px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
}

/* Each tab's own colour, as a short bar the lens magnifies */
.nav-tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 18px;
  height: 3px;
  margin-left: -9px;
  border-radius: 2px;
  background: var(--tab);
}

.nav-tab:hover { color: var(--text-bright); }

.tab-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tab);
}

.tab-kanji {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-dim);
}

.tab-lens {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0; /* fallback: tinted plate under the label */
  border-radius: 12px;
  pointer-events: none;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 45%, transparent);
}

/* WebGL: the lens sits over the label and refracts it; the ring is
   outside the box so the shader canvas doesn't cover it */
.lg-on > .tab-lens {
  z-index: 2;
  background: none;
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--accent) 60%, transparent),
    0 6px 20px -6px color-mix(in oklab, var(--accent) 80%, transparent);
}

.archive-nav:has(.nav-tab[aria-current]:focus-visible) .tab-lens {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.archive-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* JS sets [hidden]; without JS every section shows as one long page */
.archive-section[hidden] { display: none; }

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--text-bright);
}

.section-heading::before {
  content: "";
  align-self: center;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

.kanji-sub {
  font-size: 0.9rem;
  font-weight: 400;
  color: color-mix(in oklab, var(--accent) 70%, var(--text-dim));
}

/* ============================================================
   00 PROFILE
   ============================================================ */
.narrative-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

.narrative-prose {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-secondary);
  max-width: 64ch;
}

.narrative-prose strong {
  color: var(--text-bright);
  font-weight: 700;
}

.narrative-prose em { color: var(--accent); font-style: normal; }

.lead-text {
  font-size: 1.14rem;
  color: var(--text-main);
}

.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover { color: var(--text-bright); }

.data-pair-list {
  border-left: 2px solid var(--accent);
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
}

.data-pair dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.data-pair dd { color: var(--text-main); }

/* ============================================================
   01 PROJECTS
   ============================================================ */
.projects-dossier {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.project-entry {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-hairline);
}

.project-entry:first-child {
  padding-top: 0;
  border-top: none;
}

.entry-meta-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.entry-num {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

.entry-status { color: var(--text-main); }

.entry-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: 1px;
  background: var(--dot, var(--text-dim));
}

.entry-status[data-state="live"] { --dot: var(--osu-lime); }
.entry-status[data-state="ongoing"] { --dot: var(--osu-blue); }

.entry-stack { color: var(--text-secondary); }

.entry-body-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 68ch;
}

.entry-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
}

.entry-tagline {
  margin-top: -8px;
  color: var(--text-main);
}

.story-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: color-mix(in oklab, var(--accent) 60%, var(--text-dim));
}

.story-block p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ============================================================
   02 WORKSTATION
   ============================================================ */
.specs-composite-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.spec-table caption,
.scores-ledger caption {
  text-align: left;
  font-weight: 700;
  color: var(--text-bright);
  padding-bottom: 8px;
}

.spec-table caption { color: var(--accent); }

.spec-table tr { border-top: 1px solid var(--border-hairline); }

.spec-table th,
.spec-table td {
  padding: 8px 0;
  vertical-align: baseline;
}

.spec-table th {
  width: 38%;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
}

.spec-table td { color: var(--text-main); }

/* ============================================================
   03 RHYTHM
   ============================================================ */
.rhythm-profile-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 32px;
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}

.player-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text-bright);
  text-decoration: none;
}

.player-name:hover { color: var(--accent); }

.player-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.stat-unit dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.stat-unit dd {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
}

#osu-pp { color: var(--accent); }

.table-container {
  border-top: 1px solid var(--border-medium);
  padding-top: 16px;
}

.scores-ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.scores-ledger th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-dim);
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-hairline);
}

.scores-ledger td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
}

.scores-ledger tbody tr:hover { background: color-mix(in oklab, var(--accent) 6%, transparent); }

.scores-ledger .num {
  text-align: right;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.col-rank { width: 36px; }
.col-play { width: 40px; }
.col-mods, .col-grade { text-align: center !important; }

.td-rank {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* #1 play is the spotlight */
.top-play .td-rank { color: var(--accent); font-weight: 600; }
.top-play .td-song-title { font-size: 1.05rem; }

.td-audio-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.65rem;
  cursor: pointer;
}

.td-audio-btn:hover,
.td-audio-btn.playing {
  color: var(--accent);
  border-color: var(--accent);
}

/* Playing state: three level bars (they move only with animations on) */
.eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.eq i {
  width: 2px;
  height: 100%;
  background: currentColor;
  transform-origin: bottom;
}

.eq i:nth-child(1) { transform: scaleY(0.5); }
.eq i:nth-child(3) { transform: scaleY(0.7); }

.td-audio-btn.playing .play-symbol { display: none; }
.td-audio-btn.playing .eq { display: inline-flex; }

.td-song-title {
  font-weight: 700;
  color: var(--text-bright);
  text-decoration: none;
}

.td-song-title:hover { color: var(--accent); }

.td-song-diff {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.td-pp { color: var(--accent); font-weight: 600; }
.td-dim { color: var(--text-secondary); }

.td-mods, .td-grade {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* osu!lazer ModType colours */
.mod-inc { color: var(--osu-red); }
.mod-red { color: var(--osu-lime); }
.mod-auto { color: var(--osu-blue); }

.td-grade { font-size: 0.85rem; font-weight: 600; }
.grade-ss { color: var(--rank-ss); }
.grade-s { color: var(--rank-s); }
.grade-a { color: var(--rank-a); }
.grade-b { color: var(--rank-b); }
.grade-c { color: var(--rank-c); }
.grade-d { color: var(--rank-d); }

.table-msg {
  text-align: center;
  padding: 18px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.expand-table-btn {
  display: block;
  margin-top: 12px;
  background: none;
  border: none;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
}

.expand-table-btn:hover { color: var(--text-bright); }

/* ============================================================
   04 LORE
   ============================================================ */
.lore-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  align-items: start;
}

.lore-narrative {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text-secondary);
  max-width: 64ch;
}

.lore-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-bright);
}

.colophon-title {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
}

.colophon-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.92rem;
}

.colophon-list li::before {
  content: "- ";
  color: var(--accent);
}

.plate-image {
  display: block;
  width: 100%;
  height: auto;
}

.editorial-plate figcaption {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ============================================================
   FOOTER & TOAST
   ============================================================ */
.site-footer {
  padding-top: 20px;
  border-top: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.toast-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.toast-indicator.show { opacity: 1; }

/* ============================================================
   MOTION (Animations switch). Nothing moves without it.
   ============================================================ */
[data-motion="on"] { transition: --accent 0.5s ease; }

[data-motion="on"] .switch-track { transition: background 0.2s ease; }
[data-motion="on"] .switch-thumb { transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1), background 0.2s ease; }

/* Lens slide with a little overshoot; JS adds the squish */
[data-motion="on"] .tab-lens { transition: transform 0.55s cubic-bezier(0.3, 1.45, 0.5, 1); }

[data-motion="on"] .nav-tab,
[data-motion="on"] a,
[data-motion="on"] .link-btn,
[data-motion="on"] .td-audio-btn,
[data-motion="on"] .expand-table-btn { transition: color 0.15s ease, border-color 0.15s ease; }

[data-motion="on"] .scores-ledger tbody tr { transition: background 0.15s ease; }
[data-motion="on"] .spotify-bar-fill { transition: width 1s linear; }
[data-motion="on"] .toast-indicator { transition: opacity 0.2s ease; }

/* Tab enter: content arrives from the side you moved towards */
@keyframes rise {
  from {
    opacity: 0;
    transform: translate(var(--dx, 0px), 10px);
  }
}

[data-motion="on"] .rise {
  animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

/* Live data: a stat that just changed flashes the accent, new Discord text fades up */
@keyframes stat-flash {
  from { color: var(--accent); }
}

[data-motion="on"] .stat-unit dd.updated { animation: stat-flash 1.6s ease-out; }

@keyframes swap-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

[data-motion="on"] .presence .swap { animation: swap-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
[data-motion="on"] .status-dot { transition: background 0.3s ease; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

[data-motion="on"] .playing .eq i { animation: eq 0.8s ease-in-out infinite; }
[data-motion="on"] .playing .eq i:nth-child(2) { animation-delay: -0.3s; }
[data-motion="on"] .playing .eq i:nth-child(3) { animation-delay: -0.55s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .site-masthead,
  .narrative-grid,
  .specs-composite-grid,
  .lore-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-masthead { min-height: 0; }

  /* Leave headroom for Vivlos to peek over the card */
  .presence {
    margin-top: 84px;
    justify-self: end;
    width: min(100%, 360px);
  }

  .vivlos-art {
    --art-sink: 60px;
    right: 16px;
    height: 260px;
  }

  .data-pair-list {
    border-left: none;
    padding-left: 0;
    border-top: 2px solid var(--accent);
    padding-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .project-entry {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entry-meta-col {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 16px;
    align-items: baseline;
  }

  .editorial-plate { max-width: 260px; }
}

@media (max-width: 640px) {
  .site-canvas {
    padding: 12px 16px 48px;
    gap: 24px;
  }

  .top-status-bar > :first-child { width: 100%; }

  /* 3 + 2 grid; the lens moves in both axes */
  .archive-nav { grid-template-columns: repeat(3, 1fr); }
  .tab-kanji, .tab-num { display: none; }

  /* Drop low-value columns instead of scrolling a 600px table */
  .col-combo, .td-combo,
  .col-grade, .td-grade { display: none; }

  .scores-ledger th, .scores-ledger td { padding: 8px 6px; }
  .td-audio-btn { width: 32px; height: 32px; }
}

