/* ════════════════════════════════════════════════════════════════════
   THE SIGN: the header every room hangs over its scene. (The Index has
   no header; it keeps its own title over the harbour.)

   A neon sign on a dark wall. A porthole in tube, the name, and
   BULLETIN BOARD SYSTEM spelled out beside it; the Board on a prompt
   line underneath; the node lines top right; and a small ship's lantern
   swinging over Jamie, asleep on her rug.

   This file is the look, shared by every room. Each room still carries
   its own copy of the header's markup, and its own path on the prompt
   (C:\DARKLORE\ABOUT>). Link this file after /board.css and before the
   room's own <style>, so a room can still override it.

   What moves, and nothing else: two fog clouds, the o in Lore, the
   sun's middle line, B B S drifting lilac to amber, the cursor, the
   lantern (with its beam, its pool and its glow), the flame, and
   Jamie's breathing and her z's. All of it holds still for visitors
   who have asked for less motion.

   Every class of its own starts with hd-.
   ════════════════════════════════════════════════════════════════════ */

.site-header {
  --hd-pad: 2rem;                    /* side padding: the node lines sit where the old header put them */
  --hd-lock: 132px;                  /* where the name starts, clear of the porthole */
  --hd-node-w: 92.53px;              /* "14400 · ONLINE" as the node lines set it: the rug stops at its 1 */
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  height: 100.015625px;              /* the old header's height to the sixty-fourth, so nothing under it moves */
}

/* ── The wall, and the fog over it ───────────────────────────────────
   Dark courses, solid to 92px and gone by 138px: the fade hangs over
   the room below, and lets every click through. No rule under it. */
.hd-back {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 138px;
  overflow: hidden;                  /* the fog drifts; it must never widen the page */
  pointer-events: none;
}
.hd-wall {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, #0b0706 0 10px, #140c09 10px 11px, #0b0706 11px 14px), #0b0706;
  -webkit-mask: linear-gradient(#000 0, #000 92px, transparent 138px);
          mask: linear-gradient(#000 0, #000 92px, transparent 138px);
}
.hd-fog {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(175,165,210,0.11), rgba(175,165,210,0));
}
.hd-fog-a { left: -260px; top: 40px; width: 560px; height: 50px; animation: hdFogA 70s ease-in-out infinite alternate; }
.hd-fog-b { right: 100px; top: 6px; width: 460px; height: 42px; animation: hdFogB 90s ease-in-out infinite alternate; }
@keyframes hdFogA { to { transform: translateX(calc(40vw + 160px)); } }
@keyframes hdFogB { to { transform: translateX(calc(-40vw - 100px)); } }

/* ── The porthole, in neon tube ────────────────────────────────────── */
.hd-porthole {
  position: absolute;
  left: 28px; top: 6px;
  width: 88px; height: 88px;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 3px #ff8a30) drop-shadow(0 0 9px rgba(224,96,42,0.7));
}
.hd-flk-o   { animation: hdFlk 5s infinite; }   /* the o in Lore */
.hd-flk-sun { animation: hdFlk 6s infinite; }   /* the sun's middle line */
@keyframes hdFlk { 0%, 40%, 44%, 47%, 100% { opacity: 1; } 42%, 46% { opacity: 0.25; } }

/* ── The name, with BULLETIN BOARD SYSTEM on its line ──────────────── */
.site-header .header-left {
  position: absolute;
  left: var(--hd-lock); top: 20px;
  white-space: nowrap;
}
.site-header .header-title-row { display: block; }
.site-header .site-name {
  font: 700 28px 'Cinzel Decorative', Georgia, serif;
  color: #ffecc0;
  text-decoration: none;
  text-shadow: 0 0 3px #ffb45a, 0 0 10px #ff8a30, 0 0 26px #e0602a;
}
/* The mark: a small TM beside the name. It is paint on the wall, not a tube, so it does not glow.
   It takes no room on the line (a box of no width, its letters spilling out), so nothing beside it moves.
   Written as the letters T and M: the house's fonts have no trademark sign of their own. */
.site-header .site-name::after {
  content: "TM";
  content: "TM" / "";
  display: inline-block; width: 0; height: 0;
  font: 400 10px/0 'VT323', monospace;
  letter-spacing: 0.04em; text-indent: 3px; white-space: nowrap;
  vertical-align: 15px;
  color: #8b6030;
  text-shadow: none;
}
.site-header .site-bbs {
  font: 17px 'VT323', monospace;
  letter-spacing: 0.26em;
  margin-left: 16px;
  color: #f4eeff;
  text-shadow: 0 0 4px #a898e8, 0 0 12px #7a68c8;
}
.hd-ini { animation: hdDrift 24s ease-in-out infinite; }   /* B, B and S, together */
@keyframes hdDrift {
  0%, 100% { color: #f4eeff; text-shadow: 0 0 4px #a898e8, 0 0 12px #7a68c8; }
  50%      { color: #ffecc0; text-shadow: 0 0 3px #ffb45a, 0 0 10px #ff8a30, 0 0 18px rgba(224,96,42,0.8); }
}
.hd-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── The Board, on a prompt line under the name ──────────────────────
   Three dashes, the room's path, THE BOARD and a block cursor. No box
   and no caret: the whole line is the button. /board.css still owns
   the scroll it opens. */
.site-header .tb { padding-top: 0; margin-top: 8px; line-height: 16px; }
.site-header .tb-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  min-height: 0;
  font-size: 16px;
  line-height: 16px;
  letter-spacing: 0.1em;
  color: var(--tb-amber);
  background: none;
  border: 0;
  border-radius: 0;
  text-shadow: none;
}
.site-header .tb-btn::after { content: ''; position: absolute; inset: -7px -10px; }   /* a taller place to click */
.site-header .tb-burger { width: 13px; height: 9.5px; margin-right: 15px; --tb-burger: #c8923a; }
.hd-path { color: #8b6030; margin-right: 8px; transition: color 0.2s; }
.hd-label { letter-spacing: 0.2em; }
.hd-cur {
  flex: none;
  width: 9px; height: 15px;
  margin-left: 3px;
  background: #c8923a;
  animation: hdBlink 1.1s steps(1) infinite;
}
@keyframes hdBlink { 50% { opacity: 0; } }
.site-header .tb.is-open .tb-btn { color: var(--tb-parch); background: none; border: 0; }
.site-header .tb.is-open .hd-path { color: var(--tb-amber); }
@media (hover: hover) {
  .site-header .tb .tb-btn:hover { color: var(--tb-parch); background: none; border: 0; }
  .site-header .tb .tb-btn:hover .hd-path { color: var(--tb-amber); }
}

/* ── The node lines, top right, as they were ───────────────────────── */
.site-header .header-right {
  position: absolute;
  right: var(--hd-pad); top: 1.3rem;
  padding-top: 0;
  text-align: right;
}
.node-line { font-family: 'VT323', monospace; font-size: 13px; color: var(--muted3, #7a5828); letter-spacing: 0.25em; opacity: 0.85; line-height: 1.5; }
.node-line + .node-line { font-size: 12px; letter-spacing: 0.15em; opacity: 0.65; }

/* ── The lantern, the rug and Jamie ──────────────────────────────────
   Drawn in the sign's own numbers (the lantern hangs at x 936), in a
   window 240 wide whose right edge is the rug's fringe. That edge sits
   on the left edge of the 1 in 14400. */
.hd-scene {
  position: absolute;
  top: 0;
  right: calc(var(--hd-pad) + var(--hd-node-w));
  width: 240px; height: 100px;
  overflow: visible;
  pointer-events: none;
}
.hd-swing { transform: translate(936px, 0); animation: hdSwing 4s ease-in-out infinite alternate; }
@keyframes hdSwing { from { transform: translate(936px, 0) rotate(7deg); } to { transform: translate(936px, 0) rotate(-7deg); } }
.hd-pool { animation: hdPool 4s ease-in-out infinite alternate; }   /* in step with the swing */
@keyframes hdPool { from { transform: translateX(-10px); } to { transform: translateX(10px); } }
.hd-blend { mix-blend-mode: screen; }
.hd-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: hdFlame 0.9s ease-in-out infinite alternate; }
@keyframes hdFlame { to { transform: scale(0.88, 1.12); } }
.hd-breath { transform-box: fill-box; transform-origin: 50% 100%; animation: hdBreath 3.6s ease-in-out infinite; }
@keyframes hdBreath { 50% { transform: scaleY(1.06); } }
.hd-z  { animation: hdZ 3.6s ease-out infinite; }
.hd-z2 { animation-delay: -1.8s; }
@keyframes hdZ { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: 0.85; } 100% { opacity: 0; transform: translate(8px, -14px); } }

/* ── Narrower windows: the words give way first, then the scene ────── */
@media (max-width: 1020px) {
  .hd-word { display: none; }        /* BULLETIN BOARD SYSTEM becomes B B S, drifting the same way */
}
@media (max-width: 800px) {
  .hd-scene { display: none; }
}

/* ── Phones: a smaller porthole and name, B B S, and a shorter path ── */
@media (max-width: 600px) {
  .site-header {
    --hd-pad: 1rem;
    --hd-lock: 78px;
    height: 88.4375px;               /* the old phone header, to the sixty-fourth */
  }
  .hd-back { height: 122px; }
  .hd-wall {
    -webkit-mask: linear-gradient(#000 0, #000 82px, transparent 122px);
            mask: linear-gradient(#000 0, #000 82px, transparent 122px);
  }
  .hd-porthole { left: 12px; top: 13px; width: 56px; height: 56px; }
  .site-header .header-left { top: 16px; }
  .site-header .site-name { font-size: 20px; }
  .site-header .site-name::after { font-size: 8px; text-indent: 2px; vertical-align: 11px; }
  .site-header .site-bbs { font-size: 15px; margin-left: 9px; letter-spacing: 0.2em; }
  .site-header .tb { margin-top: 7px; line-height: 15px; }
  .site-header .tb-btn { font-size: 15px; line-height: 15px; }
  .site-header .tb-btn::after { inset: -9px -10px; }
  .site-header .tb-burger { margin-right: 11px; }
  .hd-path-mid { display: none; }    /* C:\> */
  .hd-cur { width: 8px; height: 14px; }
  .site-header .tb-scroll { left: calc(45px - var(--hd-lock)); }   /* the scroll hangs where it always has on a phone */
  .site-header .header-right { top: 1.1rem; }
  .node-line { font-size: 12px; }
  .node-line + .node-line { font-size: 11px; }
}

/* ── Less motion: everything holds still. The lantern hangs straight
   down, and B, B and S hold lilac. ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hd-fog, .hd-flk-o, .hd-flk-sun, .hd-ini, .hd-cur, .hd-swing, .hd-pool, .hd-flame, .hd-breath, .hd-z { animation: none; }
}
