/* P:X by mightymoose, shared design system.
   Every color below is verified against the deployed generator script
   (thecols / colnames arrays). Nothing here is an invented brand color:
   neutrals are pure Black, Ghost White, and Ghost Black, the same three
   the algorithm itself uses for background/foreground/surfaces. "Dim" and
   border tones are translucent Ghost White, never a separate gray. */

:root {
  --px-black: #000000;      /* the piece's background on curated editions */
  --px-ghost-black: #232b2b; /* named palette color; used here as the raised-surface tone */
  --px-ghost-white: #f8f8ff; /* the piece's foreground on curated editions */

  --px-orange: #fe7d05;
  --px-pink: #d71990;
  --px-blue: #0978ff;
  --px-green: #2eff53;
  --px-cyan: #00b8c8;
  --px-yellow: #ffdf00;
  --px-red: #ff0505;

  --px-bg: var(--px-black);
  --px-bg-raised: var(--px-ghost-black);
  --px-bg-card: var(--px-ghost-black);
  --px-text: var(--px-ghost-white);
  --px-border: rgba(248, 248, 255, 0.18);
  --px-text-dim: rgba(248, 248, 255, 0.62);

  --px-accent: var(--px-orange);
  --font-display: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --max-width: 1120px;
}

/* Each page claims one color from the piece's own palette as its identity.
   Color is a real trait axis in P:X, so the site's wayfinding uses it too. */
.theme-pink   { --px-accent: var(--px-pink); }
.theme-blue   { --px-accent: var(--px-blue); }
.theme-cyan   { --px-accent: var(--px-cyan); }
.theme-green  { --px-accent: var(--px-green); }
.theme-red    { --px-accent: var(--px-red); }
.theme-yellow { --px-accent: var(--px-yellow); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--px-bg);
  color: var(--px-text);
  font-family: var(--font-display);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--px-border);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .site-nav .wrap {
    height: auto;
    padding-top: 14px;
    padding-bottom: 10px;
  }
}

.px-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* The two dots echo the colon's two discs, always drawn Ghost White on a
   curated (dark) canvas, with one colored like a P-disc. */
.px-mark .dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--px-ghost-white);
  margin: 0 1px;
}

.px-mark .dot:nth-child(3) { background: var(--px-orange); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--px-text-dim);
  transition: color 0.15s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--px-text);
}

.nav-links a[aria-current="page"] {
  border-bottom: 2px solid var(--px-accent);
  padding-bottom: 22px;
}

@media (max-width: 760px) {
  .nav-links a[aria-current="page"] {
    padding-bottom: 4px;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 96px 0 72px;
  overflow: hidden;
  border-bottom: 1px solid var(--px-border);
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--px-accent);
  border: 1px solid var(--px-accent);
  padding: 4px 14px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
  max-width: 14ch;
}

.hero p.lede {
  font-size: 1.15rem;
  color: var(--px-text-dim);
  max-width: 56ch;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-figure {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 480px;
  height: 480px;
  opacity: 0.9;
  pointer-events: none;
}

@media (max-width: 900px) {
  .hero-figure { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--px-border);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

/* Every P:X edition pulses Contractive. Buttons echo that instead of lifting. */
.btn:hover { transform: scale(0.97); }
.btn:active { transform: scale(0.93); }

.btn-primary {
  background: var(--px-text);
  color: var(--px-bg);
  border-color: var(--px-text);
}

.btn-primary:hover { background: var(--px-accent); border-color: var(--px-accent); color: var(--px-black); }

.btn-ghost {
  background: transparent;
  color: var(--px-text);
}

.btn-ghost:hover { border-color: var(--px-text); }

.jump-input {
  background: var(--px-bg);
  border: 1px solid var(--px-border);
  color: var(--px-text);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  width: 120px;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.jump-input:focus-visible {
  outline: 2px solid var(--px-accent);
  outline-offset: 2px;
}

/* ---------- Stat strip ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--px-border);
  border: 1px solid var(--px-border);
  overflow: hidden;
  margin: 56px 0;
}

.stat-strip div {
  background: var(--px-bg-raised);
  padding: 22px 20px;
}

.stat-strip .num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--px-text);
  display: block;
}

.stat-strip .label {
  font-size: 0.8rem;
  color: var(--px-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Sections ---------- */

section.block {
  padding: 56px 0;
}

.block h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin: 0 0 16px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--px-accent);
  margin: 0 0 12px;
}

.block .intro {
  color: var(--px-text-dim);
  max-width: 68ch;
  font-size: 1.05rem;
}

/* ---------- Grid / cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.card {
  background: var(--px-bg-card);
  border: 1px solid var(--px-border);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.card:hover { border-color: var(--px-accent); }

.card img,
.card video {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  display: block;
  transition: transform 0.25s ease;
}

/* Contractive, like the piece's own pulse, rather than a generic hover lift. */
.card:hover img,
.card:hover video { transform: scale(0.94); }

.card .card-body { padding: 16px 18px; }

.card .card-title { font-weight: 600; margin-bottom: 4px; }

.card .card-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--px-text-dim);
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  border: 1px solid currentColor;
  margin-right: 6px;
}

/* ---------- Tables ---------- */

table.data {
  width: 100%;
  border-collapse: collapse;
  margin-top: 28px;
  font-size: 0.92rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--px-border);
}

table.data th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--px-text-dim);
}

table.data tr:hover td { background: var(--px-bg-raised); }

table.data td a { color: var(--px-accent); }

.color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  border: 1px solid var(--px-border);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--px-border);
  padding: 0 16px;
}

/* ---------- Swatches ---------- */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.swatch {
  border: 1px solid var(--px-border);
  overflow: hidden;
  background: var(--px-bg-card);
}

.swatch .chip { height: 64px; }

.swatch .info { padding: 10px 12px; }

.swatch .name { font-weight: 600; font-size: 0.9rem; }

.swatch .hex { font-family: var(--font-mono); font-size: 0.78rem; color: var(--px-text-dim); }

.swatch.rare { border-color: var(--px-accent); }

/* ---------- Composition diagram cards ---------- */

.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.comp-card {
  background: var(--px-bg-card);
  border: 1px solid var(--px-border);
  padding: 20px;
}

.comp-card.rare { border-color: var(--px-accent); }

.comp-card .comp-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--px-accent);
}

.comp-card .comp-rule {
  font-size: 0.88rem;
  color: var(--px-text-dim);
  margin-bottom: 10px;
}

.comp-card svg {
  width: 100%;
  height: 70px;
  display: block;
  margin-top: 6px;
}

/* Bars in the real generator are plain rect() calls: sharp corners, flat
   ends. No border-radius, no rounded stroke caps, anywhere in this diagram. */
.comp-card .stem { stroke: var(--px-ghost-white); stroke-width: 6; stroke-linecap: butt; }
.comp-card .stem.p { stroke: var(--px-accent); }

/* ---------- Motion demo (Speed trait is part of the artwork, not metadata) ---------- */

.speed-demo {
  display: flex;
  gap: 48px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 32px 0 12px;
  padding: 32px 20px;
  background: var(--px-bg-raised);
  border: 1px solid var(--px-border);
}

.speed-demo .unit { text-align: center; }

.speed-demo .dot {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--px-accent);
  margin: 0 auto 12px;
  animation-name: px-pulse-demo;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.speed-demo .label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--px-text-dim);
}

@keyframes px-pulse-demo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .speed-demo .dot, .pulse { animation: none; }
}

/* ---------- Footer ---------- */

footer.site-footer {
  padding: 48px 0 64px;
  color: var(--px-text-dim);
  font-size: 0.9rem;
}

footer.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

footer.site-footer a:hover { color: var(--px-text); }

footer .foot-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* ---------- Pulse motif ---------- */

@keyframes px-pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(0.92); opacity: 0.7; }
}

.pulse { animation: px-pulse 3.2s ease-in-out infinite; transform-origin: center; }
.pulse-delay-1 { animation-delay: 0.4s; }
.pulse-delay-2 { animation-delay: 0.8s; }

/* ---------- Misc ---------- */

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

.callout {
  background: var(--px-bg-card);
  border: 1px solid var(--px-border);
  border-left: 3px solid var(--px-accent);
  padding: 20px 24px;
  margin: 28px 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
}

.kicker-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.kicker-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.kicker-list .num {
  font-family: var(--font-mono);
  color: var(--px-accent);
  min-width: 2ch;
}

/* ---------- Shape divider ----------
   The recurring six-shape motif (three circles, three bars) used as a
   section break, instead of a plain rule. Bars are flat rectangles, exactly
   like the piece's own stems. No rounded corners. */

.shape-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  height: 28px;
}

.shape-divider .bar {
  width: 22px;
  height: 4px;
  background: var(--px-border);
}

.shape-divider .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--px-accent);
}
