/* ==========================================================================
   PROJECT ARES — application shell + document typography
   Screen layout, then print rules for A4 / A5.
   ========================================================================== */

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

:root {
  --ink:        #1c2333;
  --ink-soft:   #5a6478;
  --ink-faint:  #8b93a7;
  --rule:       #e2e6ee;
  --paper:      #ffffff;
  --wash:       #f6f7fb;
  --navy:       #10192b;
  --navy-2:     #182338;
  --amber:      #f0a63c;
  --amber-ink:  #8a5a06;
  --rule-strong:#c9d0dd;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 288px;
  flex: 0 0 288px;
  background: var(--navy);
  color: #cfd6e6;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  padding: 26px 0 40px;
  transition: margin-left 0.18s ease;
}

/* collapsible navigation */
body { overflow-x: hidden; }
.shell.nav-collapsed .sidebar { margin-left: -288px; }

.nav-hide {
  position: absolute;
  top: 18px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.16);
  background: transparent;
  color: #98a4bd;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-hide:hover { background: rgba(255,255,255,0.09); color: #fff; }

.nav-show {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: none;
  padding: 18px 9px;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: var(--navy);
  color: #cfd6e6;
  cursor: pointer;
  box-shadow: 2px 0 10px rgba(16,25,43,0.18);
}
.nav-show:hover { color: #fff; background: #1b2740; }
.shell.nav-collapsed .nav-show { display: block; }

.brand {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0 24px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 18px;
}
.brand .mark {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
}
.brand h1 {
  margin: 6px 0 4px;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #fff;
  font-weight: 700;
}
.brand p {
  margin: 0;
  font-size: 12.5px;
  color: #8f9bb4;
  line-height: 1.45;
}

.navgroup { margin: 0 0 18px; }
.navgroup h2 {
  margin: 0 0 6px;
  padding: 0 24px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6f7d99;
  font-weight: 700;
}
.navgroup a {
  display: block;
  padding: 7px 24px 7px 24px;
  color: #c3cbdd;
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  line-height: 1.35;
}
.navgroup a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.navgroup a.active {
  background: rgba(240,166,60,0.10);
  border-left-color: var(--amber);
  color: #fff;
  font-weight: 600;
}
.navgroup a .meta {
  display: block;
  font-size: 11.5px;
  color: #7a87a2;
  font-weight: 400;
  margin-top: 1px;
}

.sidebar .foot {
  margin-top: 26px;
  padding: 16px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11.5px;
  color: #6f7d99;
  line-height: 1.5;
}
.sidebar .foot strong { color: #b9c3d8; font-weight: 600; }

/* --------------------------------------------------------------------------
   Main
   -------------------------------------------------------------------------- */
.main { flex: 1 1 auto; min-width: 0; }

.topbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 14px 44px;
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: saturate(140%) blur(6px);
}
.crumbs {
  font-size: 13px;
  color: var(--ink-faint);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { margin: 0 7px; opacity: 0.5; }

.actions { display: flex; gap: 10px; flex-wrap: nowrap; flex: 0 0 auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 7px;
  border: 1px solid var(--rule-strong);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: #fbfcfe; border-color: #aab4c6; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: #1b2740; border-color: #1b2740; }
.btn svg { flex: 0 0 auto; }

.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 44px 44px 120px;
  background: var(--paper);
  min-height: calc(100vh - 60px);
}

/* --------------------------------------------------------------------------
   Document typography
   -------------------------------------------------------------------------- */
.doc h1 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  font-weight: 700;
}
.doc h1 + h2 { margin-top: 10px; }
.doc > h2:first-of-type { margin-top: 30px; }

.doc h2 {
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 46px 0 12px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--rule);
  font-weight: 700;
  scroll-margin-top: 80px;
}
.doc h3 {
  font-size: 17.5px;
  margin: 30px 0 10px;
  font-weight: 700;
  color: #16203a;
  scroll-margin-top: 80px;
}
.doc h4 {
  font-size: 14px;
  margin: 24px 0 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
}
.doc h1 + p, .doc h2 + p, .doc h3 + p { margin-top: 6px; }

.doc p { margin: 0 0 13px; }
.doc strong { font-weight: 700; color: #101a2e; }
.doc em { font-style: italic; }

.doc a { color: #1a56c4; text-decoration: none; border-bottom: 1px solid rgba(26,86,196,0.28); }
.doc a:hover { border-bottom-color: #1a56c4; }

.doc hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 34px 0;
}

.doc ul, .doc ol { margin: 0 0 14px; padding-left: 24px; }
.doc li { margin: 0 0 6px; }
.doc li > ul, .doc li > ol { margin-top: 6px; }

.doc blockquote {
  margin: 18px 0;
  padding: 14px 20px;
  background: #fbf7ec;
  border-left: 4px solid var(--amber);
  color: #4a4126;
  border-radius: 0 6px 6px 0;
}
.doc blockquote p { margin: 0 0 8px; }
.doc blockquote p:last-child { margin: 0; }

.doc code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.87em;
  font-variant-ligatures: none;
  background: #f1f3f8;
  padding: 1px 5px;
  border-radius: 4px;
  color: #24304a;
  border: 1px solid #e6eaf2;
}

.doc pre {
  margin: 16px 0;
  padding: 14px 16px;
  background: #f8f9fc;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  font-variant-ligatures: none;
}
.doc pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
}

/* tables */
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  font-size: 14px;
  line-height: 1.5;
}
.doc thead th {
  background: #f2f5fa;
  text-align: left;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #37415a;
  padding: 9px 11px;
  border: 1px solid var(--rule-strong);
}
.doc td {
  padding: 9px 11px;
  border: 1px solid var(--rule);
  vertical-align: top;
}
.doc tbody tr:nth-child(even) td { background: #fafbfd; }
.doc td strong { color: #101a2e; }

/* checklists */
.doc .task { list-style: none; padding-left: 0; }
.doc .task li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 7px;
}
.doc .task li::before {
  content: "";
  position: absolute;
  left: 2px; top: 5px;
  width: 14px; height: 14px;
  border: 1.5px solid #a9b3c6;
  border-radius: 3px;
  background: #fff;
}

.doc li.check { list-style: none; position: relative; padding-left: 27px; }
.doc li.check::before {
  content: "";
  position: absolute;
  left: 2px; top: 5px;
  width: 13px; height: 13px;
  border: 1.5px solid #a9b3c6;
  border-radius: 3px;
  background: #fff;
}

/* pack preview surface */
.packdoc { max-width: none; margin: 0; padding: 34px 20px 70px; background: var(--wash); overflow-x: auto; }
body.printdoc .content { background: #fff; }

/* print sources shown on screen stand alone, exactly as they will print */
@media screen {
  body.printdoc .sidebar,
  body.pack .sidebar,
  body.printdoc .topbar,
  body.pack .topbar { display: none; }
  body.printdoc .content { max-width: 794px; margin: 0 auto; padding: 40px 24px; }
  body.pack .packdoc { background: #fff; padding: 24px 0; }
}

/* callouts produced by the build from blockquotes with markers */
.callout {
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: 0 6px 6px 0;
  border-left: 4px solid var(--navy);
  background: #f4f6fb;
  font-size: 15px;
}
.callout.warn { border-left-color: #c2410c; background: #fdf4ef; }
.callout.tip  { border-left-color: #0f766e; background: #eefaf7; }
.callout p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Landing page
   -------------------------------------------------------------------------- */
.hero {
  padding: 54px 44px 40px;
  background: linear-gradient(160deg, #10192b 0%, #1c2c4a 60%, #23344f 100%);
  color: #fff;
}
.hero-inner { max-width: 900px; margin: 0 auto; }
.hero .eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 12px 0 14px;
  font-weight: 700;
}
.hero p.lead {
  font-size: 17px;
  line-height: 1.6;
  color: #c3cee2;
  max-width: 640px;
  margin: 0 0 24px;
}
.hero .stats {
  display: flex; gap: 34px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.hero .btn-primary {
  background: #fff;
  border-color: #fff;
  color: var(--navy);
}
.hero .btn-primary:hover { background: #f1f4fa; border-color: #f1f4fa; }
.hero .btn:not(.btn-primary) {
  background: transparent;
  border-color: rgba(255,255,255,0.35);
  color: #e8eefb;
}
.hero .btn:not(.btn-primary):hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.55); }
.hero .stat b { display: block; font-size: 22px; color: #fff; font-weight: 700; }
.hero .stat span { font-size: 12px; color: #8d9ab4; letter-spacing: 0.04em; text-transform: uppercase; }

.section { max-width: 980px; margin: 0 auto; padding: 40px 44px; }
.section > h2 {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 16px;
  font-weight: 700;
}
.section > h2.group-head {
  font-size: 19px;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy);
  display: inline-block;
}
.section > p.group-lead {
  margin: 10px 0 20px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 720px;
}
.section + .section { padding-top: 8px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }

.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px 20px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color .14s, box-shadow .14s, transform .14s;
  position: relative;
}
.card:hover {
  border-color: #b9c4d8;
  box-shadow: 0 8px 24px rgba(16,25,43,0.09);
  transform: translateY(-2px);
}
.card .kicker {
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  margin-bottom: 7px;
}
.card h3 { margin: 0 0 7px; font-size: 16.5px; line-height: 1.3; font-weight: 700; }
.card p { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; flex: 1; }
.card .dl {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--navy);
  padding-top: 12px; border-top: 1px solid var(--rule);
}
.card .dl svg { opacity: .7; }

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: #eef1f7;
  color: #4a5570;
}
.badge.amber { background: #fdf1dc; color: var(--amber-ink); }

/* --------------------------------------------------------------------------
   Print — A4 default
   -------------------------------------------------------------------------- */
@page { size: A4; margin: 18mm 16mm 18mm 16mm; }

@media print {
  body { background: #fff; font-size: 10.5pt; line-height: 1.5; }
  .sidebar, .topbar, .no-print, .hero .stats, .card .dl { display: none !important; }
  .shell { display: block; }
  .content { max-width: none; margin: 0; padding: 0; min-height: 0; }
  .doc h1 { font-size: 24pt; }
  .doc h2 { font-size: 15pt; margin-top: 20pt; page-break-after: avoid; break-after: avoid; }
  .doc h3 { font-size: 12pt; margin-top: 16pt; page-break-after: avoid; break-after: avoid; }
  .doc h4 { font-size: 9pt; page-break-after: avoid; break-after: avoid; }
  .doc p, .doc li { orphans: 3; widows: 3; }
  .doc table { font-size: 9pt; page-break-inside: auto; }
  .doc thead { display: table-header-group; }
  .doc tr { page-break-inside: avoid; break-inside: avoid; }
  .doc blockquote, .callout { page-break-inside: avoid; break-inside: avoid; }
  .doc pre { font-size: 8.5pt; }
  a { color: inherit; text-decoration: none; border: 0; }
}

/* --------------------------------------------------------------------------
   Pack sheets (A5 card packs)
   -------------------------------------------------------------------------- */
body.pack { background: #fff; }

.pack-sheet {
  width: 210mm;
  min-height: 297mm;
  padding: 16mm 18mm;
  margin: 0 auto 14mm;
  background: #fff;
  border: 1px solid #dfe4ee;
  position: relative;
  display: flex;
  flex-direction: column;
  break-inside: avoid;
  page-break-inside: avoid;
}

.pack-rule { border-top: 1.5px solid #10192b; margin: 0 0 10px; }

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 8pt;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b93a7;
  font-weight: 700;
  margin-bottom: 8px;
}
.sheet-head .num { color: #10192b; }

.pack-sheet h2 {
  font-size: 17pt;
  line-height: 1.12;
  margin: 0 0 2px;
  letter-spacing: -0.015em;
  border: 0;
  padding: 0;
}
.pack-sheet h2.cont { font-size: 12pt; color: #8b93a7; }
.pack-sheet h3 {
  font-size: 8.6pt;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4a5570;
  margin: 10px 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid #e2e6ee;
  break-after: avoid;
}
.pack-sheet > h3 { margin-top: 10px; }
.pack-sheet p, .pack-sheet li { font-size: 9pt; line-height: 1.4; margin-bottom: 5px; }
.pack-sheet ul, .pack-sheet ol { margin: 0 0 8px; padding-left: 18px; }
.pack-sheet li { margin-bottom: 4px; }
.pack-sheet table { font-size: 8.6pt; margin: 10px 0; }
.pack-sheet blockquote { margin: 8px 0; padding: 8px 12px; }
.pack-sheet .sb-script { transform: scale(0.79); transform-origin: left top; margin: 8px 0 0; }
.pack-sheet .task li::before { width: 11px; height: 11px; top: 4px; }
.pack-sheet li.check { padding-left: 22px; }

.sheet-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #e2e6ee;
  font-size: 7.5pt;
  color: #9aa3b6;
  display: flex;
  justify-content: space-between;
}

@media print {
  .pack-sheet {
    border: 0;
    margin: 0;
    width: auto;
    min-height: 0;
    padding: 0;
    break-after: page;
    page-break-after: always;
  }
  .pack-sheet:last-child { break-after: auto; page-break-after: auto; }
}
