:root {
  --bg: #ffffff;
  --navy: #000074;
  --red: #d60000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--navy);
  font-family: "Instrument Sans", system-ui, sans-serif;
  display: grid;
  grid-template-columns: 180px 1fr;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--navy);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.85rem;
}

.rail a {
  color: var(--navy);
  text-decoration: none;
  opacity: 0.55;
}

.rail a:hover, .rail a.is-on { opacity: 1; color: var(--red); }

.switch {
  margin-top: auto;
  border: 1px solid var(--navy);
  padding: 8px;
  text-align: center;
  opacity: 1 !important;
}

.chapter {
  min-height: 50vh;
  padding: 72px 8vw 64px;
  border-bottom: 1px solid var(--navy);
}

h1, h2 { font-weight: 600; line-height: 1.1; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: 1.5rem; margin-bottom: 10px; }

.deck { max-width: 44ch; font-size: 1.05rem; margin: 16px 0 28px; }

.cta {
  display: inline-block;
  background: var(--red);
  color: var(--bg);
  text-decoration: none;
  padding: 12px 18px;
  font-weight: 600;
}

.preview p { opacity: 0.65; }

.edit-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  grid-column: 1 / -1;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0,0,116,0.25);
  padding: 24px;
}

.edit-modal[hidden] { display: none; }

.edit-modal-card {
  width: min(420px, 100%);
  border: 2px solid var(--navy);
  background: var(--bg);
  padding: 32px 28px;
  text-align: center;
}

.edit-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}

.edit-modal-card h2 { font-size: 1.45rem; margin-bottom: 10px; }
.edit-modal-card p { margin-bottom: 22px; }
.edit-modal-card button {
  width: 100%;
  background: var(--red);
  color: var(--bg);
  border: none;
  padding: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .rail {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--navy);
  }
  .switch { margin-top: 0; }
}
