/*
  Hermes plugin manuals: the shared frame for linchpin.studio/hermes and every plugin manual under it.
  One layout, one type system, one print path. Each plugin sets its own accent on <body class="m-<plugin>">.
  Zero border radius throughout, per the LINCHPIN frame.
*/
:root {
  --cream: #F4F1EA;
  --paper: #FBF9F4;
  --ink: #1d1c19;
  --ink-2: #33302a;
  --rule: rgba(29, 28, 25, .14);
  --rule-strong: rgba(29, 28, 25, .28);
  --navy: #002147;
  --gold: #C5A059;

  /* Plugin accent. Defaults are LINCHPIN gold on navy; each manual overrides these. */
  --accent: #C5A059;          /* fills, rules, numerals on dark */
  --accent-ink: #7d5c1e;      /* accent used as text on cream */
  --accent-wash: rgba(197, 160, 89, .12);
  --hero-bg: #001433;
  --hero-ink: #F4F1EA;
  --hero-image: none;
  --display: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --display-weight: 900;
  --display-case: uppercase;
  --display-track: -0.045em;

  --font-sans: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Source Serif 4", ui-serif, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Courier New", monospace;
  --measure: 680px;
}

/* Cabinet: walnut and brass, from botcabinet.com (--brass #c69a4b, light-mode brass #76500f) */
body.m-cabinet {
  --accent: #c69a4b;
  --accent-ink: #76500f;
  --accent-wash: rgba(198, 154, 75, .14);
  --hero-bg: #0d0b08;
  --hero-ink: #f0ece3;
  --hero-image: url("cabinet/cabinet-doors.jpg");
  --display: "DM Serif Display", "Source Serif 4", Georgia, serif;
  --display-weight: 400;
  --display-case: none;
  --display-track: -0.01em;
}

/* Field Academy: Mount Olympus at dusk, from the plugin's own banner (blaze orange on the Hermes dark skin) */
body.m-academy {
  --accent: #e07a3e;
  --accent-ink: #9b4a17;
  --accent-wash: rgba(224, 122, 62, .12);
  --hero-bg: #121417;
  --hero-ink: #eef0f3;
  --hero-image: url("field-academy/olympus.jpg");
  --display: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --display-weight: 700;
  --display-case: uppercase;
  --display-track: 0.1em;
}
body.m-academy .hero::before { background-position: right bottom; background-size: auto 66%; background-repeat: no-repeat; opacity: .9;
  -webkit-mask-image: linear-gradient(90deg, transparent 47%, #000 58%); mask-image: linear-gradient(90deg, transparent 47%, #000 58%); }
body.m-academy .hero::after { background: none; }
body.m-academy .hero h1 { font-size: clamp(38px, 6.6vw, 76px); }
@media (max-width: 680px) { body.m-academy .hero::before { background-size: auto 150px; background-position: right top; opacity: .45; -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%); mask-image: linear-gradient(180deg, #000 40%, transparent 100%); } }
body.m-academy .hero h1 .dash { color: var(--accent); font-weight: 400; }
body.m-academy h2 { text-transform: none; letter-spacing: -0.02em; font-weight: 800; }

* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--cream); color: var(--ink); font-family: var(--font-serif); font-size: 18px; line-height: 1.62;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
code, kbd { font-family: var(--font-mono); font-size: .84em; background: rgba(29, 28, 25, .06); padding: 1px 5px; }
strong { font-weight: 600; }
::selection { background: var(--accent-wash); }
.print-only { display: none; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 16px; background: #fff; padding: 8px 12px; z-index: 20; }

/* ---------- Top bar: quiet LINCHPIN frame ---------- */
.topbar { background: var(--hero-bg); color: var(--hero-ink); border-bottom: 1px solid rgba(255, 255, 255, .08); position: relative; z-index: 2; }
.topbar .in { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { font-family: var(--font-sans); font-weight: 900; letter-spacing: -0.05em; font-size: 18px; color: var(--hero-ink); text-decoration: none; text-transform: uppercase; }
.wordmark:hover { color: var(--gold); }
.crumbs { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; display: flex; gap: 10px; align-items: center; }
.crumbs a { color: var(--hero-ink); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--accent); }
.topbar .lead-in { display: flex; align-items: center; gap: 18px; }

/* ---------- Hero ---------- */
.hero { background: var(--hero-bg); color: var(--hero-ink); position: relative; overflow: hidden; border-bottom: 3px solid var(--accent); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: var(--hero-image); background-size: cover; background-position: 70% 40%; opacity: .55; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--hero-bg) 0%, var(--hero-bg) 34%, rgba(13, 11, 8, .55) 70%, rgba(13, 11, 8, .2) 100%); }
.hero .in { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 64px 24px 56px; }
.hero .brand-img { height: 30px; width: auto; margin-bottom: 26px; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track);
  font-size: clamp(48px, 9vw, 96px); line-height: .95; margin-top: 14px; color: #fff; }
.hero .sub { margin-top: 22px; font-size: 21px; line-height: 1.5; max-width: 620px; color: var(--hero-ink); }
.facts { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid rgba(255, 255, 255, .16); max-width: 760px; }
.facts div { padding: 14px 26px 0 0; margin-right: 26px; }
.facts dt { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.facts dd { font-family: var(--font-sans); font-size: 16px; font-weight: 700; margin-top: 4px; color: #fff; }
.facts dd a { color: #fff; }
.facts dd a:hover { color: var(--accent); }

/* ---------- Layout ---------- */
.layout { max-width: 1180px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; }
.toc { position: sticky; top: 0; align-self: start; padding: 48px 0 40px; max-height: 100vh; overflow-y: auto; }
.toc p { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 14px; }
.toc ol { list-style: none; border-left: 1px solid var(--rule); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; font-family: var(--font-sans);
  font-size: 14px; line-height: 1.35; color: var(--ink); text-decoration: none; transition: color .2s ease, border-color .2s ease; }
.toc a:hover, .toc a[aria-current="true"] { border-left-color: var(--accent); color: var(--accent-ink); }
main { padding: 8px 0 72px; min-width: 0; }

/* ---------- Sections ---------- */
.sec { padding: 56px 0 8px; scroll-margin-top: 16px; }
.sec + .sec { border-top: 1px solid var(--rule); }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
h2 { font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track);
  font-size: clamp(32px, 4.6vw, 46px); line-height: 1.04; color: var(--ink); break-after: avoid; }
h3 { font-family: var(--font-sans); font-weight: 800; letter-spacing: -0.015em; font-size: 20px; line-height: 1.3; margin: 34px 0 10px; break-after: avoid; }
.prose { max-width: var(--measure); }
.prose p + p, .prose p + ul, .prose ul + p, .prose p + ol, .prose ol + p { margin-top: 14px; }
.prose ul { padding-left: 0; list-style: none; }
.prose ol { padding-left: 24px; }
.prose ol li { margin-top: 6px; padding-left: 4px; }
.prose ul li { position: relative; padding-left: 22px; margin-top: 8px; }
.prose ul li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 9px; height: 2px; background: var(--accent); }
.lead { font-size: 21px; line-height: 1.5; }

/* Numbered steps */
.steps { list-style: none; counter-reset: s; margin-top: 22px; max-width: var(--measure); }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); break-inside: avoid; }
.steps > li:last-child { border-bottom: 1px solid var(--rule); }
.steps > li::before { content: counter(s); width: 36px; height: 36px; display: grid; place-items: center; background: var(--hero-bg); color: var(--accent);
  font-family: var(--font-sans); font-weight: 900; font-size: 17px; margin-top: 1px; }
.steps > li > div { min-width: 0; }
.steps b { font-family: var(--font-sans); font-weight: 800; letter-spacing: -0.01em; }
.ui { font-family: var(--font-sans); font-weight: 700; font-size: .9em; white-space: nowrap; border-bottom: 2px solid var(--accent); padding: 0 1px; }

/* Screenshots */
.shot { margin: 30px 0 8px; break-inside: avoid; }
.shot .frame { background: #0e1014; border: 1px solid rgba(29, 28, 25, .5); box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 22px 50px -18px rgba(13, 11, 8, .45); }
.shot img { width: 100%; height: auto; }
.shot.narrow { max-width: 620px; }
.shot figcaption { font-family: var(--font-mono); font-size: 12px; line-height: 1.55; letter-spacing: .02em; color: var(--ink-2); margin-top: 12px; max-width: var(--measure);
  display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.shot figcaption b { color: var(--accent-ink); letter-spacing: .14em; text-transform: uppercase; font-size: 11px; padding-top: 1px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.pair .shot { margin-top: 24px; }

/* Callouts, definition tables, code */
.note { margin-top: 24px; max-width: var(--measure); border-left: 3px solid var(--accent); background: var(--accent-wash); padding: 16px 20px; break-inside: avoid; }
.note .k { display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 4px; }
.cmd { margin-top: 10px; background: var(--hero-bg); color: #f0ece3; font-family: var(--font-mono); font-size: 14.5px; padding: 14px 16px; overflow-x: auto; white-space: pre; }
.cmd .p { color: var(--accent); user-select: none; }
.ladder { margin-top: 24px; max-width: var(--measure); border-top: 2px solid var(--ink); }
.ladder div { display: grid; grid-template-columns: 34px 170px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.ladder i { font-style: normal; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--accent-ink); padding-top: 3px; }
.ladder b { font-family: var(--font-sans); font-weight: 800; font-size: 16px; }
.ladder span { font-size: 17px; }
.dl { margin-top: 22px; max-width: var(--measure); border-top: 2px solid var(--ink); }
.dl div { display: grid; grid-template-columns: 190px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.dl dt { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); padding-top: 3px; }
.dl dd { font-size: 17px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; max-width: 860px; margin-top: 22px; }
.two > div { border-top: 2px solid var(--ink); padding-top: 12px; break-inside: avoid; }
.two h4 { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 4px; }
.faq { max-width: var(--measure); margin-top: 10px; }
.faq h3 { margin-top: 28px; font-size: 19px; }
.credits { list-style: none; max-width: var(--measure); margin-top: 18px; border-top: 2px solid var(--ink); }
.credits li { padding: 14px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.credits b { font-family: var(--font-sans); font-weight: 800; }

/* ---------- Hub ---------- */
.hub-intro { max-width: 1180px; margin: 0 auto; padding: 56px 24px 8px; }
.cards { max-width: 1180px; margin: 0 auto; padding: 24px 24px 72px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: var(--paper); border: 1px solid var(--rule-strong); display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; break-inside: avoid; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -22px rgba(13, 11, 8, .45); border-color: var(--card-accent); color: var(--ink); }
.card .top { height: 168px; background: var(--card-bg); position: relative; overflow: hidden; border-bottom: 3px solid var(--card-accent); }
.card .top img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.card .top .glyph { position: absolute; left: 22px; bottom: 18px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--card-accent); }
.card .body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { margin: 0; font-size: 26px; font-family: var(--card-display, var(--font-sans)); font-weight: var(--card-weight, 800); letter-spacing: -0.015em; }
.card p { font-size: 17px; }
.status { align-self: flex-start; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 5px 9px;
  border: 1px solid var(--card-accent-ink); color: var(--card-accent-ink); }
.card .go { margin-top: auto; padding-top: 10px; font-family: var(--font-sans); font-weight: 800; font-size: 15px; color: var(--card-accent-ink); display: flex; align-items: center; gap: 8px; }
.card .go svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; transition: transform .2s ease; }
a.card:hover .go svg { transform: translateX(3px); }
.card.c-cabinet { --card-bg: #0d0b08; --card-accent: #c69a4b; --card-accent-ink: #76500f; --card-display: "DM Serif Display", Georgia, serif; --card-weight: 400; }
.card.c-factory { --card-bg: #16181d; --card-accent: #4a84fe; --card-accent-ink: #1d4fbf; }  /* Software Factory's own blue, as in its manual */
.card.c-academy { --card-bg: #0e0f12; --card-accent: #e07a3e; --card-accent-ink: #9b4a17; --card-display: "Inter Tight", ui-sans-serif, sans-serif; --card-weight: 700; }
.card .blank { position: absolute; inset: 0; background:
  repeating-linear-gradient(90deg, transparent 0 39px, rgba(255, 255, 255, .05) 39px 40px),
  repeating-linear-gradient(0deg, transparent 0 39px, rgba(255, 255, 255, .05) 39px 40px); }
.community { max-width: 1180px; margin: 0 auto; padding: 0 24px 72px; }
.community .two { max-width: none; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--rule-strong); }
.foot .in { max-width: 1180px; margin: 0 auto; padding: 28px 24px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; align-items: baseline;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--ink-2); }
.foot .wm { font-family: var(--font-sans); font-weight: 900; letter-spacing: -0.05em; font-size: 15px; color: var(--ink); text-decoration: none; text-transform: uppercase; }
.foot .wm:hover { color: var(--accent-ink); }
.foot a { color: var(--ink-2); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; max-height: none; padding: 30px 0 4px; border-bottom: 1px solid var(--rule); }
  .toc ol { border-left: 0; display: flex; flex-wrap: wrap; gap: 6px; }
  .toc a { display: inline-flex; border: 1px solid var(--rule-strong); padding: 6px 10px; margin: 0; font-size: 13px; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 17px; }
  .topbar .in, .hero .in, .layout, .hub-intro, .cards, .community, .foot .in { padding-left: 16px; padding-right: 16px; }
  .hide-sm { display: none !important; }
  .hero .in { padding-top: 40px; padding-bottom: 40px; }
  .hero::after { background: linear-gradient(180deg, rgba(13, 11, 8, .55) 0%, var(--hero-bg) 62%); }
  .hero .sub { font-size: 18px; }
  .facts div { margin-right: 18px; padding-right: 0; }
  .sec { padding-top: 40px; }
  .ladder div { grid-template-columns: 28px 1fr; }
  .ladder span { grid-column: 2; }
  .dl div { grid-template-columns: 1fr; gap: 4px; }
  .two, .pair, .cards { grid-template-columns: 1fr; }
  .steps > li { grid-template-columns: 36px 1fr; gap: 12px; }
  .steps > li::before { width: 30px; height: 30px; font-size: 15px; }
  .shot { margin-left: -16px; margin-right: -16px; }
  .shot figcaption { padding: 0 16px; grid-template-columns: 1fr; gap: 2px; }
  .cmd { font-size: 13px; }
}

/* ---------- Print: light, ink-saving, no chrome ---------- */
@media print {
  @page { margin: 16mm 15mm 18mm; }
  html, body { background: #fff !important; color: #111 !important; font-size: 10.5pt; line-height: 1.5; }
  p, li, dd { orphans: 3; widows: 3; }
  .skip, .toc, .topbar .crumbs { display: none !important; }
  .topbar, .hero { background: transparent !important; color: #111 !important; border-bottom: 1px solid #999; }
  .hero::before, .hero::after { display: none !important; }
  .hero .brand-img { display: none; }
  .hero .in, .topbar .in { padding: 8px 0 14px; max-width: none; }
  .wordmark { color: #111 !important; }
  .hero h1 { color: #111 !important; font-size: 34pt; }
  .hero .sub { color: #222 !important; font-size: 12pt; }
  .eyebrow, .facts dt, .toc p, .note .k, .two h4, .shot figcaption b, .dl dt { color: #5f430f !important; }
  .facts { border-top-color: #bbb; }
  .facts dd, .facts dd a { color: #111 !important; }
  .layout { display: block; max-width: none; padding: 0; }
  main { padding: 0; }
  .sec { padding-top: 18pt; break-inside: auto; }
  .sec + .sec { border-top: 1px solid #bbb; }
  h2 { font-size: 20pt; break-after: avoid; page-break-after: avoid; }
  h3, h4, .sec-head { break-after: avoid; page-break-after: avoid; }
  .prose, .steps, .note, .dl, .ladder, .faq, .credits, .shot figcaption { max-width: none; }
  .steps > li::before { background: transparent !important; color: #5f430f !important; border: 1px solid #5f430f; }
  .steps > li, .ladder div, .dl div, .credits li, .note, .two > div, .card, .faq h3 + p { break-inside: avoid; page-break-inside: avoid; }
  .note { background: transparent !important; border-left: 2px solid #5f430f; }
  .cmd { background: transparent !important; color: #111 !important; border: 1px solid #999; white-space: pre-wrap; }
  .cmd .p { color: #5f430f !important; }
  code { background: transparent; border: 1px solid #ccc; }
  .ui { border-bottom-color: #5f430f; }
  /* Screenshots are dark app screens: on paper they are solid ink. Print keeps the caption and points to the web copy. */
  .shot { margin: 8pt 0 4pt; break-inside: avoid; page-break-inside: avoid; }
  .shot .frame { display: none !important; }
  .shot figcaption { display: block; border-left: 2px solid #999; padding-left: 8pt; color: #333; }
  .shot figcaption b { display: inline; margin-right: 6pt; }
  .print-only { display: block !important; }
  .pair { display: block; }
  a { color: #111 !important; text-decoration: underline; }
  .credits a[href^="http"]::after, .print-links a[href^="http"]::after { content: " (" attr(href) ")"; font-family: var(--font-mono); font-size: 8pt; color: #444; word-break: break-all; }
  .cards { display: block; padding: 0; }
  .card { border: 1px solid #999; margin-bottom: 10pt; background: transparent !important; }
  .card .top { display: none; }
  .card .go { display: none; }
  .status { color: #5f430f !important; border-color: #5f430f !important; }
  .card h3 { font-size: 16pt; }
  .hub-intro, .community { padding: 0; max-width: none; }
  .foot { border-top: 1px solid #999; }
  .foot .in { padding: 10pt 0 0; color: #333; }
  .foot .wm { color: #111 !important; }
}
.m-hub .hero::after, .m-hub .hero::before { display: none; }
