:root {
  --red: #c00;
  --text: #1a1a1a;
  --muted: #444;
  --max: 42rem;
  --draft-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='200' viewBox='0 0 320 200'%3E%3Ctext x='160' y='110' text-anchor='middle' fill='%23c00' fill-opacity='0.14' font-family='system-ui,sans-serif' font-size='48' font-weight='700' transform='rotate(-28 160 100)'%3EDRAFT%3C/text%3E%3C/svg%3E");
  --draft-mark-on-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='200' viewBox='0 0 320 200'%3E%3Ctext x='160' y='110' text-anchor='middle' fill='%23ffffff' font-family='system-ui,sans-serif' font-size='48' font-weight='700' transform='rotate(-28 160 100)'%3EDRAFT%3C/text%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #fff;
  background-image: var(--draft-mark);
  background-repeat: repeat;
  background-size: 18rem 11rem;
  background-attachment: fixed;
  color: var(--text);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.125rem;
  line-height: 1.55;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem calc(4rem + env(safe-area-inset-bottom, 0px));
  overflow: visible;
  background: #fff;
}

/* Collapsible long story — only #switch visible until opened */
#story:not(.is-open) > :not(#switch) {
  display: none;
}

#switch {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.2rem 0.7rem 0.25rem;
  border: 1px solid var(--red);
  border-radius: 0.45rem;
  background: #fff;
  color: var(--red);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}

#switch:hover,
#switch:focus-visible {
  background: var(--red);
  color: #fff;
  outline: none;
}

#story.is-open #switch {
  margin-bottom: 1.5rem;
}

/* Half in / half out of the text column, to the right */
.sidebar {
  float: right;
  width: 12rem;
  margin: 0 -6rem 1.25rem 1.25rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid #bbb;
  background: #fff;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.sidebar p {
  margin: 0 0 0.65rem;
}

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

@media (max-width: 52rem) {
  /* iOS drops background-attachment:fixed; the white .page also
     covers the body mark, so paint a fainter stamp on the column. */
  body {
    background-attachment: scroll;
  }

  .page {
    background-color: #fff;
    background-image: var(--draft-mark);
    background-repeat: repeat;
    background-size: 16rem 10rem;
  }

  .sidebar {
    width: 7.25rem;
    margin: 0 -0.85rem 1rem 0.65rem;
    padding: 0.55rem 0.55rem;
    font-size: 0.78rem;
    line-height: 1.35;
  }
}

/* Inverted header: white fill, red border + red text
   (related to filled red / white-text, but not the same) */
.banner {
  border: 4px solid var(--red);
  background: #fff;
  padding: 1.25rem 1.35rem;
  margin: 0 0 2rem;
}

.banner h1 {
  margin: 0;
  font-family: "Archivo Black", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--red);
  text-wrap: balance;
  text-align: center;
}

.intro p {
  margin: 0 0 2rem;
  color: var(--muted);
}

#mmip {
  display: inline;
  border: 1px solid var(--red);
  border-radius: 0.25rem;
  padding: 0 0.2em;
  cursor: help;
  white-space: nowrap;
}

#mmip .mmip-full {
  display: none;
}

#mmip:hover .mmip-short,
#mmip:focus-visible .mmip-short {
  display: none;
}

#mmip:hover .mmip-full,
#mmip:focus-visible .mmip-full {
  display: inline;
}

#mmip:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Superposition of Yes / No — headers side by side, bodies stacked */
.dual-truth {
  margin: 0 0 2rem;
  padding: 0.85rem 1rem 1rem;
  color: var(--muted);
  border: 1px solid var(--red);
  border-radius: 0.65rem;
}

.dual-heads {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  margin: 0 0 0.7rem;
}

.dual-head {
  appearance: none;
  background: #fff;
  border: 1px solid var(--red);
  border-radius: 0.45rem;
  padding: 0.2rem 0.7rem 0.25rem;
  margin: 0;
  cursor: pointer;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--red);
  transition: opacity 0.45s ease, font-weight 0.45s ease;
}

.dual-head:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.dual-stack {
  position: relative;
  display: grid;
}

.dual-body {
  grid-area: 1 / 1;
  margin: 0;
  transition: opacity 0.45s ease;
}

/* Gradual alternate reveal while shifting */
@keyframes dual-focus {
  0%,
  100% {
    opacity: 1;
    font-weight: 700;
  }
  50% {
    opacity: 0.28;
    font-weight: 400;
  }
}

@keyframes dual-body-focus {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.08;
  }
}

.dual-truth[data-mode="shift"] .dual-head[data-dual="yes"],
.dual-truth[data-mode="shift"] #yes {
  animation: dual-focus 9s ease-in-out infinite;
}

.dual-truth[data-mode="shift"] #yes {
  animation-name: dual-body-focus;
}

.dual-truth[data-mode="shift"] .dual-head[data-dual="no"],
.dual-truth[data-mode="shift"] #no {
  animation: dual-focus 9s ease-in-out infinite;
  animation-delay: -4.5s;
}

.dual-truth[data-mode="shift"] #no {
  animation-name: dual-body-focus;
}

/* Locked to one truth */
.dual-truth[data-mode="yes"] .dual-head[data-dual="yes"],
.dual-truth[data-mode="yes"] #yes {
  opacity: 1;
  font-weight: 700;
}

.dual-truth[data-mode="yes"] .dual-head[data-dual="no"] {
  opacity: 0.28;
  font-weight: 400;
}

.dual-truth[data-mode="yes"] #no {
  opacity: 0;
  pointer-events: none;
}

.dual-truth[data-mode="no"] .dual-head[data-dual="no"],
.dual-truth[data-mode="no"] #no {
  opacity: 1;
  font-weight: 700;
}

.dual-truth[data-mode="no"] .dual-head[data-dual="yes"] {
  opacity: 0.28;
  font-weight: 400;
}

.dual-truth[data-mode="no"] #yes {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .dual-truth[data-mode="shift"] .dual-head,
  .dual-truth[data-mode="shift"] .dual-body {
    animation: none;
  }

  .dual-truth[data-mode="shift"] .dual-head[data-dual="yes"],
  .dual-truth[data-mode="shift"] #yes {
    opacity: 1;
    font-weight: 700;
  }

  .dual-truth[data-mode="shift"] .dual-head[data-dual="no"],
  .dual-truth[data-mode="shift"] #no {
    opacity: 0.35;
    font-weight: 400;
  }
}

.box {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.15rem 1.1rem;
  border: 1px solid #e0b3b3;
  border-left: 3px solid var(--red);
  background: #faf6f6;
  box-shadow: 0 1px 6px rgba(204, 0, 0, 0.06);
}

.box h2,
.box h3 {
  margin: 0 0 0.7rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--red);
}

.box > :last-child {
  margin-bottom: 0;
}

.box ol {
  margin: 0;
  padding-left: 1.35rem;
}

.box ol > li {
  margin: 0 0 0.95rem;
}

.box ol > li:last-child {
  margin-bottom: 0;
}

.box .box-lead {
  color: inherit;
  font-weight: 700;
}

.box ul {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
  list-style: disc;
  line-height: 1.3;
}

.box ul li {
  margin: 0;
}

.links {
  margin: 0;
  padding: 0;
  list-style: disc;
  padding-left: 1.25rem;
}

.links li {
  margin: 0 0 1.35rem;
}

.links a {
  display: block;
  color: var(--red);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.links a:hover,
.links a:focus-visible {
  text-decoration-thickness: 2px;
}

.links .desc {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.desc a {
  display: inline;
}

/* ----- FAQ ----- */

.faq-section {
  margin: 2.5rem 0 0;
  border-top: 1px solid #ddd;
  padding-top: 1.25rem;
}

.faq-section > summary {
  cursor: default;
  pointer-events: none;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--red);
  list-style: none;
}

.faq-section > summary::-webkit-details-marker {
  display: none;
}

/* Propose-a-question form at top of FAQ */
.faq-propose {
  margin: 1rem 0 0;
  padding: 0.85rem 0 0.25rem;
  border-bottom: 1px solid #eee;
}

.faq-propose-label {
  display: block;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.faq-propose-input {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 2.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text);
  background: #fff;
}

.faq-propose-input:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--red);
}

.faq-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.faq-propose-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.faq-propose-count {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.75rem;
  color: #888;
}

.faq-propose-submit {
  appearance: none;
  border: 2px solid var(--red);
  background: #fff;
  color: var(--red);
  cursor: pointer;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 2.25rem;
  padding: 0.35rem 0.9rem;
}

.faq-propose-submit:hover,
.faq-propose-submit:focus-visible {
  background: var(--red);
  color: #fff;
  outline: none;
}

.faq-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0.75rem 0 0;
}

.faq-expand-all {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #888;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.faq-expand-all:hover,
.faq-expand-all:focus-visible {
  color: var(--muted);
}

.faq-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.faq-item {
  margin: 0 0 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item > summary {
  cursor: pointer;
  list-style: none;
  position: relative;
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

/* Hover hint while collapsed; click again to collapse (native <details>) */
.faq-item:not([open]) > summary:hover::after,
.faq-item:not([open]) > summary:focus-visible::after {
  content: "click to expand";
  display: block;
  margin-top: 0.2rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #999;
  font-style: italic;
}

.faq-item .question {
  display: block;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

/* First line of answer + ellipsis while collapsed */
.faq-item .preview {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faq-item[open] .preview {
  display: none;
}

.faq-item .answer {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.faq-item:not([open]) .answer {
  display: none;
}

/* Floating docks sit near the content column so they overlap text */
.faq-dock,
.resources-dock,
.video-dock {
  position: fixed;
  z-index: 40;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* Sticky FAQ jump — inward from left, over the text column */
.faq-dock {
  left: max(0.75rem, calc(50% - 16rem));
  right: auto;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.faq-dock.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.faq-dock-btn {
  appearance: none;
  border: 2px solid var(--red);
  background: #fff;
  color: var(--red);
  cursor: pointer;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: 2.75rem; /* thumb-friendly */
  padding: 0.55rem 1.1rem;
}

.faq-dock-btn:hover,
.faq-dock-btn:focus-visible,
.resources-dock-btn:hover,
.resources-dock-btn:focus-visible {
  background: var(--red);
  color: #fff;
  outline: none;
}

/* Sticky resources jump — centered between FAQ and video */
.resources-dock {
  left: 50%;
  transform: translateX(-50%);
}

.resources-dock-btn {
  appearance: none;
  border: 2px solid var(--red);
  background: #fff;
  color: var(--red);
  cursor: pointer;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
}

/* Sticky video opener — inward from right, over the text column */
.video-dock {
  right: max(0.75rem, calc(50% - 16rem));
  left: auto;
}

.video-dock-btn {
  appearance: none;
  position: relative;
  display: block;
  width: 4.5rem;
  height: 3rem;
  padding: 0;
  border: 2px solid var(--red);
  background: var(--red);
  cursor: pointer;
  overflow: hidden;
}

.video-dock-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-dock-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.45rem 0 0.45rem 0.75rem;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.video-dock-btn:hover,
.video-dock-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Video popup */
.video-dialog {
  border: none;
  padding: 0;
  max-width: min(56rem, calc(100vw - 2rem));
  width: 100%;
  background: transparent;
}

.video-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.65);
  background-image: var(--draft-mark-on-dark);
  background-repeat: repeat;
  background-size: 18rem 11rem;
}

.video-dialog-inner {
  position: relative;
  background: #000;
  padding: 0;
}

/* <dialog> is in the top layer, so the page watermark cannot cover it */
.video-dialog-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: var(--draft-mark-on-dark);
  background-repeat: repeat;
  background-size: 18rem 11rem;
  opacity: 0.22;
}

.video-dialog-close {
  appearance: none;
  position: absolute;
  z-index: 2;
  top: 0.35rem;
  right: 0.35rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.video-dialog-close:hover,
.video-dialog-close:focus-visible {
  background: rgba(0, 0, 0, 0.8);
  outline: none;
}

.video-dialog-media video,
.video-dialog-media iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  background: #000;
}

@media (prefers-reduced-motion: reduce) {
  .faq-dock {
    transition: none;
  }
}
