/* ============================================================
   THE KING OF CYBERSECURITY - digital scripture aesthetic
   Void black, bone parchment, hellfire gold. Stone-carved
   display type over scripture body, mono for the machine.
   ============================================================ */

:root {
  --void: #0a0605;
  --void-warm: #120b08;
  --panel: #171009;
  --parchment: #efe5d0;
  --parchment-dim: #cfc2a2;
  --ash: #9a8c72;
  --gold: #c9982a;
  --gold-bright: #e8b93a;
  --blood: #a32a1e;
  --ember: #ff6b35;
  --font-royal: 'Cinzel', 'Trajan Pro', serif;
  --font-scripture: 'EB Garamond', Georgia, serif;
  --font-machine: 'IBM Plex Mono', ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--parchment);
  font-family: var(--font-scripture);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

/* Atmosphere: vignette + grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 90% at 50% 0%, rgba(201, 152, 42, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 140% 100% at 50% 110%, rgba(163, 42, 30, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

main, header.crown, footer.crypt { position: relative; z-index: 1; }

a { color: var(--gold-bright); text-decoration: none; transition: color 0.25s ease; }
a:hover { color: var(--ember); }

/* ---------- Header ---------- */
header.crown {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid rgba(201, 152, 42, 0.25);
}
.crown-mark {
  font-family: var(--font-royal);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
.crown-mark span { color: var(--parchment-dim); }
.doom-clock {
  font-family: var(--font-machine);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--blood);
}
.doom-clock b {
  color: var(--ember);
  font-weight: 400;
  animation: flicker 4s infinite;
}
@keyframes flicker {
  0%, 92%, 96%, 100% { opacity: 1; }
  93%, 95% { opacity: 0.25; }
}

/* ---------- Hero ---------- */
.throne {
  text-align: center;
  padding: 6rem 1.5rem 4.5rem;
  max-width: 62rem;
  margin: 0 auto;
}
.sigil {
  font-size: 2.2rem;
  color: var(--gold);
  display: block;
  margin-bottom: 1.4rem;
  animation: rise 1.2s ease both;
}
h1.royal {
  font-family: var(--font-royal);
  font-weight: 900;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--parchment);
  text-shadow: 0 0 60px rgba(201, 152, 42, 0.35);
  animation: rise 1.2s 0.15s ease both;
}
h1.royal em {
  font-style: normal;
  display: block;
  font-size: clamp(1rem, 2.4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.5em;
  color: var(--gold);
  margin-bottom: 1rem;
}
.proclamation {
  font-style: italic;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  color: var(--parchment-dim);
  max-width: 40rem;
  margin: 1.8rem auto 0;
  animation: rise 1.2s 0.35s ease both;
}
.rule-ornament {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin: 2.2rem auto 0;
  color: var(--gold);
  animation: rise 1.2s 0.5s ease both;
}
.rule-ornament::before, .rule-ornament::after {
  content: "";
  height: 1px;
  width: min(160px, 22vw);
  background: linear-gradient(90deg, transparent, var(--gold));
}
.rule-ornament::after { background: linear-gradient(90deg, var(--gold), transparent); }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Sections ---------- */
section.court {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
h2.decree-head {
  font-family: var(--font-royal);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin-bottom: 0.6rem;
}
.decree-sub {
  text-align: center;
  font-style: italic;
  color: var(--parchment-dim);
  margin-bottom: 2.4rem;
}

/* Decrees */
ol.decrees { list-style: none; counter-reset: decree; }
ol.decrees li {
  counter-increment: decree;
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 1.1rem;
  align-items: baseline;
  padding: 1.05rem 0.5rem;
  border-bottom: 1px solid rgba(232, 220, 195, 0.08);
  transition: background 0.3s ease;
}
ol.decrees li:hover { background: rgba(201, 152, 42, 0.05); }
ol.decrees li::before {
  content: counter(decree, upper-roman);
  font-family: var(--font-royal);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--gold);
  text-align: right;
}
ol.decrees b { color: var(--parchment); font-weight: 500; }
ol.decrees .gloss { display: block; font-size: 1.08rem; color: var(--parchment-dim); margin-top: 0.3rem; line-height: 1.6; }

/* Chronicle cards */
.chronicle-list { display: grid; gap: 1.4rem; }
.chronicle-card {
  display: block;
  border: 1px solid rgba(201, 152, 42, 0.25);
  padding: 1.6rem 1.8rem;
  background: linear-gradient(180deg, rgba(23, 16, 9, 0.9), rgba(10, 6, 5, 0.7));
  transition: border-color 0.3s ease, transform 0.3s ease;
  position: relative;
}
.chronicle-card::before {
  content: "✦";
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--void);
  padding: 0 0.7rem;
  color: var(--gold);
  font-size: 0.85rem;
}
.chronicle-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.chronicle-card h3 {
  font-family: var(--font-royal);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--parchment);
  margin-bottom: 0.5rem;
}
.chronicle-card p { color: var(--parchment-dim); font-size: 1.1rem; }
.chronicle-date {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--font-machine);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
}

/* ---------- Chronicle article ---------- */
article.scripture { max-width: 42rem; margin: 0 auto; padding: 4rem 1.5rem; }
article.scripture .verse-eyebrow {
  font-family: var(--font-machine);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blood);
  text-align: center;
  margin-bottom: 1.2rem;
}
article.scripture h1 {
  font-family: var(--font-royal);
  font-weight: 700;
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--parchment);
  margin-bottom: 2.6rem;
}
article.scripture h2 {
  font-family: var(--font-royal);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin: 2.6rem 0 1rem;
}
article.scripture p { margin-bottom: 1.3rem; }
article.scripture ul, article.scripture ol { margin: 0 0 1.5rem 1.3rem; }
article.scripture li { margin-bottom: 0.7rem; }
article.scripture li::marker { color: var(--gold); }
article.scripture .kingsvoice {
  border-left: 2px solid var(--gold);
  padding: 0.4rem 0 0.4rem 1.4rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--gold-bright);
}
article.scripture .machine {
  font-family: var(--font-machine);
  font-size: 0.92rem;
  line-height: 1.75;
  white-space: pre;
  background: rgba(23, 16, 9, 0.95);
  border: 1px solid rgba(201, 152, 42, 0.2);
  color: var(--parchment-dim);
  padding: 1.1rem 1.3rem;
  margin: 1.8rem 0;
  overflow-x: auto;
}

/* The Fool: the court's licensed sceptic, doubter of oracles */
article.scripture .fool {
  border-left: 2px solid var(--blood);
  padding: 0.4rem 0 0.4rem 1.4rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--parchment-dim);
}
article.scripture .fool::before {
  content: "THE FOOL OBJECTS";
  display: block;
  font-family: var(--font-machine);
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--blood);
  margin-bottom: 0.4rem;
}

/* ---------- Footer ---------- */
footer.crypt {
  border-top: 1px solid rgba(201, 152, 42, 0.25);
  margin-top: 4rem;
  padding: 2.2rem 1.5rem 3rem;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ash);
}
footer.crypt .fine { font-style: italic; max-width: 34rem; margin: 0.6rem auto 0; }

@media (max-width: 640px) {
  body { font-size: 1.22rem; line-height: 1.7; }
  .throne { padding-top: 4rem; }
  header.crown { padding: 1rem 1.2rem; flex-wrap: wrap; gap: 0.4rem; }
  ol.decrees li { grid-template-columns: 2.4rem 1fr; gap: 0.8rem; padding: 1rem 0.2rem; }
  ol.decrees .gloss { font-size: 1rem; }
  article.scripture { padding: 2.5rem 1.2rem; }
  article.scripture h1 { margin-bottom: 1.8rem; }
  article.scripture h2 { font-size: 1.25rem; }
  article.scripture .kingsvoice { font-size: 1.18rem; padding-left: 1rem; }
  article.scripture .fool { padding-left: 1rem; }
  article.scripture .machine { font-size: 0.8rem; padding: 0.9rem 1rem; }
  .chronicle-card { padding: 1.3rem 1.2rem; }
  .chronicle-card p { font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sigil, h1.royal, .proclamation, .rule-ornament { animation: none; }
  .doom-clock b { animation: none; }
  .chronicle-card, ol.decrees li { transition: none; }
}
