/* ==========================================================================
   Creative direction layer — loaded after style.css.
   Built only from the existing tokens (palette, type, radii) in style.css.
   ========================================================================== */

/* ---------- D1. Shared pieces ---------- */
a.nav-link { text-decoration: none; }

.hero-intro .eyebrow { margin-bottom: 22px; }

.section-title--xl { font-size: clamp(2.3rem, 1.4rem + 3.4vw, 3.9rem); line-height: 1.06; }

.stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.split-text .section-title,
.spotlight-body .section-title { margin-bottom: 20px; }
.spotlight-body .stats { margin: 24px 0 28px; }

/* tense chips: what we hold vs what we're building */
.tense {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tense::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tense--held  { color: var(--green); background: rgba(52, 211, 153, 0.10); border: 1px solid rgba(52, 211, 153, 0.35); }
.tense--beta  { color: var(--cyan);  background: rgba(34, 211, 238, 0.10); border: 1px solid rgba(34, 211, 238, 0.35); }
.tense--build { color: var(--purple-lt); background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(177, 151, 252, 0.40); }

/* project / development pill */
.kind {
  align-self: flex-start;
  margin-top: 22px;
  padding: 3px 10px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 999px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.kind--dev { border-color: rgba(177, 151, 252, 0.45); color: var(--purple-lt); }

/* "built with" under a partner logo */
.partner { display: flex; flex-direction: column; gap: 8px; }
.partner-note {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

/* review markers: visible, greppable, removed before publish */
mark.ph {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border: 1px dashed var(--gold);
  border-radius: 6px;
  background: rgba(245, 196, 81, 0.08);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .stats--3 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- D2. Direction: verify ---------- */

/* hero proof strip */
.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(48px, 6vw, 80px);
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}
.proof-strip li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: rgba(8, 10, 20, 0.92);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.proof-strip i {
  font-size: 1.05rem;
  --fa-primary-color: var(--cyan);
  --fa-secondary-color: var(--purple);
  --fa-secondary-opacity: 0.6;
}
@media (width > 1248px) {
  .proof-strip li { padding-inline: 14px; }
}

#stack .section-header { max-width: none; }
#stack .section-subtitle { text-wrap: balance; }

/* the chain: five linked cards */
.chain {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  list-style: none;
}
.chain::before {
  content: "";
  position: absolute;
  top: 48px;
  left: 6%;
  right: 6%;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--green), var(--cyan), var(--blue), var(--gold));
  opacity: 0.55;
}
.link {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(19, 23, 43, 0.95), rgba(11, 13, 26, 0.95));
}
.link .card-icon { grid-area: 1 / 1; position: relative; z-index: 1; background: var(--surface); }
.link-num {
  grid-area: 1 / 2;
  align-self: center;
  justify-self: end;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
}
.link h3 { grid-column: 1 / -1; font-size: 1.15rem; }
.link p { grid-column: 1 / -1; color: var(--muted); font-size: 0.92rem; }
.link-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--text-2) !important;
  font-family: var(--font-mono);
  font-size: 0.75rem !important;
}

/* cores */
.cores-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.cores-intro .lead { margin: 20px 0 32px; }
.cores-media { max-width: 420px; }
.cores-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.roots {
  counter-reset: root;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
  list-style: none;
}
.roots li {
  counter-increment: root;
  position: relative;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 16, 32, 0.85);
}
.roots li::after {
  content: "0" counter(root);
  position: absolute;
  top: 18px;
  right: 20px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.roots-label {
  display: block;
  margin-bottom: 6px;
  color: var(--purple-lt);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.roots p { color: var(--text-2); font-size: 0.96rem; }
.card--zk { margin-bottom: 20px; }
.cores-apps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}
.cores-apps-label {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.cores-apps a {
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
}
.cores-apps a:hover { border-color: var(--purple-lt); color: var(--text); }

/* CircuitTree generations */
.gens {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 24px;
  list-style: none;
}
.gen {
  position: relative;
  padding: 24px 28px;
  border: 1px solid var(--line);
  background: rgba(13, 16, 32, 0.6);
  opacity: 0.75;
}
.gen:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.gen:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.gen + .gen { border-left: 0; }
.gen--now { opacity: 1; background: rgba(52, 211, 153, 0.06); border-color: rgba(52, 211, 153, 0.35); }
.gen--next { opacity: 1; background: rgba(139, 92, 246, 0.08); border-color: rgba(177, 151, 252, 0.35); }
.gen-k { color: var(--dim); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.gen--now .gen-k { color: var(--green); }
.gen--next .gen-k { color: var(--purple-lt); }
.gen h3 { margin: 6px 0 6px; font-size: 1.6rem; font-weight: 700; }
.gen p { color: var(--muted); font-size: 0.95rem; }

/* agents */
.card--feature {
  border-color: rgba(177, 151, 252, 0.35);
  background:
    radial-gradient(400px 200px at 100% 0%, rgba(139, 92, 246, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(19, 23, 43, 0.95), rgba(11, 13, 26, 0.95));
}
.practice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.practice i { color: var(--green); }

@media (max-width: 1248px) {
  .proof-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chain::before { display: none; }
  .cores-grid, .zk-head, .zk-feature { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .zk-pillars, .gens, .roots { grid-template-columns: minmax(0, 1fr); }
  .gen, .gen:first-child, .gen:last-child { border-radius: var(--radius); }
  .gen + .gen { border-left: 1px solid var(--line); margin-top: 10px; }
}
@media (max-width: 560px) {
  .chain, .proof-strip { grid-template-columns: minmax(0, 1fr); }
}


/* ---------- D3. Grafted from the field direction ---------- */

/* full-bleed hero */
.field-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 860px;
  padding: calc(var(--header-h) + 80px) 0 clamp(64px, 8vw, 110px);
  overflow: hidden;
}
.field-hero-media { position: absolute; inset: 0; z-index: -1; }
.field-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.field-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 11, 0.55) 0%, rgba(5, 6, 11, 0.15) 35%, rgba(5, 6, 11, 0.85) 78%, var(--bg) 100%),
    linear-gradient(90deg, rgba(5, 6, 11, 0.85) 0%, rgba(5, 6, 11, 0.2) 65%);
}
.field-hero-body { position: relative; }
.field-hero-title { max-width: 900px; font-size: clamp(3rem, 1.6rem + 5.6vw, 6rem); }
.field-hero .hero-desc { max-width: 640px; color: var(--text); }

/* the loop */
.loop-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(36px, 4vw, 56px);
}
.loop-head .lead { margin: 0; }
.loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.loop-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px 28px;
  background: rgba(13, 16, 32, 0.7);
}
.loop-step + .loop-step { border-left: 1px solid var(--line); }
.loop-step:not(:last-child)::after {
  content: "\2192";
  position: absolute;
  top: 34px;
  right: -11px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 20px;
  text-align: center;
}
.loop-verb {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.loop-step p { color: var(--text-2); font-size: 0.98rem; }
.loop-step .tense { align-self: flex-start; margin-top: auto; }

/* CircuitTree feature */
.ct-feature {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
}
.ct-feature-media { position: absolute; inset: 0; }
.ct-feature-media img { width: 100%; height: 100%; object-fit: cover; }
.ct-feature-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 6, 11, 0.95) 0%, rgba(5, 6, 11, 0.75) 45%, rgba(5, 6, 11, 0.1) 100%);
}
.ct-feature-body { position: relative; max-width: 640px; padding: clamp(32px, 5vw, 64px); }
.ct-feature-body .section-title { margin-bottom: 18px; }
.ct-feature-body > p { color: var(--text-2); font-size: 1.06rem; }
.ct-next { display: flex; align-items: center; gap: 12px; margin-top: 22px !important; color: var(--text) !important; font-size: 0.98rem !important; }
.ct-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.ct-fact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 16, 32, 0.8);
}
.ct-fact-v { color: var(--green); font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.ct-fact-k { color: var(--muted); font-size: 0.88rem; }
.ct-license {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.ct-license p { max-width: 720px; color: var(--text-2); }
.ct-license strong { color: var(--text); }

/* ZKNetwork */
.section--zk {
  background:
    radial-gradient(900px 500px at 85% 30%, rgba(34, 211, 238, 0.10), transparent 70%),
    radial-gradient(700px 500px at 5% 80%, rgba(139, 92, 246, 0.12), transparent 70%);
}
.zk2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.zk2-text .section-title { margin-bottom: 20px; }
.zk2-text .lead { margin-bottom: 18px; }
.zk2-text > p:not(.lead):not(.eyebrow) { margin-bottom: 28px; color: var(--text-2); }
.zk2-text strong { color: var(--cyan); }
.mixdiagram {
  padding: clamp(28px, 3vw, 40px);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 24px;
  background:
    radial-gradient(400px 240px at 50% 0%, rgba(34, 211, 238, 0.10), transparent 70%),
    var(--surface);
  box-shadow: 0 30px 80px -40px rgba(34, 211, 238, 0.5);
}
.mix-row { display: flex; align-items: center; gap: 10px; }
.mix-hops { display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; border: 1px dashed rgba(34, 211, 238, 0.35); border-radius: 16px; }
.mix-wire { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--cyan) 0 6px, transparent 6px 12px); opacity: 0.7; }
.mix-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  padding: 10px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #070912;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mix-node i { font-size: 1.2rem; --fa-primary-color: var(--cyan); --fa-secondary-color: var(--purple); --fa-secondary-opacity: 0.6; }
.mix-node--you { color: var(--purple-lt); border-color: rgba(177, 151, 252, 0.45); }
.mix-node--dst { color: var(--text-2); }
.mix-caption { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 26px; font-family: var(--font-mono); font-size: 0.82rem; }
.mix-sees { color: var(--green); }
.mix-not { color: var(--alert); }
.mix-note { flex-basis: 100%; color: var(--dim); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* cosmo-local band */
.cosmo { position: relative; overflow: hidden; padding: clamp(96px, 12vw, 160px) 0; }
.cosmo-media { position: absolute; inset: 0; z-index: -1; }
.cosmo-media img { width: 100%; height: 100%; object-fit: cover; }
.cosmo-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 6, 11, 0.92) 0%, rgba(5, 6, 11, 0.55) 60%, rgba(5, 6, 11, 0.3) 100%), linear-gradient(180deg, var(--bg) 0%, transparent 20%, transparent 80%, var(--bg) 100%); }
.cosmo-body { max-width: calc(var(--container) + var(--gutter) * 2); }
.cosmo-body .section-title { max-width: 760px; margin-bottom: 18px; }
.cosmo-body p:not(.eyebrow) { max-width: 600px; color: var(--text); font-size: 1.12rem; }

/* ZKNetwork capability row */
.zk-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(32px, 4vw, 48px);
}
.zk-cell {
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(13, 16, 32, 0.8);
}
.zk-cell-k {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.zk-cell p { color: var(--muted); font-size: 0.94rem; }
@media (max-width: 1024px) { .zk-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .zk-row { grid-template-columns: minmax(0, 1fr); } }


/* hero proof strip sits inside the full-bleed hero */
.field-hero .proof-strip { margin-top: clamp(40px, 5vw, 64px); }

/* CircuitTree: loop and progression inside the section */
#circuittree .loop { margin-top: 18px; }
#circuittree .gens { margin: 18px 0 0; }

@media (max-width: 1024px) {
  .zk2 { grid-template-columns: minmax(0, 1fr); }
  .loop, .ct-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop-step:nth-child(3) { border-left: 0; }
  .loop-step:nth-child(n+3) { border-top: 1px solid var(--line); }
  .loop-step::after { display: none; }
}
@media (max-width: 760px) { .field-hero { min-height: 680px; } }
@media (max-width: 560px) {
  .loop, .ct-facts { grid-template-columns: minmax(0, 1fr); }
  .loop-step + .loop-step { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- D4. Remix stage 2: quieter unit labels in the trust stack ---------- */
.chain .link-meta {
  color: var(--dim) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- D5. Remix stage 3: Vertex Veil / Tashi row under the agent cards ---------- */
.vv-row { margin-top: 24px; flex-wrap: nowrap; }
.vv-row p { flex: 1 1 auto; max-width: none; }
@media (max-width: 760px) { .vv-row { flex-wrap: wrap; } }

/* ---------- D6. Dashed full-width rows at a section's foot (ZKNetwork, Photon.Net) ---------- */
.zk-cta, .wide-cta { margin-top: 24px; flex-wrap: nowrap; }
.zk-cta p, .wide-cta p { flex: 1 1 auto; max-width: none; }
.zk-cta .btn-row, .wide-cta .btn-row { flex-wrap: nowrap; flex-shrink: 0; }
@media (max-width: 960px) { .zk-cta, .zk-cta .btn-row, .wide-cta, .wide-cta .btn-row { flex-wrap: wrap; } }
.spotlight + .wide-cta { margin-top: clamp(32px, 4vw, 48px); }

/* ---------- D7. Cores: heading row on top, image beside the four parts at matched height ---------- */
#cores .cores-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: stretch; }
#cores .cores-media { max-width: none; height: 100%; min-height: 360px; }
#cores .cores-media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1024px) {
  #cores .cores-media { height: auto; aspect-ratio: 16 / 9; min-height: 0; }
}

/* ---------- D8. Headlines that may only break between their two halves ---------- */
.nowrap { white-space: nowrap; }
#work .section-header { max-width: none; }

/* ---------- D9. Desktop line-breaking pass ---------- */
p, li, dd { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
#agents .section-header,
#cores .section-header,
#build .section-header { max-width: none; }
#agents .section-subtitle,
#cores .section-subtitle,
#build .section-subtitle { text-wrap: balance; }
.ct-feature-body { max-width: 760px; }
.cta-body { max-width: 820px; }
.footer-brand p { max-width: 480px; }
/* ZK primitives card: icon beside the text */
.card--zk { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 20px; align-items: start; }
.card--zk .card-icon { grid-row: 1 / span 2; margin: 0; }
.card--zk h3 { margin-top: 0; }

/* ==========================================================================
   D10. Responsive system — page-wide conventions
   Breakpoints (max-width, one scale for both stylesheets):
     1024 tablet  · multi-column rows halve, side-by-side splits stack
      960 nav     · header collapses to the menu button (style.css § 4)
      760 large phone · two-part headings stack their halves, bands stack
                    media above text, footer rows of a section stack
      560 phone   · every grid is one column, buttons fill the row
      400 narrow  · tighter card padding and display sizes
   ========================================================================== */

/* -- No element may be wider than its container -- */
.btn { max-width: 100%; }

/* CircuitTree feature: the heading's halves need ~710px at the desktop size;
   the box widens for them while the paragraphs keep their measure. */
.ct-feature-body { max-width: 840px; }
.ct-feature-body > p { max-width: 632px; }

/* Stat figures shrink with their column rather than spill out of it */
.stat-value { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2rem); }

/* -- Two-part headings: plain half, then the gradient half --
   Wide: the halves sit on one line or break between them (.nowrap).
   ≤760: each half starts its own line and wraps inside itself, balanced. */
@media (max-width: 760px) {
  .nowrap { white-space: normal; }
  :is(.section-title, .cta-title) > .gradient-text {
    display: block;
    width: fit-content;
  }
  :is(.section-header--center, .cta-body) :is(.section-title, .cta-title) > .gradient-text { margin-inline: auto; }
}

/* -- Section foot rows (dashed CTA rows): text, then the buttons -- */
@media (max-width: 760px) {
  .ct-license,
  .zk-cta, .wide-cta, .vv-row {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }
  .ct-license p { max-width: none; }
  .ct-license .btn-row,
  .zk-cta .btn-row, .wide-cta .btn-row { flex-wrap: wrap; flex-shrink: 1; }
  .ct-license .btn-row .btn { flex: 1 1 auto; }
}

/* -- Buttons on a phone: full row, and a label may wrap rather than overflow -- */
@media (max-width: 560px) {
  .btn-row .btn { flex: 1 1 100%; }
  .btn { white-space: normal; text-align: center; line-height: 1.25; text-wrap: balance; }
}

/* -- Cores: image beside the parts down to tablet; one column from 760,
      where the portrait image becomes a band above the parts.
      (The id-scoped desktop columns otherwise never yield.) -- */
@media (min-width: 761px) and (max-width: 1024px) {
  #cores .cores-media { height: 100%; aspect-ratio: auto; min-height: 360px; }
}
@media (max-width: 960px) {
  .roots { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  #cores .cores-grid { grid-template-columns: minmax(0, 1fr); }
  #cores .cores-media { height: auto; aspect-ratio: 16 / 9; min-height: 0; }
}

/* ==========================================================================
   D11. Responsive pass — section by section, top to bottom
   ========================================================================== */

/* Eyebrows: a wrapped eyebrow splits evenly, never leaves one word behind */
.eyebrow { text-wrap: balance; }
/* Short labels and short card texts split evenly rather than strand a word */
.ct-fact-k, .stat-sub { text-wrap: balance; }
@media (max-width: 1024px) {
  .loop-step p, .gen p, .zk-cell p, .roots p { text-wrap: balance; }
}

/* On phones, the chain runs vertically through the icons. */
@media (max-width: 560px) {
  .chain { gap: 14px; }
  .chain::before {
    display: block;
    top: 40px; bottom: 40px;
    left: 46px; right: auto;
    width: 2px; height: auto;
    background: linear-gradient(180deg, var(--purple), var(--green), var(--cyan), var(--blue), var(--gold));
  }
  .link { padding: 20px; }
}

/* -- Cores -- */
.roots-label { padding-right: 2.5em; }          /* clear the corner number */
@media (max-width: 560px) {
  .cores-kicker, .ct-next { flex-wrap: wrap; row-gap: 8px; }
  .roots li { padding: 18px 20px; }
  /* ZK primitives: icon beside the heading, the text full width beneath */
  .card--zk { align-items: center; row-gap: 14px; }
  .card--zk .card-icon { grid-row: 1; }
  .card--zk p { grid-column: 1 / -1; }
}

/* -- CircuitTree feature band: image above, text below once the text
      would otherwise sit on the bright half of the photo -- */
@media (max-width: 760px) {
  .ct-feature {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    background: var(--surface);
  }
  .ct-feature-media { position: relative; inset: auto; aspect-ratio: 16 / 9; }
  .ct-feature-media::after {
    background: linear-gradient(180deg, rgba(13, 16, 32, 0) 45%, var(--surface) 100%);
  }
  .ct-feature-body {
    max-width: none;
    margin-top: -40px;
    padding: 0 clamp(22px, 5vw, 36px) clamp(26px, 5vw, 36px);
  }
}

/* -- The loop: on a phone each step is a row, the verb as its label -- */
@media (max-width: 560px) {
  .loop-step {
    display: grid;
    grid-template-columns: 6.2rem minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 10px;
    padding: 22px 20px;
  }
  .loop-verb { grid-row: 1 / span 2; font-size: 1.55rem; align-self: start; padding-top: 2px; }
  .loop-step p, .loop-step .tense { grid-column: 2; }
  .loop-step .tense { margin-top: 0; justify-self: start; }
}

/* -- Facts: stay two by two on a phone -- */
@media (max-width: 560px) {
  .ct-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ct-fact { padding: 16px; }
  .ct-fact-v { font-size: 1.35rem; }
  .ct-fact-k { font-size: 0.84rem; }
}

/* -- Mixnet diagram: wires keep a visible length -- */
.mix-wire { min-width: 12px; }
.mix-note { text-wrap: balance; }
@media (max-width: 400px) {
  .mixdiagram { padding: 22px 18px; }
  .mix-row { gap: 6px; }
  .mix-node { min-width: 56px; padding: 10px 6px; }
}

/* -- Agents cards: icon beside the heading on a phone -- */
@media (max-width: 560px) {
  .card-grid > .card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px 16px;
    padding: 22px 20px;
  }
  .card-grid > .card > p { grid-column: 1 / -1; }
  .card-grid > .card .card-icon { width: 46px; height: 46px; border-radius: 12px; font-size: 1.2rem; }
}

/* -- Partners: two logos a row on a phone -- */
@media (max-width: 560px) {
  .partners { gap: 12px; }
  .media--logo img { padding: 14px 18px; }
}

/* -- Mobile menu: the CTA fills the row on a phone, sits at its own width on a tablet -- */
@media (min-width: 561px) and (max-width: 960px) {
  .nav-item--cta .btn { width: auto; padding-inline: 28px; }
}

/* -- Card copy in narrow columns (tablet two-up): split evenly, no lone last word -- */
@media (max-width: 1024px) {
  .card p, .project-body p { text-wrap: balance; }
}
