/* Eggent Enterprise: architecture and security. One page per language that is
   both the web page and, printed, the PDF (deploy/security-pdf.sh). Light only. */
:root {
  color-scheme: light;
  --paper: #FAF7F0; --shell: #ECE6D6; --line: #1A1714; --muted: #6B655C; --dim: #A39A8B;
  --yolk: #FCD12D; --yolk-shadow: #D9B01A; --crimson: #F31544; --green: #3DB04E;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--line); }
body { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 15px; line-height: 1.62; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--crimson); }
.pixel { font-family: 'Press Start 2P', monospace; letter-spacing: .04em; }
:focus-visible { outline: 3px solid var(--crimson); outline-offset: 2px; }

/* Screen: the print frame is just a column. */
table.frame, table.frame > tbody, table.frame > tbody > tr, table.frame > tbody > tr > td { display: block; }
table.frame > thead, table.frame > tfoot { display: none; }
table.frame > tbody > tr > td { max-width: 960px; margin: 0 auto; padding: 0 24px 72px; }

.nav { position: sticky; top: 0; z-index: 5; background: rgba(250,247,240,.92); backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); }
.nav-inner { max-width: 960px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 22px; }
.nav .home { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav .home img { width: 28px; height: 28px; image-rendering: pixelated; }
.nav .home span { font-size: 11px; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 13px; }
.nav-links a:not(.btn) { text-decoration: none; }
.nav-links a:not(.btn):hover { text-decoration: underline; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 800; font-size: 13px; text-decoration: none; padding: 9px 14px 8px; border: 2px solid var(--line); background: var(--yolk); color: var(--line); box-shadow: 3px 3px 0 var(--line); transition: transform 90ms steps(3, end), box-shadow 90ms steps(3, end); white-space: nowrap; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn.ghost { background: #fff; }

/* Cover */
.cover { padding: 64px 0 56px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 44px; height: 44px; image-rendering: pixelated; box-shadow: 4px 4px 0 var(--yolk); }
.brand .pixel { font-size: 13px; }
.cover h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; margin: 40px 0 20px; }
.cover h1 .hl { background: var(--yolk); padding: 0 8px; box-shadow: 6px 6px 0 var(--line); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.cover .lede { font-size: 17px; max-width: 680px; margin: 0 0 32px; text-wrap: pretty; }
.meta { display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--line); box-shadow: 5px 5px 0 var(--line); background: #fff; }
.meta div { padding: 12px 14px; border-right: 2px solid var(--line); }
.meta div:last-child { border-right: 0; }
.meta b { display: block; font-size: 11px; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.chip { font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 4px 9px; border: 2px solid var(--line); background: #fff; }
.chip.y { background: var(--yolk); }
.chip.r { background: var(--crimson); color: var(--paper); border-color: var(--crimson); }
.chip.d { background: var(--line); color: var(--paper); }
.chip.g { background: var(--green); color: #fff; border-color: var(--green); }
.cover-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; align-items: center; }
.updated { font-size: 12px; color: var(--muted); }

/* Contents */
.toc { border: 2px solid var(--line); background: #fff; box-shadow: 4px 4px 0 var(--line); padding: 16px 20px; margin: 0 0 56px; }
.toc b { display: block; font-size: 11px; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; font-size: 14px; }
.toc li { margin: 0 0 4px; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc .n { font-family: 'Press Start 2P', monospace; font-size: 9px; color: var(--muted); margin-right: 8px; }

/* Sections */
section { margin: 0 0 64px; scroll-margin-top: 84px; }
h2 { display: flex; align-items: center; gap: 12px; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; margin: 0 0 20px; }
h2 .num { font-family: 'Press Start 2P', monospace; font-size: 11px; background: var(--yolk); border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--line); padding: 7px 8px 6px; flex: none; }
h3 { font-size: 17px; font-weight: 800; margin: 28px 0 10px; }
p { margin: 0 0 12px; text-wrap: pretty; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 0 0 8px; }
ul li::marker { content: '■  '; color: var(--crimson); font-size: .8em; }
ol li::marker { font-weight: 800; }
b, strong { font-weight: 800; }
code { background: var(--shell); padding: 0 4px; font-size: .95em; }
.muted { color: var(--muted); }

.guarantees { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.card { background: #fff; border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--line); padding: 14px 16px; }
.card b { display: block; margin-bottom: 4px; }
.card.accent { background: var(--yolk); box-shadow: 4px 4px 0 var(--crimson); }

.tw { overflow-x: auto; padding: 0 6px 8px 0; margin: 8px 0 16px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--line); }
table.t th { background: var(--line); color: var(--paper); text-align: left; font-weight: 700; padding: 8px 10px; font-size: 12px; letter-spacing: .03em; }
table.t td { padding: 8px 10px; border-top: 1px solid #d9d2c2; vertical-align: top; }
.yes { font-weight: 800; }
.no { color: var(--muted); }

.figure { background: #fff; border: 2px solid var(--line); box-shadow: 5px 5px 0 var(--line); padding: 10px 8px 6px; margin: 8px 0 20px; }
.figure svg { display: block; width: 100%; height: auto; }
.figure .cap { font-size: 12px; color: var(--muted); padding: 4px 10px 6px; }
.figure .cap b { color: var(--line); }

.callout { border-left: 6px solid var(--crimson); background: #fff; padding: 12px 16px; margin: 16px 0; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; font-family: 'Press Start 2P', monospace; font-size: 10px; background: var(--line); color: var(--paper); width: 26px; text-align: center; padding: 5px 0 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.two > div > h3:first-child { margin-top: 0; }

/* Closing call */
.contact { border: 2px solid var(--line); background: var(--yolk); box-shadow: 6px 6px 0 var(--line); padding: 28px 28px 24px; }
.contact h2 { margin-bottom: 10px; }
.contact p { max-width: 640px; }
.contact .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.contact .btn { background: #fff; }
.site-foot { border-top: 2px solid var(--line); }
.site-foot .in { max-width: 960px; margin: 0 auto; padding: 20px 24px 32px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; color: var(--muted); }
.site-foot .in span:first-child { margin-right: auto; }

@media screen and (max-width: 760px) {
  body { font-size: 14px; }
  table.frame > tbody > tr > td { padding: 0 16px 56px; }
  .nav-inner { padding: 0 16px; gap: 12px; height: 58px; }
  .nav-links a:not(.btn) { display: none; }
  .cover { padding: 40px 0 40px; }
  .cover .lede { font-size: 15px; }
  .meta, .guarantees, .two { grid-template-columns: 1fr; }
  .meta div { border-right: 0; border-bottom: 2px solid var(--line); }
  .meta div:last-child { border-bottom: 0; }
  .toc ol { columns: 1; }
  h2 { font-size: 21px; }
  section { margin-bottom: 48px; }
  .two { gap: 8px; }
  table.t { font-size: 13px; }
  .contact { padding: 22px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Print: the PDF. Margins and the running footer come from the frame table,
   whose thead/tfoot Chrome repeats on every page. */
@media print {
  @page { size: A4; margin: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 9.6pt; line-height: 1.55; }
  .nav, .site-foot, .contact, .toc, .cover-actions, .screen-only { display: none !important; }
  a { text-decoration: none; }
  table.frame { display: table; width: 100%; border-collapse: collapse; }
  table.frame > thead { display: table-header-group; }
  table.frame > tfoot { display: table-footer-group; }
  table.frame > tbody { display: table-row-group; }
  table.frame > tbody > tr, table.frame > thead > tr, table.frame > tfoot > tr { display: table-row; }
  table.frame > tbody > tr > td { display: table-cell; max-width: none; padding: 0 16mm; }
  table.frame > thead td { height: 14mm; }
  table.frame > tfoot td { height: 16mm; vertical-align: top; }
  .run { display: flex; justify-content: space-between; margin: 0 16mm; padding-top: 3mm; border-top: 2px solid var(--line); font-size: 7.5pt; color: var(--muted); }
  .run .pixel { font-size: 6pt; color: var(--line); }
  .cover { min-height: 255mm; padding: 0; break-after: page; }
  .cover h1 { font-size: 30pt; line-height: 1.12; margin: 34mm 0 6mm; }
  .cover h1 .hl { padding: 0 6px; box-shadow: 5px 5px 0 var(--line); }
  .cover .lede { font-size: 11.5pt; max-width: 150mm; margin: 0 0 10mm; }
  .brand .pixel { font-size: 11pt; }
  .meta b { font-size: 7pt; }
  .meta div { padding: 10px 12px; }
  .chips { margin-top: auto; gap: 6px; }
  .chip { font-size: 7.5pt; padding: 3px 8px; }
  section { margin: 0 0 9mm; }
  h2 { font-size: 15pt; gap: 10px; margin: 0 0 4mm; break-after: avoid; }
  h2 .num { font-size: 8pt; padding: 5px 6px 4px; }
  h3 { font-size: 10.5pt; margin: 5mm 0 2mm; break-after: avoid; }
  p { margin: 0 0 2.5mm; }
  ul, ol { margin: 0 0 3mm; padding-left: 5mm; }
  li { margin: 0 0 1.4mm; }
  .guarantees { gap: 4mm; margin-top: 3mm; }
  .card { padding: 9px 11px; break-inside: avoid; }
  .card b { margin-bottom: 1mm; }
  .tw { overflow: visible; padding: 0; margin: 2mm 0 4mm; }
  table.t { font-size: 8.6pt; break-inside: avoid; }
  table.t th { padding: 6px 8px; font-size: 7.8pt; }
  table.t td { padding: 6px 8px; }
  table.t tr { break-inside: avoid; }
  .figure { padding: 8px 6px 4px; margin: 3mm 0 4mm; break-inside: avoid; }
  .figure .cap { font-size: 7.5pt; padding: 2px 8px 4px; }
  .callout { padding: 8px 12px; margin: 3mm 0; break-inside: avoid; }
  .steps li { padding-left: 9mm; }
  .steps li::before { font-size: 7pt; width: 6mm; padding: 3px 0 2px; top: 0; }
  .two { gap: 6mm; }
  .limits li { break-inside: avoid; }
}
