:root {
  --paper: #eef2ef;
  --paper-2: #e2e9e4;
  --ink: #16302c;
  --ink-soft: #46605b;
  --tag: #f7d046;
  --tag-edge: #d9b02a;
  --life: #2e7a57;
  --warn: #9a6512;
  --block: #b23a26;
  --ok: #2e7a57;
  --line: #c5d1ca;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--life); }
:focus-visible { outline: 3px solid var(--life); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip:focus { left: 8px; z-index: 10; }

/* header */
.top {
  max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.35rem var(--display); text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.top nav { display: flex; gap: clamp(12px, 3vw, 28px); flex-wrap: wrap; }
.top nav a { text-decoration: none; font-weight: 700; font-size: 0.98rem; }
.top nav a:hover { text-decoration: underline; }

main > section { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 8vw, 96px) var(--gutter); }

/* hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 6vw, 80px);
  align-items: center; padding-top: clamp(24px, 5vw, 56px) !important;
}
.hero h1 { text-wrap: balance; font-size: clamp(2.5rem, 5.4vw, 4.4rem); font-weight: 800; letter-spacing: -0.03em; font-variation-settings: "opsz" 96; }
.lede { margin-top: 24px; font-size: clamp(1.08rem, 1.6vw, 1.25rem); max-width: 34em; color: var(--ink-soft); }
.actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 22px; border: 2px solid var(--ink); border-radius: 999px;
  font-weight: 700; text-decoration: none; background: transparent;
}
.btn:hover { background: var(--paper-2); color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--life); border-color: var(--life); color: #fff; }

.hero-tag { position: relative; margin: 0; padding-top: 64px; }
.hero-tag::before { /* string from above into the hole */
  content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 84px; margin-left: -1px;
  background: var(--ink); z-index: 1;
}
.hero-tag .tag { transform: rotate(4deg); transform-origin: 50% 20px; animation: sway 1.6s cubic-bezier(.3,.6,.3,1) 1; }
@keyframes sway { 0% { transform: rotate(-8deg); } 55% { transform: rotate(7deg); } 100% { transform: rotate(4deg); } }

/* the tag – the one memorable element */
.tag {
  --notch: 22px;
  position: relative; background: var(--tag); color: var(--ink);
  padding: 34px 26px 22px 26px;
  clip-path: polygon(var(--notch) 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, 0 100%, 0 var(--notch));
  box-shadow: inset 0 0 0 2px var(--tag-edge);
}
.tag .hole {
  position: absolute; top: 12px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 2px var(--tag-edge), 0 0 0 4px rgba(255,255,255,.35);
}
.tag-kind { font-size: 0.9rem; color: var(--ink-soft); }
.tag-title { font-size: 1.45rem; margin: 4px 0 12px; font-weight: 800; }
.tag.big .tag-title { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.tag-facts { margin: 0 0 14px; display: grid; gap: 8px; }
.tag-facts div { display: grid; grid-template-columns: 8.5em 1fr; gap: 8px; border-top: 1px dashed var(--tag-edge); padding-top: 8px; }
.tag-facts dt { font-weight: 700; font-size: 0.92rem; }
.tag-facts dd { margin: 0; font-size: 0.95rem; }

.check { display: flex; align-items: baseline; gap: 8px; font-size: 0.93rem; }
.check .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; transform: translateY(1px); }
.check.ok .dot { background: var(--ok); }
.check.warn .dot { background: var(--warn); }
.check.block .dot { background: var(--block); }
.check.block { color: var(--block); font-weight: 700; }

/* browse */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.section-head h2, .list h2, .agents h2, .faq h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 800; }
.preview-note { max-width: 30em; color: var(--ink-soft); font-size: 0.95rem; }
.filters { margin-top: 28px; display: flex; gap: 14px 20px; align-items: center; flex-wrap: wrap; }
.search input {
  width: min(360px, 100%); padding: 12px 16px; border: 2px solid var(--ink); border-radius: 999px;
  font: inherit; background: #fff; color: var(--ink);
}
.search { flex: 1 1 260px; max-width: 360px; }
.search input { width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: 700 0.92rem var(--body); padding: 7px 14px; border-radius: 999px; border: 2px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:hover { border-color: var(--ink); }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: 0.95rem; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--life); }
.count { margin-top: 22px; color: var(--ink-soft); font-size: 0.95rem; }

.tags {
  list-style: none; margin: 18px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 34px 26px;
}
.tags li { position: relative; padding-top: 26px; }
.tags li::before { /* the string each tag hangs from, ending in the punched hole */
  content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 46px; margin-left: -1px;
  background: var(--ink); opacity: .6; z-index: 1; pointer-events: none;
}
.tags li:nth-child(3n+1) .tag { transform: rotate(-1.6deg); }
.tags li:nth-child(3n+2) .tag { transform: rotate(1.2deg); }
.tags li:nth-child(3n) .tag { transform: rotate(-0.4deg); }
.tag-button {
  all: unset; display: block; cursor: pointer; width: 100%;
}
.tag-button:focus-visible .tag { outline: 3px solid var(--ink); outline-offset: 4px; }
.tag-button:hover .tag { transform: rotate(0deg) translateY(-2px); }
.tag.blocked { background: #f1e3c4; }
.tag p.summary { font-size: 0.95rem; margin-bottom: 12px; }
.tag .stack { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; padding: 0; list-style: none; }
.tag .stack li { font-size: 0.82rem; padding: 2px 9px; border-radius: 999px; background: rgba(22,48,44,.09); }
.tag .stack li::before { content: none; }
.meter { height: 6px; background: rgba(22,48,44,.15); border-radius: 3px; margin: 4px 0 12px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--life); }
.empty { margin-top: 24px; font-weight: 700; }

/* list */
.list { border-top: 2px solid var(--ink); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--tag); border: 2px solid var(--ink); font: 800 1.2rem var(--display); margin-bottom: 14px;
}
.steps h3 { font-size: 1.3rem; margin-bottom: 8px; }
.steps p { color: var(--ink-soft); max-width: 32em; }
.file { display: inline-block; margin-top: 12px; font: 600 0.88rem var(--mono); }
.file.muted { color: var(--ink-soft); }
.verdicts { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 14px 36px; padding: 20px 24px; background: var(--paper-2); border-radius: 14px; }
.verdicts .check { font-size: 0.98rem; }
.verdicts strong { margin-right: 4px; }

/* agents */
.agents { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.agents p { margin-top: 16px; color: var(--ink-soft); max-width: 34em; }
.agents q { color: var(--ink); font-weight: 700; }
.terminal { background: var(--ink); color: #dfeae5; border-radius: 14px; padding: 22px 24px; overflow-x: auto; }
.terminal pre { margin: 0; font: 400 0.86rem/1.6 var(--mono); }
.terminal .c { color: #8fb3a6; }

/* faq */
.faq { max-width: 820px !important; }
.faq details { border-top: 1px solid var(--line); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { font: 600 1.15rem var(--display); cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: "+"; font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin-top: 10px; color: var(--ink-soft); max-width: 40em; }
.faq h2 { margin-bottom: 20px; }

.foot { max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 48px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--ink-soft); font-size: 0.95rem; }

/* detail dialog */
dialog { border: 0; padding: 0; background: transparent; max-width: min(560px, calc(100vw - 32px)); width: 100%; }
dialog::backdrop { background: rgba(22,48,44,.55); }
dialog[open] .detail-tag { animation: drop .28s cubic-bezier(.3,.7,.3,1); }
@keyframes drop { from { transform: translateY(-14px) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-tag h3 { font-size: 1.05rem; margin: 6px 0 6px; }
.detail-tag ol { margin: 0 0 16px; padding-left: 1.2em; }
.detail-tag #d-summary { margin-bottom: 14px; }
.close {
  position: absolute; right: 14px; top: 28px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--ink); background: transparent; color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.close:hover { background: var(--ink); color: var(--tag); }
dialog form { position: relative; height: 0; }
.detail-tag .tag-title { padding-right: 48px; }

@media (max-width: 860px) {
  .hero, .agents { grid-template-columns: 1fr; }
  .hero-tag { max-width: 440px; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .tag-facts div { grid-template-columns: 1fr; gap: 2px; }
  .top nav a { font-size: 0.92rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
