/* ============================================================
   TOKENY
   ============================================================ */
:root {
  /* Paleta */
  --navy:    #2C2E52;
  --navy-90: #3A3D63;
  --navy-deep: #1A1C3A;
  --gold:    #C5A059;
  --gold-light: #D9BD83;
  --gold-tint: #EDDFBE;

  --cream:   #F1ECDE;      /* główne tło */
  --ivory:   #F8F4E9;      /* lżejsze tło */
  --bone:    #EAE3D1;      /* karty */
  --warm-grey: #8B8A82;
  --char:    #2A2D38;

  --rule:    rgba(44, 46, 82, 0.14);
  --rule-strong: rgba(44, 46, 82, 0.28);

  /* Typografia */
  --display: 'Inter', system-ui, sans-serif;
  --body:    'Poppins', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Skala */
  --gutter: 64px;
  --content-max: 1200px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #ffffff;
  color: var(--navy);
  font-family: var(--body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* ============================================================
   TYPOGRAFIA — KLASY
   ============================================================ */
.display {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-transform: uppercase;
}
.head {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.1;
}
.mono {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 11px;
}
.body-lg { font-size: 19px; line-height: 1.55; font-weight: 400; }
.body-md { font-size: 16px; line-height: 1.6; }
.body-sm { font-size: 13.5px; line-height: 1.6; color: var(--char); }
.caption { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--warm-grey); }
.brand-name { font-family: var(--display); font-weight: 900; letter-spacing: -0.02em; text-transform: uppercase; }

/* ============================================================
   LAYOUT — SHELL
   ============================================================ */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 32px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--navy);
  z-index: 100;
  pointer-events: none;
  mix-blend-mode: normal;
}
.top-bar .right { display: flex; gap: 24px; align-items: center; }
.top-bar .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 8px; vertical-align: middle; }
.top-bar.is-dark { color: var(--cream); }
.top-bar.is-dark .dot { background: var(--gold); }

.chapter-num {
  position: absolute;
  top: 64px;
  left: var(--gutter);
  font-family: var(--display);
  font-weight: 900;
  font-size: 240px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--gold);
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
}

section.chapter {
  position: relative;
  padding: 140px var(--gutter) 120px;
  border-top: 1px solid var(--rule);
  min-height: 100vh;
}
section.chapter:first-of-type { border-top: none; }
section.chapter.dark {
  background: var(--navy);
  color: var(--cream);
  border-top: none;
}
section.chapter.dark .caption { color: rgba(241, 236, 222, 0.55); }
section.chapter.dark .chapter-num { color: var(--gold); opacity: 0.25; }
section.chapter.dark .body-sm { color: rgba(241, 236, 222, 0.75); }
section.chapter.ivory { background: var(--ivory); border-top: none; }
section.chapter.bone { background: var(--bone); border-top: none; }

.chapter-content {
  margin: 0 auto;
}

.chapter-content > * {
  max-width: var(--content-max);
}
.chapter-content > .chapter-header {
  max-width: none;
}

.chapter-content > .grid-2:has(.mockup),
.chapter-content > .grid-2:has(.card),
.chapter-content > .grid-2:has(.bcard),
.chapter-content > .grid-2:has(.slide),
.chapter-content > .grid-2:has(.construction),
.chapter-content > .grid-2:has(.clearspace-frame),
.chapter-content > .grid-2:has(.web-preview),
.chapter-content > .grid-2:has(.letterhead),
.chapter-content > .grid-2:has(.email-sig),
.chapter-content > .grid-3:has(.mockup),
.chapter-content > .grid-3:has(.color-card),
.chapter-content > .grid-4:has(.color-card),
.chapter-content > .dont-grid,
.chapter-content > .toc,
.chapter-content > .colophon-grid,
.chapter-content > .colophon-bottom {
  max-width: none;
}

.chapter-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  margin-bottom: 80px;
  align-items: end;
}
.chapter-header .meta { padding-bottom: 4px; }
.chapter-header .meta .num {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.chapter-header .meta .total {
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 0.12em;
  color: var(--warm-grey);
  margin-top: 8px;
}
.chapter-header h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 72px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--navy);
  text-wrap: pretty;
}
.dark .chapter-header h1 { color: var(--cream); }
.chapter-header h1 .accent { color: var(--gold); }
.chapter-header .sub {
  font-family: var(--body);
  font-size: 16px; line-height: 1.5;
  color: var(--char);
  max-width: 640px;
  margin-top: 20px;
  text-wrap: pretty;
}
.dark .chapter-header .sub { color: rgba(241, 236, 222, 0.78); }

.hairline {
  height: 1px;
  background: var(--rule);
  border: none;
  margin: 64px 0;
}
.hairline.gold {
  background: linear-gradient(to right, var(--gold), transparent);
  height: 1px;
}
.dark .hairline { background: rgba(241, 236, 222, 0.18); }

/* ============================================================
   SYGNET (SVG component-style)
   ============================================================ */
.sygnet { display: block; }
.sygnet .main   { fill: var(--logo-main, var(--navy)); }
.sygnet .accent { fill: var(--logo-accent, var(--gold)); }

/* ============================================================
   LOCKUPS
   ============================================================ */
.lockup-v { display: inline-flex; flex-direction: column; align-items: center; gap: 20px; }
.lockup-v .wordmark { line-height: 1.15; }
.lockup-h { display: inline-flex; flex-direction: row; align-items: center; gap: 28px; }

.wordmark {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--logo-main, var(--navy));
  text-transform: uppercase;
}
.tagline {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--logo-main, var(--navy));
  opacity: 0.7;
}

/* ============================================================
   COVER
   ============================================================ */
.cover {
  padding: 0 var(--gutter);
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.cover .top-meta {
  padding: 32px 0 0;
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--warm-grey);
}
.cover .center-lockup {
  margin: auto;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.cover .bottom-block {
  padding: 0 0 56px;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 48px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--warm-grey);
  border-top: 1px solid var(--rule);
  padding-top: 24px;
}
.cover .bottom-block strong { display: block; color: var(--navy); margin-bottom: 4px; font-weight: 600; }

/* ============================================================
   GRID HELPERS
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* Karty */
.card {
  background: #ffffff;
  border: 1px solid var(--rule);
  padding: 32px;
}
.card.dark { background: var(--navy); color: var(--cream); border-color: rgba(255,255,255,0.08); }
.card.dark .caption { color: rgba(241,236,222,0.55); }
.card.gold { background: var(--gold); color: var(--navy); border: none; }
.card.cream { background: #ffffff; border: 1px solid var(--rule); }

/* TOC */
.toc { display: grid; grid-template-columns: 1fr 1fr; gap: 0 64px; }
.toc-item {
  display: grid; grid-template-columns: 60px 1fr 80px; gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  font-family: var(--body); font-size: 15px;
  color: var(--navy);
  text-decoration: none;
}
.toc-item .num { font-family: var(--mono); font-size: 12px; color: var(--gold); font-weight: 600; letter-spacing: 0.1em; }
.toc-item .ttl { font-weight: 500; }
.toc-item .pg { font-family: var(--mono); font-size: 11px; color: var(--warm-grey); text-align: right; letter-spacing: 0.1em; }
.toc-item:hover .ttl { color: var(--gold); }

/* TABELE KOLORÓW */
.color-card { display: flex; flex-direction: column; }
.color-swatch { aspect-ratio: 1.15 / 1; }
.color-meta { padding: 20px 0 0; }
.color-meta .name { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; margin-bottom: 12px; }
.color-meta dl { margin: 0; display: grid; grid-template-columns: 70px 1fr; gap: 6px 16px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; }
.color-meta dt { color: var(--warm-grey); text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.12em; }
.color-meta dd { margin: 0; color: var(--char); }

/* DON'TS */
.dont-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.dont-card { background: var(--ivory); border: 1px solid var(--rule); padding: 28px; }
.dont-card .preview { aspect-ratio: 1.4 / 1; background: var(--bone); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; position: relative; }
.dont-card .x-mark { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; background: #B33A2A; color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 700; font-size: 14px; }
.dont-card .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--char); }
.dont-card .why { font-size: 13px; color: var(--warm-grey); margin-top: 6px; }

/* APP MOCKUPS */
.mockup {
  background: var(--ivory);
  border: 1px solid var(--rule);
  position: relative;
}
.mockup .label {
  position: absolute; top: 14px; right: 14px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--warm-grey);
}

/* Wizytówka */
.bcard {
  width: 100%;
  aspect-ratio: 85 / 55;
  padding: 28px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.bcard.front { background: #ffffff; border: 1px solid var(--rule); }
.bcard.back  { background: var(--navy); color: var(--cream); }
.bcard .top-row { display: flex; justify-content: space-between; align-items: flex-start; }

/* Papier A4 */
.letterhead {
  width: 100%;
  aspect-ratio: 210 / 297;
  background: #fff;
  border: 1px solid var(--rule);
  padding: 36px 40px;
  display: flex; flex-direction: column;
  font-size: 11px;
}

/* Stopka e-mail */
.email-sig {
  background: #fff;
  border: 1px solid var(--rule);
  padding: 24px;
  font-family: 'Inter', sans-serif; font-size: 13px;
  color: #1a1a1a;
}
.email-sig .name { font-weight: 700; font-size: 15px; color: var(--navy); }
.email-sig .role { color: var(--warm-grey); font-size: 12px; margin-bottom: 14px; }
.email-sig .row { display: flex; gap: 8px; margin-top: 3px; font-size: 12px; }
.email-sig .row .k { color: var(--gold); font-weight: 600; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; min-width: 36px; }
.email-sig .divider { height: 1px; background: var(--rule); margin: 14px 0; }

/* Container sticker */
.sticker {
  background: var(--navy);
  color: var(--cream);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  border: 4px solid var(--cream);
}

/* CONTAINER MOCKUP */
.container-mockup {
  background: linear-gradient(135deg, #C26339 0%, #A04F2E 100%);
  aspect-ratio: 2.2 / 1;
  position: relative;
  overflow: hidden;
}
.container-mockup .corrugated {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,0.18) 0 1px, transparent 1px 14px);
}
.container-mockup .doors {
  position: absolute; right: 0; top: 0; bottom: 0; width: 14%;
  background: rgba(0,0,0,0.15);
  border-left: 2px solid rgba(0,0,0,0.3);
}
.container-mockup .door-handle {
  position: absolute; right: 2%; top: 50%; transform: translateY(-50%);
  width: 3px; height: 70%; background: rgba(0,0,0,0.4);
}
.container-mockup .brand-zone {
  position: absolute; left: 8%; top: 18%; right: 22%; bottom: 18%;
  display: flex; flex-direction: column; justify-content: center;
}

/* ID Badge */
.id-badge {
  width: 100%;
  aspect-ratio: 54 / 86;
  background: #ffffff;
  border: 1px solid var(--rule);
  padding: 16px 14px;
  display: flex; flex-direction: column;
  position: relative;
}
.id-badge .strip { background: var(--navy); height: 8px; margin: -16px -14px 14px; }
.id-badge .photo { background: var(--bone); aspect-ratio: 1/1; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; }

/* Polo / Workwear */
.polo {
  background: var(--navy);
  aspect-ratio: 1/1;
  position: relative;
  padding: 30%;
  display: flex; align-items: flex-start; justify-content: flex-start;
  container-type: size;
}
.polo::before {
  content: '';
  position: absolute; inset: 12% 8%;
  background: radial-gradient(ellipse at center top, rgba(255,255,255,0.04), transparent 60%);
}
.polo .pocket {
  position: absolute;
  top: 28%; left: 22%;
}
.polo .pocket .ct-mark {
  width: auto;
  height: 90cqh;
}

/* Rollup */
.rollup {
  background: #ffffff;
  border: 1px solid var(--rule);
  aspect-ratio: 85 / 200;
  display: flex; flex-direction: column; padding: 24px 18px;
  position: relative;
}
.rollup .top { display: flex; flex-direction: column; align-items: center; padding-top: 40px; }
.rollup .mid { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.rollup .bot { padding-bottom: 20px; text-align: center; }

/* Social */
.social-1x1 { aspect-ratio: 1/1; padding: 32px; display: flex; flex-direction: column; justify-content: space-between; }
.social-16x9 { aspect-ratio: 16/9; padding: 36px; display: flex; flex-direction: column; justify-content: space-between; }
.linkedin-cover { aspect-ratio: 4/1; padding: 28px 36px; display: flex; flex-direction: column; justify-content: center; }
.linkedin-avatar { aspect-ratio: 1/1; max-width: 200px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }

/* Slide preview */
.slide {
  aspect-ratio: 16/9;
  padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.slide-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
}

/* Web preview */
.web-preview {
  aspect-ratio: 16/10;
  background: #ffffff;
  border: 1px solid var(--rule);
  padding: 28px 32px;
  display: flex; flex-direction: column;
}
.web-preview .nav { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.web-preview .nav-links { display: flex; gap: 18px; font-size: 11px; }
.web-preview .hero { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; }
.web-preview .hero-h1 { font-family: var(--display); font-weight: 900; letter-spacing: -0.025em; font-size: 42px; line-height: 1.15; }

/* Spacing helpers */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mt-64 { margin-top: 64px; }

/* Lists */
ul.dots, ol.dots { padding-left: 0; list-style: none; }
ul.dots li, ol.dots li {
  padding-left: 24px; position: relative;
  margin-bottom: 10px;
}
ul.dots li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 8px; height: 1px; background: var(--gold);
}

/* TOV examples */
.tov-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.tov-row .tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 8px; }
.tov-row .tag.yes { color: #4F8E5A; }
.tov-row .tag.no  { color: #B33A2A; }
.tov-row .text { font-size: 15px; color: var(--char); line-height: 1.5; }

/* Construction grid */
.construction { background: #ffffff;
  border: 1px solid var(--rule);
  padding: 48px;
  position: relative;
}
.construction .grid-bg {
  background-image:
    linear-gradient(to right, rgba(44,46,82,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(44,46,82,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Clear space markers */
.clearspace-frame { background: #ffffff;
  border: 1px solid var(--rule);
  padding: 48px;
}
.clearspace-frame .frame {
  border: 1px dashed var(--gold);
  padding: 48px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.clearspace-frame .x-mark-label {
  position: absolute;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--gold);
  background: var(--ivory); padding: 2px 6px;
}

/* Footer */
.colophon {
  padding: 80px var(--gutter) 64px;
  border-top: 1px solid var(--rule);
  background: var(--navy);
  color: var(--cream);
}
.colophon-grid { max-width: var(--content-max); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
.colophon-grid h4 { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 16px; font-weight: 600; }
.colophon-grid p, .colophon-grid li { font-size: 13.5px; color: rgba(241,236,222,0.78); line-height: 1.5; margin: 0 0 6px; }
.colophon-grid ul { padding: 0; list-style: none; margin: 0; }
.colophon-bottom {
  max-width: var(--content-max); margin: 56px auto 0;
  padding-top: 24px; border-top: 1px solid rgba(241,236,222,0.12);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(241,236,222,0.5);
}

/* responsywne dopasowanie */

/* === Responsive — finalize === */
@media (max-width: 1280px) {
  :root { --gutter: 48px; }
  .chapter-header h1 { font-size: 60px; }
  .chapter-num { font-size: 200px; }
}
@media (max-width: 960px) {
  :root { --gutter: 32px; }
  section.chapter { padding: 100px var(--gutter) 80px; }
  .chapter-header { grid-template-columns: 1fr; gap: 16px; margin-bottom: 56px; }
  .chapter-header h1 { font-size: 44px; }
  .chapter-num { font-size: 140px; top: 32px; }
  .grid-2, .grid-3, .grid-4, .grid-asym, .dont-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .toc { grid-template-columns: 1fr; gap: 0; }
  .colophon-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .cover .bottom-block { grid-template-columns: 1fr; gap: 16px; }
  .cover .top-meta { flex-wrap: wrap; gap: 8px; font-size: 10px; }
  /* lockup cards — shrink padding */
  .card { padding: 32px !important; }
  /* color swatches — poziomy prostokąt zamiast kwadratu */
  .color-swatch { aspect-ratio: 4 / 1; }
}
@media (max-width: 600px) {
  :root { --gutter: 20px; }
  .chapter-header h1 { font-size: 32px; line-height: 1.15; }
  .chapter-num { font-size: 96px; top: 24px; }
  section.chapter { padding: 80px var(--gutter) 56px; min-height: auto; }
  .card { padding: 24px !important; }
  /* Inline cards w/ logo at large widths — let SVG scale */
  svg.ct-logo-v, svg.ct-logo-h, svg.ct-mark { max-width: 100%; height: auto; }
  .construction { padding: 24px !important; }
  .clearspace-frame { padding: 40px !important; }
  /* Mockups stay manageable */
  .letterhead, .bcard, .web-preview, .slide, .container-mockup, .rollup, .id-badge, .polo { font-size: 9px; }
}
/* Universal — prevent horizontal overflow at any width */
html, body { overflow-x: hidden; max-width: 100vw; }
section.chapter { overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }

/* ── Downloads section ── */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.download-card {
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.download-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  min-height: 120px;
}
.download-preview img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}
.download-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--rule);
}
.download-name {
  font-family: var(--body);
  font-weight: 600;
  font-size: 13px;
  color: var(--navy);
}
.download-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--warm-grey);
  text-transform: uppercase;
}
.download-links {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.dl-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--navy);
  color: var(--navy);
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}
.dl-btn:hover {
  background: var(--navy);
  color: var(--cream);
}
.cover .top-meta, .cover .bottom-block { max-width: 100%; flex-wrap: wrap; }

/* ── Back to TOC button ── */
#toc-back {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 16px 10px 12px;
  border-radius: 2px;
  box-shadow: 0 4px 16px rgba(44,46,82,0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 999;
}
#toc-back.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#toc-back:hover {
  background: var(--gold);
  color: var(--navy);
}
