/* Astro Bear Staff Training Guide
   Shared screen + print styles for Walk the Ledger and Ursa Ledger. */

@font-face {
  font-family: Cormorant;
  src: url("training-assets/cormorant.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: Cormorant;
  src: url("training-assets/cormorant-italic.woff2") format("woff2");
  font-weight: 500 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("training-assets/manrope.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #f7f1e4;
  --paper: #fffdf7;
  --ink: #16132a;
  --ink-soft: #3a3558;
  --muted: #5c5678;
  --gold: #8a6a28;
  --gold-bright: #c9a15b;
  --gold-wash: rgba(201, 161, 91, 0.16);
  --navy: #0b0928;
  --navy-deep: #05041a;
  --line: rgba(22, 19, 42, 0.14);
  --ok: #1e6b48;
  --warn: #8a3b16;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(22, 19, 42, 0.08);
  --font-display: Cormorant, "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: Manrope, "Segoe UI", system-ui, sans-serif;
  --content: 46rem;
  --page: 72rem;
  --header-h: 62px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font-ui);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(201, 161, 91, 0.18), transparent 55%),
    radial-gradient(800px 400px at 100% 0%, rgba(22, 19, 42, 0.06), transparent 50%),
    var(--bg);
  color: var(--ink);
  min-height: 100%;
}

img { max-width: 100%; height: auto; }
a { color: var(--gold); font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover, a:focus-visible { color: var(--navy); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--navy);
  color: #fff8ea;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { top: 12px; }

.site-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 241, 228, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--gold-bright);
}
.site-bar .inner {
  width: min(var(--page), calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-height: var(--header-h);
  padding: 8px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 600 1.15rem/1 var(--font-display);
  letter-spacing: 0.04em;
}
.brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold-bright);
}
.brand:hover { color: var(--gold); text-decoration: none; }
.brand small {
  display: block;
  font: 600 0.68rem/1.2 var(--font-ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 3px;
}
.bar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-left: auto;
  align-items: center;
}
.bar-links a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.bar-links a:hover,
.bar-links a[aria-current="page"] { color: var(--gold); text-decoration: underline; }
.bar-links .btn {
  text-decoration: none;
  background: var(--navy);
  color: #fff8ea !important;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.wrap {
  width: min(var(--page), calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0 64px;
}

.hero {
  padding: 36px 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.kicker {
  margin: 0 0 8px;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}
.hero h1 {
  font: 600 clamp(2.2rem, 5vw, 3.6rem)/1.12 var(--font-display);
  margin: 0 0 12px;
  max-width: 20ch;
}
.hero h1 em { font-style: italic; color: var(--gold); }
.lede {
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
  margin: 0 0 16px;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.pill {
  display: inline-block;
  border: 1px solid var(--gold-bright);
  color: var(--gold);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff8ea;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { filter: brightness(1.08); color: #fff8ea; text-decoration: none; }
.btn.secondary {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}

.notice {
  background: var(--gold-wash);
  border: 1px solid var(--gold-bright);
  border-radius: var(--radius);
  padding: 16px 18px;
  max-width: 52rem;
  margin: 0 0 22px;
}
.notice strong { color: var(--navy); }
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin: 0; }

.toc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 12px;
  margin: 0 0 36px;
}
.toc h2 { margin-top: 0; }
.toc ol {
  columns: 1;
  gap: 24px;
  margin: 0;
  padding: 0 0 8px 1.3rem;
}
@media (min-width: 800px) {
  .toc ol { columns: 2; }
}
.toc li { break-inside: avoid; margin: 0 0 8px; }
.toc a { font-weight: 600; }

h2 {
  font: 600 clamp(1.6rem, 3vw, 2.05rem)/1.2 var(--font-display);
  color: var(--navy);
  margin: 2.4rem 0 0.7rem;
}
h3 {
  font: 600 1.35rem/1.25 var(--font-display);
  color: var(--gold);
  margin: 1.6rem 0 0.5rem;
}
h4 {
  font: 700 1.02rem/1.35 var(--font-ui);
  color: var(--navy);
  margin: 1.2rem 0 0.4rem;
}
p { margin: 0 0 0.85rem; max-width: var(--content); }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; max-width: var(--content); }
li { margin: 0 0 0.4rem; }
li > ul, li > ol { margin-top: 0.35rem; }
.lead-wide p, .lead-wide ul, .lead-wide ol { max-width: 52rem; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0 0 18px;
  max-width: 72rem;
}
@media (min-width: 720px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: 1fr 1fr 1fr; }
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
  break-inside: avoid;
}
.card h3, .card h4 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card.soon { border-style: dashed; }
.card .when {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 6px;
}

table {
  width: 100%;
  max-width: 72rem;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 18px;
  font-size: 0.95rem;
}
caption {
  text-align: left;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--navy);
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
th { background: var(--navy); color: #fff8ea; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 18px; }

.module {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 22px 20px;
  margin: 0 0 22px;
  box-shadow: var(--shadow);
  break-inside: avoid;
}
.module header.mod-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  border-bottom: 1px solid var(--line);
  margin: 12px 0 12px;
  padding-bottom: 8px;
}
.module header.mod-head h3 { margin: 0; color: var(--navy); font-size: 1.6rem; }
.mod-num {
  font: 600 0.8rem/1 var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.callout, .key, .talk, .activity, .discuss, .quiz {
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 12px;
  break-inside: avoid;
}
.callout { background: #f3eefe; border: 1px solid #c9b8e8; }
.key { background: #eef6ef; border: 1px solid #b7d4bf; }
.talk { background: #fff8ea; border: 1px solid var(--gold-bright); }
.activity { background: #eef3fb; border: 1px solid #b9c8e3; }
.discuss { background: #f8eee8; border: 1px solid #e0c4b0; }
.quiz { background: #f4f1e8; border: 1px solid var(--line); }
.callout h4, .key h4, .talk h4, .activity h4, .discuss h4, .quiz h4 { margin-top: 0; }
.quiz ol { margin-bottom: 0.6rem; }
.answer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 0.95rem;
}
.answer strong { color: var(--ok); }

code, .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(22, 19, 42, 0.06);
  padding: 0.05em 0.35em;
  border-radius: 5px;
  word-break: break-all;
}
pre {
  background: var(--navy-deep);
  color: #f7f1e4;
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
  font: 0.85rem/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  max-width: 52rem;
}
pre code { background: none; color: inherit; padding: 0; }

.steps { counter-reset: step; list-style: none; padding-left: 0; max-width: 52rem; }
.steps li {
  position: relative;
  padding: 8px 0 8px 3rem;
  border-top: 1px solid var(--line);
}
.steps li:first-child { border-top: 0; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 10px;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--navy);
  color: #fff8ea;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan { break-inside: avoid; }
.plan h3 { margin-top: 0; }

.cert {
  border: 10px solid var(--navy);
  outline: 2px solid var(--gold-bright);
  outline-offset: -16px;
  background: #fffdf7;
  padding: 48px 36px 36px;
  text-align: center;
  max-width: 52rem;
  margin: 12px auto 24px;
  break-inside: avoid;
  page-break-before: always;
}
.cert .seal {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 10px;
  border: 2px solid var(--gold-bright);
  object-fit: cover;
}
.cert .kicker { margin-bottom: 4px; }
.cert h2 {
  font-size: 2.6rem;
  margin: 0 0 6px;
  color: var(--navy);
}
.cert .sub { color: var(--ink-soft); margin: 0 0 22px; }
.cert .line {
  border-bottom: 1px solid var(--ink);
  min-height: 2.1rem;
  margin: 0 auto 6px;
  width: min(28rem, 90%);
}
.cert .label { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.cert .sig-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 28px;
  text-align: center;
}
.cert .fine { font-size: 0.8rem; color: var(--muted); margin-top: 22px; max-width: 36rem; margin-left: auto; margin-right: auto; }

.site-footer {
  border-top: 1px solid var(--gold-bright);
  padding: 28px 0 48px;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .wrap { padding-bottom: 0; }
.site-footer p { max-width: 48rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; }

.glossary dt { font-weight: 700; color: var(--navy); margin-top: 0.7rem; }
.glossary dd { margin: 0 0 0.3rem; max-width: var(--content); }

@media (max-width: 640px) {
  html { font-size: 16px; }
  .hero { padding-top: 22px; }
  .module { padding: 6px 14px 16px; }
  .cert { padding: 32px 16px 24px; outline-offset: -10px; border-width: 6px; }
  .cert .sig-row { grid-template-columns: 1fr; }
  .bar-links { width: 100%; margin-left: 0; }
  th, td { padding: 8px 8px; font-size: 0.9rem; }
}

@media print {
  :root { --bg: #fff; --paper: #fff; --shadow: none; }
  html, body {
    background: #fff;
    color: #111;
    font-size: 10.8pt;
    line-height: 1.45;
  }
  .skip, .site-bar, .actions, .no-print { display: none !important; }
  a { color: #111; text-decoration: underline; font-weight: 650; text-underline-offset: 1px; }
  a[href^="#"] { text-decoration: none; }
  .wrap { width: auto; padding: 0; }
  .hero { padding-top: 0; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid #ccc; }
  .hero h1 { font-size: 22pt; margin-bottom: 6px; }
  .lede { font-size: 10.5pt; margin-bottom: 8px; }
  .notice { padding: 10px 12px; margin-bottom: 12px; }
  .meta-row { margin-bottom: 10px; }
  h2 { font-size: 16pt; page-break-after: avoid; }
  h3, h4 { page-break-after: avoid; }
  .toc { box-shadow: none; border: 1px solid #ccc; break-inside: auto; page-break-after: auto; }
  .toc ol { columns: 2; }
  .card, .notice, .callout, .key, .talk, .activity, .discuss, .quiz, .plan {
    box-shadow: none;
    break-inside: avoid;
  }
  .module { break-inside: auto; page-break-inside: auto; border: 1px solid #ccc; padding: 6px 14px 12px; }
  .module header.mod-head { page-break-after: avoid; }
  table { break-inside: auto; border: 1px solid #ccc; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  th { background: #16132a !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  pre { background: #111; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #certificate > h2,
  #certificate > p { display: none; }
  .cert {
    page-break-before: always;
    page-break-after: always;
    page-break-inside: avoid;
    margin: 0 auto;
  }
  table a[href^="http"]::after {
    content: "\A" attr(href);
    white-space: pre-wrap;
    display: block;
    font-size: 0.72em;
    font-weight: 500;
    color: #333;
    word-break: break-all;
  }
  .site-footer { border-top: 1px solid #ccc; }
  @page {
    size: letter;
    margin: 16mm 15mm 18mm;
  }
}
