/* ==========================================================================
   BREAD AND ROSES — one-pager
   Old-timey punk: aged paper, typewriter ink, brush-lettered agitprop.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'GhettoQueen';
  src: url('../assets/fonts/GhettoQueen.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Misdemeanor';
  src: url('../assets/fonts/Misdemeanor.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'AmericanTypewriter';
  src: url('../assets/fonts/AmericanTypewriter.ttf') format('truetype');
  font-display: swap;
}
/* Special Elite (Google Fonts, Apache 2.0 — free for commercial use).
   Used for UI: buttons, gate messages, admin chrome. */
@font-face {
  font-family: 'SpecialElite';
  src: url('../assets/fonts/SpecialElite.woff2') format('woff2');
  font-display: swap;
}

/* ---------- Palette ---------- */
:root {
  --paper: #f1ead9;
  --paper-dark: #e6dcc4;
  --ink: #17140f;
  --red: #f00c0c;
  --red-dark: #c40808;
  --brush: 'GhettoQueen', 'Impact', sans-serif;
  --stamp: 'Misdemeanor', 'Impact', sans-serif;
  --type: 'AmericanTypewriter', 'Courier New', Courier, monospace;
  --ui: 'SpecialElite', 'Courier New', Courier, monospace;
  /* film-grain noise, tiled */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--noise);
  background-blend-mode: multiply;
  color: var(--ink);
  font-family: var(--type);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.09rem);
  line-height: 1.65;
}

.accent { fill: var(--red); color: var(--red); }

/* ---------- Logo (inline SVG) ---------- */
.logo { display: block; width: 100%; height: auto; }
.logo-brush { font-family: var(--brush); font-size: 198px; fill: currentColor; }
.logo-stamp { font-family: var(--stamp); font-size: 50px; fill: currentColor; }
.logo .accent { fill: var(--red); }

/* ==========================================================================
   PASSWORD GATE
   ========================================================================== */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: #0e0c0a;
  background-image: var(--noise);
  color: #f1ead9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}
.gate-inner {
  width: min(21rem, 88vw);
  text-align: center;
}
.gate-logo {
  margin: 0 auto 2.2rem;
  filter: drop-shadow(0 0 24px rgba(240, 12, 12, 0.18));
}
.gate-label {
  display: block;
  font-family: var(--ui);
  font-size: 1.15rem;
  letter-spacing: 0.22em;
  color: var(--red);
  margin-bottom: 0.8rem;
}
#gate-pass {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 3px dashed #f1ead9;
  border-radius: 0;
  color: #f1ead9;
  font-family: var(--type);
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 0.4rem 0.2rem;
  outline: none;
  caret-color: var(--red);
}
#gate-pass:focus { border-bottom-color: var(--red); }
.gate form .stamp-btn { margin-top: 1.6rem; }
.gate-error {
  font-family: var(--ui);
  color: var(--red);
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  margin-top: 1.4rem;
  transform: rotate(-2deg);
  animation: gate-shake 0.35s;
}
.gate-status {
  color: #9b937f;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  margin-top: 1.4rem;
}
@keyframes gate-shake {
  0%, 100% { translate: 0 0; }
  25% { translate: -6px 0; }
  75% { translate: 6px 0; }
}

/* ==========================================================================
   MAIN SITE
   ========================================================================== */
.site {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 3rem) clamp(1.1rem, 5vw, 2rem) 3rem;
}

.masthead { text-align: center; }
.site-logo {
  width: min(20rem, 72vw);
  margin: 0.5rem auto 0;
  color: var(--ink);
}
.tagline {
  font-family: var(--type);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #6b6455;
  margin: 1.1rem 0 0;
}

/* ---------- Brush section headings ---------- */
.brush-head {
  font-family: var(--brush);
  font-weight: normal;
  font-size: clamp(2.1rem, 5.5vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-align: center;
  transform: rotate(-1.6deg);
  margin: 3.2rem 0 1.4rem;
}
.brush-head .accent { color: var(--red); }

/* rough hand-inked divider above each heading */
.body-content section + section .brush-head::before,
.download-section::before {
  content: "";
  display: block;
  height: 8px;
  margin: 0 auto 2.6rem;
  width: min(22rem, 70%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 352 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5 Q 40 2 82 4.5 T 168 3.5 T 262 5 T 350 3' fill='none' stroke='%2317140f' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  opacity: 0.85;
  transform: rotate(0.4deg);
}

/* ---------- Body copy ---------- */
.body-content p { margin: 0 0 1.05em; }
.body-content .lede { font-weight: bold; }
.body-content .kicker { font-weight: bold; font-style: italic; }
.body-content em { font-style: italic; }
.body-content section { margin-bottom: 1rem; }

/* ---------- Video ---------- */
.video-section { margin-top: 1.5rem; }
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0e0c0a;
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(-0.4deg);
  margin: 0 auto;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Download stamp ---------- */
.download-section {
  margin-top: 3.2rem;
  text-align: center;
}
.pdf-stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.6rem 2.6rem 1.4rem;
  color: var(--red-dark);
  border: 4px solid currentColor;
  border-radius: 10px;
  text-decoration: none;
  transform: rotate(-2deg);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(240, 12, 12, 0.07), transparent 60%);
  box-shadow: 6px 6px 0 rgba(23, 20, 15, 0.85);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  max-width: 92%;
}
.pdf-stamp:hover, .pdf-stamp:focus-visible {
  transform: rotate(-2deg) translate(2px, 2px);
  box-shadow: 3px 3px 0 rgba(23, 20, 15, 0.85);
  color: var(--red);
}
.pdf-icon { width: clamp(3.2rem, 9vw, 4.2rem); height: auto; }
.pdf-label {
  font-family: var(--ui);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: 0.1em;
  line-height: 1;
}
.pdf-sub {
  font-family: var(--type);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  color: var(--ink);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3.5rem;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: #6b6455;
  text-transform: uppercase;
}

/* ---------- Stamp buttons ---------- */
.stamp-btn {
  font-family: var(--ui);
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  color: var(--paper);
  background: var(--red);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 0.55rem 1.4rem 0.45rem;
  cursor: pointer;
  transform: rotate(-1deg);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.stamp-btn:hover, .stamp-btn:focus-visible {
  transform: rotate(-1deg) translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}
.stamp-btn.small { font-size: 0.85rem; padding: 0.4rem 0.9rem 0.3rem; }
.stamp-btn.ghost { background: transparent; color: var(--ink); }
.gate .stamp-btn { border-color: var(--paper); box-shadow: 4px 4px 0 rgba(241, 234, 217, 0.55); }
.gate .stamp-btn:hover { box-shadow: 2px 2px 0 rgba(241, 234, 217, 0.55); }

/* ==========================================================================
   ADMIN PANEL
   ========================================================================== */
.admin {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 4rem;
}
.admin-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.admin-head h1 {
  font-family: var(--brush);
  font-weight: normal;
  font-size: 2.4rem;
  margin: 0;
  transform: rotate(-1.5deg);
}
.admin-card {
  background: rgba(255, 255, 255, 0.55);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(23, 20, 15, 0.25);
  padding: 1.2rem 1.4rem 1.5rem;
  margin-bottom: 2rem;
}
.admin-card h2 {
  font-family: var(--ui);
  font-weight: normal;
  letter-spacing: 0.12em;
  color: var(--red-dark);
  font-size: 1.3rem;
  margin: 0 0 0.6rem;
}
.admin-hint { font-size: 0.85rem; color: #6b6455; margin: 0 0 0.8rem; }
.admin-form { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.admin-form.stacked { flex-direction: column; }
.admin-form label { font-size: 0.8rem; letter-spacing: 0.05em; display: flex; flex-direction: column; gap: 0.3rem; }
.admin-form input, .admin-form textarea {
  font-family: var(--type);
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
  border: 2px solid var(--ink);
  background: #fffdf6;
  border-radius: 0;
}
.admin-form input:focus, .admin-form textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.admin-form textarea { line-height: 1.45; resize: vertical; }
.admin-form-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.admin-status { font-size: 0.85rem; color: var(--red-dark); letter-spacing: 0.05em; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.6rem;
}
.admin-table th {
  font-family: var(--ui);
  font-weight: normal;
  letter-spacing: 0.12em;
  text-align: left;
  border-bottom: 3px solid var(--ink);
  padding: 0.3rem 0.5rem;
}
.admin-table td {
  border-bottom: 1px solid rgba(23, 20, 15, 0.25);
  padding: 0.4rem 0.5rem;
  vertical-align: top;
  word-break: break-word;
}
.admin-table .danger {
  background: transparent;
  border: 2px solid var(--red-dark);
  color: var(--red-dark);
  font-family: var(--ui);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}
.admin-table .danger:hover { background: var(--red-dark); color: var(--paper); }
.admin-empty { color: #6b6455; font-style: italic; }

.back-to-admin {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
}

/* ==========================================================================
   PRINT — reproduce the one-page PDF
   ========================================================================== */
@media print {
  @page { size: letter; margin: 0.55in; }

  .no-print, .gate, .admin, .video-section, .download-section, .back-to-admin,
  .site-footer { display: none !important; }

  html, body {
    background: #fff !important;
    background-image: none !important;
    color: #000;
    font-size: 9pt;
    line-height: 1.32;
  }
  .site { display: block !important; max-width: none; padding: 0; margin: 0; }
  .site[hidden] { display: none !important; }

  .site-logo { width: 1.65in; margin: 0 auto; }
  .tagline { margin-top: 4pt; font-size: 7pt; color: #555; }

  .brush-head {
    font-size: 15pt;
    margin: 10pt 0 6pt;
    transform: none;
    break-after: avoid;
  }
  .body-content section + section .brush-head::before { display: none; }
  .body-content p { margin: 0 0 4.5pt; orphans: 3; widows: 3; }
  .accent { color: var(--red) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .logo .accent { fill: var(--red) !important; }
}
