/* Crowd Heuristics — editorial identity, themed (light/dark)
   paper + ink · vermilion = organic/signal · indigo = inorganic/machine
   Fraunces (display) · Inter (body) · Space Mono (machine bits) */

:root {
  --paper:   #faf6ef;   /* page background */
  --ink:     #1a1510;   /* primary text */
  --ink-soft:#4a4138;
  --ink-dim: #7c7064;
  --line:    rgba(26,21,16,.14);
  --band-dark:#1a1510;  /* the dark "ink" bands + footer */
  --on-dark: #f3ede1;   /* text on always-dark surfaces */
  --on-dark-soft: rgba(243,237,225,.74);
  --org-card:#faf6ef;   /* organic duo card */
  --inorg-card:#15110d; /* inorganic duo card */
  --signal:  #e2562a;   /* organic — warm vermilion */
  --signal-d:#c4441d;
  --cool:    #3a3ad9;   /* inorganic — electric indigo */
  --cool-lt: #8b8bf2;
  --maxw: 1140px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --r: 14px;
  --font-d: "Fraunces", Georgia, serif;
  --font-b: "Inter", system-ui, sans-serif;
  --font-m: "Space Mono", ui-monospace, monospace;
}
[data-theme="dark"] {
  --paper:   #15120d;
  --ink:     #ece5d8;
  --ink-soft:#b3a899;
  --ink-dim: #8a7f70;
  --line:    rgba(236,229,216,.15);
  --band-dark:#0d0b07;
  --org-card:#221b12;
  --inorg-card:#13110e;
  --signal:  #ff6a3d;
  --signal-d:#ff855e;
  --cool:    #9a9af5;
  --cool-lt: #b3b3f8;
}
[data-theme="dark"] { --theme-img: invert(0); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-b); font-size: 18px; line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .35s ease, color .35s ease;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
.mono { font-family: var(--font-m); }
.sr-only, .skip { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; top: 12px; left: 12px; width: auto; height: auto; clip: auto; background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 8px; z-index: 100; }

/* type */
h1, h2, h3 { font-family: var(--font-d); font-weight: 600; line-height: 1.05; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2.5rem, 6.6vw, 4.9rem); }
h1 em { font-style: italic; color: var(--signal); }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h3 { font-size: 1.35rem; line-height: 1.15; }
p { margin: 0 0 1.1rem; }
em { font-style: italic; } strong { font-weight: 600; }
.kicker, .eyebrow, .duo-tag, .foot-h { font-family: var(--font-m); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); margin: 0 0 1.1rem; display: inline-flex; align-items: center; gap: .55rem; }
.eyebrow { color: var(--signal-d); }
.inline-link { color: var(--cool); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--cool) 40%, transparent); }

/* header + theme toggle */
.site-head { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem var(--pad); background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--font-d); font-weight: 600; font-size: 1.18rem; color: var(--ink); }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 60%, transparent); animation: pulse 2.6s infinite; }
.nav { display: flex; align-items: center; gap: clamp(.9rem, 2.2vw, 1.8rem); }
.nav a { text-decoration: none; font-size: .95rem; font-weight: 500; color: var(--ink-soft); }
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a.active { border-bottom: 2px solid var(--signal); }
.theme-toggle { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer; padding: 0; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-dim); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.theme-toggle .i-moon { display: none; } .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; } [data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (max-width: 760px) { .nav a:not(.active) { display: none; } .nav a.active { display: none; } .theme-toggle { display: inline-grid; } }

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 55%, transparent); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* hero */
.hero { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.5rem, 8vw, 6rem) var(--pad) clamp(2rem, 6vw, 4rem); display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.hero .lede { font-size: clamp(1.08rem, 1.6vw, 1.28rem); color: var(--ink-soft); max-width: 40ch; margin-top: 1.5rem; }
.hero .tag { color: var(--cool); font-size: .9rem; letter-spacing: .04em; margin-top: .4rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.btn { display: inline-block; font-family: var(--font-b); font-weight: 600; font-size: 1rem; text-decoration: none; padding: .85rem 1.5rem; border-radius: 100px; transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s; cursor: pointer; border: 1.5px solid transparent; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: var(--signal-d); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.nav-cta { padding: .5rem 1rem; border: 1.5px solid var(--ink); border-radius: 100px; color: var(--ink) !important; }
.nav-cta:hover { background: var(--ink); color: var(--paper) !important; }

.hero-fig { margin: 0; } .hero-fig svg { width: 100%; height: auto; }
.svg-label { font-family: var(--font-m); font-size: 11px; fill: var(--ink-soft); letter-spacing: .04em; }
.svg-sub { font-family: var(--font-b); font-size: 11px; fill: var(--ink-dim); }
.svg-cut { font-family: var(--font-m); font-size: 11px; fill: var(--signal-d); letter-spacing: .08em; font-weight: 700; }
.svg-live { font-family: var(--font-m); font-size: 11px; fill: var(--cool); letter-spacing: .03em; }
.hero-fig line[stroke="#1a1510"] { stroke: var(--ink); }
.signal circle { fill: var(--signal); animation: blink 2.4s infinite; }
.signal circle:nth-child(odd) { fill: var(--cool); }
.signal circle:nth-child(2){animation-delay:.3s} .signal circle:nth-child(3){animation-delay:.6s} .signal circle:nth-child(4){animation-delay:.9s} .signal circle:nth-child(5){animation-delay:1.2s} .signal circle:nth-child(6){animation-delay:1.5s}
@keyframes blink { 0%,100%{opacity:.35; transform: translateY(0)} 50%{opacity:1; transform: translateY(-2px)} }
@media (prefers-reduced-motion: reduce) { .brand-dot,.live-dot,.signal circle { animation: none; } }

/* bands */
.band { padding: clamp(3.5rem, 9vw, 7rem) var(--pad); border-top: 1px solid var(--line); }
.col-narrow { max-width: 720px; margin: 0 auto; }
.band h2 { margin-bottom: 1.4rem; }
.band p { color: var(--ink-soft); font-size: 1.12rem; max-width: 62ch; }
.band-ink { background: var(--band-dark); color: var(--on-dark); border-top-color: transparent; }
.band-ink h2, .band-ink h1 { color: var(--on-dark); }
.band-ink p { color: var(--on-dark-soft); }
.band-ink .eyebrow { color: var(--signal); }
.band-ink strong { color: #fff; }

.duo { max-width: var(--maxw); margin: 2.8rem auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 760px){ .duo { grid-template-columns: 1fr; } }
.duo-card { padding: clamp(1.6rem, 3vw, 2.4rem); border-radius: var(--r); }
.duo-org { background: var(--org-card); color: var(--ink); border: 1px solid var(--line); }
.duo-org .duo-tag { color: var(--signal-d); } .duo-org h3 { margin-bottom: .6rem; color: var(--ink); }
.duo-org p { color: var(--ink-soft); }
.duo-inorg { background: var(--inorg-card); border: 1px solid rgba(139,139,242,.32); color: var(--on-dark); position: relative; overflow: hidden; }
.duo-inorg::after { content:""; position:absolute; inset:0 0 auto 0; height:3px; background: linear-gradient(90deg,var(--cool),transparent); }
.duo-inorg .duo-tag { color: var(--cool-lt); } .duo-inorg h3 { color: #fff; margin-bottom: .6rem; }
.duo-inorg p { color: var(--on-dark-soft); }
.mono-body { font-family: var(--font-m); font-size: .92rem !important; line-height: 1.6; }
.duo-foot { text-align: center; font-family: var(--font-d); font-style: italic; font-size: clamp(1.2rem,2.4vw,1.6rem); margin: 2.4rem auto 0; color: var(--on-dark); }

.steps { max-width: var(--maxw); margin: 2.6rem auto 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3,1fr); gap: clamp(1.2rem,3vw,2.2rem); }
@media (max-width: 760px){ .steps { grid-template-columns: 1fr; } }
.step { border-top: 2px solid var(--ink); padding-top: 1.1rem; }
.step-n { font-family: var(--font-m); font-weight: 700; color: var(--signal); font-size: .95rem; }
.step h3 { margin: .6rem 0 .5rem; } .step p { font-size: 1rem; color: var(--ink-soft); }

.band-quote blockquote { font-family: var(--font-d); font-style: italic; font-weight: 500; font-size: clamp(1.6rem, 3.6vw, 2.4rem); line-height: 1.18; color: var(--ink); margin: 1.6rem 0; padding-left: 1.3rem; border-left: 3px solid var(--signal); max-width: 22ch; }
.quote-line { font-family: var(--font-d); font-style: italic; font-size: clamp(1.3rem,2.6vw,1.8rem); color: var(--on-dark) !important; margin: 1.4rem 0; }

.band-cta { background: var(--signal); color: #fff; text-align: center; border-top: none; }
.band-cta h2 { color: #fff; }
.band-cta .sub { color: rgba(255,255,255,.92) !important; margin: 0 auto 2rem; max-width: 54ch; }
.signup { display: flex; gap: .6rem; max-width: 460px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.signup input { flex: 1 1 240px; padding: .85rem 1.1rem; border-radius: 100px; border: none; font-family: var(--font-b); font-size: 1rem; color: #1a1510; }
.band-cta .btn-primary { background: #1a1510; color: #fff; } .band-cta .btn-primary:hover { background: #000; }
.form-note { margin-top: 1.1rem; color: rgba(255,255,255,.84); font-size: .85rem; } .form-note a { color: #fff; }

/* footer */
.site-foot { background: var(--band-dark); color: var(--on-dark); padding: clamp(3rem,6vw,4.5rem) var(--pad) 2rem; }
.foot-grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px){ .foot-grid { grid-template-columns: 1fr 1fr; } }
.site-foot .brand { color: var(--on-dark); }
.foot-tag { color: var(--on-dark-soft); font-size: .95rem; margin-top: .8rem; }
.site-foot .foot-h { color: var(--cool-lt); margin-bottom: .9rem; }
.foot-links { display: flex; flex-direction: column; gap: .55rem; }
.foot-links a { text-decoration: none; color: var(--on-dark-soft); font-size: .95rem; } .foot-links a:hover { color: #fff; }
.soon { color: var(--ink-dim); font-size: .9rem; }
.foot-base { max-width: var(--maxw); margin: 2.6rem auto 0; padding-top: 1.4rem; border-top: 1px solid rgba(243,237,225,.12); }
.foot-base p { color: var(--on-dark-soft); font-size: .82rem; margin: 0; } .foot-base strong { color: var(--on-dark); }
.liveclock { color: var(--cool-lt); }

/* ============ KNOWLEDGE — browse ============ */
.khead { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.5rem,7vw,5rem) var(--pad) 1rem; }
.khead h1 { font-size: clamp(2.2rem,5vw,3.4rem); }
.khead .lede { font-size: clamp(1.05rem,1.5vw,1.2rem); color: var(--ink-soft); max-width: 56ch; margin-top: 1.2rem; }
.kbrowse { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem var(--pad) 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filter { font-family: var(--font-m); font-size: .8rem; letter-spacing: .03em; padding: .45rem .9rem; border-radius: 100px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); cursor: pointer; }
.filter:hover { border-color: var(--ink-dim); color: var(--ink); }
.filter.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.kcard { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; background: color-mix(in srgb, var(--ink) 2.5%, transparent); transition: transform .14s ease, border-color .14s ease; }
.kcard:hover { transform: translateY(-3px); border-color: var(--signal); }
.kcard-type { font-family: var(--font-m); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--signal-d); }
.kcard h3 { margin: .5rem 0 .3rem; }
.kcard-culture { font-size: .85rem; color: var(--ink-dim); margin: 0 0 .7rem; }
.kcard-sum { font-size: .96rem; color: var(--ink-soft); margin: 0 0 1rem; }
.kcard-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { font-family: var(--font-m); font-size: .68rem; padding: .2rem .5rem; border-radius: 6px; background: color-mix(in srgb, var(--cool) 12%, transparent); color: var(--cool); text-decoration: none; }
.kcount { margin: 2rem 0 0; color: var(--ink-dim); font-size: .85rem; }

/* ============ KNOWLEDGE — entry ============ */
.entry { max-width: 980px; margin: 0 auto; padding: clamp(2rem,6vw,4rem) var(--pad); }
.crumb { color: var(--ink-dim); font-size: .8rem; margin-bottom: 1.6rem; } .crumb a { color: var(--ink-soft); text-decoration: none; } .crumb a:hover { color: var(--signal); }
.entry-head { border-bottom: 1px solid var(--line); padding-bottom: 1.8rem; margin-bottom: 2rem; }
.entry-head h1 { font-size: clamp(2.2rem,5vw,3.4rem); margin: .4rem 0 .8rem; }
.entry-sum { font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; }
.entry-grid { display: grid; grid-template-columns: 1fr 280px; gap: clamp(1.5rem,4vw,3rem); align-items: start; }
@media (max-width: 820px){ .entry-grid { grid-template-columns: 1fr; } }
.entry-body p { font-size: 1.12rem; color: var(--ink); max-width: 64ch; }
.entry-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.8rem 0; }
.e-sources { margin-top: 2rem; } .e-sources h2 { font-size: 1.2rem; margin-bottom: .6rem; } .e-sources ul { padding-left: 1.1rem; color: var(--ink-soft); font-size: .95rem; }
.entry-meta { position: sticky; top: 5rem; border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; background: color-mix(in srgb, var(--ink) 2.5%, transparent); }
@media (max-width: 820px){ .entry-meta { position: static; } }
.entry-meta dl { margin: 0; } .m-row { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.m-row:last-of-type { border-bottom: none; } .m-row dt { color: var(--ink-dim); } .m-row dd { margin: 0; text-align: right; color: var(--ink); }
.for-inorganics { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: .5rem; }
.for-inorganics .foot-h { color: var(--cool); margin-bottom: .3rem; }
.for-inorganics a { color: var(--cool); text-decoration: none; font-size: .82rem; } .for-inorganics a:hover { text-decoration: underline; }
.entry-nav { display: flex; justify-content: space-between; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-family: var(--font-m); font-size: .85rem; }
.entry-nav a { text-decoration: none; color: var(--ink-soft); } .entry-nav a:hover { color: var(--signal); } .entry-nav .e-nav-next { margin-left: auto; }

.reveal { opacity: 1; transform: none; }

/* ============ contribute form ============ */
.contribute-form { max-width: 720px; margin: 0 auto; }
.cf-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 640px) { .cf-grid { grid-template-columns: 1fr; } }
.cf-field { display: flex; flex-direction: column; gap: .4rem; }
.cf-wide { grid-column: 1 / -1; }
.cf-field > span { font-family: var(--font-m); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-dim); }
.cf-field em { color: var(--signal); font-style: normal; }
.cf-field input, .cf-field select, .cf-field textarea {
  font-family: var(--font-b); font-size: 1rem; color: var(--ink);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; width: 100%;
}
.cf-field textarea { resize: vertical; min-height: 130px; line-height: 1.55; }
.cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 18%, transparent); }
.cf-foot { display: flex; align-items: center; gap: 1.2rem; margin-top: 1.7rem; flex-wrap: wrap; }
.cf-status { margin: 0; font-size: .92rem; }
.cf-status.ok { color: var(--signal-d); } .cf-status.err { color: #cf3b2b; }
[data-theme="dark"] .cf-status.err { color: #ff8b7a; }
.cf-note { margin-top: 1.1rem; color: var(--ink-dim); font-size: .8rem; }
