:root {
  --cream: #F7F1E3;
  --cream-dim: #EFE6D0;
  --ink: #241B2F;
  --pink: #FF2FD0;
  --pink-soft: #FFD6F0;
  --line: #D8CBB0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
}

h1, .eyebrow {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.04em;
}

button {
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Password gate ---------- */

body.gate {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,47,208,0.10), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(255,47,208,0.08), transparent 40%),
    var(--cream);
}

.gate-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--cream-dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 48px 40px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(36, 27, 47, 0.12);
}

/* ticket-stub perforation */
.gate-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background-image: radial-gradient(circle, var(--cream) 2.5px, transparent 2.6px);
  background-size: 16px 1px;
  background-position: 0 0;
  transform: translateY(64px);
  opacity: 0.9;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--pink);
}

.gate-card h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 6vw, 44px);
  line-height: 1;
  color: var(--ink);
  text-shadow:
    0 0 6px rgba(255,47,208,0.35),
    0 0 22px rgba(255,47,208,0.18);
}

.sub {
  margin: 0 0 28px;
  color: #6b5f6f;
  font-size: 14px;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.gate-form label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b5f6f;
}

.gate-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  font-family: 'Space Grotesk', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gate-form input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255,47,208,0.18);
}

.gate-form button {
  margin-top: 8px;
  padding: 14px 16px;
  border: none;
  border-radius: 3px;
  background: var(--pink);
  color: var(--cream);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow:
    0 0 12px rgba(255,47,208,0.55),
    0 0 34px rgba(255,47,208,0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gate-form button:hover,
.gate-form button:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    0 0 16px rgba(255,47,208,0.75),
    0 0 48px rgba(255,47,208,0.4);
}

.gate-form button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.error {
  margin: 2px 0 0;
  font-size: 13px;
  color: #C21E7A;
}

/* ---------- Shared header (TOC + doc pages) ---------- */

body.toc,
body.doc {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--cream);
}

.toc-header,
.doc-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid rgba(255,214,240,0.15);
  flex-wrap: wrap;
}

.toc-header .eyebrow {
  display: block;
  font-size: 12px;
  color: var(--pink);
}

.toc-header h1,
.doc-header h1 {
  margin: 2px 0 0;
  font-size: clamp(22px, 4vw, 32px);
  color: var(--cream);
}

.doc-header {
  align-items: center;
  gap: 20px;
}

.doc-header h1 {
  flex: 1;
  margin: 0;
}

.back-link {
  color: var(--pink-soft);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255,214,240,0.3);
  border-radius: 3px;
  padding: 8px 14px;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.back-link:hover,
.back-link:focus-visible {
  border-color: var(--pink);
  color: var(--pink);
}

.logout-form button {
  padding: 10px 18px;
  border: 1px solid rgba(255,214,240,0.4);
  border-radius: 3px;
  background: transparent;
  color: var(--pink-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.logout-form button:hover,
.logout-form button:focus-visible {
  border-color: var(--pink);
  color: var(--pink);
}

/* ---------- Table of contents ---------- */

.toc-main {
  flex: 1;
  padding: clamp(16px, 4vw, 40px);
  display: flex;
  justify-content: center;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 760px;
}

.toc-item + .toc-item {
  border-top: 1px solid rgba(255,214,240,0.12);
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 8px;
  color: var(--cream);
  text-decoration: none;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.toc-link:hover,
.toc-link:focus-visible {
  color: var(--pink);
  padding-left: 16px;
}

.toc-index {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--pink);
  min-width: 32px;
  letter-spacing: 0.04em;
}

.toc-title {
  flex: 1;
  font-size: clamp(18px, 2.6vw, 24px);
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.03em;
}

.toc-arrow {
  font-size: 18px;
  opacity: 0.6;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.toc-link:hover .toc-arrow,
.toc-link:focus-visible .toc-arrow {
  transform: translateX(4px);
  opacity: 1;
}

.toc-empty {
  color: rgba(247,241,227,0.5);
  padding: 22px 8px;
  font-size: 14px;
}

/* ---------- Doc viewer ---------- */

.doc-main {
  flex: 1;
  padding: clamp(12px, 2vw, 24px);
  display: flex;
}

.doc-frame {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 4px;
  background: var(--cream);
  box-shadow:
    0 0 0 1px rgba(255,214,240,0.12),
    0 0 60px rgba(255,47,208,0.10);
  min-height: 70vh;
}
