/* Dreadmark site, shared design system (direction A "Reliquary", 2026-10-04).
   Loaded by every page: home, how-its-made, devlog (generated), wiki (generated), ladder.
   Colours are the game's own menu palette (UiChrome.cs); fonts are the game's own
   (Cinzel headings, Alegreya Sans text). Page-specific styles live with each page. */

@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/assets/fonts/cinzel-var-latin.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/alegreya-sans-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/alegreya-sans-400-italic-latin.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/alegreya-sans-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/alegreya-sans-700-latin.woff2") format("woff2"); }

:root {
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --font-display: "Cinzel", Georgia, serif;
  --font-text: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs-sm: 1rem; --fs-base: 1.1875rem; --fs-lg: 1.375rem; --fs-xl: 1.75rem;
  --fs-2xl: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); --fs-3xl: clamp(2.3rem, 1.6rem + 2.6vw, 3.4rem);
  /* UiChrome.cs */
  --bg: #0e0c0b; --bg-2: #151210; --surface: #1a1715; --line: #47423d; --line-soft: #2c2825;
  --text: #e0dbd4; --text-2: #bdb8ae; --muted: #a9a49b; --bone: #c9c4bc;
  --accent: #7e3b35; --accent-text: #d4806f; --accent-well: #331a17; --coin: #e6c76b;
  --btn-fill: #5a2520; --btn-border: #c0675b; --btn-text: #fbede8;
  --frame-corner: #a26a5e;
  /* item rarity colours, as in the game */
  --r-normal: #c9c4bc; --r-magic: #7aa2ff; --r-rare: #ffd75e; --r-unique: #e0803a;
  --r: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-text); font-size: var(--fs-base); line-height: 1.6; -webkit-font-smoothing: antialiased; }
body::after { /* light film grain over everything, never in the way of clicks */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.15; text-wrap: balance; letter-spacing: .02em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--coin); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--s-5); }
.narrow { max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 200; background: var(--btn-fill); color: var(--btn-text); padding: 10px 16px; }
.skip:focus { top: 12px; }

/* ornament: a cross between two diamonds on a hairline */
.orn { display: block; width: 220px; height: 16px; margin: 0 auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 16'%3E%3Cpath d='M0 8h88M132 8h88' stroke='%23a26a5e'/%3E%3Cpath d='M95 8l4-4 4 4-4 4zM117 8l4-4 4 4-4 4z' fill='%23a26a5e'/%3E%3Cpath d='M110 0v16M104 5h12' stroke='%23a26a5e' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat; }
.section-head { text-align: center; margin-bottom: var(--s-7); }
.section-head .orn { margin-bottom: var(--s-4); }
.section-head p { color: var(--text-2); margin: var(--s-4) auto 0; max-width: 58ch; }

/* buttons: the game's primary button, lit */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 26px;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: .08em; text-decoration: none; cursor: pointer;
  border-radius: var(--r); border: 1px solid var(--line); color: var(--text); background: rgb(20 17 15 / .75); transition: border-color .15s, background-color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--bone); }
.btn-primary { color: var(--btn-text); border-color: var(--btn-border); background: linear-gradient(180deg, #7a3129, var(--btn-fill)); box-shadow: inset 0 1px 0 rgb(255 220 200 / .18), 0 0 28px rgb(192 103 91 / .25); }
.btn-primary:hover { border-color: #e39a8d; box-shadow: inset 0 1px 0 rgb(255 220 200 / .25), 0 0 36px rgb(192 103 91 / .4); }
.i-steam { display: inline-block; width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.98 0C5.7 0 .55 4.86.06 11.02l6.43 2.66a3.38 3.38 0 0 1 1.92-.6h.19l2.86-4.15v-.06a4.52 4.52 0 1 1 4.52 4.52h-.1l-4.08 2.91c0 .05.01.1.01.16a3.39 3.39 0 0 1-6.71.68L.4 15.21A12 12 0 1 0 11.98 0zM7.54 18.21l-1.47-.61a2.54 2.54 0 1 0 1.39-3.47l1.52.63a1.87 1.87 0 1 1-1.44 3.45zm11.4-9.28a3.01 3.01 0 1 0-3.01 3.01 3.01 3.01 0 0 0 3.01-3.01zm-5.27-.01a2.26 2.26 0 1 1 2.26 2.26 2.26 2.26 0 0 1-2.26-2.26z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.98 0C5.7 0 .55 4.86.06 11.02l6.43 2.66a3.38 3.38 0 0 1 1.92-.6h.19l2.86-4.15v-.06a4.52 4.52 0 1 1 4.52 4.52h-.1l-4.08 2.91c0 .05.01.1.01.16a3.39 3.39 0 0 1-6.71.68L.4 15.21A12 12 0 1 0 11.98 0zM7.54 18.21l-1.47-.61a2.54 2.54 0 1 0 1.39-3.47l1.52.63a1.87 1.87 0 1 1-1.44 3.45zm11.4-9.28a3.01 3.01 0 1 0-3.01 3.01 3.01 3.01 0 0 0 3.01-3.01zm-5.27-.01a2.26 2.26 0 1 1 2.26 2.26 2.26 2.26 0 0 1-2.26-2.26z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* frames: iron corners drawn with eight gradient strokes */
.frame { position: relative; padding: 7px; background:
  linear-gradient(var(--frame-corner), var(--frame-corner)) top left / 18px 1px no-repeat,
  linear-gradient(var(--frame-corner), var(--frame-corner)) top left / 1px 18px no-repeat,
  linear-gradient(var(--frame-corner), var(--frame-corner)) top right / 18px 1px no-repeat,
  linear-gradient(var(--frame-corner), var(--frame-corner)) top right / 1px 18px no-repeat,
  linear-gradient(var(--frame-corner), var(--frame-corner)) bottom left / 18px 1px no-repeat,
  linear-gradient(var(--frame-corner), var(--frame-corner)) bottom left / 1px 18px no-repeat,
  linear-gradient(var(--frame-corner), var(--frame-corner)) bottom right / 18px 1px no-repeat,
  linear-gradient(var(--frame-corner), var(--frame-corner)) bottom right / 1px 18px no-repeat,
  var(--bg-2);
  outline: 1px solid var(--line-soft); outline-offset: -4px; }
.frame img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: linear-gradient(180deg, rgb(8 7 6 / .96), rgb(8 7 6 / .9)); border-bottom: 1px solid var(--line-soft); }
.hdr { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 76px; gap: var(--s-5); }
.hdr nav ul { display: flex; gap: var(--s-1); list-style: none; margin: 0; padding: 0; }
.hdr nav a { display: block; padding: 10px 12px; color: var(--text-2); text-decoration: none; font-family: var(--font-display); font-size: .95rem; letter-spacing: .06em; }
.hdr nav a:hover, .hdr nav a[aria-current="page"] { color: var(--text); }
.hdr nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--btn-border); text-underline-offset: 8px; }
.hdr .right { display: flex; justify-content: flex-end; align-items: center; gap: var(--s-3); }
.crest { display: block; width: 52px; }
.crest img { filter: drop-shadow(0 0 12px rgb(200 60 30 / .35)); }
.hdr .btn { min-height: 44px; padding: 8px 18px; font-size: .9rem; }
.menu-btn { display: none; }
.mobile-nav { display: none; }
@media (max-width: 1020px) {
  .hdr { grid-template-columns: auto 1fr auto; }
  .hdr .left, .hdr .right nav { display: none; }
  .crest { order: -1; }
  .menu-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; background: none; border: 1px solid var(--line); color: var(--text); font-family: var(--font-display); font-size: .95rem; letter-spacing: .06em; cursor: pointer; }
  .mobile-nav.open { display: block; border-top: 1px solid var(--line-soft); padding: var(--s-3) 0 var(--s-5); }
  .mobile-nav a { display: block; padding: 12px var(--s-5); color: var(--text); text-decoration: none; font-family: var(--font-display); letter-spacing: .06em; border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 560px) { .hdr .btn .long { display: none; } }

/* ---------- sections ---------- */
.section { padding-block: var(--s-10); position: relative; }
.section.glow::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 45% at 50% 0%, rgb(150 70 40 / .10), transparent 70%); }
.section.dark { background: var(--bg-2); border-block: 1px solid var(--line-soft); }
@media (max-width: 700px) { .section { padding-block: var(--s-8); } }

/* page hero for inner pages (devlog, wiki, ladder, how it's made) */
.page-hero { padding-block: var(--s-9) var(--s-7); text-align: center; border-bottom: 1px solid var(--line-soft);
  background: radial-gradient(60% 100% at 50% 0%, rgb(150 70 40 / .12), transparent 70%), var(--bg-2); }
.page-hero .orn { margin-bottom: var(--s-4); }
.page-hero h1 { font-size: var(--fs-3xl); }
.page-hero .kicker { font-family: var(--font-display); color: var(--coin); letter-spacing: .14em; font-size: .95rem; margin-bottom: var(--s-3); }
.page-hero .kicker a { color: inherit; text-decoration: none; }
.page-hero p.lead { margin: var(--s-4) auto 0; max-width: 60ch; color: var(--text-2); }
.page-hero p.meta { margin-top: var(--s-3); color: var(--muted); font-size: var(--fs-sm); }

.page-hero + .section { padding-top: var(--s-8); }

/* long-form text (devlog entries, how it's made) */
.prose { font-size: 1.15rem; line-height: 1.7; color: var(--text-2); }
.prose > * + * { margin-top: var(--s-5); }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: var(--fs-xl); color: var(--text); margin-top: var(--s-8); }
.prose h3 { font-size: var(--fs-lg); color: var(--text); margin-top: var(--s-6); }
.prose strong { color: var(--text); font-weight: 700; }
.prose em { color: var(--bone); }
.prose ul { padding-left: 1.2em; display: grid; gap: var(--s-2); }
.prose li::marker { color: var(--frame-corner); }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface); border: 1px solid var(--line-soft); padding: .08em .4em; color: var(--accent-text); }
.prose figure { margin-inline: 0; }
.prose figure .frame img, .prose figure video { width: 100%; height: auto; }
.prose figcaption { margin-top: var(--s-3); color: var(--muted); font-style: italic; font-size: 1rem; text-align: center; }

/* devlog cards (homepage teaser + devlog index) */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
.post { text-decoration: none; color: inherit; display: block; }
.post .frame { aspect-ratio: 16 / 9; padding: 5px; }
.post .meta { margin-top: var(--s-4); color: var(--muted); font-size: var(--fs-sm); }
.post h3 { margin-top: 4px; font-size: 1.3rem; color: var(--text); }
.post:hover h3 { color: var(--accent-text); }
.post p { margin-top: var(--s-2); color: var(--text-2); font-size: 1.05rem; }
.center-link { text-align: center; margin-top: var(--s-7); }
@media (max-width: 900px) { .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .posts { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #090807; padding-block: var(--s-8) var(--s-6); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s-6); }
.foot-brand img { width: 220px; }
.foot-brand p { margin-top: var(--s-4); color: var(--muted); font-size: var(--fs-sm); max-width: 34ch; }
.site-footer h2 { font-size: .95rem; letter-spacing: .1em; color: var(--bone); }
.site-footer ul { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: 6px; }
.site-footer ul a { color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); }
.site-footer ul a:hover { color: var(--text); text-decoration: underline; }
.legal { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 120; display: none; place-items: center; padding: 4vmin; background: rgb(6 5 5 / .94); }
.lb.open { display: grid; }
.lb img { max-height: 84vh; width: auto; border: 1px solid var(--line); }
.lb-close { position: absolute; top: 16px; right: 16px; min-width: 48px; min-height: 48px; background: var(--bg); color: var(--text); border: 1px solid var(--line); font: 600 1rem var(--font-text); cursor: pointer; }
.lb p { margin-top: 12px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
