/* stanley-mcp-playground · cookbook site
   Follows the halftone design system (design-template, docs/halftone.md):
   one typeface, purple on white, tint fills instead of borders, no rules,
   no hover scaling, sentence case. One declared deviation: literal code
   keeps a monospace stack, because this site ships real commands. */

:root {
  --accent: #6355ff;
  --strike: #5200ff;
  --deep: #3b2baa;
  --purple-light: #9d96ff;
  --tint: #eef0ff;
  --black: #000000;
  --navy: #142658;
  --white: #ffffff;
  --grey-1: #f0f4ff;
  --grey-2: #dae0ea;
  --grey-3: #808eb6;
  --sans: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace; /* code literals only */
  --px: 24px;   /* shell gutter */
  --band: 72px; /* section rhythm */
}
@media (min-width: 768px) {
  :root { --px: 40px; --band: 112px; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.65;
  overflow-x: clip;
}

::selection { background: var(--strike); color: var(--white); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--strike); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.shell { max-width: 80rem; margin: 0 auto; padding-left: var(--px); padding-right: var(--px); }

/* the eyebrow label, straight from the spec */
.kicker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-3);
}

/* ---------- header ---------- */

.top { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 1.08rem; letter-spacing: -0.02em;
  color: var(--black); text-decoration: none;
}
.wordmark img { height: 30px; width: auto; }
.wordmark .brand { font-weight: 800; }
.wordmark .sep { color: var(--grey-2); font-weight: 500; }
.wordmark .product { font-weight: 600; color: var(--navy); }
.top nav { display: flex; gap: 6px; align-items: center; }
.top nav a {
  color: var(--black); text-decoration: none; font-size: 0.95rem; font-weight: 600;
  padding: 10px 14px; border-radius: 999px; min-height: 44px;
  display: inline-flex; align-items: center;
}
.top nav a:hover { color: var(--strike); background: var(--tint); }
.top .gh { background: var(--accent); color: var(--white); padding: 10px 22px; margin-left: 6px; }
.top .gh:hover { background: var(--strike); color: var(--white); }

/* ---------- hero ---------- */

.hero {
  padding-top: 56px; padding-bottom: 64px;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 72px; align-items: center;
}
.hero h1 {
  font-weight: 800; font-size: clamp(2.6rem, 6.3vw, 4.9rem);
  line-height: 1.04; letter-spacing: -0.04em; margin-bottom: 30px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede {
  color: var(--navy); font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.6; max-width: 46ch; margin-bottom: 32px;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; font-weight: 600; text-decoration: none;
  border-radius: 999px; padding: 0 24px; min-height: 48px; font-size: 1rem;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--strike); color: var(--white); }
.btn-ghost { border: 1px solid var(--grey-2); color: var(--black); }
.btn-ghost:hover { background: var(--tint); color: var(--black); }

.clone {
  display: flex; align-items: center; gap: 12px;
  margin-top: 28px; background: var(--tint); border-radius: 999px;
  padding: 8px 8px 8px 20px; max-width: 560px;
}
.clone code {
  font-family: var(--mono); font-size: 0.82rem; color: var(--deep);
  flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.copy-btn {
  border: 0; background: var(--white); border-radius: 999px;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  padding: 8px 16px; cursor: pointer; color: var(--navy); flex-shrink: 0;
}
.copy-btn:hover { color: var(--strike); }
@media (pointer: coarse) {
  .copy-btn { min-height: 44px; }
}

/* the turntable prop: a phone spinning through the dither, per the spec's
   dither-prop recipe. One pixel per cell, scaled up crisp. */
.prop { position: relative; aspect-ratio: 0.92; max-width: 440px; margin: 0 auto; width: 100%; }
.prop canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated;
}

/* ---------- motion, per the spec: data-rv reveals + stagger + --p ----------
   JS adds .in and writes --i / --p; this block owns every look. The noscript
   mirror in each page head reveals all of it, and reduced motion below hands
   every element its finished values. */

[data-rv]:not(.stagger) { opacity: 0; translate: 0 14px; }
[data-rv]:not(.stagger).in {
  opacity: 1; translate: 0 0;
  transition: opacity 620ms cubic-bezier(0.22, 1, 0.36, 1), translate 620ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0ms);
}
.stagger > * { opacity: 0; translate: 0 14px; }
.stagger.in > * {
  animation: rv-rise 620ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--d, 0ms) + var(--i, 0) * 70ms);
}
@keyframes rv-rise { to { opacity: 1; translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-rv]:not(.stagger), .stagger > * { opacity: 1; translate: 0 0; animation: none; transition: none; }
  [data-progress] { --p: 1; }
}

/* ---------- stats ---------- */

.stats { padding-bottom: var(--band); display: flex; gap: clamp(40px, 7vw, 96px); flex-wrap: wrap; }
.stat .n {
  display: block; font-weight: 800; font-variant-numeric: tabular-nums;
  font-size: clamp(3.2rem, 6vw, 5.5rem); line-height: 0.9; letter-spacing: -0.05em;
}
.stat .l { margin-top: 10px; }

/* ---------- shared section furniture ---------- */

h2.section {
  font-weight: 700; font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  line-height: 1.05; letter-spacing: -0.04em; margin-top: 14px;
}
p.note { color: var(--navy); max-width: 58ch; margin-top: 16px; font-size: 1.02rem; }

/* ---------- how it works ---------- */

.how { background: var(--grey-1); }
.how-inner { padding-top: var(--band); padding-bottom: var(--band); }
.flow { position: relative; display: flex; align-items: stretch; gap: 20px; margin-top: 44px; }
.flow .node { position: relative; z-index: 1; flex: 1 1 180px; background: var(--white); border-radius: 12px; padding: 24px; }
.flow .node .kicker { color: var(--accent); margin-bottom: 10px; }
.flow .node strong { font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em; display: block; margin-bottom: 8px; }
.flow .node p { font-size: 0.92rem; color: var(--navy); line-height: 1.55; }

/* a plain rail behind the pipeline; the nodes sit on it */
.rail { position: absolute; left: 0; right: 0; top: 50%; height: 2px; width: 100%; z-index: 0; overflow: visible; }
.rail path { fill: none; stroke: var(--grey-2); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* ---------- setup terminal ---------- */

.setup { padding-top: var(--band); }
.term {
  background: var(--navy); border-radius: 16px; padding: 26px 30px;
  margin-top: 44px; max-width: 860px;
}
.term-bar {
  display: block; margin-bottom: 16px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--purple-light);
}
.term pre {
  margin: 0; font-family: var(--mono); font-size: 0.84rem; line-height: 1.8;
  color: #aab0cc; white-space: pre-wrap; word-break: break-word;
}
.tc-cmd { color: var(--white); }
.tc-dim { color: var(--grey-3); }
.tc-you { color: var(--purple-light); font-weight: 500; }
.tc-tool { color: var(--purple-light); }
.tc-name { color: var(--white); font-weight: 500; }

/* ---------- recipes grid ---------- */

.recipes { padding-top: var(--band); padding-bottom: var(--band); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 44px; }
.card {
  background: var(--tint); border-radius: 12px; padding: 26px;
  text-decoration: none; color: var(--black); display: flex; flex-direction: column; gap: 8px;
}
.card:hover { background: var(--grey-1); color: var(--black); }
.card .num {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); margin-bottom: 6px;
}
.card h3 { font-weight: 700; font-size: 1.18rem; letter-spacing: -0.02em; line-height: 1.2; }
.card:hover h3 { color: var(--strike); }
.card p { font-size: 0.92rem; color: var(--grey-3); line-height: 1.5; }

/* ---------- skills ---------- */

.skills { background: var(--grey-1); }
.skills-inner { padding-top: var(--band); padding-bottom: var(--band); }
.skill-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 44px; }
.skill { background: var(--white); border-radius: 12px; padding: 22px 24px; }
.skill code {
  font-family: var(--mono); font-size: 0.95rem; font-weight: 500;
  color: var(--accent); background: none; padding: 0;
}
.skill p { margin-top: 6px; font-size: 0.95rem; color: var(--navy); }

/* ---------- footer: white ground, accent wordmark, circuit band ---------- */

footer {
  position: relative; background: var(--white); overflow: clip;
  padding-bottom: clamp(140px, 18vh, 230px);
}
.foot {
  position: relative; z-index: 1;
  padding-top: 80px; padding-bottom: 48px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.9rem; color: var(--grey-3);
}
.foot a { color: var(--navy); text-decoration: none; font-weight: 600; padding: 10px 0; }
.foot a:hover { color: var(--strike); }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-mark {
  position: relative; z-index: 1; padding: 0 16px;
  font-weight: 800; font-size: 7.7vw; letter-spacing: -0.055em;
  line-height: 1.1; color: var(--accent); white-space: nowrap;
}
.foot-mark .dot { color: var(--deep); }

/* the closing band: circuitry rendered through the same ordered dither,
   rising behind the wordmark the way the reference's treeline does. */
.circuit {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 0;
  height: clamp(240px, 26vh, 360px);
}
.circuit canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated;
}

/* ---------- recipe pages (navy text, per the system's application surfaces) ---------- */

.page {
  padding-top: 32px; padding-bottom: 96px;
  display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 64px;
}
.toc { position: sticky; top: 28px; align-self: start; font-size: 0.9rem; }
.toc .kicker { margin-bottom: 14px; padding-left: 10px; }
.toc ol { list-style: none; }
.toc a {
  display: flex; gap: 10px; color: var(--grey-3); text-decoration: none;
  padding: 7px 10px; border-radius: 8px; font-weight: 500; line-height: 1.4;
}
.toc a .n { font-size: 0.78rem; font-weight: 600; color: var(--accent); flex-shrink: 0; padding-top: 2px; }
.toc a:hover { background: var(--grey-1); color: var(--navy); }
.toc a.here { background: var(--tint); color: var(--navy); font-weight: 700; }

article { max-width: 700px; min-width: 0; color: var(--navy); }
article .kicker { color: var(--accent); margin-bottom: 12px; }
article h1 {
  font-weight: 800; font-size: clamp(2rem, 3.6vw, 2.9rem);
  letter-spacing: -0.05em; line-height: 1; margin-bottom: 24px; color: var(--black);
}
article h2 {
  font-weight: 700; font-size: 1.4rem; letter-spacing: -0.04em;
  line-height: 1.05; margin: 48px 0 4px; color: var(--black);
}
article p, article ul, article ol { margin-top: 14px; }
article ul, article ol { padding-left: 24px; }
article li { margin-top: 8px; }
article code {
  font-family: var(--mono); font-size: 0.85em;
  background: var(--tint); border-radius: 4px; padding: 1px 5px; color: var(--deep);
}
article pre {
  background: var(--navy); color: var(--white); border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; margin-top: 16px; font-size: 0.85rem;
}
article pre code { background: none; padding: 0; color: inherit; }

/* the recipe's lead facts, pulled into one tint panel by the builder */
.meta {
  background: var(--tint); border-radius: 12px; padding: 22px 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 8px;
}
.meta p { margin-top: 6px; font-size: 0.95rem; line-height: 1.55; }

/* tables: tint separation, no cell borders */
article table {
  border-collapse: collapse; width: 100%; margin-top: 16px; font-size: 0.92rem;
  display: block; overflow-x: auto; border-radius: 10px;
}
article th, article td { padding: 10px 16px; text-align: left; }
article thead tr { background: var(--tint); }
article th { font-weight: 700; color: var(--black); }
article tbody tr:nth-child(even) { background: var(--grey-1); }

/* prompts: paste-able blockquotes as tint panels, label above, no border */
article blockquote {
  position: relative; background: var(--tint); border-radius: 12px;
  padding: 40px 20px 16px; margin-top: 14px;
  font-size: 0.96rem; color: var(--navy); line-height: 1.6;
}
article blockquote p { margin: 0; }
article blockquote .copy-btn { position: absolute; top: 10px; right: 10px; }
article blockquote::before {
  content: "Paste this"; position: absolute; top: 14px; left: 20px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
}

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 64px; font-size: 0.92rem; }
.pager a {
  text-decoration: none; background: var(--tint); border-radius: 999px;
  padding: 12px 22px; color: var(--navy); font-weight: 600; min-height: 44px;
  display: inline-flex; align-items: center;
}
.pager a:hover { background: var(--grey-1); color: var(--strike); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 32px; gap: 44px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .skill-rows { grid-template-columns: 1fr; }
  .page { grid-template-columns: 1fr; gap: 40px; }
  .toc { position: static; }
  .flow { flex-direction: column; }
  .rail { display: none; }
}
@media (max-width: 767px) {
  /* the nav row goes away below md, as the system's header does */
  .top nav a:not(.gh) { display: none; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr; gap: 14px; }
  .stats { gap: 32px; }
}
@media (max-width: 379px) {
  /* below 380 the header pill hides too; GitHub stays reachable in the footer */
  .top .gh { display: none; }
}
