/* ============================================================
   GLOBAL RELAY TRACK — the frame for moved-in tools
   The Track's header and footer, and nothing else. Tool pages (the letter
   builders, the songs, Suminagashi, the storytelling guide) keep their own
   styles for everything inside; this file never touches <body>, headings,
   links or images outside .hdr / .ftr. Every rule is scoped and resets the
   properties a tool's own element rules (header {}, nav a {}, p {}) could leak in.
   Keep in step with the header/footer blocks in track.css.
   ============================================================ */

.hdr, .ftr {
  --purple: #5F249F; --gold: #FFC600; --red: #FF0000;
  --ink-soft: #4A4A4A; --paper: #FDFAF3;
  --font-display: 'Fraunces', 'Source Serif 4', Georgia, serif;
  --font-head: 'Outfit', 'Poppins', system-ui, sans-serif;
  --font-body: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
  display: block; margin: 0; box-shadow: none; text-align: left;
  font-family: var(--font-body); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
.hdr *, .hdr *::before, .hdr *::after,
.ftr *, .ftr *::before, .ftr *::after { box-sizing: border-box; }
.hdr p, .ftr p { margin: 0; }
.hdr img, .ftr img { display: block; max-width: 100%; }
.hdr :focus-visible, .ftr :focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- header ---------- */
.hdr {
  /* not sticky: several tools keep their own sticky toolbar at top: 0 */
  position: relative; z-index: 1000; padding: 0; width: auto; height: auto;
  background: rgba(20, 6, 43, .97);
  color: #fff; font-size: 17px;
  border: 0; border-bottom: 1px solid rgba(255,255,255,.08);
}
.hdr .bar { position: relative; display: flex; align-items: center; min-height: 60px; padding: 8px 16px; margin: 0; max-width: none; background: none; }
.hdr .brand { display: flex; align-items: center; text-decoration: none; color: #fff; min-height: 44px; min-width: 0; flex-shrink: 1; gap: 0; padding: 0; background: none; }
.hdr .brand img { height: 30px; width: auto; margin: 0 12px 0 0; }
.hdr .brand .name { font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: .01em; line-height: 1.1; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr .brand .name small { display: block; font-weight: 400; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin-top: 2px; }
.hdr .spacer { flex: 1; }

.hdr .menu-box { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }
.hdr .menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0 14px; margin: 0; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer;
  color: #fff; border: 1.5px solid rgba(255,255,255,.35); background: transparent;
}
.hdr .menu-btn:hover { background: rgba(255,255,255,.1); }
.hdr .nav {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  background: rgba(20, 6, 43, .98); padding: 8px 16px 18px; margin: 0;
  border: 0; border-bottom: 1px solid rgba(255,255,255,.1);
}
.hdr .menu-box:checked ~ .nav { display: block; }
.hdr .menu-box:focus-visible ~ .menu-btn { outline: 3px solid var(--gold); }
.hdr .nav a {
  display: block; padding: 12px 6px; margin: 0; min-height: 44px;
  font-family: var(--font-head); font-weight: 500; font-size: 17px; line-height: 1.2; letter-spacing: 0;
  text-decoration: none; text-transform: none; color: #fff; background: none;
  border: 0; border-bottom: 1px solid rgba(255,255,255,.08); border-radius: 0;
}
.hdr .nav a .k { color: var(--gold); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-right: 10px; }
.hdr .nav a:hover, .hdr .nav a[aria-current="page"] { color: var(--gold); }
.hdr .hdr-search { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 6px 0 0; padding: 0; border-radius: 50%; color: #fff; text-decoration: none; background: none; }
.hdr .hdr-search svg { display: block; }
.hdr .hdr-search:hover { background: rgba(255,255,255,.12); }
@media (min-width: 900px) {
  .hdr .menu-btn { display: none; }
  .hdr .nav { display: flex; position: static; background: transparent; padding: 0; border: 0; order: 1; }
  .hdr .nav a { border: 0; padding: 10px 14px; font-size: 15px; }
  .hdr .nav a .k { display: none; }
  .hdr .hdr-search { order: 2; margin-left: 4px; }
}
@media (max-width: 440px) { .hdr .brand .name small { display: none; } .hdr .hdr-search { margin-right: 2px; } .hdr .bar { padding: 8px 12px; } }

/* ---------- footer ---------- */
.ftr { background: var(--paper); color: var(--ink-soft); padding: 34px 0 46px; font-size: 14px; border: 0; }
.ftr .wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 720px) { .ftr .wrap { padding: 0 32px; } }
.ftr .disc { font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--purple); margin-bottom: 12px; }
.ftr .disc b { color: var(--red); }
.ftr .links a { color: var(--purple); text-decoration: none; font-weight: 600; margin-right: 14px; display: inline-block; min-height: 32px; line-height: 32px; background: none; }
.ftr .links a:hover { text-decoration: underline; }
.ftr .made { margin-top: 10px; font-family: var(--font-display); font-style: italic; color: var(--ink-soft); }
.ftr .made .fix { font-family: var(--font-body); font-style: normal; font-weight: 600; color: var(--purple); text-decoration: none; margin-left: 6px; white-space: nowrap; }
.ftr .made .fix:hover { text-decoration: underline; }

/* Letters and song sheets print without the frame. */
@media print { .hdr, .ftr { display: none !important; } }
