/* Header, menus, footer, spoiler bar, preloader */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 200ms var(--ease);
}
.site-header.is-shrunk { box-shadow: var(--shadow); }
.site-header.is-shrunk .logo-mark { transform: scale(0.92); }
.site-header.is-shrunk .header-inner { min-height: 64px; }

.header-inner {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: min-height 200ms var(--ease);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--heading);
  min-height: 44px;
  flex: 0 0 auto;
}
.logo-mark { width: 42px; height: 42px; display: block; color: var(--accent-2-text); }
.logo-mark .ember { fill: var(--accent); stroke: none; }
.logo-name {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1;
  display: block;
}
.logo-sub {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  display: block;
  margin-top: 3px;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: var(--space-2);
}
.nav-link, .mega > summary {
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  list-style: none;
  background: none;
  border: 0;
}
.nav-link[aria-current="page"], .mega[open] > summary { color: var(--accent-text); }
.mega { position: relative; }
.mega > summary { gap: 6px; }
.mega > summary::-webkit-details-marker { display: none; }
.mega > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.mega-panel {
  padding: var(--space-3);
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.mega-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: var(--space-3);
}
.mega-links { display: grid; gap: 4px; }
.mega-links a, .drawer a {
  text-decoration: none;
  color: var(--text);
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
}
.mega-links a:hover, .drawer a:hover { background: var(--bg-inset); color: var(--heading); }
.mini-cover { width: 36px; height: 54px; flex: 0 0 auto; overflow: hidden; }
.mini-cover .cover { width: 36px; height: 54px; max-width: 36px; }
.mega-feature {
  border: 1px solid var(--line);
  padding: var(--space-2);
  background: var(--bg-inset);
  display: grid;
  gap: 8px;
  align-content: start;
}
.mega-feature a { color: var(--heading); font-family: var(--font-display); font-size: 1.4rem; text-decoration: none; }

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--heading);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 500;
}
.tool-select { max-width: 118px; background: var(--bg-inset); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  line-height: 1.1;
  text-align: center;
}
.btn-primary { background: var(--accent-fill); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--heading); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent-text); color: var(--heading); }
.btn-tiny { min-height: 44px; padding: 0 12px; font-size: 0.92rem; }
.join-link { display: inline-flex; padding: 0 12px; }

.mobile-nav { margin-left: auto; }
.desktop-nav + .header-tools .menu-summary { display: inline-flex; }
.mobile-nav > summary.menu-summary {
  list-style: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  font-family: var(--font-ui);
  font-weight: 500;
}
.mobile-nav > summary::-webkit-details-marker { display: none; }
.drawer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 8px 16px 24px;
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  overflow: auto;
}
.drawer details { border-bottom: 1px solid var(--line); }
.drawer summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 1.05rem;
  list-style: none;
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer a { padding-left: 8px; }

.spoiler-bar {
  background: var(--bg-inset);
  border-bottom: 1px solid var(--line);
}
.spoiler-bar-inner {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 8px 0;
}
.spoiler-bar label {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--heading);
}
.spoiler-bar select, .field input, .field select, .field textarea {
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  padding: 8px 12px;
  border-radius: var(--radius);
  width: 100%;
}
.spoiler-bar select { width: auto; min-width: min(280px, 100%); }
.spoiler-note { margin: 0; color: var(--text-soft); font-size: 0.95rem; flex: 1 1 220px; }
.page-reveal { font-family: var(--font-ui); }

@media (min-width: 1040px) {
  .desktop-nav { display: flex; }
  .mobile-nav { display: none; }
  .nav-link, .mega > summary { font-size: 1.125rem; }
  .mega-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(760px, 70vw);
  }
  .mega:last-of-type .mega-panel { left: auto; right: 0; }
}

@media (max-width: 1039px) {
  .header-tools .tool-select, .header-tools .theme-btn { display: none; }
  .logo-sub { display: none; }
}
@media (max-width: 420px) {
  .logo-name { font-size: 1.05rem; }
  .header-inner { gap: 6px; width: calc(100% - 16px); }
  .join-link { font-size: 0.92rem; padding: 0 10px; }
}

.site-footer { border-top: 1px solid var(--line); background: var(--bg-inset); margin-top: var(--space-8); }
.news-strip { padding: var(--space-5) 0; border-bottom: 1px solid var(--line); }
.news-grid, .foot-grid {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
}
.news-grid {
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 800px) {
  .news-grid { grid-template-columns: 1.2fr 0.8fr; align-items: center; }
}
.foot-forthcoming {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  padding: 12px;
  background: var(--bg-raised);
  text-decoration: none;
  color: inherit;
}
.foot-forthcoming strong { font-family: var(--font-display); font-size: 1.25rem; color: var(--heading); display: block; }
.foot-grid, .news-grid { min-width: 0; max-width: 100%; }
.foot-grid {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6) 0 var(--space-4);
}
.foot-grid > div, .news-grid > * { min-width: 0; }
.foot-grid a, .foot-base p, .foot-base a { overflow-wrap: anywhere; }
@media (min-width: 800px) {
  .foot-grid { grid-template-columns: repeat(4, 1fr); }
}
.foot-grid h2 {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-text);
}
.foot-grid a { display: block; min-height: 36px; padding: 6px 0; color: var(--text); text-decoration: none; }
.foot-grid a:hover { color: var(--heading); }
.foot-base {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
  padding: var(--space-3) 0 var(--space-5);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.95rem;
}
.socials { display: flex; gap: 8px; }
.socials a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--heading);
  text-decoration: none;
}
.to-top { font-family: var(--font-ui); }

#preloader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--bg);
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: 16px;
}
html.do-preload #preloader { display: grid; }
.pre-crown { width: min(220px, 60vw); color: var(--gold-text); }
.pre-crown path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html.do-preload .pre-crown path.draw {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw 1.1s var(--ease) forwards;
}
.pre-glow {
  width: 80px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.85;
}
#preloader p { margin: 0; font-family: var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.75rem; color: var(--text-soft); }
#preloader-skip { pointer-events: auto; }

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form input { flex: 1 1 200px; min-width: 0; background: var(--bg-raised); border: 1px solid var(--line-strong); padding: 8px 12px; }
