:root {
  color-scheme: light;
  --page: #f4eee3;
  --paper: #fbf7ef;
  --ink: #1b1a17;
  --muted: #5c574e;
  --line: #c8beaf;
  --accent: #a82d1b;
  --accent-strong: #892414;
  --green: #2f5d3a;
  --amber: #72520c;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font: 16px/1.5 var(--sans);
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3, p, dl, ol, ul, blockquote { margin: 0; }
h1, h2, h3, p, dd, blockquote { overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 2;
  inset: 8px auto auto 8px;
  padding: 10px 14px;
  background: var(--paper);
}

.site-header, .page, .site-footer {
  width: min(100% - 2rem, 1120px);
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--ink);
}

.site-header-inner {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-top: clamp(12px, 3vw, 24px);
}

.brand {
  color: var(--ink);
  font: 600 clamp(25px, 4vw, 34px)/1 var(--serif);
  letter-spacing: .08em;
  text-decoration: none;
}

.brand-note { font-size: .8125rem; color: var(--muted); }
nav { display: flex; gap: 4px; margin-inline-start: auto; }
nav a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 8px clamp(8px, 2vw, 16px);
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
}
nav a[aria-current] { color: var(--ink); border-color: var(--accent); }

.page {
  flex: 1 0 auto;
  padding-block: clamp(26px, 5vw, 52px) clamp(40px, 7vw, 80px);
}

.site-footer {
  padding-block: 16px 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8125rem;
}

.intro { max-width: 48rem; margin-bottom: 28px; }
.intro > p:last-child { margin-top: 12px; }
h1 {
  max-width: 25ch;
  margin-block: 8px 12px;
  font: 500 clamp(2rem, 5.4vw, 3.4rem)/1.04 var(--serif);
  letter-spacing: -.035em;
  text-wrap: balance;
}
h2 { font: 500 clamp(1.25rem, 3vw, 1.55rem)/1.15 var(--serif); }
h3 { font-size: .975rem; line-height: 1.35; }
.eyebrow, .status, .section-note, .timeline time {
  font: 500 .8125rem/1.4 var(--mono);
  color: var(--muted);
}
.eyebrow, .status { letter-spacing: .04em; text-transform: uppercase; }
.eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.status {
  display: inline-block;
  flex-shrink: 0;
  width: fit-content;
  border: 1px solid currentColor;
  padding: 3px 7px;
  color: var(--ink);
  font-size: .75rem;
}
[data-status="complete"], [data-status="redeemed"] { color: var(--green); }
[data-status="overdue"] { color: var(--accent); }
[data-status="verifying"] { color: var(--amber); }
[data-status="revoked"] { color: var(--muted); }

.muted { color: var(--muted); font-size: .9375rem; }
.panel {
  min-width: 0;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--ink);
  background: var(--paper);
}
.panel-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.panel-top h2, .panel-top h3 { min-width: 0; }
.panel-top .section-note { margin-top: 4px; }

.demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 6vw, 66px);
  align-items: start;
}
.demo-main, .demo-side {
  display: grid;
  min-width: 0;
  gap: clamp(24px, 4vw, 30px);
}

.ruled { border-top: 1px solid var(--ink); padding-top: 16px; }
.ruled h2, .demo-activity h2, .demo-actions h2 {
  font: 650 .8125rem/1.4 var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.clock {
  margin-block: 9px;
  font: 500 clamp(2.6rem, 6.4vw, 5.2rem)/1 var(--mono);
  letter-spacing: -.065em;
  font-variant-numeric: tabular-nums;
}
.assignment-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  margin-top: 12px;
  font-size: .9375rem;
}
.assignment-meta > div { display: contents; }
.assignment-meta dt { color: var(--muted); }
.assignment-meta dd { margin: 0; }
#demo-result { font-weight: 650; }
.sealed {
  border: 1px dashed #8a8378;
  text-align: center;
  padding: clamp(20px, 4vw, 38px) 14px;
  margin-top: 16px;
}
#sealed-title { font: 500 1.25rem/1.3 var(--serif); margin-bottom: 5px; }
blockquote {
  font: italic 400 clamp(1.2rem, 3vw, 1.65rem)/1.35 var(--serif);
  margin-block: 15px 8px;
  text-wrap: pretty;
  white-space: pre-wrap;
}
#demo-card { border-top: 1px solid var(--line); margin-top: 16px; }
.timeline { padding: 0; list-style: none; }
.timeline li {
  display: grid;
  grid-template-columns: minmax(7.4rem, 34%) minmax(0, 1fr);
  gap: 3px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.timeline time { grid-row: 1 / 3; }
.timeline p { grid-column: 2; color: var(--muted); font-size: .875rem; }
.demo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 2px solid var(--ink);
  padding-top: 17px;
}
.demo-actions p { margin-top: 4px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: fit-content;
  padding: 7px 13px;
  border: 1px solid transparent;
  color: var(--ink);
  background: transparent;
  font: 650 .9375rem/1.3 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.primary, .danger {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.primary:hover, .danger:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.secondary { border-color: var(--ink); }
.secondary:hover, .scenario[aria-pressed="true"].secondary { background: var(--ink); color: var(--paper); }
.scenario[aria-pressed="true"].primary { background: var(--accent-strong); }
.text-button { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.text-button:hover { color: var(--ink); }
.button:disabled { opacity: .55; cursor: default; }
.scenario-list, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
}
.login-panel { max-width: 33rem; }
.login-panel > p { margin-block: 8px 14px; }
#login-form, #create-form { display: grid; gap: 8px; }
#create-form { margin-top: 16px; }
#create-form fieldset {
  display: grid;
  min-inline-size: 0;
  padding: 0;
  border: 0;
  margin: 0 0 4px;
  gap: 7px;
}
.form-group { display: grid; gap: 6px; margin-block: 6px; }
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 9px;
}
.field-row label { display: block; margin-bottom: 4px; }
.time-offset { display: grid; gap: 4px; }
.field-row .time-offset { margin-top: 5px; }
label { font-size: .9375rem; font-weight: 650; }
input, textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 8px 10px;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.4 var(--sans);
}
textarea { resize: vertical; }
.check-label {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-block: 6px;
  font-weight: 500;
}
.check-label input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
.form-options { padding-top: 8px; border-top: 1px solid var(--line); }
.form-options summary {
  min-height: 36px;
  width: fit-content;
  color: var(--accent);
  cursor: pointer;
}
.form-options p { margin-bottom: 9px; }
.inline-status:not(:empty), .lookup-status:not(:empty), #card-status:not(:empty) {
  padding-block: 8px;
  font-size: .9375rem;
}
.error { color: var(--accent); }
.pilot-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.commitments { list-style: none; padding: 0; }
.commitment { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.commitment h3 { font: 500 1.25rem/1.2 var(--serif); }
.commitment > .muted { margin-top: 8px; }
.commitment .row-actions { margin-top: 12px; }
.standalone-card { max-width: 36rem; }
dialog {
  width: min(100% - 2rem, 28rem);
  max-height: calc(100% - 2rem);
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 20px;
}
dialog::backdrop { background: rgb(27 26 23 / .45); }
dialog p { margin-block: 10px 16px; }
dialog form { justify-content: flex-end; }

@media (max-width: 760px) {
  .demo-layout, .workspace { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 580px) {
  .brand-note { display: none; }
  .demo-actions { align-items: start; flex-direction: column; }
}

@media (max-width: 360px) {
  .site-header-inner { gap: 5px; }
  nav { gap: 0; }
  nav a { font-size: .875rem; }
  .timeline li { grid-template-columns: 1fr; }
  .timeline time, .timeline p { grid-area: auto; }
  .assignment-meta { grid-template-columns: minmax(0, 35%) minmax(0, 1fr); gap: 6px 10px; }
}
