/* ============================================================
   PYNG · page & section layouts (home, blog, article, inner)
   ============================================================ */

/* ---------- global atmosphere (never a flat page) -------- */
html { background: var(--bg); }
body { background: transparent; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -10; pointer-events: none;
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(58% 48% at 86% -6%, rgba(124,92,255,.16), transparent 56%),
    radial-gradient(50% 44% at 0% 16%, rgba(91,140,255,.11), transparent 56%),
    radial-gradient(52% 44% at 96% 98%, rgba(69,214,182,.08), transparent 58%),
    linear-gradient(180deg, #0A1322 0%, #080E1A 60%, #060B15 100%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(58% 46% at 88% -8%, rgba(91,77,209,.08), transparent 54%),
    radial-gradient(48% 42% at 0% 18%, rgba(124,92,255,.06), transparent 54%),
    linear-gradient(180deg, #EEF1F8 0%, #E8ECF5 100%);
}
/* bands stay subtly distinct without going flat */
[data-theme="dark"] .section--band { background: rgba(255,255,255,.018); }
[data-theme="light"] .section--band { background: rgba(17,19,25,.025); }
.nav { background: color-mix(in srgb, var(--bg) 72%, transparent); }
.foot { background: color-mix(in srgb, var(--bg-deep) 55%, transparent); backdrop-filter: blur(8px); }


/* ---------- shared section header ------------------------ */
.sec-head { max-width: 64ch; }
.sec-head .h2 { margin-top: var(--s2); }
.sec-head .lead { margin-top: var(--s4); }
.sec-head--center { margin-inline: auto; text-align: center; }
.sec-head--center .label { justify-content: center; }

/* ---------- HOME · hero overlay -------------------------- */
/* hero scoped styles live in hero.css; we only place it in flow */
#pyng-hero { min-height: min(100svh, 880px); }
@media (max-width: 780px){ #pyng-hero { min-height: auto; } }

/* ---------- HOME · problem ------------------------------- */
.problem-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.slop-stack { display: grid; gap: 10px; }
.slop {
  display: flex; align-items: center; gap: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 13px 16px;
  font-size: .94rem; color: var(--muted);
  box-shadow: var(--shadow-1);
}
.slop .av { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); flex: 0 0 auto; display:grid; place-items:center; color: var(--faint); font-family: var(--font-mono); font-size: .72rem; }
.slop--dim { opacity: .5; }
.slop--dim:nth-child(3){ opacity:.34; }
.slop--dim:nth-child(4){ opacity:.2; }
.slop--live {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 500;
  box-shadow: var(--shadow-2);
}
.slop--live .av { background: var(--accent); color: var(--on-accent); }
.slop-note { margin-top: var(--s4); color: var(--faint); font-size: .9rem; }

/* ---------- HOME · the shift (editorial triptych) -------- */
.shift {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.shift > div { padding: clamp(26px, 3vw, 40px); border-right: 1px solid var(--line); transition: background .18s ease; }
.shift > div:hover { background: var(--surface-2); }
.shift > div:last-child { border-right: 0; }
.shift .n { font-family: var(--font-mono); font-size: .74rem; color: var(--faint); letter-spacing: .1em; }
.shift h3 { margin: var(--s3) 0 var(--s2); font-size: 1.28rem; }
.shift p { color: var(--muted); font-size: .96rem; }
.shift .ic {
  width: 46px; height: 46px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--cat, var(--accent)) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--cat, var(--accent)) 24%, transparent);
  color: var(--cat, var(--accent-ink)); margin-bottom: var(--s5);
}
.shift .ic svg { width: 23px; height: 23px; }
@media (max-width: 820px){ .shift { grid-template-columns: 1fr; } .shift > div { border-right: 0; border-bottom: 1px solid var(--line); } .shift > div:last-child { border-bottom: 0; } }

/* ---------- HOME · how it works (single trace) ----------- */
.loop {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s4);
  margin-top: var(--s7);
}
.loop::before {
  content: ""; position: absolute; left: 7%; right: 7%; top: 26px; height: 2px;
  background: linear-gradient(to right, var(--cold), var(--warm) 55%, var(--hot));
  opacity: .55;
}
.loop-step { position: relative; }
.loop-node {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-strong);
  display: grid; place-items: center; color: var(--accent-ink);
  position: relative; z-index: 1; box-shadow: var(--shadow-1);
}
.loop-node svg { width: 24px; height: 24px; }
.loop-step:nth-child(1) .loop-node { color: var(--cold); }
.loop-step:nth-child(3) .loop-node { color: var(--accent-ink); border-color: var(--accent); }
.loop-step:nth-child(5) .loop-node { color: var(--hot); border-color: color-mix(in srgb, var(--hot) 50%, transparent); }
.loop-step .k { font-family: var(--font-mono); font-size: .72rem; color: var(--faint); margin: var(--s4) 0 var(--s1); letter-spacing: .06em; }
.loop-step h4 { font-size: 1.02rem; margin-bottom: var(--s2); }
.loop-step p { font-size: .88rem; color: var(--muted); line-height: 1.5; }
.loop-gate {
  display: inline-flex; align-items: center; gap: .4em; margin-top: 6px;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-ink);
}
@media (max-width: 860px){
  .loop { grid-template-columns: 1fr 1fr; gap: var(--s5); }
  .loop::before { display: none; }
}
@media (max-width: 520px){ .loop { grid-template-columns: 1fr; } }

/* ---------- HOME · control proof (review card) ----------- */
.control-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px,5vw,72px); align-items: center; }
.ticks { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; gap: var(--s3); }
.ticks li { position: relative; padding-left: 30px; color: var(--ink-2); }
.ticks li svg { position: absolute; left: 0; top: 2px; width: 19px; height: 19px; color: var(--success); }
.review {
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-2); overflow: hidden;
}
.review-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s5); border-bottom: 1px solid var(--line); }
.review-av { width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); flex:0 0 auto; }
.review-name { font-weight: 600; color: var(--ink); }
.review-role { font-size: .84rem; color: var(--muted); }
.review-score { margin-left: auto; display:flex; align-items:center; gap:.45em; font-family: var(--font-mono); font-size: .78rem; color: var(--hot); }
.review-why { padding: var(--s4) var(--s5) 0; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.review-msg { margin: var(--s2) var(--s5); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-2); font-size: .94rem; line-height: 1.6; }
.review-msg .by { display: block; margin-top: var(--s3); color: var(--faint); font-size: .8rem; }
.review-actions { display: flex; gap: var(--s2); padding: 0 var(--s5) var(--s5); flex-wrap: wrap; }

/* ---------- HOME · EU trust ------------------------------ */
.eu-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px,5vw,64px); align-items: center; }
.eu-rows { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.eu-row { display: flex; gap: var(--s4); padding: var(--s5); border-bottom: 1px solid var(--line); }
.eu-row:last-child { border-bottom: 0; }
.eu-row .ic { flex: 0 0 auto; width: 24px; height: 24px; color: var(--warm); margin-top: 2px; }
.eu-row h4 { font-size: 1.02rem; margin-bottom: 4px; }
.eu-row p { font-size: .9rem; color: var(--muted); }
.eu-art { display: grid; place-items: center; }
.eu-ring {
  position: relative; width: min(300px, 78%); aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--warm) 40%, var(--line-strong));
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--warm) 8%, var(--surface)) 0%, var(--surface) 70%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 33px, color-mix(in srgb, var(--warm) 22%, transparent) 33px 34px);
  box-shadow: var(--shadow-2), inset 0 0 60px -30px color-mix(in srgb, var(--warm) 60%, transparent);
  display: grid; place-items: center;
}
.eu-ring .eu-badge { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--warm); letter-spacing: -0.02em; }
.eu-ring .star { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warm) 16%, transparent); }
.eu-ring .pkt { position:absolute; width:7px; height:7px; border-radius:50%; background: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warm) 14%, transparent); }
@media (max-width: 820px){ .eu-grid { grid-template-columns: 1fr; } .eu-art { order: -1; } }

/* ---------- CTA band ------------------------------------- */
.cta-band { background: var(--surface-3); border-block: 1px solid var(--line); text-align: center; }
.cta-band .h2 { max-width: 22ch; margin-inline: auto; }
.cta-band .lead { margin: var(--s4) auto 0; }
.cta-form { display: flex; gap: var(--s2); max-width: 460px; margin: var(--s6) auto 0; }
.cta-form input { flex: 1; min-width: 0; height: 52px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.cta-form input::placeholder { color: var(--faint); }
.cta-form .btn { height: 52px; }
.cta-fine { margin-top: var(--s4); font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em; color: var(--faint); }
@media (max-width: 520px){ .cta-form { flex-direction: column; } }

/* ---------- BLOG listing --------------------------------- */
.blog-hero { padding-top: clamp(48px, 8vw, 96px); }
.blog-hero .display { max-width: 16ch; margin-top: var(--s3); }
.blog-hero .lead { margin-top: var(--s4); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s6); }

.feat {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform .2s, border-color .2s, box-shadow .2s; margin-top: var(--s5);
}
.feat:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.feat-art { min-height: 280px; position: relative; border-right: 1px solid var(--line); }
.feat-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.feat-body { padding: clamp(28px, 3.4vw, 46px); display: flex; flex-direction: column; }
.feat-body h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: var(--s4) 0; }
.feat-body p { color: var(--muted); }
.feat-meta, .card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding-top: var(--s5); font-family: var(--font-mono); font-size: .76rem; color: var(--faint); }
.feat-meta .dot, .card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
@media (max-width: 780px){ .feat { grid-template-columns: 1fr; } .feat-art { border-right: 0; border-bottom: 1px solid var(--line); min-height: 200px; } }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); margin-top: var(--s6); }
@media (max-width: 980px){ .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px){ .post-grid { grid-template-columns: 1fr; } }
.pcard { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-1); transition: transform .18s, border-color .18s, box-shadow .18s; }
.pcard:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.pcard-art { aspect-ratio: 16 / 10; position: relative; border-bottom: 1px solid var(--line); }
.pcard-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pcard-body { padding: var(--s5); display: flex; flex-direction: column; flex: 1; }
.pcard h3 { font-size: 1.16rem; margin: var(--s3) 0; line-height: 1.25; }
.pcard p { font-size: .92rem; color: var(--muted); flex: 1; }
.is-hidden { display: none !important; }

/* ---------- ARTICLE -------------------------------------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; z-index: 60; }
.art-hero { padding-top: clamp(40px, 6vw, 72px); }
.crumbs { font-family: var(--font-mono); font-size: .78rem; color: var(--faint); margin-bottom: var(--s4); }
.crumbs a:hover { color: var(--ink); }
.art-hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.06; margin: var(--s4) 0; max-width: 20ch; }
.art-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.art-meta > span { white-space: nowrap; }
.art-meta .av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); font-size: .8rem; }
.art-figure { margin-top: var(--s6); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 21/9; position: relative; box-shadow: var(--shadow-1); }
.art-figure svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.art-layout { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.toc { position: sticky; top: 92px; }
.toc .label { margin-bottom: var(--s4); }
.toc ul { list-style: none; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 7px 14px; font-size: .88rem; color: var(--muted); border-left: 2px solid transparent; margin-left: -1px; transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 500; }
@media (max-width: 920px){ .art-layout { grid-template-columns: 1fr; } .toc { display: none; } }

/* prose */
.prose { font-size: 1.12rem; line-height: 1.8; color: var(--ink-2); max-width: 68ch; }
.prose > * + * { margin-top: 1.3em; }
.prose h2 { font-size: clamp(1.5rem, 2.4vw, 1.95rem); margin-top: 1.8em; scroll-margin-top: 92px; }
.prose h3 { font-size: 1.3rem; margin-top: 1.4em; scroll-margin-top: 92px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: .5em; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 1.6em 0; padding: var(--s5) var(--s6);
  border-left: 3px solid var(--accent); border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface-2);
}
.prose blockquote p { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.5; color: var(--ink); font-weight: 500; }
.pull {
  margin: 1.8em 0; padding-left: var(--s5); border-left: 3px solid var(--hot);
  font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 1.85rem); line-height: 1.3;
  font-weight: 600; color: var(--ink); letter-spacing: -0.01em;
}
.prose .callout { font-size: 1rem; }
.prose figure.key { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-left: 3px solid var(--accent); border-radius: var(--r-md); padding: var(--s5); }
.prose figure.key .label { margin-bottom: var(--s3); }
.prose figure.key ul { margin: 0; }

/* author + related */
.author-card { display: flex; gap: var(--s5); align-items: flex-start; margin-top: var(--s8); padding-top: var(--s6); border-top: 1px solid var(--line); }
.author-card .av { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); font-size: 1.1rem; flex: 0 0 auto; }
.author-card h4 { font-size: 1.05rem; }
.author-card .role { font-family: var(--font-mono); font-size: .76rem; color: var(--faint); margin: 2px 0 8px; }
.author-card p { color: var(--muted); font-size: .94rem; max-width: 56ch; }

.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); margin-top: var(--s5); }
@media (max-width: 780px){ .related-grid { grid-template-columns: 1fr; } }

/* ---------- INNER PAGES ---------------------------------- */
.page-hero { padding-top: clamp(48px, 8vw, 104px); }
.page-hero .display { margin-top: var(--s3); max-width: 18ch; }
.page-hero .lead { margin-top: var(--s5); }
.hero-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px,5vw,64px); align-items: center; }
@media (max-width: 880px){ .hero-split { grid-template-columns: 1fr; } }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
@media (max-width: 880px){ .feature-grid { grid-template-columns: 1fr; } }
.feature {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  padding: clamp(22px,2.6vw,30px); box-shadow: var(--shadow-1);
}
.feature .ic { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--accent-ink); background: var(--accent-soft); margin-bottom: var(--s4); }
.feature .ic svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.18rem; margin-bottom: var(--s2); }
.feature p { color: var(--muted); font-size: .96rem; }

/* product loop: editorial alternating rows */
.steps { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-1); }
.step-row { display: grid; grid-template-columns: 90px 1fr; gap: var(--s5); padding: clamp(22px,3vw,34px); border-bottom: 1px solid var(--line); align-items: start; }
.step-row:last-child { border-bottom: 0; }
.step-row .num { font-family: var(--font-mono); font-size: 1.5rem; color: var(--faint); font-weight: 500; }
.step-row h3 { font-size: 1.22rem; margin-bottom: var(--s2); }
.step-row p { color: var(--muted); max-width: 64ch; }
.step-row.gate { background: var(--accent-soft); }
.step-row.gate .num { color: var(--accent-ink); }
.step-row.gate .gate-tag { display:inline-flex; align-items:center; gap:.4em; margin-top: var(--s2); font-family: var(--font-mono); font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; color: var(--accent-ink); }
@media (max-width: 620px){ .step-row { grid-template-columns: 1fr; gap: var(--s2); } }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px,5vw,64px); align-items: center; }
@media (max-width: 820px){ .split-2 { grid-template-columns: 1fr; } }

/* ---------- SYSTEM / rationale page ---------------------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: var(--s3); }
.sw { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.sw .chip-color { height: 64px; }
.sw .meta { padding: 10px 12px; font-family: var(--font-mono); font-size: .72rem; }
.sw .meta .nm { color: var(--ink); }
.sw .meta .hx { color: var(--faint); }
.type-row { display: flex; align-items: baseline; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.type-row .tag { font-family: var(--font-mono); font-size: .72rem; color: var(--faint); width: 110px; flex: 0 0 auto; }
.tells { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
@media (max-width: 820px){ .tells { grid-template-columns: 1fr; } }
.tell { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s5); background: var(--surface); }
.tell .x { color: var(--danger); font-family: var(--font-mono); font-size: .8rem; font-weight: 500; }
.tell .y { color: var(--success); font-family: var(--font-mono); font-size: .8rem; font-weight: 500; margin-top: var(--s3); }
.tell p { font-size: .94rem; color: var(--muted); margin-top: 6px; }
.toc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: var(--s4); }
