:root {
  --bg: #f4efe4;
  --surface: #fbf8f1;
  --ink: #1b1a17;
  --muted: #5a554c;
  --rule: #1b1a17;
  --accent: #c23a12;
  --accent-ink: #ffffff;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: clip;
}

h1, h2, h3, p { margin: 0; }

button, input, select { font: inherit; color: inherit; }

.masthead,
main,
.colophon {
  max-width: 980px;
  margin-inline: auto;
  padding-inline: 24px;
}

.masthead {
  padding-block: 48px 32px;
  border-bottom: 3px solid var(--rule);
}

.kicker,
.board-meta,
.time,
.field label,
.tag,
.board-nav {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kicker { color: var(--muted); }

.wordmark {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(64px, 14vw, 156px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.wordmark span {
  color: var(--accent);
  font-style: italic;
}

.dek {
  margin-top: 16px;
  max-width: 44ch;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.4;
}

.board-nav {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip,
.btn {
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.chip:active,
.btn:active,
.open-item:active,
.close-btn:active,
.save-item:active { transform: scale(0.97); }

.board { padding-block: 48px 64px; }

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.board-head h2 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 16px 24px;
  margin-top: 24px;
}

.field { display: flex; flex-direction: column; gap: 8px; }

.field input,
.field select {
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  font-size: 16px;
}

.field input:focus-visible,
.field select:focus-visible,
.chip:focus-visible,
.btn:focus-visible,
.open-item:focus-visible,
.close-btn:focus-visible,
.save-item:focus-visible,
.departure:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.departures {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.departure {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  align-items: start;
  gap: 16px 24px;
  padding-block: 20px;
  border-bottom: 1px solid var(--rule);
  transition: background-color 200ms var(--ease);
}

.time {
  padding-top: 6px;
  color: var(--muted);
}

.time strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
}

.row-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.row-summary {
  margin-top: 6px;
  color: var(--muted);
  max-width: 60ch;
}

.row-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 4px 10px;
  border: 1px solid var(--ink);
  color: var(--ink);
}

.tag.saved {
  background: var(--ink);
  color: var(--bg);
}

.open-item {
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}

.empty {
  margin-top: 40px;
  padding: 32px;
  border: 2px dashed var(--ink);
  text-align: center;
}

.empty p { font-family: var(--serif); font-size: 22px; margin-bottom: 16px; }

.btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.detail-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(27 26 23 / 0.55);
}

.detail-layer[hidden] { display: none; }

.detail {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 40px clamp(20px, 5vw, 56px);
  background: var(--surface);
  border: 3px solid var(--ink);
  outline: none;
}

.detail .time { margin-bottom: 16px; }

.detail-title {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.detail-meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.detail-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 16px;
  border-block: 1px solid var(--rule);
}

.save-item {
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--ink);
  background: var(--surface);
  cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}

.save-item[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.close-btn {
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background-color 200ms var(--ease), transform 200ms var(--ease);
}

.detail-body {
  margin-top: 28px;
  max-width: 66ch;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.65;
}

.detail-body p + p { margin-top: 1em; }

.colophon {
  padding-block: 32px 48px;
  border-top: 3px solid var(--rule);
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .masthead, main, .colophon { padding-inline: 20px; }
  .dek { font-size: 19px; }
  .controls { grid-template-columns: 1fr; }
  .departure { grid-template-columns: 1fr; gap: 12px; }
  .time { padding-top: 0; display: flex; gap: 12px; align-items: baseline; }
  .time strong { display: inline; }
  .row-title { font-size: 23px; }
  .open-item { justify-self: start; }
  .detail { padding: 28px 20px; }
  .detail-layer { padding: 0; place-items: end stretch; }
  .detail { width: 100%; max-height: 92vh; border-bottom: 0; }
}

@media (hover: hover) and (pointer: fine) {
  .chip:hover,
  .btn:hover,
  .close-btn:hover,
  .save-item:hover { background: var(--ink); color: var(--bg); }
  .chip[aria-pressed="true"]:hover { background: var(--accent); border-color: var(--accent); }
  .open-item:hover { background: var(--accent); border-color: var(--accent); }
  .btn:hover { background: var(--ink); border-color: var(--ink); }
  .departure:hover { background: var(--surface); }
  .departure:hover .row-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .save-item[aria-pressed="true"]:hover { background: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
  .chip:active,
  .btn:active,
  .open-item:active,
  .close-btn:active,
  .save-item:active { transform: none; }
}
