/* =========================================================
   STEINS HUB — Paper Industrial Editorial (v2)
   Warm paper · ink black · one process yellow
   ========================================================= */

:root {
  --paper: #FEFEFE;
  --paper-2: #F6F6F5;
  --paper-3: #FCFBF9;
  --stone: #ECE6D3;
  --stone-2: #D5CBB0;
  --ink: #1A1A1A;
  --ink-soft: #3A3A3A;
  --mute: #7A7A76;
  --line: #D8D9D5;
  --line-2: #B6B8B3;
  --yellow: #FCF800;
  --yellow-deep: #E8E000;
  --night: #13131A;
  --night-2: #1C1C24;

  --rail: 80px;
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
  --measure: 38rem;

  --font-display: "Bebas Neue", "Inter", "Noto Sans SC", sans-serif;
  --font-ui: "Inter", "Noto Sans SC", system-ui, sans-serif;
  --font-cn: "Noto Sans SC", "Inter", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul, dl, p, h1, h2, h3 {
  margin: 0;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--yellow);
  color: var(--ink);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: var(--rail);
}

/* ---------- Left rail ---------- */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.rail-mark {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--ink);
  color: var(--paper);
  flex-shrink: 0;
}
.rail-mark-cn {
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--yellow);
}
.rail-mark-en {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
}

.rail-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0;
  width: 100%;
}

.rail-item {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.rail-item svg {
  width: 20px;
  height: 20px;
}
.rail-item:hover,
.rail-item.is-active {
  background: var(--paper-2);
  color: var(--ink);
}
.rail-item.is-active {
  outline: 1px solid var(--ink);
  outline-offset: -1px;
}
.rail-tip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0.35rem 0.55rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.rail-item:hover .rail-tip,
.rail-item:focus-visible .rail-tip {
  opacity: 1;
}

.rail-foot {
  width: 100%;
  padding: 0.75rem;
}
.rail-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  width: 100%;
  aspect-ratio: 1;
  background: var(--ink);
  color: var(--paper);
  transition: background 0.15s ease, color 0.15s ease;
}
.rail-cta:hover {
  background: var(--yellow);
  color: var(--ink);
}
.rail-cta-en {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}
.rail-cta-cn {
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 0.8rem;
}

/* ---------- Page shell ---------- */
.page {
  margin-left: var(--rail);
  min-height: 100vh;
  background:
    radial-gradient(circle at 1px 1px, rgba(26, 26, 26, 0.045) 1px, transparent 0) 0 0 / 18px 18px,
    var(--paper);
}

/* ---------- Eyebrows / type helpers ---------- */
.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-ui);
}
.eyebrow-en {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}
.eyebrow-cn {
  font-family: var(--font-cn);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--mute);
}
.eyebrow .arrow {
  color: var(--ink);
  font-size: 0.75rem;
}

.section {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) var(--gutter);
}

.section-head {
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  max-width: 60rem;
}

.section-title {
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  letter-spacing: 0.02em;
  line-height: 1.15;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) clamp(3rem, 6vw, 4.5rem);
  overflow: hidden;
}

.hero-paper {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 47px,
      rgba(186, 175, 146, 0.12) 47px,
      rgba(186, 175, 146, 0.12) 48px
    ),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(236, 230, 211, 0.55), transparent 70%),
    var(--paper-3);
  z-index: 0;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: end;
  min-height: calc(100vh - 6rem);
}

.hero-dossier {
  max-width: 32rem;
  padding-bottom: 1rem;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.25rem 0 1rem;
}
.hero-title-cn {
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: clamp(2.4rem, 5.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
}
.hero-title-en {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 9vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero-rule {
  width: 4.5rem;
  height: 6px;
  background: var(--yellow);
  margin: 0 0 1.25rem;
}

.hero-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  font-weight: 500;
  line-height: 1.7;
  max-width: var(--measure);
  margin-bottom: 0.65rem;
}
.hero-sub {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--mute);
  max-width: 28rem;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.35rem;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-yellow {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow);
}
.btn-yellow:hover {
  background: var(--yellow-deep);
  border-color: var(--yellow-deep);
}
.btn-ink {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ink:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn-arrow {
  font-family: var(--font-ui);
  font-weight: 700;
}

.spec-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  max-width: 22rem;
}
.spec-sheet dt {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--mute);
  margin-bottom: 0.15rem;
}
.spec-sheet dd {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-poster {
  position: relative;
  margin: 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  align-self: stretch;
  min-height: 420px;
  overflow: hidden;
}
.hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.poster-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.9rem;
  background: rgba(254, 254, 254, 0.92);
  border-top: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.poster-idx { color: var(--mute); }
.poster-label { color: var(--ink); }

/* ---------- ABOUT ---------- */
.about {
  background: var(--paper);
  overflow: hidden;
}

.giant-mark {
  position: absolute;
  top: 1.25rem;
  left: var(--gutter);
  right: var(--gutter);
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 14vw, 10rem);
  line-height: 0.85;
  letter-spacing: 0.01em;
  color: rgba(26, 26, 26, 0.07);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}

.about-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin-top: clamp(2rem, 6vw, 4rem);
}

.about-col {
  max-width: 36rem;
}
.about-lead {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 1.1rem;
}
.about-col p + p {
  margin-top: 0.85rem;
  color: var(--ink-soft);
}
.about-en {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--mute) !important;
}

.about-panel {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  border: 1px solid var(--line);
  background: var(--paper-2);
  min-height: 220px;
}
.about-panel-bar {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}
.dossier-list {
  list-style: none;
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.dossier-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.dossier-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.dl-k {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--mute);
}
.dl-v {
  font-weight: 600;
  font-size: 0.98rem;
}

/* ---------- MATERIALS masthead + cards ---------- */
.materials {
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  background: var(--paper-2);
}

.masthead {
  background: var(--yellow);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.75rem, 4vw, 2.75rem) var(--gutter);
}
.masthead-brand {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  margin-bottom: 0.35rem;
}
.masthead-title {
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: 0.04em;
}
.masthead-sub {
  margin-top: 0.45rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}
.masthead-deco {
  width: min(220px, 28vw);
  flex-shrink: 0;
  opacity: 0.9;
}

.mat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.mat-tab {
  padding: 0.95rem 1.35rem;
  font-family: var(--font-cn);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--mute);
  border-right: 1px solid var(--line);
  transition: background 0.15s ease, color 0.15s ease;
}
.mat-tab:first-child {
  border-left: 1px solid var(--line);
}
.mat-tab.is-active,
.mat-tab:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.mat-tab.is-active {
  box-shadow: inset 0 -2px 0 var(--ink);
}

.mat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  padding: clamp(1.75rem, 4vw, 2.75rem) var(--gutter);
  background:
    radial-gradient(circle at 1px 1px, rgba(26, 26, 26, 0.04) 1px, transparent 0) 0 0 / 16px 16px,
    var(--paper);
}

.mat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mat-card:hover {
  border-color: var(--ink);
}
.mat-frame {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.mat-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.mat-rule {
  height: 3px;
  background: linear-gradient(90deg, var(--yellow) 0 40%, var(--ink) 40% 55%, var(--line-2) 55% 100%);
}
.mat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
}
.mat-names h3 {
  font-family: var(--font-cn);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.2;
}
.mat-names p {
  margin-top: 0.15rem;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--mute);
}
.mat-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.chip-sq {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.75rem;
}
.chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--chip, var(--yellow));
  border: 1px solid var(--ink);
}

.mat-foot {
  padding: 0  var(--gutter) clamp(2.5rem, 5vw, 3.5rem);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--mute);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  background: var(--paper);
}
.mat-foot-idx {
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ink);
}

/* ---------- LINKS ---------- */
.links {
  background: var(--paper);
}

.links-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.links-lead .about-lead {
  margin-bottom: 0.65rem;
}

.link-list {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}
.link-row {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 0.25rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.link-row:hover {
  background: var(--yellow);
}
.link-code {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--mute);
}
.link-row:hover .link-code {
  color: var(--ink);
}
.link-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.link-en {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
}
.link-cn {
  font-size: 0.95rem;
  font-weight: 500;
}
.link-go {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.1rem;
}

/* ---------- Night instrument (sparse) ---------- */
.instrument {
  background: var(--night);
  color: #E8E8E4;
  padding: 1rem var(--gutter);
}
.instrument-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  max-width: 72rem;
}
.inst-label {
  background: var(--yellow);
  color: var(--ink);
  padding: 0.2rem 0.45rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.inst-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c04040;
  flex-shrink: 0;
}
.inst-text {
  flex: 1;
  color: #A8A8A4;
}
.inst-idx {
  color: #6A6A68;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: 1.5rem var(--gutter);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.footer-en {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.footer-cn {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--mute);
}
.footer-meta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--mute);
}
.footer-top {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--ink);
}
.footer-top:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 0;
  }
  .hero-poster {
    min-height: 360px;
    max-height: 520px;
    order: -1;
  }
  .about-body,
  .links-layout {
    grid-template-columns: 1fr;
  }
  .mat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .masthead-deco {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --rail: 0px;
  }

  .rail {
    position: sticky;
    top: 0;
    inset: auto;
    width: 100%;
    height: 56px;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail-mark {
    width: 56px;
    height: 56px;
    aspect-ratio: auto;
  }
  .rail-mark-cn { font-size: 1.1rem; }
  .rail-nav {
    flex-direction: row;
    flex: 1;
    padding: 0 0.35rem;
    gap: 0.15rem;
    justify-content: flex-start;
    overflow-x: auto;
  }
  .rail-item {
    width: 44px;
    height: 44px;
  }
  .rail-tip { display: none; }
  .rail-foot {
    width: auto;
    padding: 0.35rem;
  }
  .rail-cta {
    width: 56px;
    height: 44px;
    aspect-ratio: auto;
    flex-direction: row;
    gap: 0.35rem;
    padding: 0 0.5rem;
  }
  .rail-cta-cn { display: none; }

  .page {
    margin-left: 0;
  }

  .hero {
    min-height: 0;
    padding-top: 1.5rem;
  }

  .mat-grid {
    grid-template-columns: 1fr;
  }

  .giant-mark {
    font-size: clamp(3.5rem, 18vw, 5.5rem);
  }

  .instrument-inner {
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .spec-sheet {
    grid-template-columns: 1fr;
  }
  .link-row {
    grid-template-columns: 2.25rem 1fr auto;
    gap: 0.65rem;
  }
}
