/* base.css — shared chrome for all three PSA treatments. */

* { box-sizing: border-box; }

/* Reset margins on elements we use as flex/grid children so default
   browser margins (esp. blockquote's 40px) don't blow out narrow layouts. */
blockquote, figure, p { margin: 0; }
cite { font-style: normal; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, sans-serif;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.case {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 6rem);
  animation: case-fade-in 280ms ease-out both;
}

@keyframes case-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.case .case-header,
.case .case-quote,
.case .case-context,
.case .case-annotation,
.case .case-footer-text {
  max-width: min(80ch, 90vw);
  text-align: center;
}

.case .case-quote {
  font-size: clamp(1.25rem, 3.5vw, 3rem);
  line-height: 1.25;
}

.case .case-context {
  margin-top: 1.5rem;
  font-size: clamp(0.85rem, 1.25vw, 1.05rem);
  opacity: 0.7;
  font-style: italic;
}

.case .case-annotation {
  margin-top: 2rem;
  font-size: clamp(0.85rem, 1.25vw, 1rem);
  opacity: 0.85;
}

.case .case-footer-text {
  margin-top: 2.25rem;
  font-size: clamp(0.75rem, 1vw, 0.9rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  max-width: 50ch;
  line-height: 1.4;
}

/* ─── carousel chrome ─────────────────────────────────────── */
.chrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem clamp(1rem, 3vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 100;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}

.chrome > * { pointer-events: auto; }

.chrome button {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 0.55rem 0.9rem;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.chrome button:hover,
.chrome button:focus-visible {
  background: currentColor;
}
.chrome button:hover span,
.chrome button:focus-visible span {
  color: var(--invert, #000);
}

.chrome .counter-block {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.1;
}

.chrome .counter {
  text-align: center;
  opacity: 0.85;
}

.chrome .chrome-links {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}
.chrome .dot-sep { opacity: 0.4; }

.chrome .overlay-toggle {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
  opacity: 0.55;
}
.chrome .overlay-toggle:hover,
.chrome .overlay-toggle:focus-visible {
  background: transparent;
  opacity: 1;
}
.chrome .overlay-toggle:hover span,
.chrome .overlay-toggle:focus-visible span { color: inherit; }

/* ─── info overlays (about / report / help) ────────────── */
.info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  color: #fff;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  cursor: pointer;
}

.info-overlay.is-open { display: flex; }

.info-overlay .info-inner {
  position: relative;
  max-width: 64ch;
  width: 100%;
  margin: auto;
  cursor: auto;
  font-family: Georgia, "Times New Roman", serif;
  text-align: left;
  padding: 1.5rem 0.5rem;
}

.info-overlay .info-close {
  position: absolute;
  top: -0.25rem;
  right: 0;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
}
.info-overlay .info-close:hover,
.info-overlay .info-close:focus-visible { opacity: 1; border-color: #fff; }

/* Old top-of-overlay disclaimer (now combined into .real-help at bottom) */
.info-overlay .info-disclaimer { display: none; }

.info-overlay h2 {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 1rem;
  opacity: 0.85;
  margin: 0 0 1rem;
  text-align: center;
}

.info-overlay h3 {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  opacity: 0.7;
  margin: 1.5rem 0 0.6rem;
}

.info-overlay p {
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  line-height: 1.55;
  margin: 0 0 1rem;
}

.info-overlay ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.info-overlay li {
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  line-height: 1.55;
  margin-bottom: 0.4rem;
}

.info-overlay a {
  color: #ffb1ba;
  text-decoration: underline;
}

.info-overlay code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  font-size: 0.95em;
}

.info-overlay .info-tagline {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  color: #ff3344;
  margin: 1.5rem 0;
}

/* Combined disclaimer + real crisis resources block (bottom of every overlay) */
.info-overlay .real-help {
  margin-top: 2.5rem;
  padding: 1.25rem 1.25rem 1rem;
  border: 2px solid #ff3344;
  background: rgba(255, 51, 68, 0.06);
  font-family: system-ui, -apple-system, sans-serif;
}

.info-overlay .real-help-lede {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #ffb1ba;
  margin: 0 0 0.9rem;
  letter-spacing: 0.01em;
}

.info-overlay .real-help-lede em {
  font-style: italic;
  color: #fff;
}

.info-overlay .real-help ul {
  list-style: disc;
  margin: 0;
  padding-left: 1.25rem;
}

.info-overlay .real-help li {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

/* Code blocks inside overlays (API endpoint + AGENTS.md snippets) */
.info-overlay pre {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.9rem 1rem;
  margin: 0 0 1rem;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre;
}
.info-overlay pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.info-overlay .info-close-bottom {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  margin: 2rem 0 0;
  padding: 0.9rem 1rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 0;
  color: #fff;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.info-overlay .info-close-bottom:hover,
.info-overlay .info-close-bottom:focus-visible {
  background: #fff;
  color: #000;
}

/* ─── accessibility: reduced motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .case { transition: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─── small viewports: scrollable layout ──────────────────── */
/* Below this breakpoint the case grows naturally and the body scrolls,
   so long quotes don't get clipped behind the chrome and corner stamps. */
@media (max-width: 720px), (max-height: 600px) {
  html, body { overflow-y: auto; overflow-x: hidden; height: auto; }
  #stage { position: relative; width: 100%; height: auto; min-height: 100vh; overflow: visible; }
  .case {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 100vh;
    /* clear the fixed top corners (REC + case stamp) and bottom chrome */
    padding-top: clamp(3.5rem, 12vw, 5rem);
    padding-bottom: clamp(5.5rem, 16vw, 7rem);
    padding-left: clamp(1rem, 4vw, 2rem);
    padding-right: clamp(1rem, 4vw, 2rem);
    justify-content: center;
    gap: 1.25rem;
  }
  /* Force long uppercase monospace words to break instead of overflowing. */
  .case .case-header,
  .case .case-quote,
  .case .case-annotation,
  .case .case-footer-text {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
  .case .case-quote { font-size: clamp(1rem, 4vw, 1.5rem); }
  .case .case-annotation { margin-top: 1.25rem; }
  .case .case-footer-text { margin-top: 1.5rem; }
}

@media (max-width: 480px) {
  .chrome {
    font-size: 0.7rem;
    padding: 0.5rem;
    gap: 0.3rem;
  }
  .chrome button { padding: 0.4rem 0.5rem; }
  .chrome .counter { font-size: 0.6rem; }
  .chrome .overlay-toggle { font-size: 0.55rem; letter-spacing: 0.05em; }
  .chrome .chrome-links { gap: 0.25rem; }
}
