/* RATS — site chrome for the pages already on the new look: the shared sticky bar
   (drawn by assets/js/nav.js), the page header (eyebrow, display title, lede, art band) and the
   footer. Linked AFTER theme.css (and ui.css where a page uses it). A page links this file only
   once it has been made over, so the rest of the site is untouched until its turn.
   Type and gold follow the Okanvil page (public/okanvil/okanvil.css). */

@import url("https://fonts.googleapis.com/css2?family=Marcellus&family=Figtree:wght@400;500;600;700&display=swap");

:root {
  --display: "Marcellus", "Trajan Pro", Georgia, serif;   /* titles: the engraved face */
  --body: "Figtree", var(--font);                          /* everything else */
  --title: #f3e3bd;      /* page titles: the gold, bleached toward parchment */
  --heading: #f1e6cc;    /* section and card titles */
  --lede: #c9c3b6;       /* intro text under a title */
  --line-warm: #3a3530;  /* borders around art, a touch warmer than --border */
  --bar-h: 60px;
}

body {
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px }

/* ---------- the shared sticky bar ---------- */
.site-bar {
  position: sticky; top: 0; z-index: 40;
  min-height: var(--bar-h);
  background: rgba(20, 21, 23, .84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.sb-in {
  max-width: var(--wrap-wide); margin: 0 auto; padding: 0 20px;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 20px;
}
.sb-logo { display: flex; align-items: center; gap: 9px; text-decoration: none }
.sb-logo img { width: 32px; height: 32px; border-radius: 50% }
.sb-logo b { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--accent-hi); letter-spacing: 1px }
.sb-crumb {
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  border: 1px dashed rgba(192, 148, 58, .5); border-radius: 20px; padding: 3px 10px;
}
.sb-nav { display: flex; gap: 2px; margin-left: auto; font-size: 14px }
.sb-nav a {
  color: var(--text-dim); text-decoration: none;
  padding: 6px 10px; border-radius: var(--radius);
}
.sb-nav a:hover { color: var(--accent-hi) }
.sb-nav a[aria-current="page"] { color: var(--accent-hi); background: rgba(192, 148, 58, .1) }
.sb-discord {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  height: 32px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--line-warm); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text-dim);
}
.sb-discord:hover { border-color: var(--accent); color: var(--white) }
.sb-discord svg, .sb-menu svg { width: 16px; height: 16px }
.sb-menu {
  display: none; margin-left: auto;
  height: 34px; width: 38px; padding: 0; border-radius: var(--radius);
  border: 1px solid var(--line-warm); background: var(--surface); color: var(--text-dim);
  align-items: center; justify-content: center; cursor: pointer;
}

@media (max-width: 860px) {
  .sb-menu { display: inline-flex }
  .sb-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: var(--bar-h);
    flex-direction: column; gap: 0; padding: 8px 12px 14px;
    background: rgba(20, 21, 23, .97); border-bottom: 1px solid var(--border);
  }
  .site-bar.open .sb-nav { display: flex }
  .sb-nav a { padding: 10px 12px; font-size: 15px }
  .sb-discord { order: 3 }
}

/* ---------- page header: eyebrow, display title, lede, optional art band ---------- */
.phead { position: relative; padding: 56px 0 30px }
.phead .eyebrow, .eyebrow {
  margin: 0 0 12px; font-size: 12px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
}
.phead h1 {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(34px, 4.4vw, 52px); line-height: 1.05; letter-spacing: .3px;
  color: var(--title); text-shadow: 0 2px 20px rgba(0, 0, 0, .5);
}
.phead .lede { margin: 14px 0 0; font-size: 16.5px; line-height: 1.55; color: var(--lede); max-width: 72ch }
.phead .lede b { color: var(--white) }
/* header actions sit in their own column on the right, level with the title, so a long lede never
   runs under them; on a narrow screen they drop below the lede */
.phead:has(.actions:not([hidden])) {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: end;
}
.phead:has(.actions) > :not(.actions) { grid-column: 1 }
.phead .actions { grid-column: 2; grid-row: 1 / span 3; align-self: end; display: flex; gap: 8px; align-items: center }
/* page scripts reveal officer-only actions by clearing `hidden`: it must win over the flex above */
.phead .actions[hidden] { display: none }

/* the art band sits behind the header, faded to the page on the left and at the bottom */
.band {
  position: absolute; left: 0; right: 0; top: var(--bar-h);
  height: 340px; overflow: hidden; z-index: 0; pointer-events: none;
}
.band img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 35%; opacity: .5;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.band::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(20, 21, 23, .75) 40%, rgba(20, 21, 23, .2) 100%);
}
.band ~ .wrap, .band ~ main { position: relative; z-index: 1 }
.band ~ .wrap .phead, .band ~ main .phead { padding-top: 84px }

/* big screens: use the room instead of a narrow column in the middle
   (bar, footer, hub and every .wrap.wide page follow --wrap-wide) */
@media (min-width: 1600px) {
  :root { --wrap-wide: min(88vw, 1800px) }
}

/* ---------- footer ---------- */
.site-foot {
  max-width: var(--wrap-wide); margin: 40px auto 0; padding: 26px 20px 40px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--text-faint); font-size: 13px;
}

@media (max-width: 760px) {
  .phead:has(.actions:not([hidden])) { display: block }
  .phead .actions { margin-top: 16px }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important } }

/* officers only (nav.js adds it when this browser holds the guild key): a small gold seal, set apart
   from the public links by a thin rule */
.sb-nav a.sb-officer {
  position: relative; display: inline-flex; align-items: center; gap: 7px; margin-left: 14px;
  padding: 6px 14px 6px 10px; border-radius: 999px;
  font-weight: 700; letter-spacing: .02em; color: #16120a;
  background: linear-gradient(135deg, #f5d98a 0%, #c0943a 55%, #9a6f24 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 14px -6px rgba(192, 148, 58, .7);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.sb-nav a.sb-officer::before {
  content: ""; position: absolute; left: -9px; top: 20%; bottom: 20%; width: 1px; background: var(--line-warm);
}
.sb-nav a.sb-officer svg {
  width: 20px; height: 20px; padding: 3px; border-radius: 50%; box-sizing: border-box;
  background: rgba(22, 18, 10, .18); stroke-width: 2.4;
}
.sb-nav a.sb-officer:hover {
  color: #16120a; transform: translateY(-1px); filter: brightness(1.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 20px -6px rgba(192, 148, 58, .85);
}
.sb-nav a.sb-officer[aria-current="page"] { color: #16120a }
@media (prefers-reduced-motion: reduce) { .sb-nav a.sb-officer { transition: none } .sb-nav a.sb-officer:hover { transform: none } }

/* ---------- lock screens: the guild-key gate (data.js) and the admin password (admin.js) ---------- */
.gate {
  background-color: #0f1012;
  background-image:
    radial-gradient(ellipse at 50% 45%, rgba(20, 21, 23, .55) 0%, rgba(15, 16, 18, .96) 70%),
    url("../../images/hub/band-officer.jpg");
  background-size: cover;
  background-position: center 40%;
  font-family: var(--body);
}
.gate-wait { font-size: 40px; line-height: 1 }
.gate-card {
  width: min(380px, calc(100vw - 32px));
  padding: 30px 28px 26px;
  text-align: center;
  background: rgba(27, 29, 33, .92);
  border: 1px solid var(--line-warm);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.gate-eyebrow {
  margin: 0 0 10px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
}
.gate-title {
  margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.15;
  text-transform: none; letter-spacing: 0; color: var(--title);
}
.gate-sub { margin: 8px 0 18px; font-size: 14px; color: var(--lede) }
.gate-input {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--field); color: var(--white);
  border: 1px solid var(--field-border); border-radius: var(--radius);
  font: inherit; font-size: 14px; text-align: center; color-scheme: dark;
}
.gate-input:focus { outline: none; border-color: var(--accent) }
.gate-err { min-height: 18px; margin: 8px 0; font-size: 12.5px; color: #ff6b6b }
.gate-err.wait { color: var(--text-dim-2) }
.gate-btn {
  width: 100%; height: 42px; border: 0; border-radius: var(--radius); cursor: pointer;
  background: var(--accent); color: #16120a; font: inherit; font-weight: 700; font-size: 14px;
}
.gate-btn:hover { background: var(--accent-hi) }
.gate-btn:disabled { opacity: .5; cursor: wait }
