/* tokens: backdrop #C7C3B7 (linoleum desk), paper #FBFAF4, ink #17150F,
   stamp red #A5352B (the one colour, per lane). type: Anonymous Pro only,
   typed on one machine, nothing hand-lettered. */

@font-face {
  font-family: 'Anonymous Pro';
  src: url('assets/fonts/anonymous-pro-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Anonymous Pro';
  src: url('assets/fonts/anonymous-pro-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Anonymous Pro';
  src: url('assets/fonts/anonymous-pro-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #C7C3B7;
}

body {
  min-height: 100vh;
  padding: clamp(14px, 4vw, 48px) clamp(10px, 3vw, 24px);
  display: flex;
  justify-content: center;
  font-family: 'Anonymous Pro', 'Courier New', monospace;
  color: #17150F;
}

.sheet {
  width: 100%;
  max-width: 700px;
  background: #FBFAF4;
  border: 1px solid #17150F;
  padding: clamp(16px, 3vw, 28px) clamp(16px, 4vw, 32px) 22px;
}

.letterhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid #17150F;
  padding-bottom: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 6px;
}

.letterhead-title {
  font-weight: 700;
  font-size: clamp(15px, 3.4vw, 20px);
  letter-spacing: 0.08em;
}

.letterhead-sub {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #4A473E;
}

.record {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.photo-box {
  border: 1px solid #17150F;
  padding: 6px;
}

.photo {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(1) contrast(1.05);
}

.photo-caption {
  display: block;
  text-align: center;
  font-size: 10px;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #4A473E;
  margin-top: 5px;
}

.fields {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field-value {
  font-size: clamp(13px, 2.6vw, 15px);
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #17150F;
  padding-bottom: 3px;
  word-break: break-all;
}

.field-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #4A473E;
  margin-top: 3px;
}

.field-value.ca {
  cursor: pointer;
}
.field-value.ca:hover,
.field-value.ca:focus-visible {
  background: #ECE7D8;
  outline: none;
}

.notes {
  border-top: 1px solid #17150F;
  border-bottom: 1px solid #17150F;
  padding: 12px 0 14px;
  margin-bottom: 18px;
}

.notes-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.notes p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.55;
}
.notes p:last-child { margin-bottom: 0; }

#log-line {
  font-style: italic;
  color: #3A3730;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.review-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  background: #FBFAF4;
  color: #17150F;
  border: 1px solid #17150F;
  padding: 9px 14px;
  cursor: pointer;
}
.review-btn:hover { background: #17150F; color: #FBFAF4; }
.review-btn:active { transform: translateY(1px); }

.review-count {
  font-size: 11px;
  color: #4A473E;
}

.stamp-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 22px;
}

.stamp {
  border: 3px double #A5352B;
  color: #A5352B;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 8px 16px;
  transform: rotate(-8deg);
  transform-origin: center;
  opacity: 0.92;
  mix-blend-mode: multiply;
}

@keyframes stamp-thud {
  0%   { transform: rotate(-8deg) scale(1.5); opacity: 0; }
  55%  { transform: rotate(-8deg) scale(0.94); opacity: 0.92; }
  75%  { transform: rotate(-8deg) scale(1.05); }
  100% { transform: rotate(-8deg) scale(1); opacity: 0.92; }
}

.stamp.thud { animation: stamp-thud 320ms ease-out; }

.filing {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  border-top: 1px solid #17150F;
  padding-top: 10px;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: #4A473E;
}

.filing a {
  color: #17150F;
}

.filing #clock {
  color: #17150F;
  font-weight: 700;
}

#boot-error {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #A5352B;
  color: #fff;
  font-family: monospace;
  font-size: 12px;
  padding: 8px 12px;
  z-index: 999;
}

@media (max-width: 520px) {
  .record {
    grid-template-columns: 1fr;
  }
  .photo-box {
    width: 148px;
  }
  .stamp-wrap {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stamp.thud { animation: none; }
}
