/* =================================================================
   COLLATERA — shared stylesheet
   One file, loaded by every page. Edit visual styling here once and
   it applies site-wide. (Nav links and header markup live in site.js.)
   Palette and type match the live brand: cream Light profile, teal
   accent, Gill Sans MT headings, Calibri Light body.
   ================================================================= */

:root {
  /* ---- Light palette ---- */
  --bg:        #FAF7F0;   /* page background  */
  --surface:   #F0EDE6;   /* cards, header    */
  --ink:       #2E2C2A;   /* body text        */
  --muted:     #6B6860;   /* secondary text   */
  --border:    #D8D4CC;   /* hairlines        */
  --accent:        #E39FC4;  /* pink base — highlights, borders, focus rings */
  --accent-deep:   #A84E7C;  /* pink deep (text on tint) */
  --accent-tint:   #FBEAF3;  /* pink tint  */
  --brand:         #1C6390;  /* logo blue — wordmark & em-dash, stays blue */
  --panel:         #DEEDF8;  /* search panel: pale logo-blue tint */
  --panel-ink:     #2E2C2A;  /* text inside the panel = normal ink */
  --panel-line:    #1F6EA3;  /* edge: slightly darker than the logo blue */
  --title:         #A8455C;  /* page title — deep coral */
  /* account pill / menu (light: pale pink surface, deep coral edge) */
  --acct:       #FCEBF1;  --acct-open:  #FCEBF1;  --acct-ink:   #3A2630;
  --acct-edge:  #A8455C;  --acct-edge2: #E9A0AC;  --acct-lbl:   #2E86BE;
  --acct-val:   #17557A;  --acct-user:  #2E86BE;  --acct-admin: #B0303A;
  --acct-field: #FFFFFF;  --acct-line:  #E0BCC8;  --acct-mute:  #9A8792;
  --acct-hover: rgba(168,69,92,.12);
  --acct-ok:    #1D7A4C;  --acct-err:   #B23B3B;
  --banner-ink:    #2F7FB5;  /* dev banner — light blue accent */
  --footer-ink:    #17557A;  /* footer — deep blue */
  --logo-ring:     #A8455C;  /* ring around the header logo */
  --header-bg:     #F0EDE6;  /* header bar */
  --pink:          #FAD8E9;  /* logo pink — search panel tint */
  --pink-line:     #EFB9D3;  /* logo pink, darkened for hairlines */
--shadow:    rgba(46,44,42,0.10);
  --radius:    16px;
  --pill-ink:  #1F1D1B;  /* fixed dark text for society/category pills — pill backgrounds don't change with theme, so this shouldn't either */

  /* Category accent colours, rotating through the brand palette */
  --c1: #85CCCC; --c2: #90C0D8; --c3: #8DD4A8;
  --c4: #A5C878; --c5: #C0AEDD; --c6: #F0A860;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg:#141C22; --surface:#1B242B; --ink:#EAF0F3; --muted:#93A2AC;
    --border:#2B3841; --accent:#E9A6C8; --accent-deep:#F3C2DC;
    --accent-tint:#3A2A33; --pink:#3A2A33; --pink-line:#6E4A5E;
    --title:#E8909E; --brand:#7CC0EC; --panel:#22394D; --panel-ink:#F2EFE7;
    --acct:#1B5E85; --acct-open:#0F3A54; --acct-ink:#FFFFFF;
    --acct-edge:#7CC0EC; --acct-edge2:#7CC0EC; --acct-admin:#FF9B9B;
    --acct-lbl:#F0B8D4; --acct-val:#8ECBF2;
    --acct-user:#F0B8D4; --acct-field:rgba(255,255,255,.13);
    --acct-line:rgba(255,255,255,.32); --acct-mute:rgba(255,255,255,.5);
    --acct-hover:rgba(255,255,255,.14); --acct-ok:#BFEBC8; --acct-err:#FFC9C9;
    --banner-ink:#8CC6E8; --footer-ink:#FAD8E9;
    --logo-ring:transparent; --logo-ring-w:0px; --header-bg:#141C22;
    --panel-line:#6FB6E4; --shadow:rgba(0,0,0,0.35);
  }
}
:root[data-theme="dark"] {
  --bg:#141C22; --surface:#1B242B; --ink:#EAF0F3; --muted:#93A2AC;
  --border:#2B3841; --accent:#E9A6C8; --accent-deep:#F3C2DC;
  --accent-tint:#3A2A33; --pink:#3A2A33; --pink-line:#6E4A5E;
  --title:#E8909E; --brand:#7CC0EC; --panel:#22394D; --panel-ink:#F2EFE7;
  --acct:#1B5E85; --acct-open:#0F3A54; --acct-ink:#FFFFFF;
  --acct-edge:#7CC0EC; --acct-edge2:#7CC0EC; --acct-admin:#FF9B9B;
  --acct-lbl:#F0B8D4; --acct-val:#8ECBF2;
  --acct-user:#F0B8D4; --acct-field:rgba(255,255,255,.13);
  --acct-line:rgba(255,255,255,.32); --acct-mute:rgba(255,255,255,.5);
  --acct-hover:rgba(255,255,255,.14); --acct-ok:#BFEBC8; --acct-err:#FFC9C9;
  --banner-ink:#8CC6E8; --footer-ink:#FAD8E9;
  --logo-ring:transparent; --logo-ring-w:0px; --header-bg:#141C22;
  --panel-line:#6FB6E4; --shadow:rgba(0,0,0,0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Calibri Light", "Calibri", "Hanken Grotesk", system-ui, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(var(--border) 0.5px, transparent 0.5px),
    radial-gradient(var(--border) 0.5px, var(--bg) 0.5px);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, .brand, .chip, .count, .section-title, .brandmark, .cs-title {
  font-family: "Gill Sans MT", "Gill Sans", "Gill Sans Nova",
               "Hanken Grotesk", "Segoe UI", sans-serif;
}

/* =================================================================
   HEADER  (top bar injected by site.js)
   ================================================================= */
header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--header-bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: none;
}
/* soft fade at the header's lower edge rather than a hard rule */
header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -18px; height: 18px;
  pointer-events: none;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--header-bg) 78%, transparent), transparent);
}
.header-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 8px 20px;
}
.header-top {
  display: flex; align-items: center; gap: 10px;
}

/* hamburger menu button (top-left) */
.menu-btn {
  flex: 0 0 auto;
  width: 51px; height: 51px;
  border: 1px solid var(--border); border-radius: 13px;
  background: var(--bg); color: var(--ink);
  cursor: pointer; font-size: 20px; line-height: 1;
  display: grid; place-items: center; transition: .18s;
}
.menu-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
/* logo sits on a dark disc so its pale ring keeps contrast on cream */
/* logo + wordmark act as the menu trigger; a coral ring gives the pale
   logo edge definition without a heavy filled disc */

.brand-group {
  display: flex; align-items: baseline; gap: 0;
}
/* em-dash separator between the wordmark and the page title */
.section-title::before { content: none; }
.brand {
  font-size: 26px; font-weight: 700; letter-spacing: .01em;
  color: var(--brand); text-decoration: none; line-height: 1;
  font-variant-caps: small-caps;
}
.brand .brand-c { font-size: 1.34em; letter-spacing: 0; }
.section-title {
  font-size: 1.66em; font-weight: 400; font-style: italic; letter-spacing: .02em;
  color: var(--title); line-height: 1;
  font-variant-caps: small-caps; text-transform: none;
}
.brand-group { margin-left: 19px; display: flex; align-items: center; }
.header-top { align-items: center; }
.spacer { flex: 1 1 auto; }

.theme-btn {
  flex: 0 0 auto;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--muted); border-radius: 999px;
  width: 32px; height: 32px; cursor: pointer; font-size: 14px;
  display: grid; place-items: center; transition: .2s;
}
.theme-btn { border-width: 2px; border-color: var(--brand); }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn:hover { color: var(--accent-deep); border-color: var(--accent); }

/* upload button (top-right, next to theme toggle) — same size as theme-btn */
.upload-btn {
  flex: 0 0 auto;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--muted); border-radius: 999px;
  width: 38px; height: 38px; cursor: pointer; font-size: 19px; font-weight: 600;
  display: grid; place-items: center; transition: .2s;
  text-decoration: none; line-height: 1;
}
.upload-btn:hover { color: var(--accent-deep); border-color: var(--accent); }

/* brand-mark logo (top-right) */
.brandmark {
  flex: 0 0 auto;
  height: 40px; width: auto; display: block;
  object-fit: contain; user-select: none;
}

/* =================================================================
   NAV PANEL  (opens from the hamburger)
   ================================================================= */
.nav-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20,18,16,0.35);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.nav-scrim.open { opacity: 1; pointer-events: auto; }

.nav-panel {
  position: fixed; top: 0; left: 0; z-index: 70;
  width: 300px; max-width: 84vw; height: 100%;
  background: var(--surface); border-right: 1px solid var(--border);
  box-shadow: 6px 0 30px var(--shadow);
  transform: translateX(-100%); transition: transform .24s ease;
  display: flex; flex-direction: column; padding: 18px 16px;
}
.nav-panel.open { transform: none; }
.nav-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding: 2px 4px 14px;
  border-bottom: 1px solid var(--border);
}
.nav-head .brand { font-size: 24px; }
.nav-close {
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--muted); cursor: pointer; font-size: 18px;
  display: grid; place-items: center; transition: .18s;
}
.nav-close:hover { color: var(--ink); border-color: var(--accent); }
.nav-divider { border-top: 1px solid var(--border); margin: 8px 0; }
.nav-link {
  display: block; text-decoration: none;
  color: var(--ink); font-size: 16px; font-weight: 600;
  padding: 13px 14px; border-radius: 11px; margin-bottom: 4px;
  border: 1px solid transparent; transition: .15s;
}
.nav-link:hover { background: var(--bg); border-color: var(--border); }
.nav-link[aria-current="page"] {
  background: var(--accent-tint); color: var(--accent-deep);
  border-color: var(--accent);
}
.nav-link .nl-sub {
  display: block; font-family: "Calibri Light","Hanken Grotesk",sans-serif;
  font-weight: 400; font-size: 12.5px; color: var(--muted);
  text-transform: none; letter-spacing: 0; margin-top: 2px;
}

/* =================================================================
   DEV / DISCLAIMER BANNER
   ================================================================= */
.dev-banner {
  text-align: center;
  font-size: 12.5px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--banner-ink);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 7px 16px;
}

/* =================================================================
   SEARCH + CHIP FILTER  (library & guidelines)
   ================================================================= */
.controls {
  max-width: 1180px; margin: 18px auto; padding: 18px 20px 4px;
  background: var(--panel); border: 1px solid var(--panel-line);
  border-radius: var(--radius);
}

/* contents of the tinted panel keep normal ink; only hairlines follow the panel */
.controls .search-input {
  background: var(--bg); border-color: var(--panel-line);
  color: var(--panel-ink);
}
.controls .search-input::placeholder { color: var(--muted); }
.controls .chip { color: var(--muted); border-color: var(--border); }
.controls .chip:hover { color: var(--panel-ink); border-color: var(--accent); }
.controls .chip[aria-pressed="true"] {
  background: var(--accent); color: var(--pill-ink); border-color: var(--accent);
}

.search-wrap { position: relative; margin: 0 0 14px; }
.search-wrap svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.search-input {
  width: 100%; padding: 13px 16px 13px 46px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 16px; outline: none; transition: .2s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.controls .search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

.chips {
  display: flex; align-items: center; gap: 8px; overflow-x: auto;
  padding: 0 0 14px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; cursor: pointer; user-select: none;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--muted); padding: 7px 15px; border-radius: 999px;
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: .18s;
}
.chip:hover { color: var(--ink); border-color: var(--accent); }
.chip[aria-pressed="true"] {
  background: var(--accent-tint); color: var(--accent-deep);
  border-color: var(--accent);
}
/* view-mode chips (Recent / Most used) — pinned at the front */
.chip.is-mode {
  color: var(--accent-deep); border-color: var(--accent);
  background: var(--bg);
}
.chip.is-mode::before { content: "★"; font-size: 11px; margin-right: 5px; opacity: .8; }
.chip.is-mode[aria-pressed="true"] { background: var(--accent-tint); }
/* tag chips read as a lighter, secondary class of filter than categories */
.chip.is-tag {
  font-size: 13px; font-weight: 600; padding: 6px 13px;
  border-style: dashed; color: var(--muted);
}
.chip.is-tag::before {
  content: "#"; opacity: .55; margin-right: 1px; font-weight: 700;
}
.chip.is-tag[aria-pressed="true"] {
  border-style: solid; background: var(--accent-tint); color: var(--accent-deep);
}
/* thin divider between the category group and the tag group */
.chip-sep {
  flex: 0 0 auto; width: 1px; align-self: stretch;
  background: var(--border); margin: 2px 4px;
}

/* pinned static repository links (guidelines page) */
.repos {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 2px 0 16px;
}
.repos-label {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  letter-spacing: .02em; margin-right: 2px;
}
.repo-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--accent-deep); background: var(--accent-tint);
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 5px 12px; transition: .16s;
}
.repo-link:hover { background: var(--bg); }
.repo-link::after { content: "↗"; font-size: 11px; opacity: .7; }

/* =================================================================
   MAIN + GALLERY GRID
   ================================================================= */
main { max-width: 1180px; margin: 0 auto; padding: 18px 20px 80px; }
.count { font-size: 14px; color: var(--muted); margin-bottom: 16px; }

/* 7 per row on desktop, 3 on mobile (smaller thumbnails) */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(7, 1fr);
}
@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; text-align: left;
  font: inherit; color: inherit; padding: 0;
  box-shadow: 0 1px 2px var(--shadow); transition: transform .18s, box-shadow .18s;
  opacity: 0; transform: translateY(10px);
  animation: rise .45s ease forwards;
  border-top: 3px solid var(--cat, var(--border));  /* category colour accent */
}
@keyframes rise { to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px var(--shadow); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.thumb {
  aspect-ratio: 4 / 3; width: 100%; object-fit: cover;
  background: var(--bg); border-bottom: 1px solid var(--border); display: block;
}
/* compact card: category + title only — note/tags are shown in the lightbox */
.card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 5px; }
.card-cat {
  align-self: flex-start;
  font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; color: var(--pill-ink); line-height: 1.3;
}
.card-title {
  font-size: 13px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 720px) {
  .card-title { font-size: 12px; }
  .card-cat { font-size: 9px; }
}

.empty { text-align: center; color: var(--muted); padding: 70px 20px; }
.empty strong { color: var(--ink); display: block; font-size: 18px; margin-bottom: 6px;
  font-family: "Gill Sans MT","Hanken Grotesk",sans-serif; }

/* =================================================================
   GUIDELINE LINK CARDS  (catalog — opens an external link)
   ================================================================= */
.grid.links {
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .grid.links { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .grid.links { grid-template-columns: 1fr; } }
.linkcard {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--cat, var(--accent));
  border-radius: 12px; padding: 16px 18px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; text-align: center;
  box-shadow: 0 1px 2px var(--shadow); transition: transform .18s, box-shadow .18s;
  opacity: 0; transform: translateY(10px); animation: rise .45s ease forwards;
}
.linkcard:hover { transform: translateY(-3px); box-shadow: 0 8px 20px var(--shadow); }
.linkcard:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lc-soc {
  align-self: flex-start; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px; color: var(--pill-ink);
}
.lc-title { font-size: 32px; font-weight: 700; line-height: 1.2;
  font-family:"Gill Sans MT","Hanken Grotesk",sans-serif; }
.lc-meta { font-size: 18px; color: var(--muted); }
.lc-socrow { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }

/* =================================================================
   LIGHTBOX  (image expanded — title, category, tags, note appear here)
   ================================================================= */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(20,18,16,0.72); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 24px;
}
.lightbox.open { display: flex; }
.lb-panel {
  background: var(--bg); border-radius: 18px; max-width: 1000px; width: 100%;
  max-height: 92vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5); animation: pop .25s ease;
}
@keyframes pop { from { opacity:0; transform: scale(.97);} to {opacity:1; transform:none;} }
.lb-imgwrap {
  background: var(--surface); display: grid; place-items: center;
  overflow: auto; padding: 16px; flex: 1 1 auto; min-height: 0;
}
.lb-imgwrap img { max-width: 100%; max-height: 70vh; border-radius: 8px; }
.lb-meta {
  padding: 16px 22px 20px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.lb-tagrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lb-cat {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; color: var(--pill-ink);
}
.lb-tag {
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 3px 9px; border-radius: 999px;
  border: 1px dashed var(--border);
}
.lb-tag::before { content: "#"; opacity: .55; }
.lb-title { font-size: 20px; font-weight: 700;
  font-family:"Gill Sans MT","Hanken Grotesk",sans-serif; }
.lb-note { font-size: 15px; color: var(--muted); }
.lb-close, .lb-nav {
  position: absolute; top: 18px; right: 18px;
  width: 44px; height: 44px; border-radius: 999px; border: none;
  background: rgba(0,0,0,0.45); color: #fff; font-size: 22px;
  cursor: pointer; display: grid; place-items: center; transition: .2s;
}
.lb-close:hover { background: rgba(0,0,0,0.7); }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 18px; right: auto; }
.lb-next { right: 18px; }
.lb-nav:hover { background: rgba(0,0,0,0.7); }

/* =================================================================
   COMING-SOON PAGES  (how-to, self-educate)
   ================================================================= */
.coming-soon {
  max-width: 760px; margin: 0 auto; padding: 90px 24px;
  text-align: center;
}
.cs-badge {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-deep);
  background: var(--accent-tint); border: 1px solid var(--accent);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.cs-title { font-size: 34px; font-weight: 700; line-height: 1.15; margin-bottom: 14px; }
.cs-body { font-size: 16.5px; color: var(--muted); max-width: 520px; margin: 0 auto; }

/* =================================================================
   FOOTER
   ================================================================= */
footer {
  max-width: 1180px; margin: 0 auto; padding: 0 20px 50px;
  color: var(--footer-ink); font-size: 13px; font-weight: 700; text-align: center;
}
footer a { color: var(--accent-deep); }

@media (max-width: 560px) {
  .brand { font-size: 24px; }
  .section-title { font-size: 24px; letter-spacing: .01em; }
  .lb-meta { padding: 14px 18px 18px; }
}
/* =================================================================
   SLIDE DECKS  (/decks/)
   Card grid reuses .grid/.card from the image library; these rules
   cover the deck-specific extras, the passphrase gate, and the viewer.
   ================================================================= */
.grid.decks { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .grid.decks { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid.decks { grid-template-columns: 1fr; } }

.deckcard { position: relative; }
.deck-thumb {
  aspect-ratio: 16 / 9; object-fit: contain; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.deck-lock {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: 12px; line-height: 1; padding: 5px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
}
.deck-meta { font-size: 12.5px; color: var(--muted); }

/* ---------- passphrase gate ---------- */
.decks-gate {
  display: none; position: fixed; inset: 0; z-index: 120;
  background: rgba(0,0,0,0.55); align-items: center; justify-content: center; padding: 20px;
}
.decks-gate.open { display: flex; }
.gate-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; width: 100%; max-width: 380px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,0.3);
}
.gate-lock { font-size: 26px; margin-bottom: 10px; }
.gate-title {
  font-family: "Gill Sans MT","Gill Sans","Hanken Grotesk",sans-serif;
  font-size: 21px; font-weight: 700; margin-bottom: 5px;
}
.gate-sub { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.gate-input {
  width: 100%; padding: 11px 13px; font-size: 15px; font-family: inherit;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; outline: none;
}
.gate-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.gate-err { font-size: 13px; color: #C0503A; margin-top: 9px; }
.gate-actions { display: flex; gap: 9px; margin-top: 16px; }
.gate-btn {
  flex: 1; padding: 10px 12px; font-size: 14.5px; font-family: inherit;
  border-radius: 10px; cursor: pointer; border: 1px solid var(--border);
}
.gate-btn.ghost { background: transparent; color: var(--muted); }
.gate-btn.ghost:hover { color: var(--ink); border-color: var(--accent); }
.gate-btn.solid { background: var(--accent); border-color: var(--accent); color: var(--pill-ink); font-weight: 600; }
.gate-btn.solid:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

/* ---------- deck viewer ---------- */
.dv {
  display: none; position: fixed; inset: 0; z-index: 130;
  background: var(--bg); flex-direction: column;
}
.dv.open { display: flex; }
.dv-bar {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  padding: 9px 14px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.dv-title {
  font-family: "Gill Sans MT","Gill Sans","Hanken Grotesk",sans-serif;
  font-size: 16px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 46vw;
}
.dv-counter {
  font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dv-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer;
  padding: 6px 9px; flex: 0 0 auto;
}
.dv-btn:hover { color: var(--accent-deep); border-color: var(--accent); }

.dv-body { display: flex; flex: 1 1 auto; min-height: 0; }

.dv-rail {
  flex: 0 0 132px; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border-right: 1px solid var(--border);
}
.dv.rail-hidden .dv-rail { display: none; }
.dv-thumb {
  position: relative; padding: 0; cursor: pointer; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
  aspect-ratio: 16 / 9; flex: 0 0 auto;
}
.dv-thumb canvas { width: 100%; height: 100%; display: block; object-fit: contain; }
.dv-thumb.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.dv-thumb-n {
  position: absolute; bottom: 3px; right: 4px; font-size: 10.5px; padding: 1px 4px;
  border-radius: 4px; background: rgba(0,0,0,0.6); color: #fff;
}

.dv-stage {
  flex: 1 1 auto; min-width: 0; position: relative;
  display: flex; align-items: center; justify-content: center; padding: 14px 56px;
}
.dv-canvas-wrap {
  flex: 1 1 auto; height: 100%; display: flex;
  align-items: center; justify-content: center; position: relative; min-width: 0;
}
#dvCanvas { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 6px 24px var(--shadow); }
.dv-loading { position: absolute; font-size: 14.5px; color: var(--muted); }
.dv-loading[hidden] { display: none; }
.dv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 50%;
  color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer;
  width: 40px; height: 40px; z-index: 2;
}
.dv-nav:hover { border-color: var(--accent); color: var(--accent-deep); }
.dv-prev { left: 10px; }
.dv-next { right: 10px; }

@media (max-width: 720px) {
  .dv-rail { display: none; }
  .dv.rail-hidden .dv-rail { display: none; }
  .dv-stage { padding: 10px 44px; }
  .dv-title { max-width: 40vw; font-size: 15px; }
  #dvRailBtn { display: none; }
}
/* =================================================================
   SELF-EDUCATION RESOURCE HUB  (/self-educate/)
   Same card language as the guideline linkcards: --cat drives the
   left border and the glyph stroke, rotating through --c1..--c6.
   The CATEGORY is carried by the glyph shape, not by colour.
   ================================================================= */
.grid.se-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .grid.se-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .grid.se-grid { grid-template-columns: 1fr; } }

.se-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--cat, var(--accent));
  border-radius: 12px; padding: 18px 18px 20px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; text-align: center;
  box-shadow: 0 1px 2px var(--shadow); transition: transform .18s, box-shadow .18s;
  opacity: 0; transform: translateY(10px); animation: rise .45s ease forwards;
}
.se-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px var(--shadow); }
.se-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.se-glyph { width: 54px; height: 54px; color: var(--cat, var(--accent)); flex: none; }
.se-glyph svg { width: 100%; height: 100%; display: block; }

.se-title {
  font-size: 19px; font-weight: 700; line-height: 1.25;
  font-family: "Gill Sans MT", "Hanken Grotesk", sans-serif;
}
.se-desc { font-size: 13.5px; color: var(--muted); line-height: 1.45; }


/* =================================================================
   MOBILE HEADER
   The page title wraps and fights the account button on narrow
   screens, so it is dropped below the brand and the header keeps to
   a single compact row. Desktop layout is unchanged.
   ================================================================= */
@media (max-width: 720px) {
  .header-inner { padding: 6px 12px; }
  .header-top { gap: 6px; }

  /* page title drops to its own line instead of wrapping beside the brand */
  .header-top { flex-wrap: wrap; }
  .brand-group { order: 3; flex-basis: 100%; margin-top: 1px; }
  .section-title { font-size: 1.35em; letter-spacing: .01em; }
  .brand-group { margin-left: 0; }
  .section-title::before { content: none; }

  .menu-btn { width: 42px; height: 42px; border-radius: 11px; }
  .menu-btn.is-brand { padding: .15em .45em .15em .15em; gap: .3em; }
  .menu-btn.is-brand .brand { font-size: 20px; }
  .menu-chev { font-size: .62em; }

  .theme-btn { width: 34px; height: 34px; font-size: 15px; border-width: 2px; }

  /* the account box is fixed-position; keep it small and clear of the brand */
  .cauth-slot { display: none; }
  .cauth-box { top: .42rem; right: .55rem; font-size: 13px; }
  .cauth-box .cauth-pill { padding: .42em .7em; }
  .cauth-box .cauth-pill-email { max-width: 8.5em; }
  .cauth-box.open { width: min(94vw, 340px); font-size: 15px; }
  .cauth-box.open .cauth-pill-email { max-width: none; }
}


/* account box tracks the inner edge of the 1180px content column */
.cauth-box { right: max(.9rem, calc((100vw - 1180px) / 2 + 20px)); }
@media (max-width: 720px) { .cauth-box { right: .5rem; } }


/* header motif sits between the brand button and the page title */
.hdr-motif { color: var(--brand); opacity: .8; flex: none; margin-right: 2px; vertical-align: middle; }
.brand-group { display: flex; align-items: center; gap: 8px; }
@media (max-width: 720px) {
  .hdr-motif { display: none; }
  /* mobile: keep the account button minimal */
  .cauth-box .cauth-pill-email { display: none; }
  .cauth-box .cauth-pill-lead { display: inline !important; }
  .cauth-box.open .cauth-pill-email { display: inline; }
}


/* the theme button now lives in the fixed account cluster */
.cauth-cluster .theme-btn { display: inline-flex; align-items: center; justify-content: center; }
