/* 品味小宇宙 · 夜场 / Night Gallery — shared base (home + item pages) */
:root {
  color-scheme: dark;
  --ink-0: #0d0c0b;
  --ink-1: #141311;
  --ink-2: #1b1917;
  --ink-3: #24211e;
  --paper: #f3eee3;
  --paper-2: #b9b1a2;
  --paper-3: #857d70;
  --paper-4: #5c564d;
  --line: rgba(243, 238, 227, .10);
  --line-strong: rgba(243, 238, 227, .18);
  --seal: #e5532d;
  --seal-deep: #b54825;
  --seal-soft: rgba(229, 83, 45, .14);
  --brass: #d8ba8c;
  --brass-dim: rgba(216, 186, 140, .32);
  --brass-faint: rgba(216, 186, 140, .14);
  --label-paper: #efe9dc;
  --label-ink: #181613;
  --label-muted: #665e53;
  --label-line: #d2c8b3;
  --c-physics: #ffb454;
  --c-astronomy: #9db7ff;
  --c-chemistry: #7fe0b0;
  --c-biology: #ff8a7a;
  --c-engineering: #c9a7ff;
  --c-art: #f2b8d6;
  --c-game: #ffd56a;
  --c-docs: #b9b1a2;
  --headline: "Pinwei Headline", "Pinwei Display", "Noto Serif SC", "Songti SC", serif;
  --display: "Pinwei Display", "Pinwei Headline", "Noto Serif SC", "Songti SC", serif;
  --serif: "Pinwei Serif", "Noto Serif SC", "Songti SC", Georgia, serif;
  --latin: "Pinwei Latin", "Cormorant Garamond", Georgia, serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 20px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
  --tone: #d8ba8c;
  --disc: #d8ba8c;
}

[data-disc="physics"] { --disc: var(--c-physics); }
[data-disc="astronomy"] { --disc: var(--c-astronomy); }
[data-disc="chemistry"] { --disc: var(--c-chemistry); }
[data-disc="biology"] { --disc: var(--c-biology); }
[data-disc="engineering"] { --disc: var(--c-engineering); }
[data-disc="art"] { --disc: var(--c-art); }
[data-disc="game"] { --disc: var(--c-game); }
[data-disc="docs"] { --disc: var(--c-docs); }

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink-0);
  color: var(--paper);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
  background: var(--ink-0);
  color: var(--paper);
  font: 15px/1.75 var(--serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
::selection { background: var(--seal); color: #fff7ef; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* starfield: barely there */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 18px 32px, rgba(243, 238, 227, .5), transparent 100%),
    radial-gradient(1.5px 1.5px at 121px 87px, rgba(216, 186, 140, .45), transparent 100%),
    radial-gradient(1px 1px at 190px 171px, rgba(243, 238, 227, .5), transparent 100%),
    radial-gradient(1px 1px at 64px 208px, rgba(216, 186, 140, .45), transparent 100%),
    radial-gradient(1.5px 1.5px at 48px 61px, rgba(243, 238, 227, .5), transparent 100%),
    radial-gradient(1px 1px at 203px 148px, rgba(216, 186, 140, .45), transparent 100%),
    radial-gradient(1px 1px at 112px 252px, rgba(243, 238, 227, .5), transparent 100%),
    radial-gradient(1px 1px at 281px 40px, rgba(243, 238, 227, .5), transparent 100%),
    radial-gradient(1.5px 1.5px at 347px 214px, rgba(216, 186, 140, .45), transparent 100%),
    radial-gradient(1px 1px at 150px 336px, rgba(243, 238, 227, .5), transparent 100%),
    radial-gradient(1px 1px at 393px 95px, rgba(216, 186, 140, .45), transparent 100%),
    radial-gradient(1px 1px at 227px 380px, rgba(243, 238, 227, .5), transparent 100%),
    radial-gradient(120% 55% at 50% -8%, rgba(216, 186, 140, .10), transparent 62%);
  background-size:
    233px 233px, 233px 233px, 233px 233px, 233px 233px,
    311px 311px, 311px 311px, 311px 311px, 311px 311px,
    419px 419px, 419px 419px, 419px 419px, 419px 419px,
    100% 100%;
  background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, no-repeat;
}

/* the page sits above the sky */
:where(.sky ~ header, .sky ~ main, .sky ~ footer) { position: relative; z-index: 1; }
[hidden] { display: none !important; }
.spark { color: var(--seal); font-family: var(--serif); font-style: normal; }

/* eyebrow */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font: 500 11px/1.4 var(--latin);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brass);
}
.eyebrow i { font-style: normal; color: var(--paper-4); }
.eyebrow .cjk {
  font: 400 13px/1.4 var(--display);
  letter-spacing: .14em;
  text-transform: none;
}

.disc-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--disc);
  box-shadow: 0 0 8px -1px var(--disc);
}

/* brand lockup */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 400 21px/1 var(--display);
  letter-spacing: .1em;
  color: var(--paper);
  white-space: nowrap;
}
.brand b { font-weight: 400; color: var(--brass); }
.brand-mark { width: 22px; height: 22px; flex: none; overflow: visible; }
.brand-mark ellipse { fill: none; stroke: var(--paper); stroke-opacity: .7; stroke-width: 1.35; }
.brand-mark .bm-core { fill: var(--seal); }
.brand-mark .bm-planet { fill: var(--paper); }

/* buttons */
.button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font: 600 14px/1 var(--sans);
  letter-spacing: .02em;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  transition: background .28s var(--ease), color .28s var(--ease), border-color .28s var(--ease), transform .28s var(--ease), box-shadow .28s var(--ease);
}
.button:active, .btn:active { transform: scale(.96); }
.button-accent {
  background: var(--seal);
  border-color: var(--seal);
  color: #fff7ef;
  box-shadow: 0 14px 30px -12px rgba(229, 83, 45, .7);
}
.btn-solid { background: var(--paper); border-color: var(--paper); color: var(--ink-0); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--paper); }
@media (hover: hover) {
  .button:hover, .btn-ghost:hover { border-color: var(--brass); background: var(--brass-faint); }
  .button-accent:hover { background: #f06034; border-color: #f06034; }
  .btn-solid:hover { background: #fff; }
}

.tier-badge {
  display: inline-block;
  background: var(--seal);
  color: #fff7ef;
  font: 700 10.5px/1.5 var(--sans);
  letter-spacing: .06em;
  padding: 1px 6px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}

/* footer */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 72px;
  padding-top: 40px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: grid;
  gap: 28px;
}
.footer-open { display: grid; gap: 10px; }
.footer-line { font: 800 22px/1.3 var(--headline); color: var(--paper); letter-spacing: .02em; }
.site-index h2 {
  font: 400 15px/1.4 var(--display);
  letter-spacing: .16em;
  color: var(--brass);
  margin-bottom: 14px;
}
.site-index ul { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.site-index a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 400 12.5px/1 var(--sans);
  color: var(--paper-2);
  transition: border-color .28s var(--ease), color .28s var(--ease), transform .28s var(--ease);
}
.site-index a span { font: italic 500 13px/1 var(--latin); color: var(--paper-3); }
.site-index a:active { transform: scale(.96); }
@media (hover: hover) { .site-index a:hover { border-color: var(--brass-dim); color: var(--paper); } }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font: 400 12px/1.6 var(--sans);
  color: var(--paper-3);
}

@media (min-width: 1024px) {
  .footer-line { font-size: 30px; }
  .site-footer { margin-top: 96px; padding-top: 56px; }
}
@media (max-width: 760px) {
  body.home .site-footer { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* view transitions */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .26s; }
::view-transition-group(vt-poster) { animation-duration: .42s; animation-timing-function: var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
