/* Foundation Credit (FCR) — Project FCRED site styles
   BRAND-SPEC v1.0 */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Narrow:wght@600;700&family=IBM+Plex+Mono:wght@400;500&family=Source+Sans+3:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --archive-black: #1a1a1a;
  --containment-red: #8b1e1e;
  --stamp-red: #a52a2a;
  --document-white: #f4f2ed;
  --ledger-gray: #6b6b6b;
  --fcr-gold: #b8963e;
  --border: #d4d0c8;
  --paper-shadow: 0 2px 12px rgba(26, 26, 26, 0.08);
  --font-head: 'Archivo Narrow', 'Arial Narrow', sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --max-width: 52rem;
  --header-h: 3.5rem;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--archive-black);
  background: #e8e6e1;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--archive-black);
  color: var(--document-white);
  border-bottom: 3px solid var(--containment-red);
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: -40%;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    -32deg,
    transparent 0,
    transparent 18px,
    rgba(139, 30, 30, 0.17) 18px,
    rgba(139, 30, 30, 0.17) 20px,
    transparent 20px,
    transparent 38px
  );
  animation: chrome-pattern-drift 11s linear infinite;
}

.header-inner {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  background: var(--containment-red);
  padding: 0.3rem 0.7rem;
  border-radius: 0;
}

.brand-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--document-white);
}

.brand-sub {
  font-size: 0.65rem;
  color: rgba(244, 242, 237, 0.88);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* —— Site meta bar (issued by / last updated) —— */
.site-meta-bar {
  background: var(--document-white);
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--containment-red);
  box-shadow: 0 1px 4px rgba(26, 26, 26, 0.06);
}

.site-meta-bar__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.45rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
}

.site-meta-bar__authority {
  margin: 0;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--archive-black);
}

.site-meta-bar__label {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--containment-red);
  letter-spacing: 0.08em;
}

.site-meta-bar .site-last-updated {
  margin: 0;
  font-size: 0.72rem;
  color: var(--ledger-gray);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid #555;
  color: var(--document-white);
  padding: 0.35rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--document-white);
}

.site-nav a[aria-current="page"] {
  border-bottom: 2px solid var(--containment-red);
  padding-bottom: 0.1rem;
}

/* —— Main layout —— */
main {
  flex: 1;
  padding: 2rem 1.25rem 3rem;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.container--wide {
  max-width: 72rem;
}

/* —— Restricted access banner (top) —— */
.notice-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.65rem;
  background: var(--containment-red);
  color: var(--document-white);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* —— Unofficial disclaimer (below) —— */
.restricted-bar {
  background: #111;
  color: #888;
  text-align: center;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(139, 30, 30, 0.45);
}

.restricted-badge {
  display: inline-block;
  background: var(--containment-red);
  color: var(--document-white);
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  margin-right: 0.5rem;
  letter-spacing: 0.12em;
}

.doc-classification {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--containment-red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.site-last-updated {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #666;
  margin: 0.5rem 0 0;
  letter-spacing: 0.03em;
}

.site-last-updated strong {
  color: #888;
  font-weight: 500;
}

/* —— Hero (index) —— */
.hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
}

.hero-mark {
  width: 11.25rem;
  height: 11.25rem;
  margin: 0 auto 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: transparent;
  box-shadow: none;
}

.hero-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(26, 26, 26, 0.1));
}

.hero h1 {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  letter-spacing: 0.02em;
}

.hero .tagline {
  font-family: var(--font-head);
  color: var(--containment-red);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .lead {
  color: var(--ledger-gray);
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
}

.page-home .hero {
  padding-bottom: 1rem;
}

.page-home .hero .lead {
  margin-bottom: 0.75rem;
}

.page-home .status-panel {
  margin-top: 1rem;
}

/* —— Portal sections (home) —— */
.portal {
  margin: 2rem 0;
}

.portal-section {
  margin-bottom: 2.25rem;
}

.portal-section:last-child {
  margin-bottom: 0;
}

.portal-section-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--archive-black);
  margin: 0 0 0.35rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--containment-red);
}

.portal-section-desc {
  font-size: 0.88rem;
  color: var(--ledger-gray);
  margin: 0 0 1rem;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
}

.portal-grid--single {
  max-width: 22rem;
}

/* —— Cards —— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.card {
  position: relative;
  background: var(--document-white);
  border: 1px solid var(--border);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--paper-shadow);
  transition: border-color 0.15s, transform 0.15s;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2.75rem;
  height: 3px;
  background: var(--containment-red);
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 2.25rem;
  background: var(--containment-red);
}

.card:hover {
  border-color: var(--containment-red);
  transform: translateY(-2px);
}

.card h2,
.card h3 {
  font-family: var(--font-head);
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--containment-red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ledger-gray);
}

/* —— Home entrance motion —— */
@keyframes home-rise-in {
  from {
    opacity: 0;
    transform: translateY(0.65rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html.fcred-skip-splash body.page-home .hero-mark,
body.page-home.splash-done .hero-mark {
  animation: home-rise-in 0.6s ease-out 0.05s both;
}

html.fcred-skip-splash body.page-home .hero h1,
html.fcred-skip-splash body.page-home .hero .tagline,
html.fcred-skip-splash body.page-home .hero .lead,
body.page-home.splash-done .hero h1,
body.page-home.splash-done .hero .tagline,
body.page-home.splash-done .hero .lead {
  animation: home-rise-in 0.55s ease-out both;
}

html.fcred-skip-splash body.page-home .hero h1,
body.page-home.splash-done .hero h1 { animation-delay: 0.12s; }

html.fcred-skip-splash body.page-home .hero .tagline,
body.page-home.splash-done .hero .tagline { animation-delay: 0.2s; }

html.fcred-skip-splash body.page-home .hero .lead,
body.page-home.splash-done .hero .lead { animation-delay: 0.28s; }

html.fcred-skip-splash body.page-home .status-panel,
body.page-home.splash-done .status-panel {
  animation: home-rise-in 0.55s ease-out 0.38s both;
}

html.fcred-skip-splash body.page-home .portal-section,
body.page-home.splash-done .portal-section {
  animation: home-rise-in 0.5s ease-out both;
}

html.fcred-skip-splash body.page-home .portal-section:nth-of-type(1),
body.page-home.splash-done .portal-section:nth-of-type(1) { animation-delay: 0.48s; }

html.fcred-skip-splash body.page-home .portal-section:nth-of-type(2),
body.page-home.splash-done .portal-section:nth-of-type(2) { animation-delay: 0.58s; }

html.fcred-skip-splash body.page-home .portal-section:nth-of-type(3),
body.page-home.splash-done .portal-section:nth-of-type(3) { animation-delay: 0.68s; }

@media (prefers-reduced-motion: reduce) {
  html.fcred-skip-splash body.page-home .hero-mark,
  html.fcred-skip-splash body.page-home .hero h1,
  html.fcred-skip-splash body.page-home .hero .tagline,
  html.fcred-skip-splash body.page-home .hero .lead,
  html.fcred-skip-splash body.page-home .status-panel,
  html.fcred-skip-splash body.page-home .portal-section,
  body.page-home.splash-done .hero-mark,
  body.page-home.splash-done .hero h1,
  body.page-home.splash-done .hero .tagline,
  body.page-home.splash-done .hero .lead,
  body.page-home.splash-done .status-panel,
  body.page-home.splash-done .portal-section {
    animation: none;
  }
}

/* —— Status panel —— */
.status-panel {
  background: var(--document-white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--containment-red);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--paper-shadow);
}

.status-panel h2 {
  font-family: var(--font-head);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
  color: var(--ledger-gray);
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.status-table th,
.status-table td {
  text-align: left;
  padding: 0.4rem 0.75rem 0.4rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.status-table th {
  font-weight: 600;
  color: var(--ledger-gray);
  width: 8rem;
  white-space: nowrap;
}

.status-table td code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  word-break: break-all;
}

.status-tbd {
  color: var(--ledger-gray);
  font-style: italic;
}

/* —— Document paper —— */
.doc {
  background: var(--document-white);
  border: 1px solid var(--border);
  padding: 2rem 2.25rem;
  box-shadow: var(--paper-shadow);
}

.doc-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ledger-gray);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.doc-meta strong {
  color: var(--archive-black);
}

.doc h1 {
  font-family: var(--font-head);
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

.doc .doc-tagline {
  font-family: var(--font-head);
  color: var(--containment-red);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 1.5rem;
}

.doc h2 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  color: var(--archive-black);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.doc h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 1rem;
}

.doc h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
}

.doc p, .doc li {
  font-size: 0.95rem;
}

.doc ul, .doc ol {
  padding-left: 1.25rem;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.doc th, .doc td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.65rem;
  text-align: left;
}

.doc th {
  background: #ebe8e2;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.doc pre {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: #ebe8e2;
  border: 1px solid var(--border);
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.45;
}

.doc .ooc {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: #ebe8e2;
  border-left: 4px solid var(--containment-red);
  font-size: 0.9rem;
}

.doc a {
  color: var(--containment-red);
}

/* —— Footer —— */
.site-footer {
  position: relative;
  background: var(--archive-black);
  color: #999;
  padding: 1.5rem 1.25rem;
  font-size: 0.8rem;
  border-top: 3px solid var(--containment-red);
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: -40%;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    -32deg,
    transparent 0,
    transparent 18px,
    rgba(139, 30, 30, 0.17) 18px,
    rgba(139, 30, 30, 0.17) 20px,
    transparent 20px,
    transparent 38px
  );
  animation: chrome-pattern-drift 11s linear infinite;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-disclaimer {
  max-width: 36rem;
  line-height: 1.5;
}

.footer-authority {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
  margin: 0 0 0.65rem;
  max-width: 36rem;
  line-height: 1.45;
}

.footer-authority-label {
  display: block;
  color: var(--containment-red);
  font-size: 0.65rem;
  margin-bottom: 0.2rem;
  letter-spacing: 0.1em;
}

.footer-meta {
  max-width: 36rem;
}

/* —— Canteen menu grid —— */
.menu-section-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2rem 0 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.menu-section-title:first-of-type {
  border-top: none;
  margin-top: 1rem;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.menu-card {
  background: #faf9f6;
  border: 1px solid var(--border);
}

.menu-card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  margin: 0;
  background: #e0ddd6;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-card-image--placeholder::after {
  content: attr(data-label);
  font-family: var(--font-head);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ledger-gray);
  text-align: center;
  padding: 0 0.25rem;
}

.menu-card-image:has(img)::after {
  display: none;
}

.menu-card-body {
  padding: 0.5rem 0.65rem 0.75rem;
}

.menu-card-body h3 {
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

.menu-card-price-row {
  display: flex;
  justify-content: flex-end;
  margin: 0.2rem 0 0.35rem;
}

.menu-card-price {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--containment-red);
  white-space: nowrap;
}

.menu-card-price--anomaly {
  font-size: 0.95rem;
  font-weight: 700;
  color: #7a0000;
  letter-spacing: 0.03em;
  text-shadow: 0 0 6px rgba(122, 0, 0, 0.25);
  animation: price-anomaly-flicker 2.2s ease-in-out infinite;
}

@keyframes price-anomaly-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}

.menu-card-desc {
  font-size: 0.82rem;
  color: var(--ledger-gray);
  margin: 0;
  line-height: 1.4;
}

/* —— Personnel badge generator —— */
.badge-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.5rem;
  align-items: start;
  margin: 1.5rem 0 1rem;
}

.badge-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.badge-form input[type="text"],
.badge-form select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  background: #fff;
  margin-bottom: 1rem;
}

.badge-form button {
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--archive-black);
  color: var(--document-white);
  border: none;
  padding: 0.55rem 1rem;
  cursor: pointer;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.badge-form button:hover {
  background: var(--containment-red);
}

.badge-procedure {
  margin: 1.25rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--containment-red);
  background: #fff;
  font-size: 0.9rem;
}

.badge-procedure ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.badge-procedure li {
  margin-bottom: 0.35rem;
}

.badge-notice {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background: #faf9f7;
  font-size: 0.88rem;
}

.badge-notice--policy {
  border-left: 4px solid var(--archive-black);
}

.badge-notice p {
  margin: 0.45rem 0 0;
  line-height: 1.5;
}

.badge-photo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.badge-photo-clear {
  background: var(--ledger-gray) !important;
}

.badge-photo-clear:hover {
  background: var(--containment-red) !important;
}

.badge-photo-filename {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ledger-gray);
}

.badge-photo-error {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--containment-red);
}

.badge-preview-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ledger-gray);
  margin: 0 0 0.5rem;
}

.personnel-badge {
  aspect-ratio: 1.586 / 1;
  max-width: 100%;
  background: var(--document-white);
  border: 2px solid var(--archive-black);
  box-shadow: var(--paper-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.personnel-badge__header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--archive-black);
  color: var(--document-white);
  padding: 0.45rem 0.55rem;
  border-bottom: 3px solid var(--containment-red);
  overflow: hidden;
}

.personnel-badge__header::before {
  content: '';
  position: absolute;
  inset: -40%;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    -32deg,
    transparent 0,
    transparent 18px,
    rgba(139, 30, 30, 0.17) 18px,
    rgba(139, 30, 30, 0.17) 20px,
    transparent 20px,
    transparent 38px
  );
  animation: none;
}

.personnel-badge__header-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  flex: 0 1 auto;
  max-width: 54%;
  background: var(--containment-red);
  padding: 0.28rem 0.5rem;
}

.personnel-badge__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--document-white);
}

.personnel-badge__subtitle {
  font-size: 0.55rem;
  color: rgba(244, 242, 237, 0.88);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.personnel-badge__site {
  position: relative;
  z-index: 1;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 0.5rem;
  text-align: right;
}

.personnel-badge__body {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem;
  flex: 1;
  min-height: 0;
}

.personnel-badge__photo {
  width: 36%;
  max-width: 6.5rem;
  aspect-ratio: 35 / 45;
  background: #d4d0c8;
  border: 1px solid var(--ledger-gray);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  align-self: flex-start;
}

.personnel-badge__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.personnel-badge__photo::after {
  content: 'PHOTO';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.45rem;
  color: var(--ledger-gray);
  letter-spacing: 0.08em;
  pointer-events: none;
}

.personnel-badge__photo--filled::after {
  display: none;
}

.personnel-badge__fields-col {
  flex: 1;
  min-width: 0;
  position: relative;
  padding-right: 4.7rem;
}

.personnel-badge__fields {
  margin: 0;
  font-size: 0.74rem;
}

.personnel-badge__fields div {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.28rem;
  margin-bottom: 0.22rem;
}

.personnel-badge__row--barcode dd {
  padding-right: 0.1rem;
}

.personnel-badge__qrcode {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 4.3rem;
  height: 4.3rem;
  opacity: 0.72;
  pointer-events: none;
  overflow: hidden;
}

.personnel-badge__qrcode img,
.personnel-badge__qrcode canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.personnel-badge__fields dt {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  color: var(--ledger-gray);
  margin: 0;
}

.personnel-badge__fields dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.76rem;
  line-height: 1.2;
  word-break: break-word;
}

.personnel-badge__status {
  color: var(--containment-red);
}

.personnel-badge__stripe {
  height: 0.35rem;
  margin-top: auto;
  background: repeating-linear-gradient(
    90deg,
    var(--archive-black) 0,
    var(--archive-black) 8px,
    #333 8px,
    #333 16px
  );
}

.personnel-badge__footer-band {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 0.48rem;
  padding: 0.03rem 0.35rem 0.05rem;
  text-align: left;
}

.personnel-badge__footer {
  margin: 0;
  width: 100%;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.17rem;
  transform: scale(0.5);
  transform-origin: left center;
  text-align: left;
  color: var(--ledger-gray);
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  box-sizing: border-box;
}

.personnel-badge__footer-line {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.personnel-badge__ooc {
  margin-top: 0;
}

@media (max-width: 720px) {
  .badge-workspace {
    grid-template-columns: 1fr;
  }
}

/* —— Correspondence (Form CA-14) —— */
.correspondence-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.correspondence-form select,
.correspondence-form input[type="text"],
.correspondence-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  background: #fff;
  margin-bottom: 1rem;
}

.correspondence-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.correspondence-form button {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--archive-black);
  color: var(--document-white);
  border: none;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
}

.correspondence-form button:hover {
  background: var(--containment-red);
}

.correspondence-form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.correspondence-error {
  background: #fdeaea;
  border-left: 4px solid var(--containment-red);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.correspondence-rules {
  font-size: 0.9rem;
  background: #ebe8e2;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--archive-black);
}

.correspondence-output {
  margin: 1.5rem 0;
}

.correspondence-output textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  min-height: 6rem;
  margin-bottom: 0.75rem;
}

.correspondence-copy-status {
  font-size: 0.85rem;
  color: var(--containment-red);
  font-weight: 600;
}

.correspondence-thread {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
}

.correspondence-x-steps {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.9rem;
}

.correspondence-x-steps ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.correspondence-x-steps li {
  margin-bottom: 0.35rem;
}

.correspondence-x-note {
  font-size: 0.88rem;
  color: var(--ledger-gray);
  margin: 0.75rem 0 0;
}

.correspondence-thread-pending {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: #ebe8e2;
  padding: 1rem;
  color: var(--ledger-gray);
}

@media (max-width: 768px) {
  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.footer-links a {
  color: #bbb;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--document-white);
}

/* —— Responsive —— */
@media (max-width: 640px) {
  html { font-size: 16px; }

  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--archive-black);
    border-bottom: 3px solid var(--containment-red);
    padding: 1rem 1.25rem;
  }

  .site-nav.is-open { display: block; }

  .site-nav ul {
    flex-direction: column;
    gap: 0.75rem;
  }

  .header-inner { position: relative; }

  .doc { padding: 1.25rem 1rem; }

  .status-table th {
    display: block;
    width: 100%;
    border-bottom: none;
    padding-bottom: 0;
  }

  .status-table td {
    display: block;
    padding-top: 0;
    padding-bottom: 0.75rem;
  }
}

/* —— Splash intro (index only) —— */
html.fcred-skip-splash #splash-screen {
  display: none !important;
}

html.fcred-skip-splash body.has-splash {
  overflow: auto;
}

body.has-splash {
  overflow: hidden;
}

body.splash-done {
  overflow: auto;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--archive-black);
  color: var(--document-white);
  overflow: hidden;
}

/* Caution / restricted-access pattern — behind text, above black */
.splash-pattern {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  animation: splash-pattern-in 1.4s ease-out 0.1s forwards;
}

.splash-pattern::before {
  content: '';
  position: absolute;
  inset: -60%;
  background: repeating-linear-gradient(
    -32deg,
    transparent 0,
    transparent 18px,
    rgba(139, 30, 30, 0.07) 18px,
    rgba(139, 30, 30, 0.07) 20px,
    transparent 20px,
    transparent 38px
  );
  animation: splash-pattern-drift 28s linear infinite;
}

.splash-pattern::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 242, 237, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 242, 237, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, black 20%, transparent 85%);
}

.splash-access-frame {
  position: absolute;
  inset: 8%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  animation: splash-pattern-in 1.2s ease-out 0.5s forwards;
  border: 1px solid rgba(139, 30, 30, 0.1);
  background:
    linear-gradient(to right, rgba(139, 30, 30, 0.4) 2px, transparent 2px) 0 0 / 1.75rem 2px no-repeat,
    linear-gradient(to bottom, rgba(139, 30, 30, 0.4) 2px, transparent 2px) 0 0 / 2px 1.75rem no-repeat,
    linear-gradient(to left, rgba(139, 30, 30, 0.4) 2px, transparent 2px) 100% 0 / 1.75rem 2px no-repeat,
    linear-gradient(to bottom, rgba(139, 30, 30, 0.4) 2px, transparent 2px) 100% 0 / 2px 1.75rem no-repeat,
    linear-gradient(to right, rgba(139, 30, 30, 0.4) 2px, transparent 2px) 0 100% / 1.75rem 2px no-repeat,
    linear-gradient(to top, rgba(139, 30, 30, 0.4) 2px, transparent 2px) 0 100% / 2px 1.75rem no-repeat,
    linear-gradient(to left, rgba(139, 30, 30, 0.4) 2px, transparent 2px) 100% 100% / 1.75rem 2px no-repeat,
    linear-gradient(to top, rgba(139, 30, 30, 0.4) 2px, transparent 2px) 100% 100% / 2px 1.75rem no-repeat;
}

.splash-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 28rem;
}

.splash-tagline {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--containment-red);
  margin: 0 0 1.25rem;
  opacity: 0;
  transform: translateY(1.25rem);
  animation: splash-rise-in 1s ease-out 0.2s forwards;
}

.splash-dept {
  font-family: var(--font-body);
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #aaa;
  margin: 0;
  opacity: 0;
  transform: translateY(1rem);
  animation: splash-rise-in 0.9s ease-out 1.1s forwards;
}

.splash--exit {
  animation: splash-fade-out 0.85s ease-in forwards;
  pointer-events: none;
}

.splash--exit .splash-tagline,
.splash--exit .splash-dept {
  animation: none;
}

@keyframes splash-rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splash-pattern-in {
  to {
    opacity: 1;
  }
}

@keyframes splash-pattern-drift {
  to {
    transform: rotate(360deg);
  }
}

@keyframes chrome-pattern-drift {
  to {
    transform: translate(38px, 28px);
  }
}

@keyframes splash-fade-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.has-splash { overflow: auto; }

  .site-header::before,
  .site-footer::before,
  .personnel-badge__header::before {
    animation: none;
  }

  .splash-pattern,
  .splash-access-frame {
    animation: none;
    opacity: 0.6;
  }

  .splash-pattern::before {
    animation: none;
  }

  .splash-tagline,
  .splash-dept {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .splash--exit {
    animation-duration: 0.3s;
  }
}
