/* STAY. — Shared Styles */

/* Theme variables */
:root {
  --bg: #000;
  --bg-secondary: #111;
  --text: #fff;
  --text-muted: #ccc;
  --text-dim: #888;
  --text-dimmer: #666;
  --border: #333;
  --highlight-bg: #1a1a1a;
  --highlight-border: #666;
  --hotline-accent: #ff6b6b;
  --nav-bg: rgba(0,0,0,0.95);
  --btn-bg: #333;
  --btn-hover: #444;
  --link: #8af;
  --link-hover: #bdf;
}

html.light {
  --bg: #fefefe;
  --bg-secondary: #f5f5f5;
  --text: #111;
  --text-muted: #333;
  --text-dim: #666;
  --text-dimmer: #888;
  --border: #ddd;
  --highlight-bg: #f0f0f0;
  --highlight-border: #999;
  --hotline-accent: #c62828;
  --nav-bg: rgba(255,255,255,0.95);
  --btn-bg: #e0e0e0;
  --btn-hover: #d0d0d0;
  --link: #06c;
  --link-hover: #039;
}

/* Base */
* { box-sizing: border-box; }
html { font-size: 19px; }
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}

/* Links */
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s;
}
a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

/* Focus states */
a:focus, button:focus {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Controls (top right) */
.controls {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 101;
}
.controls button {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text);
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
}
.controls button:hover { opacity: 0.8; }

/* Back link (top left) */
.back {
  position: fixed;
  top: 12px;
  left: 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
}
.back:hover { color: var(--text); }

/* Navigation (bottom) */
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  padding: 0.63rem 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  z-index: 100;
  transition: background 0.2s, border 0.2s;
}
nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.74rem;
  opacity: 0.7;
  padding: 0.63rem 0.84rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}
nav a:hover { opacity: 1; }
nav a:focus { opacity: 1; outline-offset: -2px; }
nav .current { font-weight: bold; opacity: 1; }

/* Sections */
section {
  min-height: 100vh;
  padding: 3.16rem 1.26rem 5.26rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

/* Cover */
.cover {
  text-align: center;
  justify-content: center;
}
.cover h1 {
  font-size: clamp(3.79rem, 20vw, 6.32rem);
  margin: 0;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Hotlines box */
.hotlines {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.42rem;
  padding: 1.26rem;
  margin: 2.1rem 0;
  text-align: center;
  transition: background 0.2s, border 0.2s;
}
.hotlines strong { color: var(--hotline-accent); }
.hotlines p { margin: 0.42rem 0; line-height: 1.6; }
.hotlines a { color: var(--text); }

/* Content typography */
h2 {
  font-size: 1.47rem;
  margin: 0 0 1.26rem;
  text-align: center;
  font-weight: 600;
}
h3 {
  font-size: 0.95rem;
  margin: 1.26rem 0 0.63rem;
  font-weight: 600;
}
p {
  font-size: 0.89rem;
  line-height: 1.6;
  margin: 0.84rem 0;
  color: var(--text-muted);
}
ul, ol {
  padding-left: 1.5em;
  margin: 0.84rem 0;
}
li {
  font-size: 0.89rem;
  line-height: 1.6;
  margin: 0.42rem 0;
  color: var(--text-muted);
}
em {
  font-style: italic;
  color: var(--text);
}
strong {
  color: var(--text);
}

/* Highlight box */
.highlight {
  background: var(--highlight-bg);
  border-left: 3px solid var(--highlight-border);
  padding: 0.84rem 1.05rem;
  margin: 1.26rem 0;
  transition: background 0.2s, border 0.2s;
}
.highlight p { margin: 0; }

/* Tool cards */
.tool {
  background: var(--bg-secondary);
  border-radius: 0.42rem;
  padding: 1.05rem;
  margin: 0.84rem 0;
  transition: background 0.2s;
}
.tool h4 {
  margin: 0 0 0.42rem;
  font-size: 0.84rem;
  color: var(--text);
}
.tool p {
  margin: 0;
  font-size: 0.79rem;
}

/* End section */
.end {
  text-align: center;
}
.end p.big {
  font-size: 1.26rem;
  color: var(--text);
  margin: 2.1rem 0;
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--text);
  padding: 0.63rem 1.26rem;
  border: 1px solid var(--border);
  border-radius: 0.32rem;
  text-decoration: none;
  font-size: 0.74rem;
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
}
.btn:hover {
  background: var(--btn-hover);
  border-color: var(--text-dim);
}

.print-btn {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--text);
  padding: 0.63rem 1.26rem;
  border-radius: 0.32rem;
  text-decoration: none;
  font-size: 0.74rem;
  margin-top: 1.05rem;
  transition: background 0.2s;
}
.print-btn:hover {
  background: var(--btn-hover);
}

/* Footer text */
.disclaimer {
  margin-top: 3.16rem;
  font-size: 0.74rem;
  color: var(--text-dim);
}
.attribution {
  margin-top: 2.1rem;
  font-size: 0.68rem;
  color: var(--text-dimmer);
}
.scroll-hint {
  color: var(--text-dim);
  font-size: 0.74rem;
  text-decoration: none;
}

/* Crisis footer */
.crisis {
  position: fixed;
  bottom: 12px;
  left: 12px;
  font-size: 11px;
  color: var(--text-dim);
}
.crisis a {
  color: var(--text-dim);
  text-decoration: underline;
}
.crisis a:hover { color: var(--text); }

/* Exercise pages - container */
.exercise-container {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

/* Screen/Print views */
.screen-view { display: block; }
.print-view { display: none; }

/* Print styles */
@media print {
  html { font-size: 12pt; }
  body { background: #fff; color: #000; }
  .screen-view { display: none; }
  .print-view { display: block; }
  nav, .controls { display: none; }

  .page {
    width: 4.25in;
    height: 6.5in;
    page-break-after: always;
    background: #fff;
    color: #000;
    padding: 0.4in 0.5in;
    position: relative;
  }
  .page.cover {
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
  }
  .page.cover h1 { font-size: 92pt; margin: 0; line-height: 1; }
  .page.backcover {
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
  }
  .page h2 { font-size: 18pt; margin: 24pt 0 8pt; text-align: center; color: #000; }
  .page h3 { font-size: 14pt; margin: 16pt 0 6pt; font-weight: bold; color: #000; }
  .page p, .page li { font-size: 11pt; line-height: 1.45; margin: 8pt 0; color: #000; }
  .page ul { padding-left: 1.2em; }
  .page a { color: #000; text-decoration: none; }
  .hotlines-print { margin-top: 1.5in; text-align: center; line-height: 1.6; }
  .qr-print { margin-top: 1.8in; text-align: center; font-size: 10pt; }
}
