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

/* ── Root vars ───────────────────────────────────────────────────────────── */
:root {
  --bg:        #080808;
  --bg2:       #0f0f0f;
  --bg3:       #161616;
  --red:       #cc2200;
  --red-hi:    #ff4422;
  --red-dim:   #661100;
  --gold:      #d4a017;
  --gold-dim:  #7a5c0a;
  --green:     #22aa44;
  --yellow:    #ccaa00;
  --text:      #ddccbb;
  --muted:     #666655;
  --border:    #2a1a0a;
  --font:      'Courier New', Courier, monospace;
}

/* ── Body ────────────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Scanlines overlay ───────────────────────────────────────────────────── */
#scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
}

/* ── Cookie banner ───────────────────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cookie-inner {
  max-width: 540px;
  border: 1px solid var(--red);
  background: var(--bg2);
  padding: 2rem;
  box-shadow: 0 0 40px rgba(204,34,0,0.3);
}
.cookie-inner p { margin-bottom: 0.8rem; }
.cookie-inner strong { color: var(--gold); }
.cookie-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.2rem;
}
.cookie-buttons button {
  font-family: var(--font);
  font-size: 13px;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--red);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cookie-buttons button:hover { background: var(--red); color: #fff; }

/* ── Screen utility ──────────────────────────────────────────────────────── */
.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* ── Boot screen ─────────────────────────────────────────────────────────── */
#boot {
  background: var(--bg);
  padding: 2rem;
  font-size: 13px;
}
#boot-output div { margin-bottom: 2px; }
.boot-warn { color: var(--red-hi); }
.boot-hi   { color: var(--gold); font-weight: bold; letter-spacing: 1px; }

@keyframes fadeOut { to { opacity: 0; } }
.fade-out { animation: fadeOut 0.6s ease forwards; will-change: opacity; }

/* ── App layout ──────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--red);
  color: #fff;
  padding: 0.4rem 1rem;
  font-size: 12px;
  letter-spacing: 1px;
}
.warning-bar {
  background: var(--red-dim);
  color: var(--red-hi);
  padding: 0.25rem 1rem;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  animation: marquee 24s linear infinite;
  will-change: transform;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Main content ────────────────────────────────────────────────────────── */
main { flex: 1; padding: 1.5rem; max-width: 860px; margin: 0 auto; width: 100%; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 10px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ── Window chrome ───────────────────────────────────────────────────────── */
.window {
  border: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: 0 0 30px rgba(204,34,0,0.08);
}
.window-bar {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.5px;
}
.window-body { padding: 1.5rem; }
.window-body p { margin-bottom: 0.8rem; }

/* ── DB query block ──────────────────────────────────────────────────────── */
.db-query {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.6rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 13px;
}
.prompt { color: var(--gold); }
.cmd    { color: #aaddcc; }
.db-result {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 1.2rem;
  padding-left: 0.4rem;
}

/* ── Record table ────────────────────────────────────────────────────────── */
.record-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.4rem;
  font-size: 13px;
}
.record-table tr { border-bottom: 1px solid var(--border); }
.record-table tr:last-child { border-bottom: none; }
.record-table td { padding: 0.5rem 0.8rem; vertical-align: top; }
.field {
  color: var(--gold);
  white-space: nowrap;
  width: 160px;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding-top: 0.6rem;
}

/* ── Tags ────────────────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border: 1px solid;
  border-radius: 2px;
}
.tag.red    { color: var(--red-hi);  border-color: var(--red-dim);    background: #200500; }
.tag.yellow { color: var(--yellow);  border-color: var(--gold-dim);   background: #1a1200; }
.tag.green  { color: var(--green);   border-color: #114422;           background: #051205; }

/* ── Section title ───────────────────────────────────────────────────────── */
.section-title {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--gold);
  margin: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Timeline ────────────────────────────────────────────────────────────── */
.timeline { font-size: 13px; }
.tl-entry { padding: 0.8rem; background: var(--bg); border: 1px solid var(--border); margin-bottom: 0; }
.tl-current { border-color: var(--red-dim); }
.tl-future  { opacity: 0.5; }
.tl-meta    { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 0.3rem; }
.tl-year    { color: var(--gold); font-size: 11px; white-space: nowrap; min-width: 60px; }
.tl-title   { color: var(--text); }
.tl-body    { padding-left: 4.5rem; font-size: 12px; line-height: 1.8; }
.tl-arrow   { padding: 0.25rem 0 0.25rem 0.8rem; color: var(--red-dim); font-size: 12px; }

/* ── Sint's note block ───────────────────────────────────────────────────── */
.note-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  padding: 1.2rem;
  font-size: 13px;
}
.note-block p { margin-bottom: 0.7rem; }
.note-block strong { color: var(--text); }
.note-sig { font-size: 12px; margin-top: 1rem; margin-bottom: 0 !important; }

/* ── Quote block ─────────────────────────────────────────────────────────── */
.quote-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red-dim);
  padding: 1.2rem;
}
.quote {
  font-size: 16px;
  color: var(--text);
  font-style: italic;
  margin-bottom: 0.6rem !important;
  letter-spacing: 0.3px;
}

/* ── Terminal ────────────────────────────────────────────────────────────── */
.terminal {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  font-size: 12px;
  line-height: 1.7;
}
.t-out  { color: var(--muted); padding-left: 1.2rem; }
.t-dir  { color: var(--gold); }
.t-err  { color: var(--red-hi); }

/* ── Cursor ──────────────────────────────────────────────────────────────── */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.cursor-blink { animation: blink 1s step-end infinite; color: var(--gold); will-change: opacity; }

/* ── Hint box (page 2) ───────────────────────────────────────────────────── */
.hint-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 13px;
}
.hint-box p   { margin-bottom: 0.6rem; }
.hint-box strong { color: var(--text); }
.steps { padding-left: 1.4rem; }
.steps li { margin-bottom: 0.5rem; }
.steps ul { margin-top: 0.3rem; padding-left: 1.2rem; }
.steps ul li { color: var(--muted); }
code {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1px 5px;
  font-family: var(--font);
  color: var(--gold);
  font-size: 12px;
}

/* ── Image wrapper (page 2) ──────────────────────────────────────────────── */
.image-wrapper { text-align: center; }
.image-wrapper a { text-decoration: none; display: inline-block; }
.image-frame {
  border: 1px solid var(--border);
  display: inline-block;
  background: var(--bg);
}
.image-label-top {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 0.4rem 0.8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.image-frame img {
  display: block;
  max-width: 100%;
  max-height: 400px;
}
.image-label-bottom {
  font-size: 11px;
  color: var(--gold);
  padding: 0.5rem;
  letter-spacing: 1px;
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}
.image-wrapper a:hover .image-label-bottom { background: var(--red-dim); color: #fff; }
.image-wrapper a:hover .image-frame { border-color: var(--red); }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.muted      { color: var(--muted); }
.error-text { color: var(--red-hi); margin-bottom: 1rem; font-size: 15px; }
