/* rules — this page's own styles; the tokens are tokens.css, the header, footer and buttons site.css */
/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ink) var(--grain-dark); color: var(--bone); font-family: var(--f-body); font-size: var(--t-body); line-height: 1.7; overflow-x: hidden; }
/* Parchment ground — light mode only */
html:not([data-theme="dark"]) body {
  background-color: var(--ink);
  background-image:
  radial-gradient(125% 90% at 50% -8%, rgba(255,251,238,.28), transparent 58%),
  radial-gradient(110% 120% at 50% 118%, rgba(74,54,22,.045), transparent 55%),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='pm' filterUnits='userSpaceOnUse' x='0' y='0' width='600' height='600'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.01' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .30 0 0 0 0 .20 0 0 0 0 .08 0 0 0 .08 0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='gamma' amplitude='1.1' exponent='.8'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23pm)'/%3E%3C/svg%3E"),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='pg' filterUnits='userSpaceOnUse' x='0' y='0' width='200' height='200'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .22 0 0 0 0 .10 0 0 0 .022 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23pg)'/%3E%3C/svg%3E");
  background-size: cover, cover, 600px 600px, 200px 200px;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
  background-attachment: fixed, fixed, scroll, scroll;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.12; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 2px; }
/* ============ Page hero ============ */
.page-hero { position: relative; isolation: isolate; min-height: 60vh; min-height: 60svh; display: flex; align-items: center; justify-content: center; text-align: center; padding: calc(var(--header-h) + var(--s5)) 0 var(--s5); overflow: hidden; }
.page-hero-art { position: absolute; inset: 0; z-index: -2; }
.page-hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; filter: var(--grade); }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grain-dark); background-color: rgba(11, 10, 9, .5); }
.page-hero-inner { max-width: 820px; margin-inline: auto; display: flex; flex-direction: column; align-items: center; }
.page-hero .sub { font-family: var(--f-title); font-size: clamp(1rem, .9rem + .5vw, 1.25rem); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-hi); text-shadow: 0 2px 16px rgba(0,0,0,.7); margin-bottom: var(--s2); }
.page-hero h1 { font-family: var(--f-hero); font-size: clamp(2.75rem, 1.6rem + 4.5vw, 5rem); font-weight: 400; line-height: 1; letter-spacing: .01em; color: var(--on-dark); text-shadow: 0 4px 24px rgba(0,0,0,.7); }
.page-hero .lead { margin-top: var(--s3); max-width: 56ch; font-size: clamp(1.125rem, 1rem + .4vw, 1.3125rem); line-height: 1.55; color: var(--on-dark); text-shadow: 0 2px 14px rgba(0,0,0,.7); }
/* Hero divider — gilded rampart with a banner valance hung from it */
.hero-divider { position: relative; z-index: 3; margin-top: -16px; pointer-events: none; }
.hero-divider .merlons {
  height: 16px; background: linear-gradient(180deg, var(--btn-rule-color), var(--gold-hi));
  -webkit-mask: linear-gradient(#000 0 0) bottom / 100% 6px no-repeat, repeating-linear-gradient(90deg, #000 0 16px, transparent 16px 32px) top / 100% 10px no-repeat;
  mask: linear-gradient(#000 0 0) bottom / 100% 6px no-repeat, repeating-linear-gradient(90deg, #000 0 16px, transparent 16px 32px) top / 100% 10px no-repeat;
}
.hero-divider .valance {
  height: 34px; background: var(--grain-dark), linear-gradient(180deg, var(--btn-red), var(--btn-red-deep)); border-top: 2px solid var(--btn-rule-color);
  -webkit-mask: radial-gradient(circle 14px at 16px 100%, transparent 96%, #000 100%) 0 0 / 32px 100% repeat-x;
  mask: radial-gradient(circle 14px at 16px 100%, transparent 96%, #000 100%) 0 0 / 32px 100% repeat-x;
}
/* ============ Section scaffold ============ */
.section { padding-block: clamp(var(--s6), 10vw, var(--s7)); scroll-margin-top: var(--header-h); }
.section-head { max-width: 62ch; }
.section-title { font-family: var(--f-hero); font-weight: 400; font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem); letter-spacing: .01em; color: var(--bone); }
.section-standfirst { margin-top: var(--s1); font-size: 1.1875rem; line-height: 1.55; color: var(--muted); }
/* ============ Rule sections ============ */
.rules { padding-block: var(--s4) var(--s6); }
.rules-sec { padding-block: var(--s5); border-top: 1px solid var(--border); scroll-margin-top: var(--header-h); }
.rules-sec:first-child { border-top: 0; }
.rules-sec .eyebrow { display: block; font-family: var(--f-title); font-size: var(--t-xs); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--btn-red); margin-bottom: 10px; }
[data-theme="dark"] .rules-sec .eyebrow { color: var(--gold-hi); }
.rule-list { list-style: none; margin: var(--s4) 0 0; padding: 0; max-width: 880px; display: flex; flex-direction: column; gap: var(--s2); }
.rule { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s2); align-items: start; background: var(--surface); border: 1px solid var(--border); border-top: 2px solid color-mix(in oklab, var(--gold-hi) 55%, transparent); border-radius: 0 0 10px 10px; padding: var(--s3); scroll-margin-top: calc(var(--header-h) + 16px); }
.rule:target { border-color: var(--gold-hi); box-shadow: 0 0 0 1px var(--gold-hi); }
.rule-no { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 44px; padding: 0 8px; font-family: var(--f-title); font-weight: 700; font-size: 1.0625rem; color: var(--btn-on-red); text-decoration: none; text-shadow: 0 1px 2px rgba(20,4,2,.7); background: var(--btn-cloth), linear-gradient(to bottom, var(--btn-red), var(--btn-red-deep)); border-radius: 6px; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--btn-rule-color) 50%, transparent); white-space: nowrap; transition: filter var(--dur-s) var(--ease-out); }
@media (hover: hover) {
  .rule-no:hover { filter: brightness(1.12); }
}
.rule-title { font-family: var(--f-title); font-weight: 700; font-size: 1.1875rem; line-height: 1.3; color: var(--bone); padding-top: 8px; }
.rule-why { margin-top: 8px; font-size: 1.0625rem; line-height: 1.6; color: var(--muted); max-width: 68ch; }
/* Moderation — statements, not numbered rules */
.closing { margin-top: var(--s4); max-width: 880px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.closing p { font-size: 1.125rem; line-height: 1.65; color: var(--muted); max-width: 68ch; }
.closing .final { padding-top: var(--s2); border-top: 1px solid var(--border); font-family: var(--f-title); font-weight: 600; font-size: 1.1875rem; line-height: 1.45; color: var(--bone); }
/* ============ Reveal ============ */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity var(--dur-l) var(--ease-out), transform var(--dur-l) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
/* ============ Responsive ============ */
@media (max-width: 767px) {
  .rules-sec { padding-block: var(--s4); }
  .rule { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: var(--s2); }
  .rule-no { justify-self: start; }
  .rule-title { padding-top: 0; }
  .closing { padding: var(--s3) var(--s2); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
}
/* no introduction written in the control panel: no empty line under the title */
.page-hero .lead:empty { display: none; }
