/* Site shell: skip link, ticker, header, mobile menu, footer, mobile call bar, grain.
   Ported from the reference's scoped component styles onto rw- classes. */

/* Skip link (reference +layout.svelte) */
.rw-skip {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--color-cream);
  color: var(--color-night);
  font-weight: 700;
}
.rw-skip:focus {
  top: 12px;
}

/* Ticker */
.rw-ticker {
  position: relative;
  overflow: hidden;
  background: var(--color-ember);
  color: var(--color-cream);
  padding: 10px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.rw-track {
  display: flex;
  width: max-content;
  animation: rh-marquee var(--duration) linear infinite;
}
.rw-ticker:hover .rw-track {
  animation-play-state: paused;
}
.rw-tick {
  white-space: nowrap;
  padding-right: 56px;
}
/* Editor-only affordances */
.rw-ticker-empty {
  min-height: 38px;
}
.rw-ticker-edit {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--color-night-3);
  color: var(--color-cream);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: none;
  cursor: pointer;
}

/* Header. The kit's `[data-theme=dark] body > header` / `> footer` tints are
   neutralized by repeating the properties at higher specificity. */
.rw-body > header.rw-header {
  background: var(--color-night);
  border-color: rgb(251 243 230 / 0.28);
}
.rw-body > footer.rw-footer {
  background: var(--color-night-3);
}
.rw-header {
  position: relative;
  z-index: 20;
  background: var(--color-night);
  border-bottom: 4px double rgb(251 243 230 / 0.28);
}
.rw-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-block: 16px;
}
.rw-primary {
  display: flex;
  gap: 30px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rw-header nav a[aria-current='page']:not(.rh-btn) {
  text-decoration: underline 3px var(--color-ember);
  text-underline-offset: 9px;
}
.rw-primary a:hover,
.rw-actions .rw-phone:hover {
  color: var(--color-orange);
}
.rw-header .rw-logo img,
.rw-footer .rw-logo img {
  display: block;
  width: auto;
}
.rw-header .rw-logo img {
  height: 88px;
}
.rw-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
  font-weight: 700;
  font-size: 14px;
}
.rw-actions .rw-phone {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mobile menu: a <details> child of the header. The summary sits in the bar's
   toggle slot; the open panel flows full width under the bar. */
.rw-mnav {
  display: none;
}
.rw-toggle {
  position: absolute;
  top: 25px; /* (62px logo + 2 x 16px bar padding - 44px) / 2 */
  /* 44px tap target around the 30px glyph, glyph flush with the content edge */
  right: calc(clamp(20px, 5vw, 64px) - 7px);
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--color-cream);
  list-style: none;
  cursor: pointer;
}
.rw-toggle::-webkit-details-marker {
  display: none;
}
.rw-toggle::marker {
  content: '';
}
.rw-toggle svg {
  width: 30px;
  height: 30px;
}
.rw-toggle .rw-icon-close,
.rw-mnav[open] .rw-toggle .rw-icon-open {
  display: none;
}
.rw-mnav[open] .rw-toggle .rw-icon-close {
  display: block;
}
.rw-panel {
  border-top: 1px solid rgb(251 243 230 / 0.16);
  background: var(--color-night-2);
}
.rw-panel nav {
  display: flex;
  flex-direction: column;
  padding-block: 6px 20px;
}
.rw-panel nav > a:not(.rh-btn) {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid rgb(251 243 230 / 0.12);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rw-panel .rh-btn {
  margin-top: 16px;
  justify-content: center;
}
@media (max-width: 767.98px) {
  .rw-bar {
    grid-template-columns: auto 1fr auto;
  }
  .rw-primary,
  .rw-actions {
    display: none;
  }
  .rw-header .rw-logo {
    grid-column: 1;
  }
  .rw-header .rw-logo img {
    height: 62px;
  }
  .rw-mnav {
    display: block;
  }
}

/* Footer */
.rw-footer {
  background: var(--color-night-3);
  color: var(--color-smoke);
}
.rw-footer .rw-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  align-items: center;
  padding-block: 46px 40px;
  font-size: 13px;
}
.rw-footer .rw-logo img {
  height: 60px;
}
.rw-footer nav {
  display: flex;
  gap: 26px;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rw-footer nav a:hover {
  color: var(--color-orange);
}
.rw-legal {
  margin: 0;
  text-align: right;
  line-height: 1.7;
}
.rw-legal a {
  color: var(--color-cream);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rw-nap {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.6;
}
.rw-nap a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rw-nap a:hover {
  color: var(--color-orange);
}
@media (max-width: 767.98px) {
  .rw-footer .rw-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 22px;
  }
  .rw-footer nav {
    flex-wrap: wrap;
    gap: 14px 20px;
  }
  .rw-legal {
    text-align: center;
  }
}

/* Mobile call bar */
.rw-mobilebar {
  display: none;
}
@media (max-width: 767.98px) {
  .rw-mobilebar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    background: var(--color-night-2);
    border-top: 3px solid var(--color-ember);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .rw-mobilebar > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .rw-mobilebar > .rw-bar-book {
    background: var(--color-ember);
    color: var(--color-cream);
  }
}

/* Paper grain (reference PaperGrain) */
.rw-grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .92  0 0 0 0 .8  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Kit UI above the grain (z 40). The HUD (60), Z button (55), modals (70+) and
   section modal (200) already clear it; only the cookie note needed raising (45,
   below the HUD and Z button so it never hides the editor). */

/* Cookie note, restyled for the dark site: a paper card with ink text. */
.zk-notice {
  z-index: 45;
  background: var(--color-paper);
  color: var(--color-ink);
  border: 1px solid rgb(42 28 21 / 0.25);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.5);
}
.zk-notice-copy {
  color: var(--color-ink-2);
}
.zk-notice-ok {
  background: var(--color-ember);
  color: var(--color-cream);
}
.zk-notice-privacy {
  color: var(--color-ink);
}
.zk-notice-privacy:hover {
  color: var(--color-ember-dark);
}
.zk-notice-ok:focus-visible,
.zk-notice-privacy:focus-visible {
  box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 4px var(--color-ember);
}
/* On mobile the note clears the sticky call bar. */
@media (max-width: 767.98px) {
  .zk-notice {
    bottom: calc(var(--rw-bar-h, 51px) + 0.75rem + env(safe-area-inset-bottom));
  }
}

/* Four nav items (a fourth page is published, e.g. Testimonials). Only a header with a fourth link is
   touched, so the three-item header is exactly as before. Tightened so four fit beside the centred
   logo from 1000px up (the full-size nav is kept from 1200px); below that the hamburger menu takes over (the same rules as the 767px block). */
@media (min-width: 1000px) and (max-width: 1199.98px) {
  .rw-primary:has(> a:nth-child(4)) {
    gap: 18px;
    font-size: 13px;
    letter-spacing: 0.05em;
  }
}
@media (min-width: 768px) and (max-width: 999.98px) {
  .rw-header:has(.rw-primary > a:nth-child(4)) .rw-bar {
    grid-template-columns: auto 1fr auto;
  }
  .rw-header:has(.rw-primary > a:nth-child(4)) .rw-primary,
  .rw-header:has(.rw-primary > a:nth-child(4)) .rw-actions {
    display: none;
  }
  .rw-header:has(.rw-primary > a:nth-child(4)) .rw-logo {
    grid-column: 1;
  }
  .rw-header:has(.rw-primary > a:nth-child(4)) .rw-logo img {
    height: 62px;
  }
  .rw-header:has(.rw-primary > a:nth-child(4)) .rw-mnav {
    display: block;
  }
}

/* Tablets with four nav items: the header actions are hidden above, so the sticky call bar shows here
   too (same look as below 768px; it is sticky, so the page needs no extra bottom padding). */
@media (min-width: 768px) and (max-width: 999.98px) {
  /* The cookie note clears the call bar here too, as it does below 768px. */
  body:has(.rw-primary > a:nth-child(4)) .zk-notice {
    bottom: calc(var(--rw-bar-h, 51px) + 0.75rem + env(safe-area-inset-bottom));
  }
  body:has(.rw-primary > a:nth-child(4)) .rw-mobilebar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    background: var(--color-night-2);
    border-top: 3px solid var(--color-ember);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body:has(.rw-primary > a:nth-child(4)) .rw-mobilebar > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  body:has(.rw-primary > a:nth-child(4)) .rw-mobilebar > .rw-bar-book {
    background: var(--color-ember);
    color: var(--color-cream);
  }
}

/* Not-found page (message, links, game slot) */
.rw-nf {
  padding-block: clamp(40px, 8vw, 88px) 0;
  text-align: center;
}
.rw-nf-title {
  margin: 10px 0 0;
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1.1;
  color: var(--color-cream);
}
.rw-nf-text {
  margin: 14px auto 0;
  max-width: 34rem;
  color: var(--color-smoke);
}
.rw-nf-links {
  margin: 24px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.rw-nf-game {
  padding-block: clamp(28px, 5vw, 56px) clamp(40px, 8vw, 88px);
}
