/* ============================================================================
   ROUGE Performer Safety Guide - visual system
   Black / deep red / restrained white. Theatrical, minimal, premium.
   ========================================================================== */

:root {
  --bg: #0b0a0a;
  --bg-soft: #100e0e;
  --panel: #151212;
  --panel-2: #1b1717;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --red: #d92632;
  --red-deep: #7e1420;
  --red-bright: #ff6b75;
  --text: #f4f1ee;
  --muted: #b7aea8;
  --faint: #857d78;
  --font-display: 'Marcellus', 'Georgia', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --measure: 46rem;
  --radius: 10px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red); color: #fff; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  background: var(--red);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0.75rem; }

/* ------------------------------ top bar -------------------------------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(11, 10, 10, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  height: var(--topbar-h);
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { display: flex; align-items: baseline; gap: 0.7rem; white-space: nowrap; }
.brand-word {
  font-family: var(--font-display);
  color: var(--red);
  font-size: 1.35rem;
  letter-spacing: 0.28em;
  margin-right: -0.28em;
}
.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.chapter-dots { display: flex; gap: 0.5rem; align-items: center; }
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  padding: 0;
  cursor: default;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.dot.done { background: var(--red); border-color: var(--red); }
.dot.current { border-color: var(--red-bright); transform: scale(1.35); }
.dot.reachable { cursor: pointer; }
.dot.reachable:hover { border-color: var(--red-bright); }
.dot.locked { opacity: 0.35; }

.progress { height: 2px; background: rgba(255,255,255,0.06); }
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 0.45s ease;
}

/* ------------------------------- layout --------------------------------- */

main { padding-top: var(--topbar-h); min-height: calc(100vh - var(--topbar-h)); }
.view { min-height: calc(100vh - var(--topbar-h)); }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

.view-enter { animation: viewIn 0.45s ease both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------- cover ---------------------------------- */

.cover { position: relative; overflow: hidden; }
.cover-hero { position: relative; }
.cover-hero img {
  display: block;
  width: 100%;
  height: clamp(240px, 42vw, 460px);
  object-fit: cover;
  object-position: center 38%;
}
.cover-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(11,10,10,0.05) 40%, var(--bg) 98%);
}
.cover-body {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4.5rem;
  text-align: center;
}
.kicker {
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin: 0 0 1.25rem;
}
.cover-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1.08;
  margin: 0 0 1.25rem;
  letter-spacing: 0.01em;
}
.cover-sub { color: var(--muted); font-size: 1.1rem; max-width: 34rem; margin: 0 auto 0.75rem; }
.cover-meta { color: var(--faint); font-size: 0.9rem; letter-spacing: 0.06em; margin: 0 0 2.25rem; }
.cover-actions { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.cover-note {
  color: var(--faint);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  max-width: 30rem;
  margin: 0 auto;
}

/* ------------------------------ buttons --------------------------------- */

.btn {
  appearance: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.95rem 2.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #e53240; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { border-color: var(--red); color: #fff; }
.btn-ghost:disabled { opacity: 0.3; cursor: not-allowed; }
.btn .arrow { font-size: 1.1em; line-height: 1; }

:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------ chapters -------------------------------- */

.chapter-head { margin-bottom: 2.75rem; }
.chapter-number {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 0.9rem;
}
.chapter-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
  margin: 0 0 0.7rem;
}
.chapter-subtitle { color: var(--muted); font-size: 1.08rem; margin: 0; }
.rule-line {
  height: 1px;
  background: var(--red-deep);
  margin: 2rem 0 0;
  max-width: 5rem;
}

.block { margin-bottom: 2.1rem; }
.block h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 2.6rem 0 1rem;
  padding-top: 0.4rem;
}
.block h2:first-child { margin-top: 0; }
.block p { margin: 0 0 1.1rem; color: #e9e4e0; }
.block p strong, .block li strong { color: #fff; }

.bullets { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.bullets li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.6rem;
  border-bottom: 1px solid var(--line);
  color: #e9e4e0;
}
.bullets li:last-child { border-bottom: none; }
.bullets li::before {
  content: "";
  position: absolute;
  left: 0.35rem; top: 1.18rem;
  width: 7px; height: 7px;
  background: var(--red);
  transform: rotate(45deg);
}

/* ------------------------------ callouts -------------------------------- */

.callout {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--red);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin: 1.8rem 0 2.2rem;
}
.callout-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin: 0 0 0.6rem;
}
.callout-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.45;
  letter-spacing: 0.015em;
  margin: 0;
  color: #fff;
}
.callout-critical {
  background: #20090c;
  border-color: rgba(217, 38, 50, 0.55);
  border-left-width: 4px;
  box-shadow: 0 0 0 1px rgba(217, 38, 50, 0.12), 0 18px 44px -22px rgba(217, 38, 50, 0.45);
}
.callout-info { border-left-color: var(--muted); }
.callout-info .callout-title { color: var(--muted); }
.callout-info .callout-text { font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; }

/* ------------------------------ contacts -------------------------------- */

.contact-group { margin: 0 0 1.6rem; }
.contact-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin: 0 0 0.9rem;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.25rem;
  margin-bottom: 0.7rem;
}
.contact-mark {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--red);
  color: var(--red-bright);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.contact-name { font-weight: 700; font-size: 1.06rem; margin: 0; }
.contact-role { color: var(--muted); font-size: 0.92rem; margin: 0.1rem 0 0; }
.contact-note { color: var(--muted); font-size: 0.95rem; margin: 0.4rem 0 0; }

/* ---------------------------- chapter footer ----------------------------- */

.chapter-foot {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.nav-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gate-hint {
  flex: 1 1 100%;
  font-size: 0.85rem;
  color: var(--faint);
  letter-spacing: 0.04em;
  margin: 0 0 0.4rem;
  text-align: right;
}
.gate-hint.ok { color: var(--red-bright); }

/* ------------------------------- forms ----------------------------------- */

.ack-statement {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.7rem;
  margin: 0 0 2.4rem;
}
.ack-statement p { margin: 0 0 1rem; color: #e9e4e0; }
.ack-statement p:last-child { margin-bottom: 0; }

.field { margin-bottom: 1.5rem; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; }
.field label .req { color: var(--red-bright); }
.field input[type="text"],
.field input[type="email"],
.field select {
  width: 100%;
  background: #0f0d0d;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  transition: border-color 0.2s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(217, 38, 50, 0.22);
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--red-bright); }
.field .error { color: var(--red-bright); font-size: 0.86rem; margin: 0.4rem 0 0; min-height: 1.2em; }
.field-readonly {
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.check-row {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.check-row:hover { border-color: var(--line-strong); }
.check-row input {
  width: 1.35rem; height: 1.35rem;
  margin-top: 0.15rem;
  accent-color: var(--red);
  flex: 0 0 auto;
  cursor: pointer;
}
.check-row span { font-size: 0.98rem; line-height: 1.55; }

.sig-label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; }
.sig-label .req { color: var(--red-bright); }
.sig-wrap {
  position: relative;
  background: #0f0d0d;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.sig-wrap canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sig-baseline {
  position: absolute; left: 1.2rem; right: 1.2rem; bottom: 2.6rem;
  border-bottom: 1px solid rgba(217, 38, 50, 0.5);
  pointer-events: none;
}
.sig-hint {
  position: absolute; left: 1.2rem; bottom: 0.7rem;
  color: var(--faint); font-size: 0.8rem; letter-spacing: 0.05em;
  pointer-events: none;
}
.sig-clear {
  position: absolute; top: 0.6rem; right: 0.6rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}
.sig-clear:hover { color: #fff; border-color: var(--red); }

.form-errors {
  display: none;
  border: 1px solid rgba(217, 38, 50, 0.6);
  background: #20090c;
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.6rem;
}
.form-errors.show { display: block; }
.form-errors p { margin: 0 0 0.5rem; font-weight: 700; color: #fff; }
.form-errors ul { margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.94rem; }
.form-errors a { color: var(--red-bright); }

/* ----------------------------- completion -------------------------------- */

.done-screen { text-align: center; padding: 4rem 1.5rem; max-width: 40rem; margin: 0 auto; }
.done-mark {
  width: 84px; height: 84px;
  margin: 0 auto 1.8rem;
  border-radius: 50%;
  border: 2px solid var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: var(--red-bright);
}
.done-screen h1 { font-family: var(--font-display); font-weight: 400; font-size: 2.4rem; margin: 0 0 1rem; }
.done-screen p { color: var(--muted); margin: 0 0 1rem; }
.done-card {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin: 2rem 0;
}
.done-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.55rem 1.2rem; }
.done-card dt { color: var(--faint); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; }
.done-card dd { margin: 0; font-weight: 600; }
.done-ref {
  font-size: 0.85rem; color: var(--faint); letter-spacing: 0.12em;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  display: inline-block;
  margin-bottom: 2rem;
}
.demo-note {
  font-size: 0.85rem; color: var(--faint);
  border-top: 1px solid var(--line);
  padding-top: 1.4rem; margin-top: 2.4rem;
}

/* ------------------------------- reveal ---------------------------------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* -------------------------------- footer --------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 1.6rem 1.5rem 2.4rem;
  text-align: center;
}
.foot p { margin: 0; color: var(--faint); font-size: 0.8rem; letter-spacing: 0.08em; }

.noscript {
  max-width: var(--measure);
  margin: 4rem auto;
  padding: 2rem;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  text-align: center;
}

/* ------------------------------ responsive -------------------------------- */

@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand-sub { display: none; }
  .wrap { padding: 2.5rem 1.15rem 3.5rem; }
  .nav-row .btn { flex: 1 1 auto; }
  .gate-hint { text-align: center; }
  .callout-text { font-size: 1.14rem; }
  .done-card dl { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .done-card dd { margin-bottom: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* -------------------------------- print ----------------------------------- */

@media print {
  .topbar, .chapter-foot, .cover-actions, .sig-clear, .foot { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .block p, .bullets li { color: #000; }
  .callout, .ack-statement, .contact-card { break-inside: avoid; border-color: #999; background: #fff; }
  .callout-text { color: #000; }
}
