/* =========================================================
   CINAILO — style
   ========================================================= */

/* ---------- Fonts (self-hosted from Google Fonts, OFL; variable weights) ---------- */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/jetbrainsmono-cyrillic-ext.woff2?v=1') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/jetbrainsmono-cyrillic.woff2?v=1') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/jetbrainsmono-latin-ext.woff2?v=1') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/jetbrainsmono-latin.woff2?v=1') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/unbounded-cyrillic-ext.woff2?v=1') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/unbounded-cyrillic.woff2?v=1') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/unbounded-latin-ext.woff2?v=1') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/unbounded-latin.woff2?v=1') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-display: 'Unbounded', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --accent: #e3262b;
}

/* ---------- Dark (default) ---------- */
:root {
  color-scheme: dark;
  --bg: #070707;
  --bg-2: #101010;
  --fg: #ededed;
  --muted: #8b8b8b;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .28);
  --chrome: linear-gradient(180deg, #ffffff 0%, #e4e4e4 32%, #8e8e8e 49%, #3a3a3a 53%, #a9a9a9 72%, #f2f2f2 100%);
  --shine: rgba(255, 255, 255, .95);
  --cg1: #ffffff; --cg2: #a0a0a0; --cg3: #4a4a4a; --cg4: #c2c2c2; --cg5: #f4f4f4;
  --btn-bg: linear-gradient(180deg, #2b2b2b 0%, #141414 55%, #0c0c0c 100%);
  --btn-border: #4a4a4a;
  --btn-inset: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .6);
  --btn-glow: 0 10px 40px -12px rgba(255, 255, 255, .25);
  --spot: rgba(255, 255, 255, .07);
  --grain-op: .07;
  --grain-blend: overlay;
  --cover-glow: .42;
}

.cg-1 { stop-color: var(--cg1); }
.cg-2 { stop-color: var(--cg2); }
.cg-3 { stop-color: var(--cg3); }
.cg-4 { stop-color: var(--cg4); }
.cg-5 { stop-color: var(--cg5); }

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

html {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure { margin: 0; }

::selection { background: var(--fg); color: var(--bg); }

:focus-visible {
  outline: 1.5px solid var(--fg);
  outline-offset: 4px;
  border-radius: 4px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
:lang(zh) .mono { letter-spacing: .06em; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  padding: 10px 14px; background: var(--fg); color: var(--bg); border-radius: 999px;
  transition: top .2s;
}
.skip:focus { top: 12px; }

/* ---------- Chrome text ---------- */
.chrome {
  background-image:
    linear-gradient(105deg, transparent 42%, var(--shine) 50%, transparent 58%),
    var(--chrome);
  background-size: 300% 100%, 100% 100%;
  background-position: 150% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.chrome.shine { animation: shine 1.6s var(--ease); }

@keyframes shine {
  from { background-position: 150% 0, 0 0; }
  to   { background-position: -50% 0, 0 0; }
}

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  transition: background-color .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}

.header__logo {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
}
.emblem {
  width: 36px; height: 50px;
  overflow: visible;
  transition: transform .6s var(--ease), filter .6s var(--ease);
}
.header__logo:hover .emblem {
  transform: scale(1.08);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, .35));
}

.header__right {
  justify-self: end;
  display: flex; align-items: center; gap: 6px;
}

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: background-color .25s;
}
.icon-btn:hover { background: var(--line); }

/* burger */
.menu-btn { justify-self: start; }
.burger { position: relative; width: 22px; height: 10px; display: block; }
.burger i {
  position: absolute; left: 0; width: 100%; height: 1.5px; background: currentColor;
  transition: transform .45s var(--ease), top .45s var(--ease);
}
.burger i:first-child { top: 0; }
.burger i:last-child { top: 8.5px; }
.menu-open .burger i:first-child { top: 4.25px; transform: rotate(45deg); }
.menu-open .burger i:last-child { top: 4.25px; transform: rotate(-45deg); }

/* language */
.lang { position: relative; }
.lang__btn {
  height: 44px; padding: 0 12px 0 14px;
  display: flex; align-items: center; gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: border-color .25s, background-color .25s;
}
.lang__btn:hover, .lang__btn[aria-expanded="true"] { border-color: var(--line-strong); }
.lang__btn svg { width: 12px; height: 12px; transition: transform .35s var(--ease); }
.lang__btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.lang__list {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 210px;
  padding: 6px;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55);
  transform-origin: top right;
  animation: pop .28s var(--ease);
}
.lang__list[hidden] { display: none; }
.lang__list button {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 12px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  text-align: left;
  color: var(--muted);
  transition: background-color .2s, color .2s;
}
.lang__list button .mono { font-size: 10px; opacity: .7; }
.lang__list button:hover { background: var(--line); color: var(--fg); }
.lang__list button[aria-checked="true"] { color: var(--fg); }
.lang__list button[aria-checked="true"] .mono::before {
  content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 8px;
  border-radius: 50%; background: var(--accent); vertical-align: middle;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Menu overlay ---------- */
.menu {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header-h) + 2vh) var(--gutter) calc(28px + env(safe-area-inset-bottom));
  background: var(--bg);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .7s var(--ease);
}
.menu[hidden] { display: none; }
.menu.is-open { clip-path: inset(0 0 0 0); }

.menu__nav { display: flex; flex-direction: column; }
.menu__nav a {
  display: block;
  padding: 2.2vh 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(36px, 9vw, 96px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -.02em;
  opacity: 0; transform: translateY(30px);
  transition: opacity .6s var(--ease), transform .6s var(--ease), color .25s, padding-left .4s var(--ease);
}

.menu.is-open .menu__nav a { opacity: 1; transform: none; }
.menu.is-open .menu__nav a:nth-child(1) { transition-delay: .18s, .18s, 0s, 0s; }
.menu.is-open .menu__nav a:nth-child(2) { transition-delay: .24s, .24s, 0s, 0s; }
.menu.is-open .menu__nav a:nth-child(3) { transition-delay: .30s, .30s, 0s, 0s; }
.menu.is-open .menu__nav a:nth-child(4) { transition-delay: .36s, .36s, 0s, 0s; }
@media (hover: hover) {
  .menu__nav:hover a { color: var(--muted); }
  .menu__nav a:hover { color: var(--fg); padding-left: 14px; }
}

/* ---------- Sections ---------- */
.section {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: clamp(80px, 13vw, 170px) var(--gutter) 0;
  scroll-margin-top: 10px;
}

.dot {
  position: relative;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
/* the pulse is a ring that scales and fades: transform/opacity run on the GPU, box-shadow would repaint every frame */
.dot::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(227, 38, 43, .55);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { transform: scale(1); opacity: 1; }
  70%  { transform: scale(4); opacity: 0; }
  100% { transform: scale(4); opacity: 0; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--header-h) + 20px) var(--gutter) 110px;
  isolation: isolate;
  text-align: center;
}

.hero__scroll {
  position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 10px;
  color: var(--muted);
  opacity: 0;
  animation: fadeIn 1s 1.6s forwards;
}
.hero__line {
  width: 1px; height: 42px;
  background: linear-gradient(var(--fg), transparent);
  transform-origin: top;
  animation: drip 2.4s var(--ease) infinite;
}
@keyframes drip {
  0%   { transform: scaleY(0); opacity: 1; }
  60%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

@keyframes fadeIn { to { opacity: 1; } }

/* ---------- Latest ---------- */
.latest {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.latest__cover {
  position: relative;
  display: block;
  width: min(420px, 78vw);
  aspect-ratio: 1;
  margin-top: 30px;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease);
}
.latest__cover.is-tilting { transition: transform .08s linear; }
.latest__img {
  position: relative;
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px var(--line);
}
.latest__glow {
  position: absolute; inset: 8%;
  width: 84%; height: 84%;
  object-fit: cover;
  filter: blur(60px) saturate(1.4);
  opacity: var(--cover-glow);
  transform: translateZ(-1px) scale(1.15);
  pointer-events: none;
}
.latest__glare {
  position: absolute; inset: 0; border-radius: 4px;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .28), transparent 55%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.latest__cover:hover .latest__glare { opacity: 1; }

.latest__title {
  margin-top: clamp(32px, 4vw, 48px);
  font-size: clamp(44px, 9vw, 120px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  padding-bottom: .08em;
  margin-bottom: clamp(28px, 3.4vw, 40px);
}

/* ---------- Buttons ---------- */
.btn-chrome {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px;
  padding: 0 38px;
  border-radius: 999px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  box-shadow: var(--btn-inset), var(--btn-glow);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  text-transform: lowercase;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.btn-chrome span {
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.btn-chrome::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .9s var(--ease);
}
.btn-chrome:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.btn-chrome:hover::after { transform: translateX(120%); }
.btn-chrome:active { transform: translateY(0) scale(.98); }

/* ---------- Releases grid ---------- */
.releases { padding-top: clamp(72px, 10vw, 130px); }
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(26px, 3vw, 40px) clamp(14px, 2vw, 28px);
}
@media (min-width: 700px)  { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.rel a { display: block; }
.rel__art {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 3px;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line);
}
.rel__art img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(.92);
  transform: scale(1.001);
  transition: filter .7s var(--ease), transform .9s var(--ease);
}
.rel__new {
  position: absolute; left: 10px; top: 10px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px 6px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 9px;
}
.rel__new .dot { width: 6px; height: 6px; }
.rel--new .rel__art img { filter: none; }

.rel__meta { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.rel__title {
  font-size: clamp(13px, 1.3vw, 16px);
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.rel__info { color: var(--muted); font-size: 10px; }

@media (hover: hover) {
  .rel a:hover .rel__art img { filter: none; transform: scale(1.05); }
}
@media (hover: none) {
  .rel__art img { filter: grayscale(.35) contrast(1.03); }
}

/* ---------- Label seal ---------- */

.seal {
  position: relative;
  width: clamp(170px, 22vw, 230px);
  aspect-ratio: 1;
}
.seal__ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
  animation: spin 28s linear infinite;
  overflow: visible;
  will-change: transform;
}
.hero.is-off .seal__ring,
.hero.is-off .hero__line { animation-play-state: paused; }
.seal__ring text {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .32em;
  fill: var(--muted);
}
.seal__emblem {
  position: absolute; inset: 20%;
  width: 60%; height: 60%;
  overflow: visible;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Socials ---------- */
.socials { border-top: 1px solid var(--line); }
.socials li { border-bottom: 1px solid var(--line); }
.socials li { border-bottom: 1px solid var(--line); }
.socials a {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  padding: clamp(22px, 3.2vw, 38px) clamp(4px, 1vw, 16px);
  overflow: hidden;
  isolation: isolate;
  transition: color .45s var(--ease), padding-left .55s var(--ease);
}
.socials a::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .55s var(--ease);
}

.socials__name {
  font-size: clamp(26px, 5.4vw, 72px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  text-transform: uppercase;
}

.socials__arrow {
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.4vw, 30px);
  transition: transform .5s var(--ease);
}
@media (hover: hover) {
  .socials a:hover { color: var(--bg); padding-left: clamp(16px, 2.4vw, 36px); }
  .socials a:hover::before { transform: scaleY(1); }
  .socials a:hover .socials__arrow { transform: rotate(45deg); }
}
/* ---------- Contact (email, inside the Links section) ---------- */
.contact {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: clamp(80px, 13vw, 170px) 0 clamp(90px, 12vw, 160px);
}

.contact__mail {
  font-size: clamp(25px, 6.4vw, 78px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.035em;
  padding-bottom: .1em;
}

.copy-btn {
  position: relative;
  width: 52px; height: 52px;
  margin-top: clamp(22px, 3vw, 32px);
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color .25s, border-color .25s, transform .35s var(--ease);
}
.copy-btn svg {
  grid-area: 1 / 1;
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity .25s, transform .35s var(--ease);
}
.copy-btn .done-ico { opacity: 0; transform: scale(.6); }
.copy-btn:hover { color: var(--fg); border-color: var(--line-strong); }
.copy-btn:active { transform: scale(.94); }
.copy-btn.is-done { color: var(--fg); border-color: var(--fg); }
.copy-btn.is-done .copy-ico { opacity: 0; transform: scale(.6); }
.copy-btn.is-done .done-ico { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.footer {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: flex; justify-content: center;
  padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -10%; z-index: 100;
  width: 120%; height: 120%;
  will-change: transform;
  pointer-events: none;
  opacity: var(--grain-op);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -4%); }
  60%  { transform: translate(-4%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  :root { --header-h: 64px; }
  .emblem { width: 31px; height: 44px; }
  .lang__btn { padding: 0 10px 0 12px; }
  .lang__list { right: 0; }
  .hero { padding-bottom: 100px; }
  .btn-chrome { min-height: 52px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .grain { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Header logo: shows up once the hero seal is scrolled away ---------- */
.header__logo {
  opacity: 0;
  transform: translateY(-6px) scale(.9);
  pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.header.show-logo .header__logo { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Hero: the label seal ---------- */
.hero__seal {
  width: min(460px, 80vw, 58svh);
  animation: sealIn 1.8s .1s var(--ease) both;
}
@keyframes sealIn { from { opacity: 0; transform: scale(.92) rotate(-24deg); } }

/* ---------- Music: latest + 5 previous + library link ---------- */
.latest__cover .rel__new { left: 14px; top: 14px; transform: translateZ(30px); }

.recent {
  width: 100%;
  margin-top: clamp(64px, 8vw, 104px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
  text-align: left;
}
@media (max-width: 899px) {
  .recent,
  .artist-row {
    width: calc(100% + 2 * var(--gutter));
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 4px;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(44vw, 240px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .recent::-webkit-scrollbar,
  .artist-row::-webkit-scrollbar { display: none; }
  .recent .rel,
  .artist-row > li { scroll-snap-align: start; }
  .recent,
  .artist-row { cursor: grab; overscroll-behavior-x: contain; }
  .recent:not(.at-end),
  .artist-row:not(.at-end) {
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
    mask-image: linear-gradient(90deg, #000 82%, transparent);
  }
  .recent:not(.at-start):not(.at-end),
  .artist-row:not(.at-start):not(.at-end) {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 82%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 82%, transparent);
  }
  .recent.at-end:not(.at-start),
  .artist-row.at-end:not(.at-start) {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%);
    mask-image: linear-gradient(90deg, transparent, #000 12%);
  }
  .recent.is-dragging,
  .artist-row.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
  .recent.is-dragging a,
  .artist-row.is-dragging a { pointer-events: none; }
  .artist-row > li { flex: 0 0 min(36vw, 180px); }
  /* a scroll container clips overflow: leave room for the avatar ring and the name underline */
  .artist-row { padding-top: 48px; padding-bottom: 48px; margin-top: -48px; margin-bottom: -48px; }
}

.btn-line {
  margin-top: clamp(36px, 5vw, 56px);
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .25s, border-color .25s, gap .35s var(--ease);
}
.btn-line:hover { color: var(--fg); border-color: var(--line-strong); gap: 20px; }
:lang(zh) .btn-line { letter-spacing: .06em; }

/* ---------- All releases layer ---------- */
.library {
  position: fixed; inset: 0; z-index: 30;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.library[hidden] { display: none; }
.library.is-open { opacity: 1; transform: none; }
.library__inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: calc(var(--header-h) + clamp(24px, 4vw, 56px)) var(--gutter) calc(clamp(64px, 8vw, 120px) + env(safe-area-inset-bottom));
}
body.lib-open { overflow: hidden; }
body.lib-open .header__logo { opacity: 1; transform: none; pointer-events: auto; }
.library__head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 22px 16px;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.library__back {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 16px;
  transition: color .25s, border-color .25s, transform .35s var(--ease);
}
.library__back:hover { color: var(--fg); border-color: var(--line-strong); transform: translateX(-3px); }
.library__count { grid-row: 1; grid-column: 2; justify-self: end; color: var(--muted); }
.library__title {
  grid-row: 2;
  grid-column: 1 / -1;
  font-size: clamp(26px, 6.4vw, 80px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  text-transform: uppercase;
  padding-bottom: .06em;
}

/* ---------- Hero seal stacking ---------- */

.hero__seal { position: relative; z-index: 1; }
/* the spinning ring's bounding box grows when rotated: clip it to the (non-rotating) seal box */
.seal { overflow: clip; }

/* ---------- Artists ---------- */
.artists {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.artist-row {
  width: 100%;
  display: flex;
  gap: clamp(18px, 3vw, 44px);
}
.artist-row > li { flex: 0 0 clamp(120px, 15vw, 190px); }
/* centred while it fits, still scrollable from the very first card when it overflows */
.artist-row > li:first-child { margin-left: auto; }
.artist-row > li:last-child { margin-right: auto; }

.artist {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
}
.artist__avatar {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line);
}
.artist__avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(1) contrast(1.05) brightness(.92);
  transition: filter .7s var(--ease), transform .9s var(--ease);
}
.artist:hover .artist__avatar img { filter: none; transform: scale(1.04); }
.artist__name {
  position: relative;
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.artist__name::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.artist__name:hover::after { transform: scaleX(1); }

.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 16vw, 180px), 1fr));
  gap: clamp(28px, 3.4vw, 48px) clamp(16px, 2.4vw, 32px);
  justify-items: center;
}
.artist-grid .artist { width: 100%; max-width: 200px; }

/* ---------- Random-track button (header) ---------- */
.shuffle-btn { position: relative; }
.shuffle-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .5s var(--ease);
}
.shuffle-btn:hover svg { transform: rotate(-12deg) scale(1.08); }
.shuffle-btn.is-playing::after,
.shuffle-btn.is-playing::before {
  content: '';
  position: absolute; top: 9px; right: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.shuffle-btn.is-playing::before { background: rgba(227, 38, 43, .55); animation: pulse 2.2s infinite; }

/* ---------- Artist track count ---------- */
.artist { position: relative; }
.artist__count {
  position: absolute; top: 4%; right: 4%;
  min-width: 30px; height: 30px;
  padding: 0 8px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(7, 7, 7, .84);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--fg);
  font-size: 11px;
  letter-spacing: .04em;
}

/* ---------- Player ---------- */
.player {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 45;
  width: min(calc(100% - 2 * var(--gutter)), 940px);
  display: grid;
  grid-template-columns: auto minmax(0, 1.4fr) auto minmax(140px, 1.6fr) auto auto;
  grid-template-areas: "cover meta toggle prog vol close";
  align-items: center;
  gap: 16px;
  padding: 10px 10px 10px 10px;
  background: color-mix(in srgb, var(--bg-2) 84%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .75);
  opacity: 0;
  transform: translate(-50%, 24px);
  transition: opacity .4s var(--ease), transform .45s var(--ease);
}
.player[hidden] { display: none; }
.player.is-open { opacity: 1; transform: translate(-50%, 0); }
/* --player-h is the panel's real height (main.js), so long titles that wrap never cover the page end */
body.has-player { padding-bottom: calc(var(--player-h, 70px) + 50px + env(safe-area-inset-bottom)); }
body.has-player .library__inner { padding-bottom: calc(var(--player-h, 70px) + 80px + env(safe-area-inset-bottom)); }

.player__cover { grid-area: cover; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--bg); }
.player__meta { grid-area: meta; min-width: 0; }
/* long titles and long artist lists wrap onto new lines instead of being cut off */
.player__title {
  font-size: 14px; font-weight: 700; line-height: 1.25;
  overflow-wrap: anywhere;
}
.player__ver { display: inline-block; font-weight: 400; font-size: .86em; color: var(--muted); opacity: .6; }
.player__artists {
  margin-top: 4px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.45; letter-spacing: .05em;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.player__artist { display: inline-block; max-width: 100%; }
a.player__artist { color: var(--fg); transition: opacity .2s; }
a.player__artist:hover { text-decoration: underline; text-underline-offset: 3px; }

.player__btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: background-color .25s, color .25s, transform .25s var(--ease);
}
.player__btn svg { width: 18px; height: 18px; }
.player__toggle { grid-area: toggle; background: var(--fg); color: var(--bg); }
.player__toggle svg { fill: currentColor; }
.player__toggle:active { transform: scale(.94); }
.player__toggle .ico-play { display: none; }
.player.is-paused .player__toggle .ico-play { display: block; }
.player.is-paused .player__toggle .ico-pause { display: none; }
.player__close { grid-area: close; color: var(--muted); }
.player__close svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.player__close:hover { color: var(--fg); background: var(--line); }

.player__progress { grid-area: prog; display: flex; align-items: center; gap: 10px; min-width: 0; }
.player__time { min-width: 34px; font-size: 10px; letter-spacing: .04em; color: var(--muted); text-align: center; }
.player__volume { grid-area: vol; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.player__volume svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.player__vol { width: 92px; }

/* sliders: click anywhere to jump, drag the thumb to scrub */
.range {
  --p: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%; height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--fg) var(--p), var(--line-strong) var(--p));
}
.range::-moz-range-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--fg) var(--p), var(--line-strong) var(--p));
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; margin-top: -4.5px;
  border: 0; border-radius: 50%;
  background: var(--fg);
  transition: transform .2s var(--ease);
}
.range::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--fg); }
.range:hover::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { transform: scale(1.3); }
.range:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 900px) {
  .player {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "cover meta toggle close"
      "prog prog vol vol";
    gap: 8px 12px;
    padding: 10px;
    border-radius: 16px;
  }
  .player__vol { width: 64px; }
}

/* iPhone/iPad: no volume slider (main.js adds .no-volume), the device buttons set the volume; seek takes its place */
.player.no-volume {
  grid-template-columns: auto minmax(0, 1.4fr) auto minmax(140px, 1.6fr) auto;
  grid-template-areas: "cover meta toggle prog close";
}
.player.no-volume .player__volume { display: none; }
@media (max-width: 900px) {
  .player.no-volume {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "cover meta toggle close"
      "prog prog prog prog";
  }
}

/* ---------- Touch devices: keep scrolling smooth on weak GPUs ---------- */
@media (hover: none) {
  .grain { display: none; }
  .header.is-scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
  }
  .player {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: color-mix(in srgb, var(--bg-2) 97%, transparent);
  }
}
