/* GOBLIN WG1 community survey – shared styles (palette and type follow goblin-cost.eu) */
:root {
  --bg: #fcfaf7;
  --surface: #ffffff;
  --surface-2: #f6f4f0;
  --text: #231f20;
  --text-2: #3a3335;      /* body copy on cards and intros */
  --muted: #5a5254;       /* ~7:1 on the cream background */
  --line: #e7e1dc;
  --accent: #ed174f;       /* GOBLIN crimson */
  --accent-strong: #a11037;
  --accent-deep: #7f0d2b;
  --accent-soft: #fbe3ea;
  --violet: #554cd2;       /* GOBLIN violet */
  --violet-soft: #e9e8f9;
  --focus: #554cd2;
  --shadow: 0 1px 2px rgba(35, 31, 32, .06), 0 6px 20px rgba(35, 31, 32, .05);
  --radius: 10px;
  --maxw: 1160px;
  --font-head: "Platypi", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17141a; --surface: #201c23; --surface-2: #28232c; --text: #f1ecef; --text-2: #ddd5d9; --muted: #c4bbc0;
    --line: #3a333d; --accent: #ff4d78; --accent-strong: #ff7896; --accent-deep: #ffb3c4; --accent-soft: #3d1a25;
    --violet: #a39dff; --violet-soft: #2c2945; --focus: #a39dff;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --bg: #17141a; --surface: #201c23; --surface-2: #28232c; --text: #f1ecef; --text-2: #ddd5d9; --muted: #c4bbc0;
  --line: #3a333d; --accent: #ff4d78; --accent-strong: #ff7896; --accent-deep: #ffb3c4; --accent-soft: #3d1a25;
  --violet: #a39dff; --violet-soft: #2c2945; --focus: #a39dff;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 18px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 50; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--text); }
.brand b { font: 700 22px/1 var(--font-head); color: var(--accent); letter-spacing: .02em; }
.brand span { font-size: 14px; color: var(--muted); }
.site-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none; color: var(--text); font-weight: 600; font-size: 16px;
  padding: 8px 11px; border-radius: 8px;
}
.site-nav a.nav-cta { background: var(--accent); color: #fff; margin-left: 6px; }
.site-nav a.nav-cta:hover { background: var(--accent-strong); color: #fff; }
.site-nav a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.site-nav a[aria-current="page"] { color: var(--accent-strong); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.theme-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px;
  width: 36px; height: 36px; cursor: pointer; font-size: 16px;
}
@media (max-width: 640px) { .site-nav { margin-left: 0; width: 100%; } .site-header .wrap { padding-block: 8px; gap: 8px; } }

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -120px; top: -80px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--violet-soft), transparent 70%); z-index: -1;
}
.eyebrow { font: 600 13px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); margin: 0 0 14px; }
.hero h1 { font-size: clamp(34px, 5.2vw, 58px); max-width: 17ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: clamp(19px, 2vw, 22px); line-height: 1.55; color: var(--text-2); max-width: 58ch; margin: 0 0 28px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 16px;
  padding: 12px 20px; border-radius: 999px; border: 2px solid var(--accent); color: var(--accent-strong); background: transparent;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn:hover { background: var(--accent-soft); }

/* ---------- sections ---------- */
section { padding: 72px 0; scroll-margin-top: 64px; }
@media (max-width: 640px) { section { padding: 52px 0; } }
section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 66ch; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 36px); }
.section-head p { color: var(--text-2); margin: 0; }
.prose { max-width: 70ch; }
.prose p { margin: 0 0 1em; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat .n { font: 600 clamp(28px, 3vw, 38px)/1.05 var(--font-head); color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .l { color: var(--text-2); font-size: 16px; line-height: 1.35; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
}
.card .tag { font: 600 12px/1 var(--font-mono); color: var(--violet); letter-spacing: .05em; text-transform: uppercase; }
.card h3 { font-size: 21px; margin: 0; line-height: 1.25; }
.card p { margin: 0; color: var(--text-2); font-size: 17px; line-height: 1.55; }
.card .count { margin-top: auto; font-weight: 700; color: var(--accent-strong); }

.steps { counter-reset: s; display: grid; gap: 14px; max-width: 70ch; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.steps li::before {
  content: counter(s); width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font: 700 16px/1 var(--font-head);
}

/* ---------- footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; }
.site-footer strong { color: var(--text); }

/* ---------- embedded artefact map ---------- */
.map-frame {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  background: #fff; height: min(78vh, 760px); min-height: 520px;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 860px) { .map-frame { height: 88vh; } }

/* ---------- methodology pipeline ---------- */
.pipeline {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); counter-reset: none;
}
.pipeline li {
  position: relative; background: var(--bg); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px;
}
.pipeline li:nth-child(even) { border-top-color: var(--violet); }
.pipeline .k { font: 600 12px/1 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pipeline b { font: 600 18px/1.2 var(--font-head); }
.pipeline p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--text-2); }
@media (min-width: 1100px) {
  .pipeline li:not(:last-child)::after {
    content: "→"; position: absolute; right: -13px; top: 50%; transform: translateY(-50%);
    color: var(--accent); font-weight: 700; background: var(--surface); line-height: 1; padding: 2px 0;
  }
}
code { font: 500 .88em var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.cite { font-size: 15.5px; color: var(--muted); margin-top: 28px; max-width: 90ch; }

/* ---------- on-demand extension ---------- */
.extend {
  margin-top: 36px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start;
  background: var(--violet-soft); border-radius: var(--radius); padding: 28px;
}
@media (max-width: 860px) { .extend { grid-template-columns: 1fr; padding: 20px; } }
.extend h3 { font-size: 26px; }
.extend p { margin: 0 0 .8em; }
.extend .eyebrow { color: var(--violet); margin-bottom: 8px; }
.extend-steps { list-style: none; margin: 0; padding: 0; counter-reset: e; display: grid; gap: 8px; }
.extend-steps li {
  counter-increment: e; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px 10px 48px; position: relative; display: grid;
}
.extend-steps li::before {
  content: counter(e); position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; background: var(--violet); color: #fff;
  display: grid; place-items: center; font: 700 14px/1 var(--font-head);
}
.extend-steps b { font-weight: 700; }
.extend-steps span { font-size: 15px; color: var(--text-2); }
.principles { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.principles li { font-size: 16.5px; line-height: 1.5; color: var(--text-2); padding-left: 14px; border-left: 3px solid var(--accent); }
.principles b { display: block; color: var(--text); font-size: 17.5px; }

/* ---------- embedded coverage tree ---------- */
.tree-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.tree-frame iframe { width: 100%; height: 1500px; border: 0; display: block; }

/* ---------- hero key figures ---------- */
.keyfigs { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 40px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); }
.keyfigs div { display: grid; gap: 2px; }
.keyfigs dt { font: 600 30px/1.1 var(--font-head); color: var(--accent); font-variant-numeric: tabular-nums; }
.keyfigs dd { margin: 0; color: var(--text-2); font-size: 16px; }
.lede a { color: inherit; }
.lede strong { color: var(--text); }

/* ---------- participation ---------- */
.commit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 36px; margin-top: 40px; align-items: start; }
@media (max-width: 860px) { .commit { grid-template-columns: 1fr; gap: 20px; } }
.commit h3 { font-size: 22px; }
.commit-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.commit-table th, .commit-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 16px; }
.commit-table tr:last-child th, .commit-table tr:last-child td { border-bottom: 0; }
.commit-table th { font-weight: 600; color: var(--text-2); width: 55%; }
.commit-table td { font-weight: 700; }
.pull {
  margin: 32px 0 0; padding: 18px 24px; border-left: 4px solid var(--accent); background: var(--accent-soft);
  font: 600 clamp(19px, 2.2vw, 24px)/1.35 var(--font-head); border-radius: 0 var(--radius) var(--radius) 0; max-width: 70ch;
}

/* ---------- readability layout ---------- */
.sub { font-size: 24px; margin: 48px 0 18px; }
.muted-line { color: var(--text-2); max-width: 66ch; margin: -6px 0 22px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; gap: 24px; } }
.prose strong { color: var(--text); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; }
.panel h3 { font-size: 21px; margin-bottom: 14px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 22px; color: var(--text-2); font-size: 17px; line-height: 1.5; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ticks b { color: var(--text); }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .cards.three, .cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards.three, .cards.four { grid-template-columns: 1fr; } }

.scope-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; }
@media (max-width: 760px) { .scope-list { grid-template-columns: 1fr; } }
.scope-list div { padding: 14px 0; border-top: 1px solid var(--line); }
.scope-list dt { font: 600 19px/1.3 var(--font-head); margin-bottom: 2px; }
.scope-list dd { margin: 0; color: var(--text-2); font-size: 17px; line-height: 1.5; }

details.figure, details.more { margin-top: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.figure > summary, details.more > summary {
  cursor: pointer; list-style: none; padding: 16px 20px; display: flex; gap: 12px; align-items: center;
  color: var(--text-2); font-size: 17px;
}
details > summary::-webkit-details-marker { display: none; }
details.figure > summary::before, details.more > summary::before {
  content: "+"; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font: 700 18px/1 var(--font-body);
}
details[open] > summary::before { content: "–"; }
details.figure > summary b { color: var(--text); }
details.figure .tree-frame { margin: 0 20px; }
details.more > summary { font-weight: 600; color: var(--text); }
details.more .prose { padding: 0 20px 6px 58px; color: var(--text-2); }
.figure-note { margin: 12px 20px 18px; font-size: 16px; }

.phases { list-style: none; margin: 0; padding: 0; counter-reset: ph; display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .phases { grid-template-columns: 1fr; } }
.phases li { counter-increment: ph; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 6px; align-content: start; }
.phases li::before { content: "Phase " counter(ph); font: 600 12px/1 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--accent-strong); }
.phases b { font: 600 18px/1.25 var(--font-head); }
.phases span { color: var(--text-2); font-size: 16px; line-height: 1.5; }

.steps h3 { font-size: 20px; margin-bottom: 2px; }
.steps p { margin: 0; color: var(--text-2); }
kbd { font: 500 .85em var(--font-mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }

.cta { background: #7f0d2b; color: #fff; text-align: left; }
.cta .eyebrow { color: #ffc2d1; }
.cta h2 { font-size: clamp(28px, 3.6vw, 42px); max-width: 22ch; }
.cta .lede { color: #fbe3ea; }
.cta .btn { border-color: #fff; color: #fff; }
.cta .btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.cta .btn.primary { background: #fff; color: #7f0d2b; border-color: #fff; }
.cta .btn.primary:hover { background: #ffe3ea; color: #7f0d2b; }
:root[data-theme="dark"] .cta { background: #3d1a25; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cta { background: #3d1a25; } }

/* ---------- hero backdrop: the artefact map behind the title ---------- */
.hero { isolation: isolate; }
.hero-graph {
  position: absolute; inset: 0 0 0 30%; z-index: -1; pointer-events: none; opacity: .5;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 38%);
          mask-image: linear-gradient(to right, transparent 0%, #000 38%);
}
.hero-graph iframe { width: 100%; height: 100%; border: 0; display: block; background: transparent; }
.hero::after { display: none; }
.hero h1, .hero .lede, .keyfigs dt, .keyfigs dd, .hero .eyebrow { text-shadow: 0 0 18px var(--bg), 0 0 6px var(--bg), 0 0 2px var(--bg); }
@media (max-width: 860px) {
  .hero-graph { inset: 0; opacity: .18; -webkit-mask-image: none; mask-image: none; }
}
:root[data-theme="dark"] .hero-graph { opacity: .35; filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-graph { opacity: .35; filter: invert(1) hue-rotate(180deg); }
}

/* ---------- compact header on phones ---------- */
@media (max-width: 640px) {
  .site-header .wrap { gap: 6px 12px; padding-block: 8px 0; }
  .theme-toggle { margin-left: auto; }
  .site-nav {
    order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px 8px;
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; padding: 6px 10px; }
}
