/* ============================================================
   THE VYLIC PUMA FILES — style.css
   Aesthetic: Classified documents / noir conspiracy
   Edit freely: fonts, colors, spacing
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Oswald:wght@300;600&display=swap');

/* ── CSS Variables — change these to retheme the whole app ── */
:root {
  --bg:           #0d0d0d;
  --paper:        #f5f0e8;
  --paper-dark:   #e8e0cc;
  --ink:          #1a1208;
  --ink-light:    #3d2f1a;
  --red:          #c0392b;
  --stamp-red:    rgba(192, 57, 43, 0.85);
  --gold:         #b8860b;
  --dim:          rgba(245, 240, 232, 0.07);
  --font-display: 'Special Elite', cursive;
  --font-body:    'Courier Prime', monospace;
  --font-label:   'Oswald', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  font-family: var(--font-body);
  color: var(--paper);
  overflow-x: hidden;
}

/* ── Scanline overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.18) 2px,
    rgba(0,0,0,0.18) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── Noise grain ── */
body::after {
  content: '';
  position: fixed;
  inset: -200%;
  width: 400%;
  height: 400%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
  z-index: 9998;
  animation: grain 0.5s steps(2) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-1%, 2%); }
  50%  { transform: translate(2%, -1%); }
  75%  { transform: translate(-2%, 1%); }
  100% { transform: translate(1%, -2%); }
}

/* ── Page wrapper ── */
.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}

/* ── Document card ── */
.doc-card {
  background: var(--paper);
  color: var(--ink);
  max-width: 680px;
  width: 100%;
  padding: 3rem 3.5rem 2.5rem;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    4px 4px 0 rgba(0,0,0,0.3),
    8px 8px 0 rgba(0,0,0,0.2),
    0 30px 80px rgba(0,0,0,0.9);
  animation: pageIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Aged paper texture via pseudo-element */
.doc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 10% 15%, rgba(180,140,60,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(100,70,30,0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Hole punch marks */
.doc-card::after {
  content: '';
  position: absolute;
  left: 1.2rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 60px,
    var(--paper-dark) 60px,
    var(--paper-dark) 62px
  );
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(24px) rotate(-0.5deg); }
  to   { opacity: 1; transform: translateY(0) rotate(0deg); }
}

/* ── File header ── */
.file-header {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1.2rem;
  margin-bottom: 1.8rem;
  position: relative;
}

.file-label {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 0.3rem;
}

.file-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: 0.02em;
}

/* ── CLASSIFIED stamp ── */
.stamp {
  position: absolute;
  top: 0.2rem;
  right: 0;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--stamp-red);
  border: 2px solid var(--stamp-red);
  padding: 0.2rem 0.6rem;
  transform: rotate(-4deg);
  opacity: 0.85;
}

/* ── Chapter badge ── */
.chapter-badge {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  padding: 0.2rem 0.7rem;
  margin-bottom: 1rem;
}

/* ── Story text ── */
.story-text {
  font-family: var(--font-body);
  font-size: 0.97rem;
  line-height: 1.85;
  color: var(--ink-light);
  margin-bottom: 2rem;
  white-space: pre-wrap;
  min-height: 80px;
  position: relative;
}

.story-text.loading::after {
  content: '█';
  animation: blink 0.8s step-end infinite;
  color: var(--ink);
}

@keyframes blink { 50% { opacity: 0; } }

/* ── Access gate section ── */
.access-gate {
  border-top: 1px dashed var(--ink-light);
  padding-top: 1.5rem;
  margin-top: 0.5rem;
}

.gate-label {
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 0.7rem;
}

/* ── Input field ── */
.pw-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--ink);
  padding: 0.4rem 0;
  letter-spacing: 0.1em;
  outline: none;
  transition: border-color 0.2s;
  caret-color: var(--red);
}

.pw-input::placeholder { color: rgba(26,18,8,0.35); font-style: italic; }
.pw-input:focus { border-color: var(--gold); }

/* ── Submit button ── */
.btn {
  display: inline-block;
  margin-top: 1.2rem;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: none;
  padding: 0.65rem 2rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateX(-101%);
  transition: transform 0.2s;
}

.btn:hover { background: var(--ink-light); transform: translateY(-1px); }
.btn:hover::after { transform: translateX(0); }
.btn span { position: relative; z-index: 1; }
.btn:active { transform: translateY(0); }

/* ── Feedback message ── */
.feedback {
  margin-top: 0.9rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-style: italic;
  min-height: 1.3em;
  transition: opacity 0.3s;
}
.feedback.error   { color: var(--red); }
.feedback.success { color: #2d7a2d; }
.feedback.loading { color: var(--ink-light); }

/* ── Footer meta ── */
.file-meta {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--paper-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-meta span {
  font-family: var(--font-label);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(26,18,8,0.4);
}

/* ── Dashboard success page ── */
.success-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.redacted {
  display: inline-block;
  background: var(--ink);
  color: var(--ink);
  user-select: none;
  border-radius: 2px;
  padding: 0 0.2em;
  letter-spacing: 0.05em;
}

.achievement-list {
  list-style: none;
  margin: 1.2rem 0;
  padding: 0;
}

.achievement-list li {
  font-size: 0.85rem;
  color: var(--ink-light);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--paper-dark);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.achievement-list li::before {
  content: '✓';
  color: #2d7a2d;
  font-weight: bold;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--ink);
  color: var(--ink);
}

.btn-outline:hover { background: var(--ink); color: var(--paper); }

/* ── Responsive ── */
@media (max-width: 520px) {
  .doc-card { padding: 2rem 1.5rem 2rem 2rem; }
  .stamp { font-size: 0.6rem; }
}

/* -- Auth guard: body hidden until JS confirms access ------- */
body.guarded { visibility: hidden; }
