/* Hallmark · presentation · tone: utilitarian · theme: boring */
:root {
  --paper: #f4f4ef;
  --surface: #e8e9e3;
  --ink: #20211f;
  --muted: #5f645f;
  --rule: #caccc5;
  --accent: #2f675e;
  --focus: #174f9e;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--surface);
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html,
body,
main {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--surface);
}

button {
  border: 0;
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.library {
  width: min(100% - 32px, 1000px);
  margin: 0 auto;
  padding: 72px 0;
}

.library-header {
  max-width: 650px;
}

.library h1 {
  margin: 12px 0;
  font-size: clamp(40px, 7vw, 72px);
  letter-spacing: -0.045em;
}

.library-header > p:last-child {
  color: var(--muted);
  font-size: 18px;
}

.eyebrow,
.deck-code,
.toolbar,
.controls,
.note,
.decision small {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
  font-size: 0.95cqw;
}

.library .eyebrow {
  font-size: 13px;
}

.deck-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.deck-card {
  display: grid;
  min-height: 240px;
  padding: 28px;
  border: 1px solid var(--rule);
  background: var(--paper);
  cursor: pointer;
  text-align: left;
}

.deck-card:hover { border-color: var(--ink); }
.deck-card:active { transform: translateY(1px); }
.deck-card strong { align-self: end; font-size: 26px; }
.deck-card > span:not(.deck-code) { color: var(--muted); line-height: 1.45; }
.deck-card small { color: var(--muted); }
.deck-code { font-size: 12px; }

.presenter {
  display: grid;
  height: 100dvh;
  grid-template-rows: 44px minmax(0, 1fr) 56px;
  overflow: hidden;
}

.toolbar,
.controls {
  display: grid;
  align-items: center;
  padding: 0 16px;
  background: var(--surface);
  font-size: 12px;
}

.toolbar {
  grid-template-columns: 1fr auto 1fr;
  border-bottom: 1px solid var(--rule);
}

.toolbar button,
.controls button {
  width: max-content;
  padding: 8px;
  background: transparent;
  cursor: pointer;
}

.toolbar > span:last-child { justify-self: end; }

.stage-wrap {
  display: grid;
  min-height: 0;
  padding: 12px;
  place-items: center;
}

.slide {
  position: relative;
  container-type: size;
  width: min(100%, calc((100dvh - 124px) * 16 / 9));
  max-height: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--paper);
  border: 1px solid var(--rule);
}

.slide-content {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 4.2cqw 4.5cqw;
}

.slide h1,
.slide h2,
.slide p {
  margin: 0;
}

.slide h1 {
  max-width: 78cqw;
  margin-top: 1.2cqw;
  font-size: 3.8cqw;
  line-height: 1.04;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.slide h2 {
  font-size: 1.65cqw;
  line-height: 1.15;
}

.cover {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cover h1 {
  max-width: 78cqw;
  font-size: 5.4cqw;
}

.lede {
  max-width: 68cqw;
  margin-top: 2.2cqw !important;
  color: var(--muted);
  font-size: 1.8cqw;
  line-height: 1.35;
}

.cover-meta {
  display: flex;
  gap: 2.2cqw;
  margin-top: 4cqw;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9cqw;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.statement-list,
.decision-list {
  display: grid;
  margin-top: 3.2cqw;
  border-top: 1px solid var(--rule);
}

.statement,
.decision {
  display: grid;
  min-width: 0;
  grid-template-columns: 6cqw minmax(0, 1fr);
  gap: 2cqw;
  padding: 1.45cqw 0;
  border-bottom: 1px solid var(--rule);
}

.statement p,
.decision p,
.panel li {
  margin-top: 0.5cqw;
  color: var(--muted);
  font-size: 1.25cqw;
  line-height: 1.35;
}

.index {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1cqw;
}

.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3cqw;
  margin-top: 4cqw;
}

.panel {
  min-width: 0;
  padding-top: 1.5cqw;
  border-top: 0.28cqw solid var(--ink);
}

.panel.accent { border-color: var(--accent); }
.panel h2 { margin-bottom: 1.4cqw; }
.panel ul { margin: 0; padding-left: 1.5cqw; }
.panel li + li { margin-top: 1.1cqw; }

.slide table {
  width: 100%;
  margin-top: 3cqw;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 1.2cqw;
  line-height: 1.3;
}

.slide th,
.slide td {
  padding: 1.1cqw 0.9cqw;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.slide th {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82cqw;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slide th:first-child,
.slide td:first-child {
  width: 23%;
  padding-left: 0;
}

.note {
  margin-top: 1.2cqw !important;
  font-size: 0.8cqw;
  text-transform: none;
}

.decision {
  min-height: 7.5cqw;
  grid-template-columns: 5cqw minmax(0, 1fr) 14cqw;
  align-items: center;
}

.decision small {
  font-size: 0.78cqw;
  text-align: right;
}

.diagram {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.controls {
  grid-template-columns: 1fr minmax(160px, 360px) 1fr;
  gap: 20px;
  border-top: 1px solid var(--rule);
}

.controls button:last-child { justify-self: end; }
.controls button:disabled { cursor: not-allowed; opacity: 0.35; }

progress {
  width: 100%;
  height: 4px;
  border: 0;
  accent-color: var(--accent);
}

@media (max-width: 640px) {
  .deck-list { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr auto; }
  .toolbar > span:nth-child(2) { display: none; }
  .controls { grid-template-columns: 1fr 80px 1fr; gap: 4px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .statement,
  .panel,
  .decision { transition-duration: 0.01ms !important; }
}

@media print {
  @page { size: 16in 9in; margin: 0; }
  .toolbar,
  .controls { display: none !important; }
  .presenter { display: block !important; height: auto; }
  .stage-wrap { padding: 0; }
  .slide { width: 16in; height: 9in; max-height: none; border: 0; }
}
