/* KimetsuCraft. A Taisho-era woodblock night: sumi ink, vermilion, washi paper, wisteria.
   Gold and lacquer come from the in-game HUD (tools/hud/build_hud.py). Fonts are self-hosted (fonts.css).
   site/check.py verifies --text/--muted/--gold/--gold-text on --bg/--panel/--track at >= 4.5:1. */
:root {
  --bg: #0c090b; --panel: #171113; --track: #1d1418; --line: #3d2b31;
  --text: #efe6d8; --muted: #c8bbb2; --gold: #d4af37; --gold-text: #ffe28c; --crimson: #c8283c;
  --paper: #efe6d8; --paper-ink: #1b1215; --paper-shade: #d9cdbb;
  --wisteria: #c4abf2; --indigo: #141a2e; --blood: #3a0d16; --jade: #2f6b4f;
  --display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --wrap: 70rem; --gutter: clamp(1.25rem, 4vw, 2.5rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #4a333a var(--bg); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.65 var(--sans); overflow-x: clip; }
::selection { background: var(--crimson); color: #fff; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
a { color: var(--gold-text); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: #fff3c4; text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--gold-text); color: #120e10; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.15; color: var(--text); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.5rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 3.5rem 0 .9rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin: 2rem 0 .4rem; }
p, li, dd { max-width: 62ch; text-wrap: pretty; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; margin: 0 0 1rem; }
li { margin: .3rem 0; }
li::marker { color: var(--crimson); }
code, kbd { font: .92em var(--mono); background: var(--track); padding: .12em .4em; border-radius: 3px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; }
mark.ph { background: #3d3010; color: var(--gold-text); padding: 0 .25em; border-radius: 2px; }
.muted, .meta { color: var(--muted); }
.meta { font-size: .92rem; }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--muted); }

/* header */
.top { position: relative; z-index: 5; }
.top-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 2rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font: 800 1.3rem/1 var(--display); letter-spacing: .01em; }
.brand:hover { color: var(--text); }
.brand img { height: 3rem; width: auto; margin: -.6rem 0; }
.top ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.4rem; margin: 0; padding: 0; }
.top li { margin: 0; }
.top nav a { display: block; padding: .45rem 0; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap;
  background: linear-gradient(var(--crimson), var(--crimson)) left bottom / 0 2px no-repeat; transition: background-size .35s var(--ease), color .2s; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--text); background-size: 100% 2px; }
body.page .top { border-bottom: 1px solid var(--line); background: var(--panel); }
body.doc .top, body.map-page .top { border-bottom: 1px solid var(--line); background: var(--panel); }
body.home .top { position: absolute; left: 0; right: 0; top: 0; }

/* buttons */
.btn { display: inline-block; font: 600 1rem var(--sans); background: var(--crimson); color: #fff; border: 1px solid var(--crimson); border-radius: 3px;
  padding: .65rem 1.15rem; cursor: pointer; text-decoration: none; transition: background .2s, transform .2s var(--ease); }
.btn:hover { background: #a61f30; border-color: #a61f30; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.alt { background: transparent; color: var(--text); border-color: #6a5158; }
.btn.alt:hover { background: var(--track); border-color: var(--text); }

/* ---------- home: hero ---------- */
.hero { position: relative; margin: 0 calc(-1 * var(--gutter)); min-height: clamp(38rem, 52vw, 100svh); display: flex; align-items: center; isolation: isolate;
  padding: 7rem var(--gutter) 4rem; }
@media (min-width: 75rem) { .hero { margin: 0 calc(50% - 50vw); padding-inline: max(var(--gutter), calc(50vw - var(--wrap) / 2 + var(--gutter))); } }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9rem; z-index: -1; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }
.raceme { animation: sway 7s ease-in-out calc(var(--i) * -0.9s) infinite alternate; }
@keyframes sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.petals i { position: absolute; top: -12px; width: 9px; height: 6px; border-radius: 80% 20% 80% 20%; background: var(--wisteria); opacity: 0;
  scale: var(--s); animation: fall var(--t) linear var(--d) infinite; }
@keyframes fall { 8% { opacity: .85; } 90% { opacity: .7; } 100% { transform: translate(var(--x), 105vh) rotate(540deg); opacity: 0; } }
.hero-inner { max-width: 35rem; }
.hero h1 { font-size: clamp(2.9rem, 9.4vw, 5.75rem); line-height: .98; letter-spacing: -.02em; }
.stroke { height: .6rem; width: min(100%, 23rem); margin: 1.1rem 0 1.2rem; background: url("/stroke.svg") center / 100% 100% no-repeat;
  animation: draw .9s var(--ease) .15s backwards; }
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
.tagline { font: 600 clamp(1.15rem, 2.4vw, 1.45rem)/1.35 var(--display); color: var(--text); margin: 0 0 .6rem; }
.tagline span { display: block; }
.hero-lead { color: var(--muted); max-width: 31rem; margin-bottom: 2rem; }

/* the ticket: the one sheet of paper on the page */
.ticket { display: flex; width: fit-content; max-width: 100%; color: var(--paper-ink); filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .55)); rotate: -1.2deg; }
.ticket-main, .ticket-stub { background: var(--paper); padding: 1.05rem 1.3rem 1rem; }
.ticket-main { flex: 1; min-width: 0; --notch: radial-gradient(circle 9px at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 9px at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  -webkit-mask: var(--notch); mask: var(--notch); }
.ticket-stub { --notch: radial-gradient(circle 9px at 0 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 9px at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  -webkit-mask: var(--notch); mask: var(--notch); display: grid; justify-items: center; align-content: center; gap: .35rem; padding-inline: 1.15rem;
  background-image: linear-gradient(to bottom, var(--paper-ink) 55%, transparent 0); background-size: 1.5px 9px; background-repeat: repeat-y; background-position: left; background-color: var(--paper); }
.ticket-stub p { margin: 0; font-size: .78rem; line-height: 1.25; text-align: center; letter-spacing: .04em; }
.ticket-stub strong { font: 800 1rem var(--display); letter-spacing: 0; }
.seal { width: 2.6rem; height: 2.6rem; color: var(--crimson); rotate: -9deg; }
.ticket-label { margin: 0 0 .45rem; font-size: .8rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: #5a4a4e; }
.address { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .8rem; }
.address code { font: 600 clamp(.95rem, 4.4vw, 1.4rem) var(--mono); background: none; padding: 0; color: var(--paper-ink); user-select: all; }
.ticket .btn { padding: .4rem .95rem; font-size: .92rem; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; margin: .7rem 0 0; font-size: .9rem; color: #4a3b3f; font-variant-numeric: tabular-nums; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: #8d8085; flex: none; }
.status[data-state="online"] .dot { background: #1f8a4c; }
.status[data-state="offline"] .dot { background: var(--crimson); }
.copied { color: #8a1626; font-weight: 600; }
.copied:not(:empty)::before { content: "· "; color: #4a3b3f; }
.hero-links { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin: 2rem 0 0; }
.hero-links a { color: var(--text); font-weight: 600; text-decoration-color: var(--crimson); text-decoration-thickness: 2px; }

/* ---------- home: sections ---------- */
.home section:not(.hero) { padding: clamp(3rem, 7vw, 5.5rem) 0 0; }
.home .hero + section { padding-top: clamp(1.5rem, 4vw, 3rem); }
.home h2 { margin-top: 0; font-size: clamp(1.75rem, 4.2vw, 2.75rem); }
.section-lead { font-size: 1.15rem; color: var(--muted); max-width: 46ch; margin-bottom: 2.25rem; }
.path-split { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; }
.path { position: relative; padding: clamp(1.5rem, 4vw, 2.75rem); overflow: hidden; }
.path.slayer { background: var(--indigo); color: #e6eaf5; }
.path.demon { background: var(--blood); color: #f6e3e2; }
.path h3 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; margin: 0; color: inherit; }
.path-role { margin: .3rem 0 1.2rem; font-size: .95rem; font-weight: 600; letter-spacing: .02em; }
.slayer .path-role { color: #a9b8e8; }
.demon .path-role { color: #f0a3a8; }
.path ul { list-style: none; padding: 0; margin: 0; position: relative; }
.path li { padding: .7rem 0; margin: 0; border-top: 1px solid rgb(255 255 255 / .16); max-width: 30ch; }
.path kbd { background: rgb(0 0 0 / .35); border-color: rgb(255 255 255 / .3); }
.path-art { position: absolute; right: -.75rem; bottom: 1.25rem; width: min(38%, 13rem); opacity: .42; transition: opacity .5s, transform .7s var(--ease); }
.slayer .path-art { color: #c9d4f6; }
.demon .path-art { color: #f08a92; }
.path:hover .path-art { opacity: .7; transform: translate(-6px, -4px) rotate(-3deg); }
.path-or { align-self: center; z-index: 1; margin: 0 -1.6rem; width: 3.2rem; height: 3.2rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--paper); color: var(--paper-ink); font: 800 1.05rem/1 var(--display); padding-bottom: .15em; }
.paths-foot { margin: 1.5rem 0 0; color: var(--muted); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 2rem 0 2.25rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.steps li { counter-increment: step; margin: 0; padding: 1.4rem 1.5rem 0 0; max-width: none; position: relative; }
.steps li + li { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.steps li::before { content: counter(step); display: block; font: 800 3.2rem/1 var(--display); color: var(--crimson); margin-bottom: .6rem; }
.steps h3 { margin: 0 0 .35rem; font-size: 1.25rem; font-weight: 800; }
.steps p { color: var(--muted); margin: 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; }

@media (max-width: 64rem) {
  body.home .top { position: static; background: var(--bg); }
  .hero { --banner: clamp(24rem, 62vw, 34rem); align-items: flex-start; min-height: 0; padding-top: calc(var(--banner) - 5rem); padding-bottom: 1rem; }
  .scene, .petals { height: var(--banner); }
  .hero::after { bottom: auto; top: calc(var(--banner) - 9rem); }
}
@media (max-width: 22.5rem) { .ticket-stub { display: none; } .ticket-main { -webkit-mask: none; mask: none; } .ticket { rotate: none; } }
@media (max-width: 46rem) { .top li:first-child { display: none; } /* the logo is the home link */ .top nav a { padding: .6rem 0; } }
@media (max-width: 38rem) { .top nav { width: 100%; } .top ul { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 0 1rem; } }
@media (max-width: 46rem) {
  .path-split { grid-template-columns: 1fr; }
  .path-or { margin: -1.6rem auto; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 1.2rem 0 1.4rem 4rem; border-left: 0; border-bottom: 1px solid var(--line); }
  .steps li::before { position: absolute; left: 0; top: 1.1rem; }
}

/* ---------- reading pages ---------- */
.corner { position: absolute; right: 0; top: 4.55rem; width: clamp(15rem, 27vw, 24rem); z-index: -1; overflow: hidden; pointer-events: none; display: none; }
.corner svg { display: block; width: 100%; height: auto; }
@media (min-width: 72rem) { .corner { display: block; } }
main:not(.home) { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
main:not(.home) > h1::after { content: ""; display: block; height: .45rem; width: min(60%, 15rem); margin: 1rem 0 1.6rem;
  background: url("/stroke.svg") center / 100% 100% no-repeat; }
main:not(.home) > h2 { padding-top: 1.6rem; border-top: 1px solid var(--line); }
main:not(.home) > h1 + h2 { padding-top: 0; border-top: 0; margin-top: 2.25rem; }
h2 kbd, h3 kbd { font-size: .62em; vertical-align: .18em; }
.doc > h2 { font-size: 1.45rem; }
h2[id], h3[id], tr[id] { scroll-margin-top: 1.5rem; }
.note { background: var(--panel); border: 1px solid var(--line); padding: 1rem 1.25rem; margin: 1.5rem 0; max-width: 66ch; }
.note p { margin: 0; }
.note.warn { background: var(--blood); border-color: #7a1c2b; }
.toc { margin: 1.5rem 0; padding: 1rem 0; border-block: 1px solid var(--line); max-width: 56rem; }
.toc ol { columns: 2 16rem; column-gap: 2.5rem; margin: 0; font-size: .96rem; }
.toc li { break-inside: avoid; }
.toc a { color: var(--text); text-decoration-color: #6a5158; }
.toc a:hover { text-decoration-color: var(--crimson); }
.table-wrap { overflow-x: auto; margin: 1.25rem 0 1.5rem; }
table { border-collapse: collapse; width: 100%; max-width: 62rem; font-size: .96rem; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: .7rem 1.2rem .7rem 0; }
thead th { font: 600 .85rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom-color: #6a5158; }
ol.ladder { counter-reset: rung; list-style: none; padding: 0; max-width: 34rem; }
ol.ladder li { counter-increment: rung; display: flex; gap: 1rem; align-items: baseline; padding: .6rem 0; border-top: 1px solid var(--line); margin: 0; }
ol.ladder li::before { content: counter(rung); font: 800 1.3rem var(--display); color: var(--crimson); min-width: 1.2rem; }
/* map */
.map-frame { margin: 1.75rem 0 1.25rem; border: 1px solid var(--line); background: var(--panel); height: min(72svh, 44rem); min-height: 22rem; }
.map-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
/* link lists (legal hub, store): rows, not cards */
.grid { margin: 1.5rem 0; border-top: 1px solid var(--line); max-width: 56rem; }
.card { display: grid; grid-template-columns: minmax(11rem, 17rem) 1fr; gap: .25rem 2rem; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.card h2, .card h3 { margin: 0; padding: 0; border: 0; font-size: 1.15rem; font-weight: 600; }
.card h2 a, .card h3 a { color: var(--text); text-decoration-color: var(--crimson); }
.card h2 a:hover, .card h3 a:hover { color: var(--gold-text); }
.card p { margin: 0; color: var(--muted); }
/* wide screens: section headings in a left column, their text beside them (the same rows as .card) */
@media (min-width: 64rem) {
  main:not(.home) { display: grid; grid-template-columns: 17rem minmax(0, 1fr); align-items: start; }
  main:not(.home) > * { grid-column: 1 / -1; }
  main:not(.home) > h2 ~ :not(h2) { grid-column: 2; }
  main:not(.home) > h2, main:not(.home) > h1 + h2 { grid-column: 1; position: relative; margin: 2.75rem 0 0; padding: 1.6rem 2.5rem 1.5rem 0; border-top: 0; font-size: 1.45rem; }
  main:not(.home) > h2::before { content: ""; position: absolute; left: 0; top: 0; height: 1px; background: var(--line);
    width: calc(min(100vw, var(--wrap)) - 2 * var(--gutter)); }
  main:not(.home) > h2 + * { margin-top: 2.75rem; padding-top: 1.7rem; }
  main:not(.home) > h2 + .note, main:not(.home) > h2 + .grid, main:not(.home) > h2 + .table-wrap { margin-top: 4.45rem; padding-top: 0; }
  main:not(.home) > h2 + .note { padding-top: 1rem; }
  main:not(.home) > h2 + .grid { border-top: 0; }
}
@media (max-width: 40rem) { .card { grid-template-columns: 1fr; } .toc ol { columns: 1; } }

/* footer */
.foot { margin-top: clamp(4rem, 10vw, 7rem); background: var(--panel); padding: 0 0 2.5rem; font-size: .9rem; color: var(--muted); }
.foot::before { content: ""; display: block; height: 16px; margin-bottom: 2.25rem;
  background: repeating-conic-gradient(var(--jade) 0 25%, #0b0b0b 0 50%) 0 0 / 16px 16px; }
.foot ul.legal { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.5rem; padding: 0; margin: 0 0 1.5rem; }
.foot ul.legal li { margin: 0; }
.foot ul.legal a { display: block; padding: .35rem 0; color: var(--text); font-weight: 600; text-decoration: none; }
.foot ul.legal a:hover, .foot ul.legal a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--crimson); }
.foot p { max-width: 78ch; margin: 0 0 .6rem; }
.foot p a { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .raceme, .stroke { animation: none; }
  .petals { display: none; }
  .path-art, .btn, .top nav a { transition: none; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* print: the policies are documents people keep */
@media print {
  :root { --bg: #fff; --panel: #fff; --track: #f1eee9; --line: #bbb; --text: #111; --muted: #333; --gold-text: #111; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .top nav, .corner, .foot nav, .petals, .scene, .hero-links, .cta-row, .map-frame, .skip { display: none !important; }
  .top, .foot { background: none; border: 0; }
  .foot::before { display: none; }
  .brand, h1, h2, h3, a { color: #111; }
  a { text-decoration: underline; }
  main a[href^="http"]::after, main a[href^="/"]::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; }
  h2, h3 { break-after: avoid; }
  tr, li, .note { break-inside: avoid; }
  mark.ph { background: none; border: 1px solid #999; color: #111; }
  .note { background: none; }
}
