/* The Lampkeeper Archive. Colors and type follow the video overlay (AI-3D-Documentary-Engine/src/horror/brand.ts). */
:root {
  --mono: "Courier New", Courier, "Lucida Console", monospace;
  --label: Bahnschrift, "Segoe UI", Arial, sans-serif;
  --ink: #e9e3d3;
  --dim: rgba(233, 227, 211, 0.62);
  --faint: rgba(233, 227, 211, 0.16);
  --stamp: #c2352b;
  --bar: #050505;
  --bar-light: rgba(233, 227, 211, 0.92);
  --paper: #d8d0bc;
  --paper-ink: #1c1a17;
  --paper-dim: rgba(28, 26, 23, 0.62);
  --shade: rgba(4, 5, 7, 0.72);
  --night: #0b0b0c;
  --glow: rgba(233, 180, 90, 0.07);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(ellipse 70% 420px at 50% 0, var(--glow), transparent 70%), var(--night);
  color: var(--ink);
  font: 17px/1.7 var(--mono);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration-color: var(--stamp); text-underline-offset: 3px; }
a:hover { color: #fff; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--paper-ink); padding: 6px 10px; z-index: 10; }
.skip:focus { left: 8px; }

.label, .small, nav, .kindline, .badge, .stamp, th, .sheet-head, .block-title, .end, .button, dt {
  font-family: var(--label);
}
.label { font-size: 12px; letter-spacing: 0.45em; color: var(--dim); text-transform: uppercase; }
.small { font-size: 13px; color: var(--dim); }

/* Header and footer */
header.site {
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--faint);
}
.org { font-family: var(--label); font-size: 13px; letter-spacing: 0.4em; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.lamp {
  width: 9px; height: 9px; border-radius: 50%; background: #f1c27a; flex: none;
  box-shadow: 0 0 10px 3px rgba(241, 194, 122, 0.55);
  animation: flicker 7s infinite steps(1);
}
@keyframes flicker { 0%, 100% { opacity: 1; } 61% { opacity: 0.55; } 62% { opacity: 1; } 87% { opacity: 0.8; } 88% { opacity: 1; } }
header.site nav { display: flex; gap: 22px; font-size: 13px; letter-spacing: 0.25em; text-transform: uppercase; }
header.site nav a { text-decoration: none; color: var(--dim); padding: 4px 0; border-bottom: 2px solid transparent; }
header.site nav a[aria-current="page"], header.site nav a:hover { color: var(--ink); border-bottom-color: var(--stamp); }

footer.site { padding: 40px clamp(16px, 4vw, 48px) 48px; border-top: 1px solid var(--faint); margin-top: 72px; text-align: center; }
footer.site p { margin: 6px 0; font-size: 14px; color: var(--dim); }
footer.site .motto { color: var(--ink); font-size: 15px; letter-spacing: 0.04em; margin-bottom: 14px; }

/* Plain pages */
.page { max-width: 860px; margin: 0 auto; padding: 48px 16px 0; }
.page h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.2; margin: 10px 0 20px; letter-spacing: 0.02em; }
.page h2 { font-size: 22px; margin: 44px 0 12px; }
.page h2::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--stamp); margin-right: 12px; vertical-align: 3px; }
.page h3 { font-size: 18px; margin: 28px 0 8px; }
.page p, .page li { color: rgba(233, 227, 211, 0.88); }
.page blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--stamp); font-size: 19px; color: var(--ink); }
.page .bar { background: var(--bar-light); }

/* Tables */
.table { overflow-x: auto; margin: 20px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { text-align: left; font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--dim); font-weight: 400; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--faint); }
td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--faint); vertical-align: top; }
table.index td:first-child { white-space: nowrap; font-weight: 700; }

/* Class stamps */
.stamp {
  display: inline-block; border: 2px solid var(--stamp); color: var(--stamp); font-weight: 700; font-size: 11px;
  letter-spacing: 0.2em; padding: 1px 6px 0; transform: rotate(-3deg); line-height: 1.6; white-space: nowrap;
}
.classes { display: grid; gap: 12px; margin: 16px 0; }
.classes div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: baseline; }
.classes dd { margin: 0; color: rgba(233, 227, 211, 0.85); }

/* Home */
.hero { position: relative; min-height: min(78vh, 640px); display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--faint); }
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--night) 2%, rgba(11, 11, 12, 0.35) 55%, rgba(11, 11, 12, 0.55)); }
.hero-text { position: relative; z-index: 1; max-width: 860px; width: 100%; margin: 0 auto; padding: 0 16px 48px; }
.hero h1 { font-size: clamp(30px, 6vw, 54px); line-height: 1.12; margin: 12px 0 16px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9); }
.typed { font-size: clamp(16px, 2.4vw, 20px); margin: 0; display: inline-block; background: var(--shade); padding: 8px 14px; border-left: 4px solid var(--stamp); }
.cursor { display: inline-block; width: 0.6em; height: 1.05em; background: var(--stamp); margin-left: 6px; vertical-align: -0.15em; animation: blink 1.1s infinite steps(1); }
@keyframes blink { 50% { opacity: 0; } }

.latest { padding-top: 56px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin: 18px 0 20px; }
.card { display: flex; flex-direction: column; text-decoration: none; border: 1px solid var(--faint); background: rgba(233, 227, 211, 0.03); transition: border-color 0.2s; }
.card:hover { border-color: var(--stamp); }
.card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.card-text { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 18px; }
.card-id { font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-name { font-size: 19px; }
.card-summary { font-size: 14px; color: var(--dim); line-height: 1.55; }

/* A file */
.file { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.file-head { position: relative; margin: 28px 0 0; min-height: 360px; display: flex; align-items: flex-end; overflow: hidden; border: 1px solid var(--faint); }
.file-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4, 5, 7, 0.9), rgba(4, 5, 7, 0.15) 70%); }
.file-id { position: relative; z-index: 1; padding: 0 clamp(16px, 4vw, 36px) 28px; }
.file-id h1 { margin: 6px 0 8px; font-size: clamp(30px, 6vw, 52px); line-height: 1.1; letter-spacing: 0.04em; }
.codename { display: inline-block; font-weight: 400; font-size: 0.5em; color: var(--dim); letter-spacing: 0; vertical-align: 0.2em; }
.kindline { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: 0.3em; }
.square { width: 10px; height: 10px; background: var(--stamp); display: inline-block; }
.badge {
  position: absolute; z-index: 1; top: clamp(16px, 4vw, 30px); right: clamp(16px, 4vw, 34px); transform: rotate(-4deg);
  color: var(--stamp); border: 5px double var(--stamp); padding: 8px 16px 9px; text-align: center; background: rgba(4, 5, 7, 0.45);
}
.badge-label { font-size: 10px; letter-spacing: 0.5em; opacity: 0.9; }
.badge-class { font-weight: 700; font-size: clamp(24px, 4vw, 34px); letter-spacing: 0.22em; line-height: 1.15; margin-right: -0.22em; }
.badge-clearance { font-size: 10px; letter-spacing: 0.3em; opacity: 0.85; }

/* The paper sheet: the file itself, as on the video's document pages */
.sheet {
  position: relative; background: var(--paper); color: var(--paper-ink);
  background-image: radial-gradient(ellipse at 50% 0, rgba(255, 252, 240, 0.35), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(120, 100, 70, 0.18), transparent 50%);
  padding: clamp(22px, 5vw, 56px) clamp(18px, 6vw, 72px) clamp(32px, 5vw, 56px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}
.sheet-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; letter-spacing: 0.35em; color: var(--paper-dim); border-bottom: 2px solid rgba(28, 26, 23, 0.55); padding-bottom: 10px; margin-bottom: 22px; }
.sheet p, .sheet li { margin: 0 0 14px; }
.sheet ul, .sheet ol { padding-left: 1.4em; margin: 0 0 16px; }
.sheet a { color: var(--paper-ink); }
.notice { font-size: 14px; color: var(--paper-dim); border: 1px dashed rgba(28, 26, 23, 0.4); padding: 10px 14px; }
h2.section {
  font-family: var(--label); font-size: 15px; letter-spacing: 0.3em; text-transform: uppercase; font-weight: 700;
  margin: 40px 0 16px; padding-top: 18px; border-top: 1px solid rgba(28, 26, 23, 0.3);
}
h2.section .mark { color: var(--stamp); margin-right: 10px; }
.sheet h3 { font-family: var(--label); font-size: 13px; letter-spacing: 0.25em; text-transform: uppercase; margin: 26px 0 10px; }
.sheet blockquote { margin: 18px 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--stamp); }
.sheet hr { border: 0; border-top: 1px solid rgba(28, 26, 23, 0.3); margin: 26px 0; }
.sheet th { color: var(--paper-dim); border-bottom-color: rgba(28, 26, 23, 0.35); }
.sheet td { border-bottom-color: rgba(28, 26, 23, 0.2); }
.sheet td:first-child { white-space: nowrap; font-weight: 700; }
.sheet figure { margin: 26px 0; }
.sheet figure img { width: 100%; border: 1px solid rgba(28, 26, 23, 0.5); filter: sepia(0.15); }
.sheet figcaption { font-size: 13px; color: var(--paper-dim); margin-top: 6px; }
.end { text-align: center; font-size: 12px; letter-spacing: 0.4em; color: var(--paper-dim); margin: 40px 0 0 !important; }

/* Boxed blocks inside a file: ::: excerpt, ::: log, ::: note */
.block { border: 1px solid rgba(28, 26, 23, 0.45); padding: 16px 20px 6px; margin: 22px 0; background: rgba(255, 252, 240, 0.22); }
.block-title { font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--paper-dim); margin-bottom: 12px; }
.block-excerpt { background: #1a1917; color: var(--ink); border-color: #1a1917; padding: 22px 24px 10px; }
.block-excerpt .block-title { color: var(--dim); }
.block-excerpt strong { font-family: var(--label); font-weight: 400; font-size: 13px; letter-spacing: 0.2em; color: var(--dim); margin-right: 6px; }
.block-excerpt em { color: var(--dim); }
.block-excerpt .bar { background: var(--bar-light); }
.block-log { border-left: 4px solid var(--stamp); }

/* Redaction bars: empty boxes as wide as the secret. The secret is not in the page. */
.bar {
  display: inline-block; width: calc(var(--n) * 1ch); height: 1.1em; vertical-align: -0.2em;
  background: var(--bar); margin: 0 0.08em; user-select: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
h2.section .bar, .block-title .bar, th .bar { width: calc(var(--n) * 0.62em); }

.file-foot { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; padding: 28px 0 0; }
.button {
  display: inline-block; border: 2px solid var(--stamp); color: var(--ink); text-decoration: none; padding: 10px 18px;
  font-size: 13px; letter-spacing: 0.25em; text-transform: uppercase;
}
.button:hover { background: var(--stamp); }
.pager { display: flex; justify-content: space-between; gap: 16px; width: 100%; }
.pager a { text-decoration: none; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .file-head { min-height: 300px; align-items: flex-end; }
  .badge { padding: 6px 10px 7px; }
  .classes div { grid-template-columns: 1fr; gap: 4px; }
  .sheet td:first-child { white-space: normal; }
  .sheet-head { letter-spacing: 0.15em; font-size: 11px; }
  .block { padding: 14px 14px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .lamp, .cursor { animation: none; }
}
@media print {
  body { background: #fff; color: #000; }
  header.site nav, .file-foot, .hero-image, .file-image { display: none; }
  .sheet { box-shadow: none; }
}

/* Key-value tables (a Markdown table whose header row is empty) */
table.pairs td:first-child {
  font-family: var(--label); font-weight: 400; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--paper-dim); width: 34%; padding-top: 12px;
}
.block-note { border-style: dashed; text-align: center; }
.block-note .block-title { margin-bottom: 6px; }
