:root {
  --paper: #f4efe4;
  --ink: #17181a;
  --muted: #5b5852;
  --faint: #8a8478;
  --line: rgba(23, 24, 26, 0.12);
  --blue: #4285f4;
  --red: #ea4335;
  --yellow: #fbbc05;
  --green: #34a853;
  --card: #fffdf7;
  --bench: #14161c;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --display: "Fraunces", "Noto Sans SC", serif;
  --shadow: 0 18px 40px rgba(23, 24, 26, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--sans);
  background: var(--paper);
  line-height: 1.5;
}

.desk {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(66, 133, 244, 0.12), transparent 55%),
    radial-gradient(700px 360px at 100% 0%, rgba(251, 188, 5, 0.14), transparent 50%),
    linear-gradient(180deg, #f7f2e8, #eee6d4 70%, #e7dfcb);
}
.paper-grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(23, 24, 26, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 24, 26, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 78%);
}
.tape {
  position: absolute;
  width: 92px;
  height: 22px;
  background: rgba(251, 188, 5, 0.35);
  transform: rotate(-8deg);
}
.tape-a { top: 1.4rem; left: 12%; }
.tape-b { top: 2.1rem; right: 16%; transform: rotate(7deg); background: rgba(66, 133, 244, 0.22); }

.nav, main, .foot { position: relative; z-index: 1; }

.nav {
  position: sticky;
  top: 0.7rem;
  z-index: 5;
  width: min(1120px, calc(100% - 1.6rem));
  margin: 0.8rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0.8rem;
  background: rgba(255, 253, 247, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(14px);
}
.hub, .source {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}
.source { color: var(--blue); }
.brand {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.dots { display: inline-flex; gap: 4px; }
.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dots i:nth-child(1) { background: var(--blue); }
.dots i:nth-child(2) { background: var(--red); }
.dots i:nth-child(3) { background: var(--yellow); }
.dots i:nth-child(4) { background: var(--green); }

main {
  width: min(1120px, calc(100% - 1.6rem));
  margin: 0 auto 3rem;
}

.hero { padding: 2.4rem 0 1.2rem; }
.kicker {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}
h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.lede {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.02rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.1rem 0 1.3rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 700 0.88rem/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
}
.btn.primary {
  background: var(--ink);
  color: #fffdf7;
}
.btn.primary:hover { background: #2b2d32; }
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.bench .btn.primary {
  background: #eef1ff;
  color: var(--bench);
}
.bench .btn.primary:hover { background: #fffdf7; }
.bench .btn.ghost {
  border-color: rgba(142, 176, 255, 0.32);
  color: #eef1ff;
}
.quote {
  margin: 0;
  max-width: 40rem;
  padding: 1rem 1.1rem;
  background: var(--card);
  border-left: 4px solid var(--yellow);
  box-shadow: var(--shadow);
}
.quote p { margin: 0 0 0.4rem; }
.quote cite { color: var(--faint); font-style: normal; font-size: 0.8rem; }

.kit-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 0.4rem 0 0.9rem;
}
.kit-head h2, .note h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
}
.kit-head p { margin: 0; color: var(--muted); font-size: 0.88rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.card {
  position: relative;
  margin: 0;
  padding: 1rem 0.95rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px 6px 8px 8px;
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  transform: rotate(var(--tilt, -1.2deg));
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.card:nth-child(2) { --tilt: 1.4deg; }
.card:nth-child(3) { --tilt: -0.6deg; }
.card:nth-child(4) { --tilt: 1.8deg; }
.card:nth-child(5) { --tilt: -1.5deg; }
.card:nth-child(6) { --tilt: 0.8deg; }
.card:nth-child(7) { --tilt: -2deg; }
.card:hover, .card.is-on {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 22px 46px rgba(23, 24, 26, 0.16);
}
.card.is-on { outline: 2px solid var(--pin); }
.pin {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pin);
  transform: translateX(-50%);
  box-shadow: 0 4px 0 rgba(23, 24, 26, 0.16);
}
.idx {
  margin: 0;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.card h3 {
  margin: 0.35rem 0 0.3rem;
  font-size: 1rem;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.star {
  display: inline-block;
  margin-left: 0.2rem;
  color: var(--red);
  font-size: 0.78rem;
}

.bench {
  margin-top: 1.8rem;
  padding: 1rem;
  background: var(--bench);
  color: #eef1ff;
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(23, 24, 26, 0.22);
}
.bench-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
  color: #9aa3c7;
  font-size: 0.78rem;
}
.bench-bar b { color: var(--yellow); font-variant-numeric: tabular-nums; }
.path code {
  font-size: 0.75rem;
  color: #c9d2f0;
}
.stage { display: grid; gap: 0.85rem; }
.panel {
  padding: 1rem;
  border: 1px solid rgba(142, 176, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.55;
  filter: saturate(0.6);
  transition: opacity 180ms ease, filter 180ms ease, border-color 180ms ease;
}
.panel.is-hot {
  opacity: 1;
  filter: none;
  border-color: rgba(251, 188, 5, 0.45);
}
.panel header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}
.badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: 0.08em;
}
.panel h3 { margin: 0; font-size: 1.05rem; }
.hint, .node-copy, .slide-count { color: #b7bfd8; font-size: 0.82rem; }

.pipe, .plugins, .sources, .picks, .reverse-actions, .prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.7rem 0;
}
.chip, .plug, .src, .pick {
  border: 1px solid rgba(142, 176, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #eef1ff;
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  font: 600 0.8rem/1 var(--sans);
  cursor: pointer;
}
.chip.is-on, .plug.is-on, .src.is-on, .pick.is-on {
  background: #eef1ff;
  color: var(--bench);
}
.arrow { color: #7f89ab; align-self: center; }
.prompt-label {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: #9aa3c7;
}
.prompt-row { align-items: center; }
.prompt-row input {
  flex: 1 1 16rem;
  min-height: 2.4rem;
  padding: 0 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(142, 176, 255, 0.22);
  background: #0f1218;
  color: #eef1ff;
  font: 500 0.88rem/1.3 var(--sans);
}

.polaroids {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  min-height: 8.5rem;
}
.polaroid {
  padding: 0.4rem 0.4rem 1.2rem;
  background: #fffdf7;
  color: var(--ink);
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transform: rotate(var(--spin, -2deg));
}
.polaroid canvas {
  display: block;
  width: 100%;
  height: 92px;
  border-radius: 2px;
}
.polaroid figcaption {
  margin: 0.35rem 0.1rem 0;
  font-size: 0.72rem;
  font-weight: 700;
}
.polaroid.is-wait {
  min-height: 8.2rem;
  background: repeating-linear-gradient(135deg, #2a3144, #2a3144 8px, #232938 8px, #232938 16px);
}

.deck {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: stretch;
  margin-top: 0.6rem;
}
.deck[hidden], .film[hidden], .slide-count[hidden] { display: none; }
.slide {
  min-height: 11.5rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, #f7f3ea, #efe6cf);
  color: var(--ink);
  border-radius: 12px;
}
.slide h4 { margin: 0 0 0.4rem; font-family: var(--display); font-size: 1.3rem; }
.slide p { margin: 0; color: #4b4638; }
.nav-btn {
  width: 2.2rem;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef1ff;
  font-size: 1.4rem;
  cursor: pointer;
}

.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}
.shot {
  padding: 0.45rem;
  background: #0f1218;
  border: 1px solid rgba(142, 176, 255, 0.16);
  border-radius: 10px;
}
.shot canvas { width: 100%; height: 72px; display: block; border-radius: 6px; }
.shot b { display: block; margin-top: 0.3rem; font-size: 0.72rem; }
.shot span { color: #9aa3c7; font-size: 0.7rem; }

.film {
  margin-top: 0.8rem;
  padding: 0.7rem;
  border-radius: 14px;
  background: #07080c;
}
.film-frame {
  height: 160px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 20% 30%, rgba(251, 188, 5, 0.5), transparent 36%),
    radial-gradient(circle at 80% 70%, rgba(66, 133, 244, 0.45), transparent 40%),
    linear-gradient(160deg, #1d2433, #10141c);
  animation: reel 4.8s ease-in-out infinite;
}
.film-cap { margin: 0.45rem 0 0; color: #d7d3c4; font-size: 0.82rem; }

.note {
  margin-top: 1.6rem;
  padding: 1.1rem 1.15rem;
  background: rgba(255, 253, 247, 0.7);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.note ul { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--muted); }

.foot {
  width: min(1120px, calc(100% - 1.6rem));
  margin: 0 auto 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.foot a { color: var(--blue); text-decoration: none; }

@keyframes reel {
  0% { filter: hue-rotate(0deg) saturate(1); }
  50% { filter: hue-rotate(28deg) saturate(1.2); }
  100% { filter: hue-rotate(0deg) saturate(1); }
}

@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .polaroids, .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nav { top: 0; border-radius: 0; width: 100%; }
  .cards, .polaroids, .board { grid-template-columns: 1fr; }
  .brand { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .panel, .film-frame { transition: none; animation: none; }
}
