/* Shared Section site chrome: header, footer, download button and CTA block.
   Generators and Astro pages render the same partials in shared/partials/,
   so every page gets the home page's header with Download free in it. */

/* Inter served from this site (latin, variable weight; OFL, see /fonts/). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght.woff2") format("woff2");
}

:root {
  --sx-bg: #07090e;
  --sx-ink: #f5f7fa;
  --sx-ink-muted: #8b95a8;
  --sx-line: rgba(255, 255, 255, 0.07);
  --sx-accent: oklch(0.48 0.18 255);
  --sx-accent-hover: oklch(0.54 0.18 255);
  --sx-accent-ink: oklch(0.74 0.14 255);
  --sx-accent-soft: oklch(0.60 0.20 255 / 0.14);
  --sx-accent-line: oklch(0.60 0.20 255 / 0.32);
  --sx-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sx-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --sx-width: 1240px;
  --sx-gutter: 32px;
}

/* Download button: Section blue, the same everywhere (GRIT's button-primary). */

a.section-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  min-height: 44px;
  margin: 0;
  padding: 11px 18px;
  border: 1px solid oklch(0.62 0.18 255 / 0.55);
  border-radius: 999px;
  background: var(--sx-accent);
  color: #fff;
  font-family: var(--sx-sans);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 30px oklch(0.48 0.18 255 / 0.28);
}

a.section-dl-btn:hover {
  background: var(--sx-accent-hover);
  color: #fff;
  text-decoration: none;
}

a.section-dl-btn:active {
  background: oklch(0.44 0.18 255);
}

a.section-dl-btn:focus-visible {
  outline: 2px solid var(--sx-accent-ink);
  outline-offset: 3px;
}

.section-dl {
  grid-column: 1 / -1;
  box-sizing: border-box;
  margin: 28px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--sx-accent-line);
  border-radius: 24px;
  background: var(--sx-accent-soft);
}

.section-dl .section-dl-line {
  margin: 0 0 14px;
  color: var(--sx-ink);
  font-family: var(--sx-sans);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

a.section-dl-textlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 4px;
  color: var(--sx-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Header: the home page's bar, sticky, with Download free on the right. */

.sx-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  margin: 0;
  padding: 0;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(7, 9, 14, 0.82);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid var(--sx-line);
  font-family: var(--sx-sans);
}

.sx-header-inner,
.sx-footer-inner {
  box-sizing: border-box;
  max-width: var(--sx-width);
  margin: 0 auto;
  padding: 0 var(--sx-gutter);
}

.sx-header-inner {
  position: relative;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 22px;
}

a.sx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--sx-ink);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-decoration: none;
}

a.sx-brand img {
  display: block;
  width: 34px;
  height: 34px;
}

.sx-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 550;
}

.sx-links a {
  color: var(--sx-ink-muted);
  text-decoration: none;
}

.sx-links a:hover {
  color: var(--sx-ink);
}

.sx-header a.sx-header-btn {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 14px;
}

/* Three-bar menu: phones only. <details> opens and closes it without script. */

.sx-menu {
  display: none;
}

.sx-menu summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border-radius: 10px;
  color: var(--sx-ink);
  cursor: pointer;
  list-style: none;
}

.sx-menu summary::-webkit-details-marker {
  display: none;
}

.sx-menu summary:focus-visible {
  outline: 2px solid var(--sx-accent-ink);
  outline-offset: 2px;
}

.sx-bars {
  display: grid;
  gap: 5px;
  width: 22px;
}

.sx-bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.sx-menu[open] .sx-bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.sx-menu[open] .sx-bars span:nth-child(2) {
  opacity: 0;
}

.sx-menu[open] .sx-bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sx-header .sx-menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  padding: 6px var(--sx-gutter) 16px;
  background: var(--sx-bg);
  border-bottom: 1px solid var(--sx-line);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.45);
}

.sx-menu-panel a {
  display: flex;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--sx-line);
  color: var(--sx-ink-muted);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.sx-menu-panel a:last-child {
  border-bottom: 0;
}

.sx-menu-panel a:hover,
.sx-menu-panel a:focus-visible {
  color: var(--sx-ink);
}

@media (prefers-reduced-motion: reduce) {
  .sx-bars span {
    transition: none;
  }
}

/* Footer */

.sx-footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  padding: 28px 0 42px;
  border-top: 1px solid var(--sx-line);
  color: var(--sx-ink-muted);
  font-family: var(--sx-sans);
  font-size: 14px;
}

.sx-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
}

.sx-footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.sx-footer a {
  color: inherit;
  text-decoration: none;
}

.sx-footer a:hover {
  color: var(--sx-ink);
}

/* Reference pages (offences, mnemonics, hubs): the home page's type and
   colour. Same width, heavy sans headline, muted mono eyebrow, blue accents. */

body.sx-ref {
  background:
    radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.2), transparent 34rem),
    var(--sx-bg);
}

.sx-ref main .container,
.sx-ref main .wrap,
.sx-ref main.wrap {
  box-sizing: border-box;
  width: auto;
  max-width: var(--sx-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--sx-gutter);
  padding-right: var(--sx-gutter);
}

.sx-ref h1 {
  font-family: var(--sx-sans);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.02;
  text-wrap: balance;
}

/* Keep anchor targets and the sticky contents card clear of the header. */
.sx-ref [id] {
  scroll-margin-top: 88px;
}

.sx-ref .toc {
  top: 92px;
}

.sx-ref .eyebrow {
  font-family: var(--sx-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--sx-ink-muted);
}

.sx-ref .ptp-list strong,
.sx-ref .letter b {
  color: var(--sx-accent-ink);
}

@media (max-width: 880px) {
  :root {
    --sx-gutter: 24px;
  }

  .sx-links {
    display: none;
  }

  .sx-menu {
    display: block;
  }

  .sx-header-inner {
    min-height: 60px;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  :root {
    --sx-gutter: 16px;
  }

  .section-dl {
    padding: 18px 16px;
  }
}
