/* Woodkraft policy pages and the Legal centre, on top of home.css (tokens, top bar, buttons, footer). */

.legal-page main {
  padding-top: 68px;
}

/* Long reading stays on a plain page: the drawings keep to the title band. Short status pages keep them throughout. */
.legal-page:not(.status-page)::before {
  display: none;
}

.legal-page:not(.status-page) .doc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--text);
  opacity: 0.05;
  -webkit-mask: url('doodles.svg') 0 0 / 960px 960px;
  mask: url('doodles.svg') 0 0 / 960px 960px;
}

/* ---------- Title band ---------- */

.doc-hero {
  position: relative;
  padding: 72px 0 54px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

.doc-hero-glow {
  position: absolute;
  inset: -40% 0 auto;
  height: 620px;
  z-index: -1;
  background: radial-gradient(40% 50% at 18% 30%, rgb(244 162 27 / 14%), transparent 70%);
}

.crumbs {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 13.5px;
}

.crumbs a {
  color: var(--text-2);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--gold-2);
}

.doc-title {
  display: flex;
  align-items: center;
  gap: 18px;
}

.doc-title .sym {
  flex: none;
  width: 40px;
  height: 40px;
}

.doc-hero h1 {
  font-size: clamp(36px, 5.4vw, 68px);
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.05em;
}

.doc-summary {
  max-width: 720px;
  margin-top: 22px;
  color: var(--text-2);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 13.5px;
}

.doc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.doc-meta span::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.doc-meta .pill {
  margin-left: auto;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.doc-draft {
  display: inline-block;
  margin-top: 26px;
  padding: 8px 14px;
  border: 1px dashed rgb(244 162 27 / 35%);
  border-radius: 10px;
  color: #e9c98d;
  font-size: 13px;
}

/* ---------- Reading layout ---------- */

.doc-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 720px);
  justify-content: space-between;
  gap: 60px;
  padding-top: 64px;
  padding-bottom: 40px;
}

.doc-layout.no-toc {
  grid-template-columns: minmax(0, 860px);
}

.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.toc p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
  counter-reset: t;
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 7px 0 7px 16px;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.toc a:hover {
  color: var(--text);
}

.toc a.on {
  border-left-color: var(--gold);
  color: var(--text);
}

/* ---------- The text ---------- */

.prose {
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 18px;
}

.prose h2 {
  position: relative;
  margin-top: 56px;
  padding-top: 8px;
  color: var(--text);
  font-size: clamp(22px, 2.2vw, 27px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
  scroll-margin-top: 96px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h2 small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.prose .anchor {
  position: absolute;
  left: -1.1em;
  color: var(--gold);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.prose h2:hover .anchor {
  opacity: 0.8;
}

.prose a {
  color: var(--gold-2);
  text-decoration: underline;
  text-decoration-color: rgb(255 203 107 / 35%);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--gold-2);
}

.prose strong {
  color: var(--text);
  font-weight: 650;
}

.prose ul,
.prose ol {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.prose ul li {
  position: relative;
  padding-left: 26px;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--gold);
  transform: rotate(45deg);
}

.prose ol {
  counter-reset: n;
}

.prose ol li {
  position: relative;
  padding-left: 40px;
  counter-increment: n;
}

.prose ol li::before {
  content: counter(n);
  position: absolute;
  left: 0;
  top: 0.15em;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

.prose .licence-text {
  overflow: auto;
  max-height: 420px;
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--muted);
  font: 12.5px/1.6 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  white-space: pre-wrap;
}

mark.todo {
  padding: 0 4px;
  border-radius: 4px;
  background: rgb(244 162 27 / 18%);
  color: #ffd99a;
}

/* ---------- After the text ---------- */

.doc-next {
  padding-top: 30px;
  padding-bottom: 110px;
}

.ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  padding: 34px 36px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(70% 120% at 100% 0%, rgb(244 162 27 / 12%), transparent 70%),
    var(--bg-2);
}

.ask h2 {
  font-size: 24px;
  font-weight: 700;
}

.ask p {
  margin-top: 6px;
  color: var(--muted);
}

.related-title {
  margin: 64px 0 20px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.related,
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.doc-card {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.25s,
    transform 0.25s var(--ease),
    background 0.25s;
}

.doc-card:hover {
  border-color: rgb(244 162 27 / 40%);
  background: #12141b;
  transform: translateY(-3px);
}

.doc-card .sym {
  width: 26px;
  height: 26px;
  margin-bottom: 10px;
}

.doc-card strong {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.doc-card span {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.doc-card small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Legal centre ---------- */

.hub-title {
  font-size: clamp(40px, 6.4vw, 84px);
}

.hub-body {
  padding-top: 70px;
  padding-bottom: 110px;
}

.hub-group + .hub-group {
  margin-top: 56px;
}

.hub-group h2 {
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 700;
}

.hub-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 70px;
}

.hub-facts > div {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.hub-facts h2 {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 700;
}

.hub-facts dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 12px 24px;
  margin: 0;
  font-size: 14.5px;
}

.hub-facts dt {
  color: var(--muted);
}

.hub-facts dd {
  margin: 0;
  color: var(--text-2);
}

.hub-facts a {
  color: var(--gold-2);
}

/* ---------- Status pages (after paying) ---------- */

.status {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 68px);
  padding-top: 60px;
  padding-bottom: 80px;
}

.status-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  max-width: 560px;
  padding: 48px 40px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 60% at 50% 0%, rgb(244 162 27 / 14%), transparent 70%),
    var(--bg-2);
  color: var(--text-2);
  text-align: center;
}

.status-card .sym {
  width: 44px;
  height: 44px;
}

.status-card h1 {
  color: var(--text);
  line-height: 1.08;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 750;
  letter-spacing: -0.04em;
}

.status-card strong {
  color: var(--text);
}

.status-card .pill {
  margin-top: 10px;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 980px) {
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 40px;
  }

  .toc {
    position: static;
    max-height: none;
    margin-bottom: 30px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .related,
  .hub-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .doc-hero {
    padding: 44px 0 38px;
  }

  .doc-meta .pill {
    margin-left: 0;
  }

  .prose {
    font-size: 16px;
  }

  .related,
  .hub-grid,
  .hub-facts {
    grid-template-columns: 1fr;
  }

  .hub-facts dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .hub-facts dd {
    margin-bottom: 10px;
  }

  .ask {
    padding: 26px 22px;
  }
}

/* ---------- Print: clean black on white ---------- */

@media print {
  html,
  body {
    background: #fff !important;
    color: #111 !important;
  }

  .doc-hero::before,
  .nav,
  .footer,
  .toc,
  .doc-next,
  .doc-meta .pill,
  .doc-hero-glow,
  .crumbs,
  .anchor {
    display: none !important;
  }

  .legal-page main {
    padding-top: 0;
  }

  .doc-hero {
    padding: 0 0 12px;
    border-bottom: 1px solid #ccc;
  }

  .doc-hero h1,
  .prose h2,
  .prose strong {
    color: #111 !important;
  }

  .doc-summary,
  .prose,
  .doc-meta {
    color: #333 !important;
  }

  .doc-layout {
    display: block;
    padding-top: 16px;
  }

  .prose a {
    color: #111 !important;
  }

  .doc-draft {
    border-color: #b07a10 !important;
    color: #6b4a00 !important;
  }

  .sym {
    background: #9a6200 !important;
  }

  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
