@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Noto+Serif+SC:wght@400;500;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  color-scheme: dark;

  /* Mystic palette — Hu Tao / temple-poster energy */
  --ink-black: #0a0608;
  --deep-red: #1a0608;
  --crimson: #3c0a10;
  --blood: #720d18;
  --vermilion: #b51322;
  --ember: #ff6b1a;
  --gold: #d4a64a;
  --gold-bright: #f0c870;
  --gold-deep: #8a6420;
  --cream: #f4e7cf;
  --cream-warm: #efdfc1;
  --paper-shade: #d9c5a0;
  --ghost-violet: #a896d8;
  --ghost-pink: #f0a9c8;
  --jade: #4f8a6f;

  --shadow-deep: rgba(2, 0, 0, 0.6);
  --shadow-warm: rgba(80, 12, 18, 0.5);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  background: var(--ink-black);
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
}

body.hub {
  position: relative;
  padding: 56px 22px 0;
  background:
    /* subtle gold coin/cash pattern */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><g fill='none' stroke='%23d4a64a' stroke-width='0.8' opacity='0.08'><circle cx='60' cy='60' r='22'/><rect x='55' y='55' width='10' height='10'/><circle cx='0' cy='0' r='22'/><circle cx='120' cy='0' r='22'/><circle cx='0' cy='120' r='22'/><circle cx='120' cy='120' r='22'/><rect x='-5' y='-5' width='10' height='10'/><rect x='115' y='-5' width='10' height='10'/><rect x='-5' y='115' width='10' height='10'/><rect x='115' y='115' width='10' height='10'/></g></svg>"),
    radial-gradient(900px 600px at 50% -20%, rgba(255, 107, 26, 0.18), transparent 60%),
    radial-gradient(1100px 700px at 80% 110%, rgba(181, 19, 34, 0.22), transparent 65%),
    radial-gradient(700px 500px at 10% 30%, rgba(114, 13, 24, 0.25), transparent 60%),
    linear-gradient(180deg, var(--deep-red) 0%, #120406 40%, #08020a 100%);
  background-attachment: fixed, fixed, fixed, fixed, fixed;
}

/* ---------- Background layers ---------- */

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  isolation: isolate;
}

.bg-flame {
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 107, 26, 0.14), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(255, 43, 60, 0.10), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(212, 166, 74, 0.06), transparent 50%);
  mix-blend-mode: screen;
  animation: flame-pulse 11s ease-in-out infinite alternate;
  filter: blur(20px);
}

@keyframes flame-pulse {
  0%   { opacity: 0.7; transform: translate3d(0, 0, 0) scale(1); }
  50%  { opacity: 0.95; transform: translate3d(-2%, 1%, 0) scale(1.04); }
  100% { opacity: 0.75; transform: translate3d(2%, -1%, 0) scale(1.02); }
}

.bg-vignette {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

.bg-paper-grain {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 0.85 0 0 0 0 0.6 0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
}

.bg-embers {
  background:
    radial-gradient(2px 2px at 12% 80%, rgba(255, 180, 80, 0.7) 0, transparent 60%),
    radial-gradient(2px 2px at 38% 65%, rgba(255, 150, 70, 0.6) 0, transparent 60%),
    radial-gradient(1.5px 1.5px at 65% 85%, rgba(255, 200, 100, 0.65) 0, transparent 60%),
    radial-gradient(2px 2px at 85% 60%, rgba(255, 130, 60, 0.6) 0, transparent 60%),
    radial-gradient(1.5px 1.5px at 22% 40%, rgba(255, 180, 80, 0.55) 0, transparent 60%),
    radial-gradient(2px 2px at 52% 30%, rgba(255, 200, 100, 0.6) 0, transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 20%, rgba(255, 140, 50, 0.55) 0, transparent 60%);
  animation: embers-rise 18s linear infinite;
}

@keyframes embers-rise {
  0%   { transform: translateY(0); opacity: 0.7; }
  50%  { opacity: 1; }
  100% { transform: translateY(-200px); opacity: 0; }
}

/* ---------- SVG sprite (hidden) ---------- */

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- Floating lanterns + butterflies + blossoms (SVG) ---------- */

.floaters {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.float-lantern {
  position: absolute;
  top: -160px;
  left: var(--x);
  width: var(--size, 50px);
  height: calc(var(--size, 50px) * 1.625);
  filter: drop-shadow(0 0 14px rgba(255, 120, 60, 0.55))
          drop-shadow(0 0 28px rgba(255, 80, 30, 0.35));
  animation:
    lantern-fall var(--fall, 28s) linear infinite,
    lantern-sway var(--sw, 8s) ease-in-out infinite alternate,
    lantern-glow 2.8s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
  opacity: 0.92;
  transform-origin: 50% 0;
}

.float-lantern svg { width: 100%; height: 100%; display: block; }

@keyframes lantern-fall {
  0%   { transform: translateY(0); }
  100% { transform: translateY(140vh); }
}

@keyframes lantern-sway {
  from { margin-left: -14px; transform: rotate(-3deg); }
  to   { margin-left: 14px;  transform: rotate(3deg); }
}

@keyframes lantern-glow {
  from { filter: drop-shadow(0 0 14px rgba(255, 120, 60, 0.55))
                 drop-shadow(0 0 28px rgba(255, 80, 30, 0.35)); }
  to   { filter: drop-shadow(0 0 22px rgba(255, 160, 80, 0.75))
                 drop-shadow(0 0 44px rgba(255, 100, 40, 0.55)); }
}

.float-butterfly {
  position: absolute;
  top: var(--top);
  left: -60px;
  width: var(--size, 40px);
  height: calc(var(--size, 40px) * 0.75);
  filter: drop-shadow(0 0 8px rgba(255, 100, 60, 0.5));
  animation: bfly-cross var(--dur, 30s) linear infinite;
  animation-delay: var(--d, 0s);
}

.float-butterfly svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 60%;
  animation: bfly-flap 0.22s steps(3, end) infinite;
}

@keyframes bfly-cross {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  20%  { transform: translate3d(26vw, -30px, 0) rotate(-6deg); }
  45%  { transform: translate3d(50vw, 20px, 0) rotate(4deg); }
  70%  { transform: translate3d(74vw, -16px, 0) rotate(-4deg); }
  100% { transform: translate3d(110vw, 0, 0) rotate(2deg); }
}

@keyframes bfly-flap {
  0%   { transform: rotateY(0deg) scaleY(1); }
  50%  { transform: rotateY(60deg) scaleY(0.7); }
  100% { transform: rotateY(0deg) scaleY(1); }
}

.float-blossom {
  position: absolute;
  top: -40px;
  left: var(--x);
  width: var(--size, 22px);
  height: var(--size, 22px);
  filter: drop-shadow(0 0 6px rgba(240, 169, 200, 0.5));
  animation:
    blossom-fall var(--dur, 22s) linear infinite,
    blossom-spin var(--dur, 22s) linear infinite;
  animation-delay: var(--d, 0s);
  opacity: 0.85;
}

.float-blossom svg { width: 100%; height: 100%; display: block; }

@keyframes blossom-fall {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(20px, 60vh); }
  100% { transform: translate(-20px, 130vh); }
}

@keyframes blossom-spin {
  from { rotate: 0deg; }
  to   { rotate: 720deg; }
}

/* ---------- Cloud / dragon corner ornaments ---------- */

.corner-dragon {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
  filter: drop-shadow(0 0 12px rgba(212, 166, 74, 0.35));
  animation: dragon-drift 18s ease-in-out infinite alternate;
}

.corner-dragon.top-left  { top: 8px; left: 8px; transform-origin: top left; }
.corner-dragon.top-right { top: 8px; right: 8px; transform: scaleX(-1); transform-origin: top right; }

@keyframes dragon-drift {
  from { opacity: 0.45; }
  to   { opacity: 0.7; }
}

@media (max-width: 720px) {
  .corner-dragon { display: none; }
}

/* ---------- Hero cloud row + flame + blossoms ---------- */

.hero-cloud-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto 14px;
  max-width: 540px;
}

.hero-cloud-row svg {
  width: 140px;
  height: 56px;
  filter: drop-shadow(0 0 10px rgba(212, 166, 74, 0.4));
}

.hero-cloud-row svg.flip-h { transform: scaleX(-1); }

.hero-dragon-eye {
  width: 44px !important;
  height: 44px !important;
  animation: eye-pulse 3.6s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255, 107, 26, 0.6)) !important;
}

@keyframes eye-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%      { transform: scale(1.08); opacity: 1; }
}

.mast-flame {
  display: inline-block;
  width: 0.42em;
  height: 0.55em;
  vertical-align: middle;
  margin: 0 0.18em;
  filter: drop-shadow(0 0 14px rgba(255, 130, 50, 0.7));
  animation: flame-flicker 0.45s ease-in-out infinite alternate;
}

.mast-flame.right { animation-duration: 0.5s; animation-delay: 0.12s; }

.mast-flame svg { width: 100%; height: 100%; display: block; }

@keyframes flame-flicker {
  0%   { transform: scaleY(1) scaleX(1); opacity: 0.95; }
  100% { transform: scaleY(1.08) scaleX(0.94); opacity: 1; }
}

.hero-blossoms {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 22px auto 0;
}

.hero-blossoms svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(240, 169, 200, 0.4));
  animation: blossom-bob 4s ease-in-out infinite;
}

.hero-blossoms svg:nth-child(1) { width: 14px; height: 14px; animation-delay: 0s; }
.hero-blossoms svg:nth-child(2) { width: 20px; height: 20px; animation-delay: -0.5s; }
.hero-blossoms svg:nth-child(3) { width: 26px; height: 26px; animation-delay: -1s; }
.hero-blossoms svg:nth-child(4) { width: 20px; height: 20px; animation-delay: -1.5s; }
.hero-blossoms svg:nth-child(5) { width: 14px; height: 14px; animation-delay: -2s; }

@keyframes blossom-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-4px) rotate(4deg); }
}

.seal-alt {
  background: #1a0608 !important;
  color: var(--gold-bright) !important;
  border-color: var(--gold) !important;
}

/* ---------- Ornate divider between sections ---------- */

.ornate-divider {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 6px auto 36px;
  text-align: center;
  opacity: 0.9;
}

.ornate-divider svg {
  width: 100%;
  height: 36px;
  filter: drop-shadow(0 0 10px rgba(212, 166, 74, 0.35));
}

/* ---------- Gold filigree corners on panels ---------- */

.filigree {
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: none;
  z-index: 4;
  filter: drop-shadow(0 0 4px rgba(212, 166, 74, 0.3));
}

.filigree.tl { top: 4px; left: 4px; }
.filigree.tr { top: 4px; right: 4px; transform: scaleX(-1); }
.filigree.bl { bottom: 4px; left: 4px; transform: scaleY(-1); }
.filigree.br { bottom: 4px; right: 4px; transform: scale(-1, -1); }

.filigree.light { opacity: 0.85; }

/* Hide the simple gold corners when SVG filigree is present (kept in markup for fallback) */
.panel-frame > .corner.gold,
.chatbot-frame > .corner.gold { display: none; }

/* ---------- Issue header ---------- */

.issue-header {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto 36px;
  text-align: center;
  padding: 28px 16px 16px;
}

.issue-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  border: 1px solid rgba(212, 166, 74, 0.45);
  border-radius: 999px;
  background: rgba(20, 6, 8, 0.65);
  margin-bottom: 24px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.seal {
  font-family: "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-bright);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--gold);
  border-radius: 6px;
  background: var(--vermilion);
  box-shadow: 0 0 16px rgba(255, 107, 26, 0.4), inset 0 0 6px rgba(0, 0, 0, 0.4);
}

.issue-lines { text-align: left; line-height: 1.2; }

.kicker {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.issue-no {
  margin: 4px 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cream-warm);
  opacity: 0.75;
}

.masthead {
  margin: 0 0 10px;
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-weight: 900;
  font-size: clamp(56px, 11vw, 152px);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow:
    0 0 24px rgba(255, 107, 26, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mast-line {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 6px rgba(255, 107, 26, 0.25));
}

.mast-year {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.3em;
  text-transform: lowercase;
  color: var(--vermilion);
  margin: 0 auto 18px;
  text-shadow: 0 0 12px rgba(181, 19, 34, 0.5);
}

.masthead-sub {
  max-width: 640px;
  margin: 0 auto;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--cream-warm);
}

.masthead-sub em {
  color: var(--ghost-pink);
  font-style: italic;
}

/* ---------- Panels (parchment with gold filigree) ---------- */

.panel {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto 42px;
}

.panel-frame {
  position: relative;
  padding: 36px 38px 38px;
  background:
    radial-gradient(ellipse at 50% 0%, var(--cream) 0%, var(--cream-warm) 60%, var(--paper-shade) 100%);
  color: #2a1810;
  border-radius: 6px;
  border: 1px solid var(--gold);
  box-shadow:
    0 0 0 4px var(--crimson),
    0 0 0 5px var(--gold-deep),
    0 0 0 7px var(--crimson),
    0 26px 60px var(--shadow-deep),
    inset 0 0 30px rgba(120, 70, 30, 0.15);
}

.panel-frame::before,
.panel-frame::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(138, 100, 32, 0.35);
  border-radius: 3px;
  pointer-events: none;
}

.panel-frame::after {
  inset: 14px;
  border-style: dashed;
  border-color: rgba(212, 166, 74, 0.3);
}

.panel-body {
  position: relative;
  z-index: 2;
}

.corner {
  position: absolute;
  width: 30px;
  height: 30px;
  pointer-events: none;
  z-index: 3;
}

.corner.gold {
  border: 2px solid var(--gold);
  background:
    linear-gradient(45deg, transparent 40%, var(--gold) 40%, var(--gold) 50%, transparent 50%);
}

.corner.gold.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.corner.gold.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; transform: scaleX(-1); }
.corner.gold.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; transform: scaleY(-1); }
.corner.gold.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; transform: scale(-1, -1); }

/* Intro panel */

.intro-panel .panel-body p {
  font-size: 17.5px;
  line-height: 1.65;
  margin: 0 0 18px;
  color: #2a1810;
}

.intro-panel .panel-body em {
  font-style: italic;
  color: var(--blood);
}

.dropcap::first-letter {
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: 3.4em;
  float: left;
  line-height: 0.9;
  padding: 6px 10px 0 0;
  color: var(--vermilion);
  text-shadow: 1px 2px 0 rgba(212, 166, 74, 0.4);
}

.panel-aside {
  margin: 24px 0 0;
  padding: 14px 18px;
  border-left: 3px solid var(--vermilion);
  background: rgba(181, 19, 34, 0.06);
  font-size: 15px;
  font-style: italic;
  color: #3a1810;
  border-radius: 0 6px 6px 0;
}

.aside-tag {
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--vermilion);
  margin-right: 6px;
  text-transform: uppercase;
}

/* Section header (used outside panel-frame) */

.section-prompts {
  text-align: center;
  margin-bottom: 56px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 0 14px;
}

.section-header h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  text-shadow: 0 0 16px rgba(255, 107, 26, 0.3);
}

.section-header .sub {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.6em;
  letter-spacing: 0.06em;
  color: var(--cream-warm);
  margin-left: 8px;
  text-shadow: none;
}

.ornament {
  color: var(--vermilion);
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(255, 107, 26, 0.5));
}

.ornament.flame-orn {
  display: inline-block;
  width: 26px;
  height: 36px;
  line-height: 0;
  animation: flame-flicker 0.5s ease-in-out infinite alternate;
}

.ornament.flame-orn svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 10px rgba(255, 130, 50, 0.7));
}

.ornament.flame-orn:last-child { animation-delay: 0.18s; }

/* Lantern peeking above the chatbot frame */
.chat-lantern {
  position: absolute;
  top: -42px;
  left: 40px;
  width: 50px;
  height: 82px;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 0 16px rgba(255, 120, 60, 0.55))
          drop-shadow(0 0 28px rgba(255, 80, 30, 0.35));
  animation: lantern-sway 6s ease-in-out infinite alternate,
             lantern-glow 2.4s ease-in-out infinite alternate;
  transform-origin: 50% 0;
}

.chat-lantern.right {
  left: auto;
  right: 40px;
  animation-duration: 7s, 2.8s;
  animation-delay: -2s, -0.4s;
}

@media (max-width: 720px) {
  .chat-lantern { display: none; }
}

.section-lede {
  max-width: 640px;
  margin: 0 auto 30px;
  color: var(--cream-warm);
  font-size: 16px;
  font-style: italic;
  line-height: 1.55;
}

/* ---------- Prompt grid (parchment cards) ---------- */

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  text-align: left;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 18px 18px;
  min-height: 168px;
  background:
    radial-gradient(ellipse at 50% 0%, var(--cream) 0%, var(--cream-warm) 70%, var(--paper-shade) 100%);
  color: #2a1810;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid var(--gold);
  box-shadow:
    0 0 0 3px var(--crimson),
    0 0 0 4px var(--gold-deep),
    0 12px 30px var(--shadow-deep);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.35s ease;
  opacity: 0;
  transform: translateY(14px);
  animation: card-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 1) * 24ms);
}

@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}

.card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(212, 166, 74, 0.45);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 120%, rgba(255, 107, 26, 0.25), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.card:hover {
  transform: translateY(-6px) rotate(-0.3deg);
  box-shadow:
    0 0 0 3px var(--vermilion),
    0 0 0 4px var(--gold-bright),
    0 22px 44px var(--shadow-warm),
    0 0 24px -6px rgba(255, 107, 26, 0.5);
}

.card:hover::after { opacity: 1; }

.card-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid var(--gold-deep);
  opacity: 0.7;
  transition: opacity 0.3s ease, border-color 0.3s ease;
  z-index: 2;
  pointer-events: none;
}
.card-corner.tl { top: 3px; left: 3px;  border-right: 0; border-bottom: 0; }
.card-corner.tr { top: 3px; right: 3px; border-left: 0;  border-bottom: 0; }
.card-corner.bl { bottom: 3px; left: 3px;  border-right: 0; border-top: 0; }
.card-corner.br { bottom: 3px; right: 3px; border-left: 0;  border-top: 0; }

.card:hover .card-corner { border-color: var(--vermilion); opacity: 1; }

.card-num {
  position: relative;
  z-index: 2;
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: 38px;
  line-height: 1;
  color: var(--vermilion);
  text-shadow: 1px 1px 0 rgba(212, 166, 74, 0.4);
  letter-spacing: 0.02em;
}

.card h3 {
  position: relative;
  z-index: 2;
  margin: 2px 0 auto;
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.3;
  color: #2a1810;
}

.card .credit {
  position: relative;
  z-index: 2;
  margin: 6px 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: rgba(60, 30, 12, 0.7);
}

/* ---------- Two-column cream panel ---------- */

.panel-cream .panel-frame { padding: 32px 36px 34px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.quiet-h2 {
  margin: 0 0 10px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--vermilion);
  border-bottom: 1px solid rgba(212, 166, 74, 0.5);
  padding-bottom: 6px;
}

.panel-cream p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.6;
  color: #2a1810;
}

.panel-cream em { color: var(--blood); font-style: italic; }

.link-list, .info-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.45;
  color: #3a1810;
}

.link-list li::before {
  content: "❀";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--vermilion);
  font-size: 12px;
}

.link-list a {
  color: #2a1810;
  text-decoration: none;
  border-bottom: 1px dashed rgba(181, 19, 34, 0.45);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.link-list a:hover {
  color: var(--vermilion);
  border-bottom-color: var(--vermilion);
}

.link-list strong { color: var(--blood); }

.info-list li {
  display: flex;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 14.5px;
  line-height: 1.45;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(138, 100, 32, 0.35);
}

.info-list .lbl {
  flex: 0 0 78px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vermilion);
  padding-top: 2px;
}

.info-list code {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  background: rgba(181, 19, 34, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--blood);
}

/* ---------- Chatbot ---------- */

.hub-chatbot {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 60px auto 42px;
}

.chatbot-frame {
  position: relative;
  overflow: hidden;
  padding: 30px 32px 32px;
  background:
    radial-gradient(ellipse at 30% 0%, #1a0608 0%, #0f0204 60%, #060102 100%);
  color: var(--cream);
  border-radius: 6px;
  border: 1px solid var(--gold);
  box-shadow:
    0 0 0 4px var(--crimson),
    0 0 0 5px var(--gold-deep),
    0 0 0 7px var(--crimson),
    0 30px 70px var(--shadow-deep);
  animation: chatbot-rise 0.8s ease both;
}

.chatbot-frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(212, 166, 74, 0.3);
  border-radius: 3px;
  pointer-events: none;
  z-index: 1;
}

.chatbot-frame::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(212, 166, 74, 0.18);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}

/* Ghost mascot floating in the corner */

.ghost-mascot {
  position: absolute;
  top: 22px;
  right: 26px;
  width: 44px;
  height: 54px;
  background: linear-gradient(180deg, #f4e6f4 0%, #d8c7f0 70%, #b8a4d8 100%);
  border-radius: 50% 50% 30% 30% / 60% 60% 30% 30%;
  box-shadow: 0 0 22px rgba(216, 199, 240, 0.5), inset 0 -8px 12px rgba(120, 90, 160, 0.25);
  animation: ghost-float 4.5s ease-in-out infinite, ghost-fade 4.5s ease-in-out infinite;
  z-index: 3;
}

.ghost-mascot::before,
.ghost-mascot::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 14px;
  height: 12px;
  background: linear-gradient(180deg, #d8c7f0, #b8a4d8);
  border-radius: 50% 50% 30% 30%;
}

.ghost-mascot::before { left: 4px; }
.ghost-mascot::after { right: 4px; }

.ghost-eye {
  position: absolute;
  top: 18px;
  width: 5px;
  height: 6px;
  background: #2a1830;
  border-radius: 50%;
}
.ghost-eye.left { left: 11px; }
.ghost-eye.right { right: 11px; }

.ghost-mouth {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 5px;
  background: #2a1830;
  border-radius: 0 0 6px 6px;
}

@keyframes ghost-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@keyframes ghost-fade {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

.chatbot-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  padding-right: 64px;
}

.chatbot-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 10.5px;
  margin: 0 0 12px;
  color: var(--gold-bright);
  font-family: "JetBrains Mono", monospace;
}

.chatbot-header h2 {
  margin: 0 0 12px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: 0.06em;
  color: var(--cream);
  text-shadow: 0 0 16px rgba(255, 107, 26, 0.25);
}

.chatbot-subtitle {
  margin: 0;
  max-width: 520px;
  color: var(--cream-warm);
  font-size: 15.5px;
  line-height: 1.55;
  font-family: "Cormorant Garamond", serif;
}

.chatbot-subtitle em { color: var(--ghost-pink); font-style: italic; }

.chatbot-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chatbot-tags span {
  border: 1px solid var(--gold);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(181, 19, 34, 0.18);
  font-family: "JetBrains Mono", monospace;
}

.chatbot-body {
  position: relative;
  z-index: 2;
  margin-top: 22px;
  background:
    radial-gradient(ellipse at 50% 0%, var(--cream) 0%, var(--cream-warm) 65%, var(--paper-shade) 100%);
  color: #2a1810;
  border-radius: 4px;
  padding: 18px 18px 20px;
  border: 1px solid var(--gold);
  box-shadow:
    0 0 0 2px var(--crimson),
    inset 0 0 20px rgba(120, 70, 30, 0.12);
}

.chatbot-output {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--vermilion) transparent;
}

.chatbot-output::-webkit-scrollbar { width: 6px; }
.chatbot-output::-webkit-scrollbar-thumb { background: var(--vermilion); border-radius: 3px; }

.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
}

.chatbot-suggestion {
  border: 1px solid var(--gold-deep);
  background: rgba(181, 19, 34, 0.06);
  color: var(--blood);
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.chatbot-suggestion:hover {
  transform: translateY(-1px);
  border-color: var(--vermilion);
  color: var(--cream);
  background: var(--vermilion);
  box-shadow: 0 6px 14px rgba(181, 19, 34, 0.3);
}

.chatbot-line {
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: "Cormorant Garamond", serif;
  font-size: 15.5px;
  line-height: 1.45;
  animation: chatbot-pop 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  max-width: 86%;
  word-wrap: break-word;
  position: relative;
}

.chatbot-line.bot {
  align-self: flex-start;
  background: rgba(255, 248, 230, 0.85);
  color: #2a1810;
  border: 1px solid var(--gold-deep);
  border-left: 3px solid var(--vermilion);
}

.chatbot-line.bot::before {
  content: "oracle ::";
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--vermilion);
  margin-bottom: 4px;
}

.chatbot-line.user {
  align-self: flex-end;
  background: rgba(181, 19, 34, 0.12);
  border: 1px solid var(--vermilion);
  color: var(--blood);
  font-style: italic;
}

.chatbot-line.user::before {
  content: "you ::";
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--vermilion);
  margin-bottom: 4px;
}

.chatbot-input {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 4px 4px 4px 14px;
  background: rgba(255, 248, 230, 0.85);
  border: 1px solid var(--gold-deep);
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--crimson);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-input:focus-within {
  border-color: var(--vermilion);
  box-shadow: 0 0 0 2px var(--vermilion), 0 0 16px rgba(255, 107, 26, 0.25);
}

.chat-glyph {
  color: var(--vermilion);
  font-size: 16px;
}

.chatbot-input input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #2a1810;
  padding: 10px 6px;
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  outline: none;
}

.chatbot-input input::placeholder {
  color: rgba(60, 30, 12, 0.5);
  font-style: italic;
}

.chatbot-input button {
  border: 1px solid var(--gold-bright);
  background: linear-gradient(180deg, var(--vermilion), var(--blood));
  color: var(--cream);
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.chatbot-input button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(181, 19, 34, 0.4);
  filter: brightness(1.1);
}

.chatbot-hints {
  margin: 12px 4px 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 13.5px;
  font-style: italic;
  color: rgba(60, 30, 12, 0.65);
}

.chatbot-hints em {
  color: var(--vermilion);
  font-style: italic;
}

@keyframes chatbot-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes chatbot-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Footer ---------- */

.hub-footer {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 0 56px;
  text-align: center;
}

.footer-inner {
  display: inline-block;
  padding: 18px 28px;
  border-top: 1px solid rgba(212, 166, 74, 0.4);
  border-bottom: 1px solid rgba(212, 166, 74, 0.4);
}

.footer-signoff {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 16px;
  color: var(--cream-warm);
}

.footer-meta {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(244, 231, 207, 0.55);
  text-transform: uppercase;
}

/* ---------- Sketch page chrome (enhanced engraved temple feel) ---------- */

body:not(.hub) {
  position: relative;
  background:
    /* faint coin/cash pattern */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><g fill='none' stroke='%23d4a64a' stroke-width='0.8' opacity='0.07'><circle cx='60' cy='60' r='22'/><rect x='55' y='55' width='10' height='10'/></g></svg>"),
    radial-gradient(900px 600px at 50% 0%, rgba(255, 107, 26, 0.10), transparent 60%),
    radial-gradient(1100px 800px at 50% 110%, rgba(181, 19, 34, 0.18), transparent 60%),
    linear-gradient(180deg, var(--deep-red) 0%, #100204 60%, #08020a 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Decorative gold corner ornaments on each corner of the viewport */
body:not(.hub)::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100'><g fill='none' stroke='%23d4a64a' stroke-width='1.2' stroke-linecap='round'><path d='M 6 6 L 6 38 Q 6 48 16 48 L 48 48'/><path d='M 6 18 Q 18 18 24 28 Q 30 36 36 42'/><path d='M 14 8 Q 22 12 26 20'/></g><circle cx='6' cy='6' r='3.2' fill='%23b51322' stroke='%23d4a64a' stroke-width='0.7'/><circle cx='6' cy='6' r='1.4' fill='%23f0c870'/><circle cx='48' cy='48' r='2' fill='%23d4a64a'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100' transform='scale(-1,1)'><g fill='none' stroke='%23d4a64a' stroke-width='1.2' stroke-linecap='round'><path d='M 6 6 L 6 38 Q 6 48 16 48 L 48 48'/><path d='M 6 18 Q 18 18 24 28 Q 30 36 36 42'/><path d='M 14 8 Q 22 12 26 20'/></g><circle cx='6' cy='6' r='3.2' fill='%23b51322' stroke='%23d4a64a' stroke-width='0.7'/><circle cx='6' cy='6' r='1.4' fill='%23f0c870'/><circle cx='48' cy='48' r='2' fill='%23d4a64a'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100'><g fill='none' stroke='%23d4a64a' stroke-width='1.2' stroke-linecap='round'><path d='M 6 6 L 6 38 Q 6 48 16 48 L 48 48'/><path d='M 6 18 Q 18 18 24 28 Q 30 36 36 42'/><path d='M 14 8 Q 22 12 26 20'/></g><circle cx='6' cy='6' r='3.2' fill='%23b51322' stroke='%23d4a64a' stroke-width='0.7'/><circle cx='6' cy='6' r='1.4' fill='%23f0c870'/><circle cx='48' cy='48' r='2' fill='%23d4a64a'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100'><g fill='none' stroke='%23d4a64a' stroke-width='1.2' stroke-linecap='round'><path d='M 6 6 L 6 38 Q 6 48 16 48 L 48 48'/><path d='M 6 18 Q 18 18 24 28 Q 30 36 36 42'/><path d='M 14 8 Q 22 12 26 20'/></g><circle cx='6' cy='6' r='3.2' fill='%23b51322' stroke='%23d4a64a' stroke-width='0.7'/><circle cx='6' cy='6' r='1.4' fill='%23f0c870'/><circle cx='48' cy='48' r='2' fill='%23d4a64a'/></svg>");
  background-repeat: no-repeat;
  background-position: top 12px left 12px, top 12px right 12px, bottom 12px left 12px, bottom 12px right 12px;
  background-size: 64px 64px;
  opacity: 0.85;
}

/* Right and bottom corners get mirrored via additional layered gradients (transform on background is unreliable),
   so we use a 4-corner SVG sprite layered in body::after instead */
body:not(.hub)::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    /* horizontal gold key-pattern strip near bottom */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='10' viewBox='0 0 32 10'><g fill='none' stroke='%23d4a64a' stroke-width='0.9' opacity='0.5'><path d='M 0 9 L 0 1 L 12 1 L 12 7 L 4 7 L 4 4 L 8 4'/><path d='M 16 9 L 16 1 L 28 1 L 28 7 L 20 7 L 20 4 L 24 4'/></g></svg>");
  background-repeat: repeat-x;
  background-position: bottom 4px left 0;
  background-size: 32px 10px;
}

#genuary-ui {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(40, 8, 12, 0.92), rgba(20, 4, 6, 0.92)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><g fill='none' stroke='%23d4a64a' stroke-width='0.8' opacity='0.1'><circle cx='60' cy='60' r='22'/><rect x='55' y='55' width='10' height='10'/></g></svg>");
  border: 1px solid var(--gold);
  box-shadow:
    0 0 0 2px var(--crimson),
    0 0 0 3px var(--gold-deep),
    0 18px 30px rgba(0, 0, 0, 0.5);
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: "Cormorant Garamond", serif;
  font-size: 14px;
  /* gold dashed inner border */
  outline: 1px dashed rgba(212, 166, 74, 0.35);
  outline-offset: -8px;
}

/* Tiny gold flame icon at the left of the bar */
#genuary-ui::before {
  content: '';
  width: 14px;
  height: 20px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 60'><defs><radialGradient id='f' cx='50%25' cy='78%25' r='55%25'><stop offset='0%25' stop-color='%23fffaa0'/><stop offset='35%25' stop-color='%23ffb547'/><stop offset='75%25' stop-color='%23ff3a18'/><stop offset='100%25' stop-color='%233a0810'/></radialGradient></defs><path d='M 20 4 C 30 16 32 26 30 36 C 32 46 26 54 20 56 C 14 54 8 46 10 36 C 8 26 10 16 20 4 Z' fill='url(%23f)'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 130, 50, 0.7));
  animation: flame-flicker 0.5s ease-in-out infinite alternate;
}

.genuary-home {
  color: var(--gold-bright);
  text-decoration: none;
  font-weight: 600;
  font-family: "Cinzel", serif;
  letter-spacing: 0.08em;
  font-size: 12px;
  text-transform: uppercase;
}

.genuary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--cream-warm);
}

.genuary-nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.genuary-nav-btn {
  color: var(--cream);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid var(--gold-deep);
  background: rgba(181, 19, 34, 0.2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.genuary-nav-btn:hover {
  border-color: var(--vermilion);
  color: var(--gold-bright);
}

.genuary-day { color: var(--gold-bright); font-weight: 600; }
.genuary-prompt { color: var(--cream); }

canvas {
  display: block;
  margin: 90px auto 56px;
  position: relative;
  z-index: 2;
  border-radius: 4px;
  border: 1px solid var(--gold);
  box-shadow:
    0 0 0 3px var(--crimson),
    0 0 0 4px var(--gold-deep),
    0 0 0 5px var(--crimson),
    0 0 0 6px var(--gold),
    0 0 80px 0 rgba(255, 107, 26, 0.15),
    0 30px 80px var(--shadow-deep);
  outline: 1px dashed rgba(212, 166, 74, 0.35);
  outline-offset: -12px;
}

#controls {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 10px;
  z-index: 10;
  padding: 8px;
  background: linear-gradient(180deg, rgba(40, 8, 12, 0.92), rgba(20, 4, 6, 0.92));
  border: 1px solid var(--gold);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--crimson), 0 14px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#controls button {
  position: relative;
  background: linear-gradient(180deg, var(--vermilion), var(--blood));
  color: var(--cream);
  border: 1px solid var(--gold-bright);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

#controls button:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
  box-shadow: 0 10px 20px rgba(181, 19, 34, 0.5);
}

#controls button:active {
  transform: translateY(0);
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  body.hub { padding: 36px 14px 0; }
  .panel { margin-bottom: 32px; }
  .panel-frame { padding: 24px 22px; }
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .chatbot-frame { padding: 24px 20px 24px; }
  .chatbot-header { padding-right: 0; }
  .ghost-mascot { top: 16px; right: 16px; width: 36px; height: 44px; }
  .chatbot-input { flex-wrap: wrap; }
  .chatbot-input button { width: 100%; }
  .masthead { gap: 0; }
}

@media (max-width: 520px) {
  .issue-meta { flex-direction: column; gap: 6px; padding: 12px 18px; }
  .issue-lines { text-align: center; }
  .seal { width: 32px; height: 32px; font-size: 18px; }
  .panel-frame { padding: 20px 16px; }
  .dropcap::first-letter { font-size: 2.6em; padding: 4px 8px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .floaters, .bg-embers, .bg-flame { display: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Gold engraving — Chinese key/wave/scroll patterns on panels
   ============================================================ */

.panel-frame.engraved {
  padding: 44px 50px 56px;
  border: 1px solid var(--gold);
  box-shadow:
    0 0 0 3px var(--crimson),
    0 0 0 4px var(--gold-deep),
    0 26px 60px var(--shadow-deep),
    inset 0 0 30px rgba(120, 70, 30, 0.18);
}

.panel-frame.engraved::before,
.panel-frame.engraved::after { display: none; }

.engrave-strip {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 0 3px rgba(212, 166, 74, 0.4));
}

.engrave-strip.top    { top: 18px;    left: 56px; right: 56px; height: 14px; width: auto; }
.engrave-strip.bottom { bottom: 18px; left: 56px; right: 56px; height: 14px; width: auto; transform: scaleY(-1); }
.engrave-strip.left   { top: 56px;    bottom: 56px; left: 18px;  width: 14px; height: auto; }
.engrave-strip.right  { top: 56px;    bottom: 56px; right: 18px; width: 14px; height: auto; transform: scaleX(-1); }

.engrave-wave {
  position: absolute;
  bottom: 4px;
  left: 50px;
  right: 50px;
  height: 14px;
  width: auto;
  pointer-events: none;
  z-index: 3;
  opacity: 0.85;
  filter: drop-shadow(0 0 3px rgba(212, 166, 74, 0.35));
}

.chatbot-frame.engraved.dark .engrave-strip {
  filter: drop-shadow(0 0 4px rgba(212, 166, 74, 0.55));
}

/* Tuck the chatbot strips in slightly so they don't crash into the ghost & lanterns */
.chatbot-frame.engraved.dark .engrave-strip.top,
.chatbot-frame.engraved.dark .engrave-strip.bottom {
  left: 88px;
  right: 88px;
}

.chatbot-frame.engraved.dark .engrave-strip.right {
  top: 92px;
  bottom: 80px;
}

.chatbot-frame.engraved.dark .engrave-strip.left {
  top: 80px;
  bottom: 80px;
}

/* Panel filigree corners — bump up size & polish */
.filigree { width: 56px; height: 56px; }
.filigree.tl { top: 8px; left: 8px; }
.filigree.tr { top: 8px; right: 8px; transform: scaleX(-1); }
.filigree.bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.filigree.br { bottom: 8px; right: 8px; transform: scale(-1, -1); }

@media (max-width: 720px) {
  .panel-frame.engraved { padding: 32px 28px 40px; }
  .engrave-strip.top, .engrave-strip.bottom { left: 40px; right: 40px; }
  .engrave-strip.left, .engrave-strip.right { top: 40px; bottom: 40px; }
  .engrave-wave { left: 36px; right: 36px; }
  .filigree { width: 42px; height: 42px; }
}

/* ============================================================
   Hero medallion + phoenixes + scroll hint
   ============================================================ */

.hero-medallion {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: min(680px, 88vw);
  height: min(680px, 88vw);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  filter: drop-shadow(0 0 60px rgba(255, 107, 26, 0.18));
  animation: medallion-spin 90s linear infinite;
}

@keyframes medallion-spin {
  to { transform: translate(-50%, -48%) rotate(360deg); }
}

.issue-header { position: relative; }

.masthead-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.hero-phoenix {
  width: 120px;
  height: 60px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(212, 166, 74, 0.5));
  animation: phoenix-bob 6s ease-in-out infinite;
}

.hero-phoenix.right { transform: scaleX(-1); animation-delay: -3s; }

@keyframes phoenix-bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -6px; }
}

@media (max-width: 820px) {
  .hero-phoenix { display: none; }
  .hero-medallion { opacity: 0.4; }
}

.issue-header > *:not(.hero-medallion) { position: relative; z-index: 2; }

.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 10px 18px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: rgba(20, 6, 8, 0.55);
  color: var(--gold-bright);
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
  animation: hint-pulse 2.4s ease-in-out infinite;
}

.scroll-hint:hover {
  transform: translateY(-2px);
  color: var(--cream);
  box-shadow: 0 12px 28px rgba(181, 19, 34, 0.4);
}

.scroll-hint-arrow {
  display: inline-block;
  animation: arrow-bob 1.6s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 166, 74, 0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(212, 166, 74, 0); }
}

@keyframes arrow-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}

/* ============================================================
   Scroll-progress lanterns (left + right edges)
   The lantern is absolutely positioned at top: var(--rope-len)
   so it never escapes the viewport. JS caps rope-len.
   ============================================================ */

.scroll-ropes {
  position: fixed;
  inset: 0 0 auto 0;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
  isolation: isolate;
}

.scroll-rope {
  position: absolute;
  top: 0;
  width: 40px;
  height: 100%;
  will-change: transform;
}

.scroll-rope.side-left  { left: 30px; }
.scroll-rope.side-right { right: 30px; }

.scroll-rope-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1.5px;
  height: 100%;
  margin-left: -0.75px;
  transform-origin: 0 0;
  transform: scaleY(var(--rope-scale, 0.05));
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(212, 166, 74, 0.4) 12%,
    rgba(212, 166, 74, 0.85) 100%
  );
  box-shadow: 0 0 4px rgba(212, 166, 74, 0.3);
  will-change: transform;
}

.scroll-lantern {
  /* Outer = position-only, driven by JS via translate3d on a CSS var */
  position: absolute;
  top: 0;
  left: 50%;
  width: 30px;
  height: 50px;
  margin-left: -15px;
  transform: translate3d(0, var(--rope-len, 36px), 0);
  will-change: transform;
}

.scroll-lantern-inner {
  /* Inner = sway animation only (transform), never JS-driven, never filter-animated */
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  transform-origin: 50% 0;
  transform: translateZ(0);
  filter:
    drop-shadow(0 0 6px rgba(255, 120, 60, 0.7))
    drop-shadow(0 0 14px rgba(255, 80, 30, 0.45));
  animation: scroll-lantern-sway 5.4s ease-in-out infinite alternate;
  will-change: transform;
}

.scroll-rope.side-right .scroll-lantern-inner {
  animation-delay: -2.7s;
}

/* Halo = pulses opacity only (cheap, GPU-friendly, never invalidates layers) */
.scroll-lantern-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  margin: -40px 0 0 -40px;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(255, 200, 120, 0.55) 0%,
    rgba(255, 130, 50, 0.3) 35%,
    transparent 70%
  );
  border-radius: 50%;
  opacity: 0.55;
  animation: scroll-lantern-halo-pulse 2.6s ease-in-out infinite alternate;
  will-change: opacity;
}

.scroll-rope.side-right .scroll-lantern-halo {
  animation-delay: -1.3s;
}

@keyframes scroll-lantern-halo-pulse {
  from { opacity: 0.4; transform: scale(0.85); }
  to   { opacity: 0.85; transform: scale(1.05); }
}

.scroll-lantern svg {
  width: 100%;
  height: 100%;
  display: block;
  margin-top: -4px;
}

@keyframes scroll-lantern-sway {
  0%   { transform: translateZ(0) rotate(-6deg); }
  50%  { transform: translateZ(0) rotate(0deg); }
  100% { transform: translateZ(0) rotate(6deg); }
}


@media (max-width: 980px) {
  .scroll-rope.side-left  { left: 14px; }
  .scroll-rope.side-right { right: 14px; }
  .scroll-rope { width: 30px; }
  .scroll-lantern { width: 24px; height: 40px; margin-left: -12px; }
}

@media (max-width: 540px) {
  .scroll-ropes { display: none; }
}

/* ============================================================
   Sticky TOC sidebar (right side)
   ============================================================ */

.toc {
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 16;
  width: 200px;
  pointer-events: auto;
}

.toc-inner {
  padding: 16px 16px 14px;
  background: rgba(12, 4, 6, 0.78);
  border: 1px solid var(--gold-deep);
  border-radius: 6px;
  box-shadow:
    0 0 0 2px var(--crimson),
    0 18px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toc-title {
  margin: 0 0 12px;
  font-family: "Noto Serif SC", "Cinzel", serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.08em;
  text-align: center;
  border-bottom: 1px solid rgba(212, 166, 74, 0.3);
  padding-bottom: 8px;
}

.toc-en {
  display: inline-block;
  margin-left: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(212, 166, 74, 0.6);
  text-transform: uppercase;
  font-weight: 400;
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  font-family: "Cormorant Garamond", serif;
  font-size: 13.5px;
  color: var(--cream-warm);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}

.toc-link:hover { color: var(--gold-bright); background: rgba(181, 19, 34, 0.12); }

.toc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--gold-deep);
  background: transparent;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.toc-link.is-active { color: var(--gold-bright); }
.toc-link.is-active .toc-dot {
  background: var(--vermilion);
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px rgba(212, 166, 74, 0.25), 0 0 10px rgba(255, 107, 26, 0.5);
}

.toc-divider {
  height: 1px;
  background: rgba(212, 166, 74, 0.3);
  margin: 10px 0 8px;
}

.toc-top {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--gold-deep);
  background: rgba(181, 19, 34, 0.15);
  color: var(--gold-bright);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.toc-top:hover { background: var(--vermilion); color: var(--cream); }

@media (max-width: 1280px) {
  .toc { display: none; }
}

/* ============================================================
   Floating "ask the oracle" button
   ============================================================ */

.oracle-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 17;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 12px;
  border: 1px solid var(--gold-bright);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--vermilion), var(--blood));
  color: var(--cream);
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 0 0 3px rgba(212, 166, 74, 0.18),
    0 16px 30px rgba(181, 19, 34, 0.4);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, filter 0.2s ease;
}

.oracle-fab.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.oracle-fab.is-hidden-near {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.oracle-fab:hover {
  filter: brightness(1.08);
  box-shadow:
    0 0 0 3px rgba(212, 166, 74, 0.3),
    0 22px 38px rgba(181, 19, 34, 0.5);
}

.fab-glyph {
  width: 18px;
  height: 26px;
  display: inline-flex;
  filter: drop-shadow(0 0 6px rgba(255, 200, 100, 0.7));
  animation: flame-flicker 0.5s ease-in-out infinite alternate;
}

.fab-glyph svg { width: 100%; height: 100%; display: block; }

@media (max-width: 520px) {
  .oracle-fab .fab-label { display: none; }
  .oracle-fab { padding: 10px; }
}

/* ============================================================
   Filter bar (search + chips)
   ============================================================ */

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto 30px;
  max-width: 760px;
}

.filter-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 16px;
  background: linear-gradient(180deg, rgba(20, 6, 8, 0.85), rgba(10, 4, 6, 0.95));
  border: 1px solid var(--gold-deep);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--crimson), inset 0 0 12px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.filter-search:focus-within {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px var(--vermilion), 0 0 22px rgba(255, 107, 26, 0.2);
}

.filter-glyph {
  font-size: 18px;
  color: var(--gold-bright);
  font-family: "Cinzel", serif;
}

.filter-search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--cream);
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  padding: 8px 4px;
}

.filter-search input::placeholder { color: rgba(244, 231, 207, 0.5); font-style: italic; }

.filter-clear {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 231, 207, 0.08);
  color: var(--cream-warm);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.filter-search.has-value .filter-clear {
  opacity: 1;
  pointer-events: auto;
}

.filter-clear:hover { background: var(--vermilion); color: var(--cream); }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.filter-chip {
  padding: 6px 14px;
  border: 1px solid var(--gold-deep);
  background: rgba(181, 19, 34, 0.08);
  color: var(--cream-warm);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.filter-chip:hover {
  transform: translateY(-1px);
  border-color: var(--vermilion);
  color: var(--gold-bright);
}

.filter-chip.is-on {
  background: linear-gradient(180deg, var(--vermilion), var(--blood));
  color: var(--cream);
  border-color: var(--gold-bright);
  box-shadow: 0 6px 14px rgba(181, 19, 34, 0.4);
}

.chip-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(244, 231, 207, 0.18);
  border-radius: 999px;
  font-size: 10px;
}

.filter-empty {
  text-align: center;
  margin: 6px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 15px;
  color: var(--cream-warm);
}

.card.is-filtered-out {
  display: none !important;
}

/* ============================================================
   Favorite seal on card 31
   ============================================================ */

.favorite-seal {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 56px;
  height: 56px;
  z-index: 4;
  transform: rotate(8deg);
  filter: drop-shadow(0 6px 12px rgba(181, 19, 34, 0.5));
  pointer-events: none;
}

.favorite-seal svg { width: 100%; height: 100%; display: block; }

.favorite-seal-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 0.95;
  color: var(--cream);
  text-align: center;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  letter-spacing: 0;
  gap: 1px;
}

.favorite-seal-text span { display: block; }

.card.is-favorite {
  overflow: visible;
  box-shadow:
    0 0 0 3px var(--gold-bright),
    0 0 0 4px var(--vermilion),
    0 0 0 5px var(--gold-deep),
    0 16px 36px var(--shadow-warm),
    0 0 28px -4px rgba(255, 107, 26, 0.4);
}

.chatbot-suggestion.is-hot {
  background: linear-gradient(180deg, var(--vermilion), var(--blood));
  color: var(--cream);
  border-color: var(--gold-bright);
  font-weight: 700;
}

.chatbot-suggestion.is-hot:hover {
  background: linear-gradient(180deg, #c81a30, var(--blood));
  color: var(--cream);
}

/* ============================================================
   Deluxe ornate divider
   ============================================================ */

.ornate-divider.deluxe {
  max-width: 860px;
  margin: 12px auto 44px;
}

.ornate-divider.deluxe svg {
  width: 100%;
  height: 60px;
  filter: drop-shadow(0 0 12px rgba(212, 166, 74, 0.35));
}

/* ============================================================
   Sketch-page chrome polish (keeps engraving theme)
   ============================================================ */

#genuary-ui {
  font-family: "Cormorant Garamond", serif;
}

/* ============================================================
   Misc polish
   ============================================================ */

.card {
  transform-origin: center;
}

.card-num {
  text-shadow: 1px 1px 0 rgba(212, 166, 74, 0.4),
               0 0 12px rgba(255, 107, 26, 0.15);
}

.section-prompts {
  scroll-margin-top: 30px;
}

.intro-panel, .panel-cream, .hub-chatbot {
  scroll-margin-top: 30px;
}

/* Smaller hero on tall pages — pull header tighter */
@media (min-width: 821px) {
  body.hub { padding-top: 60px; }
}

/* Improve focus styling site-wide */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 4px;
}
