:root {
  --paper: #e7eef0;
  --sheet: #f4f7f7;
  --ink: #142024;
  --muted: #4d5c60;
  --brass: #8a6432;
  --stamp: #1e4d48;
  --line: #24363a;
  --slip: #122024;
  --slip-ink: #e7f0ee;
  --serif: "Prata", "Times New Roman", serif;
  --text: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 18px, rgba(138, 100, 50, 0.45) 18px 19px, transparent 19px),
    linear-gradient(180deg, #f7fafa 0%, var(--paper) 40%, #d5e0e2 100%);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.6;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
}

a { color: var(--stamp); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--stamp);
  color: #f4f7f7;
  padding: 0.6rem 0.9rem;
  z-index: 5;
  text-decoration: none;
}

.skip:focus { transform: none; }

.bar, .sheet, .dossier, .colophon {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
}

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.seal {
  width: 44px;
  height: 44px;
  border: 2px solid var(--stamp);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--stamp);
  letter-spacing: 0.04em;
}

.brand strong {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.8fr);
  gap: 2rem;
  padding: 2rem 0 1rem;
  align-items: start;
}
.sheet > :only-child { grid-column: 1 / -1; }

.card {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 1.4rem 1.4rem 1.5rem;
  box-shadow: 8px 10px 0 rgba(30, 77, 72, 0.12);
}

.kicker {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
  scroll-margin-top: 1rem;
}

h1 { font-size: clamp(2.2rem, 4.6vw, 3.7rem); margin: 0 0 0.8rem; }
h2 { font-size: clamp(1.55rem, 3vw, 2.05rem); margin: 1.8rem 0 0.6rem; }
h3 { font-size: 1.3rem; margin: 1.3rem 0 0.4rem; }

.dek, .lead { font-size: 1.2rem; }

.plate { margin: 0; }
.plate img, .frame img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
}

.plate img { aspect-ratio: 3 / 4; }

figcaption {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.dossier {
  padding: 0.4rem 0 2.4rem;
  display: grid;
  gap: 0.8rem;
}

.dossier a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  background: var(--sheet);
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--line);
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(30, 77, 72, 0.18);
}

.dossier a:hover,
.dossier a:focus-visible { border-style: solid; border-color: var(--stamp); }

.tag {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--sheet);
  background: var(--stamp);
  padding: 0.35rem 0.5rem;
}

.dossier strong { display: block; font-family: var(--serif); font-size: 1.3rem; font-weight: 400; }
.dossier span span { color: var(--muted); }

.entry {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.6rem 0 3rem;
}

.frame { margin: 1.2rem 0 1.5rem; }
.frame img { aspect-ratio: 4 / 3; }

.note {
  border-top: 3px solid var(--brass);
  background: var(--sheet);
  padding: 0.9rem 1rem;
  margin: 1rem 0 1.4rem;
}

.note p { margin: 0.35rem 0 0; }
.note p:first-child { margin-top: 0; }

.slip {
  background: var(--slip);
  color: var(--slip-ink);
  margin: 1.2rem 0;
  padding: 1rem;
}

.slip header {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

.slip p { margin: 0; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }

.copy {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(231, 240, 238, 0.25);
  min-height: 44px;
  border: 1px solid var(--brass);
  background: transparent;
  color: var(--slip-ink);
  font: 500 0.95rem/1 var(--mono);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.copy:hover { background: var(--brass); color: #fffaf3; }

pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.5;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.3rem;
  font-variant-numeric: tabular-nums;
  background: var(--sheet);
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem;
  border-bottom: 1px solid rgba(20, 32, 36, 0.16);
}

th { font-family: var(--mono); font-weight: 500; font-size: 0.86rem; }

.hold {
  margin-top: 2rem;
  padding: 1.1rem 1.15rem 1.25rem;
  background: var(--sheet);
  border: 1px solid var(--stamp);
  box-shadow: inset 6px 0 0 var(--brass);
}

.hold h2 { margin-top: 0; }

.slot {
  margin: 0.7rem 0 0;
  font-family: var(--mono);
  color: var(--brass);
}

.back { margin-top: 1.8rem; }
.back a { font-weight: 600; }

.colophon {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.3rem;
  border-top: 1px solid var(--line);
  padding: 1rem 0 calc(1.3rem + env(safe-area-inset-bottom));
  color: var(--muted);
}

.colophon a { font-weight: 600; }
.colophon p { margin: 0; }

#copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (prefers-reduced-motion: no-preference) {
  .lift { animation: lift 0.7s ease both; }
  .lift-2 { animation-delay: 0.14s; }
}

@keyframes lift {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  .sheet { grid-template-columns: 1fr; }
  .plate img { aspect-ratio: 4 / 3; }
  .bar { align-items: flex-start; flex-direction: column; }
  .slip header { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lift { animation: none; }
}
