/* OIO & CO. — the whole page is zeros and ones. Text is the only exception. */

:root {
  --bg: #0000AA;
  --text: #F2F2FF;
  --soft: #B9B9F5;
  --field0: #2B2BC8;  /* zeros paving the page */
  --case0: #3434D2;   /* zeros inside the machine room */
  --frame: #9C9CF2;   /* ones that draw the panel frames */
  --rule: #3B3BD8;
  --serif: "EB Garamond", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.6;
}

::selection { background: var(--text); color: var(--bg); }

/* The page floor: a fixed field of zeros behind everything */
#field {
  position: fixed;
  inset: 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
  color: var(--field0);
  user-select: none;
  pointer-events: none;
  overflow: hidden;
}

.page {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 56px) clamp(16px, 3vw, 40px) 72px;
}

/* Rows of 01 used as horizontal rules */
.binrule {
  margin: 0;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
  color: var(--frame);
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

/* Masthead */
.masthead {
  text-align: center;
  padding: 26px 0 34px;
}

.seal {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
  background: var(--bg);
  padding: 6px 12px;
}

.seal pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
  user-select: none;
}

#seal0 { color: var(--case0); }

#seal1 {
  position: absolute;
  inset: 6px 12px;
  color: #ffffff;
}

.doc-kind {
  font-size: 18px;
  font-style: italic;
  color: var(--soft);
  margin: 0 0 22px;
}

.company {
  font-weight: 500;
  font-size: clamp(46px, 9vw, 88px);
  letter-spacing: 0.02em;
  line-height: 1.02;
  margin: 0;
  color: #ffffff;
}

.entity {
  font-size: 20px;
  font-style: italic;
  color: var(--soft);
  margin: 18px 0 0;
}

/* Marquee of claims */
.marquee {
  overflow: hidden;
  background: var(--bg);
  padding: 12px 0;
}

.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: slide 26s linear infinite;
}

.marquee-track span {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 500;
  color: #ffffff;
  padding-right: 2ch;
}

@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* The employee's badge */
.badge-stage {
  padding: 56px 0 8px;
  text-align: center;
}

.badge-wrap {
  display: inline-block;
  perspective: 1100px;
  padding: 10px 40px 46px;
  position: relative;
}

.badge-shadow {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 390px;
  height: 48px;
  margin-left: -195px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.97) 30%, rgba(0, 0, 0, 0) 72%);
  pointer-events: none;
}

.badge {
  --shx: 0%;
  position: relative;
  width: 500px;
  max-width: 100%;
  background: #ececec;
  color: #000;
  border-radius: 18px;
  padding: 52px 28px 22px;
  text-align: left;
  font-family: var(--mono);
  cursor: grab;
  touch-action: none;
  user-select: none;
  will-change: transform;
  transform-style: preserve-3d;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.badge.held { cursor: grabbing; }

.badge::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgba(0, 0, 0, 0) calc(28% + var(--shx)),
    rgba(0, 0, 0, 0.07) calc(45% + var(--shx)),
    rgba(0, 0, 0, 0) calc(62% + var(--shx))
  );
}

.slot {
  position: absolute;
  top: 16px;
  left: 50%;
  width: 84px;
  height: 12px;
  margin-left: -42px;
  border-radius: 7px;
  background: #000;
}

.badge-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.photo {
  position: relative;
  background: #000;
  border-radius: 6px;
  padding: 8px 4px;
  flex: none;
}

.photo pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  user-select: none;
}

#photo0 { color: #3a3a3a; }

#photo1 {
  position: absolute;
  inset: 8px 4px;
  color: #fff;
}

.badge-meta { flex: 1; min-width: 0; }

.verified {
  display: inline-block;
  background: #000;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 5px 10px;
  margin: 0;
}

.hazard {
  margin: 6px 0 12px;
  font-size: 13px;
  line-height: 1;
  color: #000;
  overflow: hidden;
  white-space: nowrap;
}

.badge .f {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 9px;
  font-size: 18px;
}

.badge .k {
  color: #555;
  flex: none;
}

.badge .v {
  font-weight: 600;
  text-align: right;
}

.badge-name {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 14px;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  margin-top: 16px;
  padding: 12px 0;
}

.badge .nm {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 1.1;
}

.badge .sub {
  font-size: 16px;
  letter-spacing: 0.12em;
  color: #333;
  margin: 6px 0 0;
}

.sig {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  background: #000;
  color: #fff;
  padding: 8px 10px;
  min-width: 108px;
}

.sig .scribble {
  font-style: italic;
  font-size: 17px;
  letter-spacing: 0.06em;
}

.sig .k { color: #9a9a9a; font-size: 14px; }

.badge-grid { padding: 14px 0 4px; }

.badge-band {
  background: #000;
  color: #fff;
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.2em;
  padding: 7px 0;
  margin: 10px -28px -22px;
  border-radius: 0 0 18px 18px;
}

.badge-hint { margin-top: 6px; }

/* Status tiles */
.status {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 26px 0;
}

.tile {
  position: relative;
  background: var(--bg);
  padding: 26px 22px 22px;
  text-align: center;
}

.tile .k {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--soft);
  margin: 0 0 6px;
}

.tile .v {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

/* Panels framed in ones (frames drawn by frames.js) */
.framed { position: relative; background: var(--bg); }

.framed > .frame {
  position: absolute;
  inset: 0;
  margin: auto;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
  color: var(--frame);
  user-select: none;
  pointer-events: none;
  overflow: hidden;
}

.panel { padding: 40px clamp(24px, 5vw, 56px) 48px; margin: 26px 0; }

/* The machine room */
.room { margin: 26px 0; padding: 18px; }

.case {
  position: relative;
  background: #000082;
  padding: 14px 0;
  overflow: hidden;
}

.case pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
  user-select: none;
  text-align: center;
}

#zeros { color: var(--case0); }

#ones {
  position: absolute;
  inset: 14px 0;
  color: #F2F7FF;
  transition: color 0.5s ease;
}

.case.working #ones {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(190, 195, 255, 0.6);
}

.grade-bar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 0 24px 20px;
}

.grade {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  min-height: 24px;
}

.till {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--soft);
  margin: 0;
}

.room-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 24px 22px;
}

.legend {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--soft);
  margin: 0;
}

button {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  background: #ffffff;
  color: #0000AA;
  border: 1px solid #ffffff;
  padding: 12px 24px;
  cursor: pointer;
}

button:hover { background: var(--bg); color: #ffffff; }

button:focus-visible { outline: 2px solid #ffffff; outline-offset: 3px; }

/* Section content */
h2 {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 10px;
}

.articles h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 34px 0 6px;
}

.articles p { margin: 0; max-width: 62ch; }

.shares > p { max-width: 62ch; }

.table-note {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--soft);
  margin: 0 0 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 18px;
  border-top: 1px solid var(--rule);
  margin-top: 8px;
}

th, td {
  text-align: left;
  font-weight: 400;
  padding: 12px 4px;
  border-bottom: 1px solid var(--rule);
}

th { font-weight: 600; color: var(--soft); }

.amt { text-align: right; white-space: nowrap; }

tr.sum td { font-weight: 600; color: #ffffff; }

/* SPECIMEN watermark for placeholder data */
.specimen::after {
  content: "SPECIMEN";
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(48px, 10vw, 96px);
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.055);
  pointer-events: none;
}

/* Work receipts */
#joblog {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 18px;
  border-top: 1px solid var(--rule);
}

#joblog li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--rule);
}

#joblog .amt { font-weight: 600; color: #ffffff; }

/* Footer */
footer {
  text-align: center;
  padding-top: 30px;
}

footer p {
  margin: 12px 0 0;
  font-size: 19px;
  line-height: 1.7;
  color: var(--soft);
}

/* Mobile */
@media (max-width: 720px) {
  .status { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 19px; }
  .badge-wrap { transform: scale(0.68); transform-origin: top center; margin-bottom: -190px; }
  .tile { padding: 22px 12px 18px; }
  .panel { padding: 32px 20px 40px; }
  .grade-bar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 0 24px 20px;
}

.grade {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  min-height: 24px;
}

.till {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--soft);
  margin: 0;
}

.room-bar { padding: 14px 12px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  #ones { transition: none; }
}
