/* Shardcrown public pages (landing, news, legal): the game's "Starglass & Ink" tokens and its pixel frames
   (client/assets/art/frame, tex), on their own sheet so a visitor loads none of the game. routes/public.js serves it on
   a content-hashed URL. Desktop first; phones at <= 760px. */
:root {
  color-scheme: dark;
  --ink: #090c13; --bg: #0d1018; --bg2: #141824; --card: #1a1f2e; --card-hi: #222839; --line: #2a3145; --line-hi: #3b4560;
  --text: #e9ecf5; --muted: #9aa3bb; --faint: #5d6680;
  --glass: #7ef0ff; --glass-ink: #1d7487; --ember: #f5b94a; --shard: #b59cff; --good: #5fd38d; --bad: #ff7a72;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Liberation Sans", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "DejaVu Serif", serif;
  --frame-card: url(/assets/art/frame/card.png); --frame-button: url(/assets/art/frame/button.png); --frame-primary: url(/assets/art/frame/primary.png);
  --wrap: 1180px;
  font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55;
}
* { box-sizing: border-box; }
body.pub { margin: 0; min-height: 100dvh; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, #1a2238 0%, transparent 70%), radial-gradient(ellipse 60% 40% at 100% 100%, #1a1430 0%, transparent 70%), var(--bg); }
a { color: var(--glass); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .6rem; letter-spacing: .01em; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pub-muted { color: var(--muted); }
.small { font-size: .85rem; }
:focus-visible { outline: 2px solid var(--glass); outline-offset: 2px; }

/* buttons: carved stone (ghost) and starglass (primary) pixel frames */
.pub-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1.1rem; font: inherit; font-weight: 650; color: var(--text);
  background: var(--card-hi); border: 6px solid transparent; border-image: var(--frame-button) 6 / 6px repeat; image-rendering: pixelated; cursor: pointer; white-space: nowrap; }
.pub-btn.primary { color: #fff; background: linear-gradient(180deg, #24889d, var(--glass-ink)); border-image-source: var(--frame-primary); }
.pub-btn:hover { text-decoration: none; filter: brightness(1.15); }
.pub-btn.big { font-size: 1.1rem; padding: .75rem 1.5rem; }
.pub-btn.ghost { background: #0d1018cc; }

/* top bar */
.pub-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem max(1rem, calc((100% - var(--wrap)) / 2));
  background: #090c13e6; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.pub-brand { display: flex; align-items: center; gap: .55rem; }
.pub-brand img { image-rendering: pixelated; display: block; }
.pub-word { height: 28px; width: auto; }
.pub-nav { display: flex; align-items: center; gap: .9rem; }
.pub-nav > a:not(.pub-btn) { color: var(--muted); font-weight: 600; }
.pub-nav > a[aria-current], .pub-nav > a:not(.pub-btn):hover { color: var(--text); }
.pub-nav .pub-btn { padding: .35rem .8rem; font-size: .92rem; }

/* hero: a crossfading slideshow of the staged shots behind the pitch */
.hero { position: relative; min-height: min(86vh, 760px); display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
.hero-slides { position: absolute; inset: 0; z-index: -1; background: #05070c; }
.hero-slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: 0;
  animation: heroFade calc(var(--n) * 7s) infinite; animation-delay: calc(var(--i) * 7s); }
.hero-slides img:first-child { opacity: 1; }
.hero-slides::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #090c1300 30%, #090c13c0 65%, #090c13 100%), linear-gradient(90deg, #090c13d0 0%, #090c1340 55%, #090c1300 100%); }
@keyframes heroFade { 0% { opacity: 0; transform: scale(1.04); } 4%, 25% { opacity: 1; } 30%, 100% { opacity: 0; transform: scale(1); } }
.hero-slides img:first-child { animation-name: heroFirst; }
@keyframes heroFirst { 0%, 25% { opacity: 1; } 30%, 96% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero-slides img { animation: none; } .hero-slides img:not(:first-child) { display: none; } }
.hero-in { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 4rem 1.25rem 3rem; }
.hero h1 { margin: 0 0 .4rem; }
.hero-word { width: min(520px, 90%); height: auto; image-rendering: pixelated; filter: drop-shadow(0 4px 18px #000c); }
.hero-tag { font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.8rem); margin: 0 0 .7rem; color: #fff; text-shadow: 0 2px 10px #000; }
.hero-pitch { max-width: 620px; font-size: 1.08rem; color: #d6dbea; text-shadow: 0 1px 6px #000; margin: 0 0 1.4rem; }
.hero-pitch b { color: var(--ember); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-pts { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; list-style: none; padding: 0; margin: 1.4rem 0 0; color: var(--muted); font-size: .92rem; }
.hero-pts li::before { content: '✦ '; color: var(--glass); }

/* waitlist */
.waitlist { max-width: 560px; padding: 1rem 1.1rem; background: #0d1018e0; border: 14px solid transparent; border-image: var(--frame-card) 14 repeat; image-rendering: auto; }
.wl-lead { margin: 0 0 .6rem; }
.wl-row { display: flex; gap: .5rem; }
.wl-row input { flex: 1; min-width: 0; font: inherit; padding: .6rem .7rem; border-radius: 6px; border: 1px solid var(--line-hi); background: var(--ink); color: var(--text); }
.wl-consent { display: flex; gap: .5rem; align-items: flex-start; margin-top: .6rem; font-size: .85rem; color: var(--muted); }
.wl-consent input { margin-top: .2rem; }
.wl-msg { margin: .5rem 0 0; min-height: 1.2em; font-size: .9rem; }
.wl-msg.good { color: var(--good); } .wl-msg.bad { color: var(--bad); }

/* features: big framed shots with short captions, alternating sides */
.feats { max-width: var(--wrap); margin: 0 auto; padding: 4rem 1.25rem 1rem; display: grid; gap: 4.5rem; }
.feat { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2.5rem; align-items: center; }
.feat.flip .shot { order: 2; }
.shot { margin: 0; position: relative; background: #05070c; border: 14px solid transparent; border-image: var(--frame-card) 14 repeat; box-shadow: 0 24px 60px #000d; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; image-rendering: pixelated; }
.feat-tag { margin: 0 0 .3rem; color: var(--glass); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.feat h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.feat-txt p:last-child { color: #c9cfdf; font-size: 1.05rem; }

/* gallery: a swipeable strip */
.gallery { max-width: var(--wrap); margin: 0 auto; padding: 4rem 1.25rem 0; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: min(46%, 520px); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .8rem; scrollbar-color: var(--line-hi) transparent; }
.strip figure { margin: 0; scroll-snap-align: start; background: #05070c; border: 14px solid transparent; border-image: var(--frame-card) 14 repeat; }
.strip img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; image-rendering: pixelated; }
.strip figcaption { padding: .5rem .2rem 0; color: var(--muted); font-size: .9rem; }

/* sections, news cards */
.pub-sec { max-width: var(--wrap); margin: 0 auto; padding: 4rem 1.25rem 0; }
.sec-h { font-size: 1.6rem; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pub-card { position: relative; background: linear-gradient(180deg, #ffffff06, transparent 120px), url(/assets/art/tex/parchment.png) 0 0 / 128px 128px repeat, var(--card);
  border: 14px solid transparent; border-image: var(--frame-card) 14 repeat; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; margin-top: 1rem; }
.news-card { display: flex; flex-direction: column; }
.news-img { display: block; background: #05070c; }
.news-img img { display: block; width: 100%; aspect-ratio: 16 / 8; object-fit: cover; image-rendering: pixelated; }
.news-txt { padding: .8rem .9rem 1rem; }
.news-txt h3 { font-size: 1.2rem; }
.news-txt h3 a { color: var(--text); }
.news-txt p:last-child { margin: 0; color: var(--muted); }
.news-meta { margin: 0 0 .4rem; font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cat { display: inline-block; padding: .05rem .5rem; border-radius: 4px; font-weight: 700; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; background: #16303b; color: var(--glass); }
.cat-update { background: #2a2146; color: var(--shard); }
.cat-event { background: #2c2312; color: var(--ember); }
.cat-maintenance { background: #2a1a1c; color: var(--bad); }
.pin { color: var(--ember); font-weight: 700; }
.news-card.big { flex-direction: row; }
.news-card.big .news-img { flex: 0 0 34%; }
.news-card.big .news-img img { height: 100%; aspect-ratio: auto; min-height: 150px; }
.join { text-align: center; padding-bottom: 1rem; }
.join .hero-cta { justify-content: center; }
.join > p { color: var(--muted); }

/* news list / post / legal */
.pub-main { width: 100%; max-width: 860px; margin: 0 auto; padding: 2.2rem 1.25rem 0; flex: 1; }
.page-h h1 { font-size: 2.2rem; }
.cats, .tags, .legal-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.cats a, .tags a, .legal-nav a { padding: .25rem .7rem; border: 1px solid var(--line-hi); border-radius: 999px; color: var(--muted); font-size: .9rem; }
.cats a[aria-current], .tags a[aria-current], .legal-nav a[aria-current] { color: #fff; border-color: var(--glass); background: #16303b; }
.news-list { display: grid; gap: 1.2rem; }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 1.5rem 0; color: var(--muted); }
.crumbs { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem; }
.post-card { padding: 1.4rem 1.6rem 1.6rem; }
.post-card h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.post-lead { font-size: 1.12rem; color: #c9cfdf; }
.post-img { margin: 1rem -1.6rem; background: #05070c; }
.post-img img { display: block; width: 100%; max-height: 420px; object-fit: cover; image-rendering: pixelated; }
.md { font-size: 1.03rem; }
.md h2 { font-size: 1.5rem; margin-top: 1.6rem; }
.md h3 { font-size: 1.22rem; margin-top: 1.4rem; color: #fff; }
.md img { display: block; margin: 1rem auto; image-rendering: pixelated; border: 1px solid var(--line); }
.md code { background: var(--ink); padding: .05rem .35rem; border-radius: 4px; font-size: .92em; }
.md blockquote { margin: 1rem 0; padding: .2rem 1rem; border-left: 3px solid var(--glass); color: #c9cfdf; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.md li { margin: .25rem 0; }
.md-table { overflow-x: auto; margin: 1rem 0; }
.md table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.md th, .md td { text-align: left; vertical-align: top; padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
.md th { color: var(--glass); font-weight: 700; }
.more { margin-top: 2.5rem; }
.msg { text-align: center; padding: 2.5rem 1.5rem; }
mark.ph { background: #4a3510; color: var(--ember); padding: 0 .3rem; border-radius: 3px; font-weight: 700; }
.draft-note { margin: 0 0 1rem; padding: .7rem 1rem; border: 1px dashed var(--ember); border-radius: 8px; background: #2c2312; color: #f3dba6; font-size: .92rem; }
.staff-only, .staff-note { margin-top: .5rem; padding: .6rem .8rem; border-radius: 6px; background: #3a1d1d; color: #ffd0cc; font-size: .88rem; }
.staff-note { margin: 0 0 1rem; }

/* footer */
.pub-foot { margin-top: 5rem; border-top: 1px solid var(--line); background: #090c13; padding: 2rem 1.25rem 1.5rem; }
.pub-foot-in { max-width: var(--wrap); margin: 0 auto; display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.pub-foot-in img { image-rendering: pixelated; }
.pub-foot-in > div { max-width: 420px; }
.pub-foot nav { display: grid; grid-template-columns: repeat(2, auto); gap: .4rem 2rem; align-content: start; }
.pub-foot nav a { color: var(--muted); }
.pub-copy { max-width: var(--wrap); margin: 1.5rem auto 0; color: var(--faint); font-size: .82rem; }

@media (max-width: 760px) {
  .pub-top { padding: .45rem .75rem; }
  .pub-brand .pub-word { display: none; }
  .pub-nav { gap: .6rem; }
  .pub-nav .pub-btn { padding: .3rem .6rem; font-size: .85rem; }
  .hero { min-height: 92vh; }
  .hero-in { padding: 3rem 1rem 2rem; }
  .hero-slides::after { background: linear-gradient(180deg, #090c1360 0%, #090c13c4 38%, #090c13 92%); }
  .feats { gap: 3rem; padding-top: 2.5rem; }
  .feat { grid-template-columns: 1fr; gap: 1rem; }
  .feat.flip .shot { order: 0; }
  .shot { margin: 0 -.5rem; }
  .strip { grid-auto-columns: 86%; }
  .news-card.big { flex-direction: column; }
  .news-card.big .news-img img { aspect-ratio: 16 / 8; min-height: 0; }
  .wl-row { flex-direction: column; }
  .post-card { padding: 1rem 1rem 1.2rem; }
  .post-img { margin: 1rem -1rem; }
  .pub-foot nav { grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
}

/* Marketing analytics: the cookie banner (client/consent.js, imported by site.js; the same rules as client/styles.css).
   Reject and Accept are the same button: neither is the "easy" one. */
.cc-banner { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9000;
  width: min(640px, calc(100% - 24px)); background: var(--card); color: var(--text); border: 1px solid var(--line-hi); border-radius: 8px;
  box-shadow: 0 12px 40px #000a; font-size: .92rem; line-height: 1.45; }
.cc-in { padding: 14px 16px; }
.cc-banner p { margin: 0 0 8px; }
.cc-title { font-size: 1rem; }
.cc-text a { color: var(--glass); }
.cc-cats { display: grid; gap: 8px; margin: 4px 0 10px; }
.cc-cat { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.cc-cat { margin: 0; color: var(--text); font-size: inherit; }
.cc-cat input { width: auto; margin: 3px 0 0; padding: 0; flex: none; }
.cc-cat span { flex: 1; }
.cc-cat input:disabled + span { opacity: .85; }
.cc-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cc-btn { flex: 1 1 160px; min-height: 40px; padding: 8px 14px; font: inherit; font-weight: 650; color: var(--text); background: var(--card-hi);
  border: 1px solid var(--line-hi); border-radius: 6px; cursor: pointer; }
.cc-btn:hover { background: var(--line); }
.cc-btn[hidden], .cc-link[hidden], .cc-cats[hidden] { display: none; }
.cc-link { background: none; border: 0; padding: 4px 2px; color: var(--glass); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .cc-banner { bottom: max(10px, env(safe-area-inset-bottom)); font-size: .88rem; }
  .cc-btn { flex-basis: 100%; }
}
