/* DFM Platform — public presentation layer.
   Sober, institutional, analytical. Dark-adjacent professional surface.
   No external fonts, no CDNs, no trackers. Production-safe system stacks only. */

:root {
  /* Surfaces — deep ink, lifted panels, hairlines */
  --bg:        #0f1418;
  --bg-grad:   #11181d;
  --surface:   #151d23;
  --surface-2: #1a242b;
  --line:      #28333b;
  --line-soft: #1e272e;

  /* Type — warm paper on ink */
  --ink:   #e9e5d9;
  --soft:  #b4bcc1;
  --mute:  #7e878d;
  --faint: #5a646a;

  /* Accents — muted gold, used sparingly; steel for secondary */
  --gold:      #c6a23a;
  --gold-soft: #d8be72;
  --gold-dim:  #8f7732;
  --steel:     #7ba0b0;

  --maxw: 880px;
  --maxw-wide: 1060px;

  /* Type stacks (system / production-safe; no web fonts) */
  --font-head: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 78% -8%, #16222a 0%, rgba(22,34,42,0) 60%) no-repeat,
    linear-gradient(180deg, var(--bg-grad) 0%, var(--bg) 520px) no-repeat,
    var(--bg);
  line-height: 1.62;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(198,162,58,0.26); color: var(--ink); }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--gold-soft); }

/* ---- Accessibility ---------------------------------------------------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: #14110a; padding: .6rem 1rem;
  font-family: var(--font-mono); font-size: .8rem; z-index: 100; border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Top bar ---------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .85rem clamp(1rem, 4vw, 2rem);
  background: rgba(15,20,24,0.86);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-mono);
  font-weight: 600; font-size: .92rem; letter-spacing: .04em;
  color: var(--ink); white-space: nowrap;
  display: inline-flex; align-items: center; gap: .55rem;
}
.brand::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px rgba(198,162,58,0.16);
}
.topbar nav { margin-left: auto; display: flex; gap: 1.35rem; flex-wrap: wrap; }
.topbar nav a {
  font-family: var(--font-mono);
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mute);
}
.topbar nav a:hover { color: var(--gold-soft); }

/* ---- Layout ----------------------------------------------------------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: clamp(1.6rem, 4vw, 3.2rem) clamp(1rem, 4vw, 2rem) 3rem; }
.container.wide { max-width: var(--maxw-wide); }

section { margin: 0 0 2.6rem; }

/* Hairline rule used between major blocks */
.rule { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }

/* ---- Typography ------------------------------------------------------- */
h1 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: .3rem 0 .7rem;
  text-wrap: balance;
}
h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: -0.01em;
  margin: 2.2rem 0 .7rem;
}
h3 { font-family: var(--font-head); font-weight: 600; font-size: 1.12rem; margin: .2rem 0 .4rem; }

p { margin: 0 0 1rem; }

.kicker, .eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 .55rem;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.kicker::before {
  content: ""; width: 1.6rem; height: 1px; background: var(--gold-dim); display: inline-block;
}

.lead {
  font-size: clamp(1.08rem, 1.8vw, 1.26rem);
  line-height: 1.55; color: var(--soft); max-width: 62ch;
  font-weight: 400;
}

.muted { color: var(--mute); }
strong { color: var(--ink); font-weight: 600; }

/* Analytical question — the framing line for a thread/pill */
.question {
  font-family: var(--font-head);
  font-size: 1.05rem; line-height: 1.45; color: var(--steel);
  border-left: 2px solid var(--gold-dim);
  padding-left: .95rem; margin: 0 0 1rem;
}
.question em { font-style: normal; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font-mono);
  font-size: .78rem; letter-spacing: .06em;
  background: var(--gold); color: #14110a;
  padding: .62rem 1.05rem; border: 1px solid var(--gold);
  border-radius: 3px; cursor: pointer;
  transition: background .15s ease, transform .12s ease, color .15s ease;
}
.btn:hover { background: var(--gold-soft); color: #14110a; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: transparent; color: var(--soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--gold-soft); border-color: var(--gold-dim); transform: translateY(-1px); }

.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: 1.1rem 0; }

/* Inline text link with subtle arrow */
.arrow-link {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .04em;
  color: var(--gold-soft);
}
.arrow-link:hover { color: var(--gold); }

/* ---- Hero ------------------------------------------------------------- */
.hero { padding: 1rem 0 .4rem; }
.hero .lead { margin-bottom: 1.2rem; }
/* Compact variant — content-first homepage keeps the hero to one short block */
.hero-compact { padding: .4rem 0 .2rem; }
.hero-compact h1 { font-size: clamp(1.8rem, 3.8vw, 2.5rem); max-width: 20ch; }
.hero-compact .lead { font-size: clamp(1rem, 1.6vw, 1.12rem); max-width: 58ch; margin-bottom: 1rem; }

/* Featured latest thread — visually elevated card */
.card.featured {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-color: var(--gold-dim);
  padding: 1.5rem 1.6rem;
}
.card.featured h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.18; }
.card.featured .excerpt { font-size: 1.05rem; }
.featured-flag {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .18em; text-transform: uppercase;
  color: #14110a; background: var(--gold); padding: .18rem .55rem; border-radius: 100px; white-space: nowrap;
}

/* Registration prompt block */
.signup {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 1.6rem 1.6rem 1.2rem;
}
.signup h2 { margin-top: .2rem; }

/* Future professional layer — deliberately lower visual priority */
.future-layer {
  border-top: 1px solid var(--line-soft);
  padding-top: 1.4rem;
  color: var(--mute);
}
.future-layer h2 { font-size: 1.05rem; color: var(--soft); margin-top: .3rem; }
.future-layer .eyebrow { color: var(--faint); }
.future-layer .eyebrow::before { background: var(--faint); }
.future-layer p { max-width: 64ch; font-size: .92rem; }

/* small "what it is / isn't" strip under the hero */
.tenets {
  list-style: none; padding: 0; margin: 1.4rem 0 0;
  display: grid; gap: .5rem;
  font-family: var(--font-mono); font-size: .8rem; color: var(--mute);
}
.tenets li { display: flex; gap: .6rem; align-items: baseline; }
.tenets li::before { content: "—"; color: var(--gold-dim); }

/* ---- Access ladder ---------------------------------------------------- */
.ladder { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0; }
.ladder li {
  display: grid; grid-template-columns: 2.6rem 1fr; align-items: baseline;
  gap: .8rem; padding: .85rem 0; border-top: 1px solid var(--line-soft);
}
.ladder li:first-child { border-top: 0; }
.ladder .step {
  font-family: var(--font-mono); font-size: .72rem; color: var(--gold-dim);
  letter-spacing: .08em;
}
.ladder .who { color: var(--ink); font-weight: 600; }
.ladder .what { color: var(--mute); }

/* ---- Cards (thread / pill archive) ----------------------------------- */
.cards { display: grid; gap: 1rem; }
@media (min-width: 720px) { .cards.two { grid-template-columns: 1fr 1fr; } }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 1.25rem 1.3rem 1.15rem;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.card:hover { border-color: var(--gold-dim); transform: translateY(-2px); background: var(--surface-2); }

.card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; margin-bottom: .55rem;
}
.card h3 { margin: .15rem 0 .45rem; font-size: 1.18rem; line-height: 1.25; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--gold-soft); }
.card .excerpt { color: var(--soft); margin: 0 0 .7rem; }
.card .why-line {
  font-size: .92rem; color: var(--mute);
  border-left: 2px solid var(--line); padding-left: .75rem; margin: 0 0 .9rem;
}
.card .btn-row { margin: .9rem 0 0; }

/* Topic / category micro-label */
.topic-label {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold);
}
/* Source provenance marker (small) */
.source-marker {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .04em;
  color: var(--faint); display: block; margin-top: .2rem;
}
.source-marker .src-name { color: var(--mute); }

/* ---- Thread / pill detail -------------------------------------------- */
.breadcrumb {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--faint); margin: 0 0 1.4rem;
}
.breadcrumb a { color: var(--mute); }
.breadcrumb a:hover { color: var(--gold-soft); }
.breadcrumb .sep { color: var(--line); margin: 0 .45rem; }

/* provenance metadata line under the H1 */
.provenance {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .03em;
  color: var(--mute); margin: 0 0 1.6rem;
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
}
.provenance .dot { color: var(--gold-dim); }

.excerpt-lead { font-size: 1.12rem; color: var(--soft); line-height: 1.6; }

/* "Why this matters" callout */
.why {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 1.1rem 1.3rem;
  margin: 1.8rem 0;
}
.why h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.why p { margin: 0; color: var(--soft); }

/* Registered-extension / register prompt block */
.gate {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 1.2rem 1.3rem;
  margin: 1.8rem 0;
}
.gate p { color: var(--soft); }

/* Source & provenance block (mandatory original-publication) */
.source-pub {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-left: 3px solid var(--steel);
  border-radius: 5px;
  padding: 1.2rem 1.35rem;
  margin: 2rem 0;
}
.source-pub .kicker { color: var(--steel); }
.source-pub .kicker::before { background: var(--steel); }
.source-pub .pub-title { font-family: var(--font-head); font-size: 1.08rem; font-weight: 600; margin: 0 0 .5rem; }
.source-pub .pub-meta {
  font-family: var(--font-mono); font-size: .73rem; color: var(--mute);
  margin: 0 0 1rem; line-height: 1.7;
}
.source-pub .pub-meta .lbl { color: var(--faint); }

/* Interactions (save / follow — first-party interest events) */
.interactions { display: flex; gap: .55rem; flex-wrap: wrap; margin: 1.6rem 0; }
.interactions .btn { background: transparent; color: var(--soft); border: 1px solid var(--line); }
.interactions .btn:hover { border-color: var(--gold-dim); color: var(--gold-soft); }

/* Tag / topic chips */
.tagrow { display: flex; gap: .45rem; flex-wrap: wrap; margin: 1.4rem 0; align-items: center; }
.tag-chip {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em;
  color: var(--soft); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 100px; padding: .25rem .7rem;
}
.tag-chip:hover { border-color: var(--gold-dim); color: var(--gold-soft); }
.tagrow .label { font-family: var(--font-mono); font-size: .72rem; color: var(--faint); letter-spacing: .08em; text-transform: uppercase; }

/* ---- Plain thread list (related / latest compact) -------------------- */
.thread-list { list-style: none; padding: 0; margin: .6rem 0 0; }
.thread-list li {
  padding: .85rem 0; border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
}
.thread-list li:first-child { border-top: 0; }
.thread-list a { color: var(--ink); font-weight: 500; }
.thread-list a:hover { color: var(--gold-soft); }
.ttype {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-dim); white-space: nowrap;
}

/* Category index list */
.cat-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.cat-list li { padding: 1rem 0; border-top: 1px solid var(--line-soft); }
.cat-list li:first-child { border-top: 0; }
.cat-list .cat-name { font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; }
.cat-list .cat-name a { color: var(--ink); }
.cat-list .cat-name a:hover { color: var(--gold-soft); }
.cat-list .cat-desc { color: var(--mute); margin: .25rem 0 0; }

/* category quick-nav (inline pills) */
.cat-nav { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 0; }
.cat-nav a {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em;
  color: var(--soft); border: 1px solid var(--line); border-radius: 100px; padding: .25rem .75rem;
}
.cat-nav a:hover { border-color: var(--gold-dim); color: var(--gold-soft); }

/* ---- Forms (register / sign-in / profile) ---------------------------- */
form { margin: 1.4rem 0 0; }
fieldset { border: 0; padding: 0; margin: 0 0 1.6rem; }
legend, form h3 {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold); margin: 1.8rem 0 .8rem; padding: 0;
}
label { display: block; font-size: .92rem; color: var(--soft); margin: 0 0 .9rem; }
input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%; margin-top: .3rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px;
  padding: .6rem .7rem; font-family: var(--font-body); font-size: .98rem;
}
input:focus, select:focus { border-color: var(--gold-dim); outline: none; box-shadow: 0 0 0 2px rgba(198,162,58,0.2); }
select[multiple] { min-height: 8rem; }
input[type="checkbox"] { accent-color: var(--gold); margin-right: .5rem; transform: translateY(1px); }
label:has(input[type="checkbox"]) { display: block; color: var(--soft); }

.form-note { font-family: var(--font-mono); font-size: .74rem; color: var(--faint); }

/* ---- Empty / fallback states ----------------------------------------- */
.empty { color: var(--mute); border: 1px dashed var(--line); border-radius: 6px; padding: 1.4rem; }

.phase-flag {
  font-family: var(--font-mono); font-size: .74rem; color: var(--mute);
  border: 1px dashed var(--line); padding: .4rem .6rem; border-radius: 3px;
}

/* ---- Disclaimer ------------------------------------------------------- */
.disclaimer { font-size: .82rem; color: var(--faint); line-height: 1.55; margin-top: 2rem; }

/* ---- Footer ----------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem; padding: 2rem clamp(1rem, 4vw, 2rem);
  font-size: .82rem; color: var(--mute);
  max-width: var(--maxw-wide); margin-left: auto; margin-right: auto;
}
.footer p { margin: 0 0 .7rem; max-width: 70ch; }
.footer strong { color: var(--soft); }

/* ---- Motion (restrained; respect reduced-motion) --------------------- */
@media (prefers-reduced-motion: no-preference) {
  .container > section { animation: rise .5s ease both; }
  .container > section:nth-child(2) { animation-delay: .05s; }
  .container > section:nth-child(3) { animation-delay: .1s; }
  .container > section:nth-child(4) { animation-delay: .15s; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
