:root {
  --paper: #f6f1e7;
  --ink: #1c1916;
  --muted: #6b635a;
  --line: #ddd4c6;
  --accent: #24382f;
  --measure: 40rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color-scheme: light;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
}

::selection {
  background: #d5e0d8;
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

p,
li {
  text-wrap: pretty;
}

.mast,
main,
.colophon {
  width: min(var(--measure), calc(100% - 2.75rem));
  margin-inline: auto;
}

.mast {
  position: relative;
  padding-top: 4.75rem;
}

.top-actions {
  position: absolute;
  top: 1.15rem;
  right: 0;
  display: flex;
  gap: 0.45rem;
}

.top-door {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.2;
  text-decoration: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

button.top-door:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.top-door:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.mark {
  display: block;
  width: 4.75rem;
  height: 4.75rem;
  flex: none;
}

h1 {
  margin: 0;
  font-size: clamp(2.85rem, 9vw, 4.35rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.92;
}

h1::after {
  content: "";
  display: block;
  width: 2.25rem;
  height: 1px;
  margin-top: 1.2rem;
  background: var(--accent);
}

.epigraph {
  margin: 2.6rem 0 0;
  padding: 0 0 0 1.15rem;
  border-left: 1px solid var(--accent);
  max-width: 34rem;
}

.epigraph p {
  margin: 0;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
}

.epigraph footer {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-variant: small-caps;
  letter-spacing: 0.08em;
}

.aim {
  margin: 2.6rem 0 0;
  max-width: 18em;
  font-size: clamp(1.45rem, 3.2vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

section {
  margin-top: 3.65rem;
}

h2 {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.12em;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

ol,
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

ol li,
ul li {
  margin: 0 0 0.85rem;
  padding-left: 1.85rem;
  position: relative;
}

ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.7rem;
  height: 1px;
  background: var(--accent);
}

ol {
  counter-reset: item;
}

ol li::before {
  counter-increment: item;
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0.08em;
  color: var(--accent);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tracks {
  margin: 1.25rem 0 1.25rem;
}

.types li {
  margin-bottom: 0.95rem;
}

.diagram {
  margin: 2.75rem 0 0;
}

.plate {
  display: block;
  width: min(36rem, 100%);
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.plate .ring {
  fill: none;
  stroke: #5c534c;
  stroke-width: 1.75;
}

.plate .stem {
  stroke: #5c534c;
  stroke-width: 1.5;
}

.plate .seat {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.6;
}

.plate .seat.lead {
  fill: #7a332e;
  stroke: none;
}

.plate .seat.small {
  stroke-width: 1.2;
}

.plate .book path {
  fill: var(--paper);
  stroke: #7a332e;
  stroke-width: 1.35;
  stroke-linejoin: round;
}

.plate .book line {
  stroke: #c4b4a4;
  stroke-width: 0.85;
}

.plate .label {
  fill: var(--ink);
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  font-size: 15px;
}

.plate .label.center {
  text-anchor: middle;
}

.lines {
  width: min(36rem, 100%);
  margin: 1.35rem auto 0;
  display: grid;
  row-gap: 0.7rem;
}

.track {
  display: grid;
  grid-template-columns: 6.4rem 1fr 11.4rem;
  align-items: center;
  column-gap: 0.7rem;
}

.track-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a332e;
}

.track-note {
  font-size: 0.92rem;
  line-height: 1.25;
  color: #3c352f;
  text-align: right;
}

.line-persistent {
  position: relative;
  height: 2px;
  background: var(--accent);
}

.line-persistent i,
.line-fluid i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.line-persistent i {
  top: -3px;
  background: var(--accent);
}

.line-persistent i:nth-child(1) { left: 0; }
.line-persistent i:nth-child(2) { left: 22%; }
.line-persistent i:nth-child(3) { left: 46%; }
.line-persistent i:nth-child(4) { left: 71%; }
.line-persistent i:nth-child(5) { right: 0; }

.line-fluid {
  position: relative;
  height: 8px;
}

.line-fluid i {
  top: 0;
  background: #7a332e;
}

.line-fluid i:nth-child(1) { left: 14%; }
.line-fluid i:nth-child(2) { left: 58%; }
.line-fluid i:nth-child(3) { left: 86%; }

@media (max-width: 640px) {
  .lines {
    row-gap: 0.85rem;
  }

  .track {
    grid-template-columns: 4.7rem 1fr 8.15rem;
    column-gap: 0.35rem;
  }

  .track-name {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }

  .track-note {
    font-size: 0.68rem;
    white-space: nowrap;
  }
}

.close {
  margin-top: 4.25rem;
  padding-top: 1.85rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1.25rem;
}

.close h2 {
  margin-bottom: 0.75rem;
  color: var(--ink);
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  font-variant: normal;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.close p {
  max-width: 34rem;
  font-size: 1.12rem;
  line-height: 1.55;
}

.door {
  max-width: 34rem;
  margin-top: 1.75rem;
}

.field {
  margin: 0 0 1.15rem;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
}

.field input[type="text"],
.field input[type="email"],
.field textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: #fffdf8;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.45;
}

.field textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  margin: 0;
  font-size: 1.05rem;
  cursor: pointer;
}

.choice input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--accent);
}

.door button {
  margin-top: 0.35rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--paper);
  background: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
}

.door button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

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

.door-status {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.colophon {
  margin-top: 4.5rem;
  padding: 1.35rem 0 5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.colophon p {
  margin: 0;
}

.colophon a {
  color: var(--muted);
}


@media (max-width: 640px) {
  .top-actions {
    gap: 0.35rem;
  }

  .top-door {
    padding: 0.4rem 0.5rem;
    font-size: 0.84rem;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.1rem;
  }

  .mark {
    width: 4.25rem;
    height: 4.25rem;
  }
}

@media (min-width: 720px) {
  .mast {
    padding-top: 6.75rem;
  }

  .epigraph {
    margin-top: 3.25rem;
  }
}
