/* Shattered Pact — Ghost theme sharing the forum's dark/gold WoW header.
   Palette lifted from the Flarum forum: gold #c9a24d, slate #262c39. */
:root {
    --sp-gold: #c9a24d;
    --sp-gold-soft: #e3c983;
    --sp-dark: #262c39;
    --sp-darker: #1b2029;
    --sp-header: #20252f;
    --sp-ink: #2a2f3a;
    --sp-ink-soft: #5c6472;
    --sp-bg: #ead8c1;      /* old-school parchment */
    --sp-card: #f7efe0;    /* warm cream card on the parchment */
    --sp-line: #e7e4dd;
    --sp-shadow: 0 18px 40px -26px rgba(20, 24, 34, .5);
    --sp-serif: "Cinzel", Georgia, "Times New Roman", serif;
    --sp-sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--sp-sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--sp-ink);
    background: var(--sp-bg);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.sp-shell { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.sp-shell--narrow { max-width: 720px; }

/* ---------- header (shared with the forum look) ---------- */
.sp-header {
    position: sticky; top: 0; z-index: 40;
    background: var(--sp-dark);
    border-bottom: 1px solid rgba(201, 162, 77, .35);
    box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
    overflow: visible;
}
.sp-header__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 68px; }
.sp-brand { justify-self: center; align-self: center; }
/* oversized overhanging logo, matching the forum's bespoke header (106px on a 68px bar) */
.sp-brand__logo { height: 106px; max-height: none; width: auto; margin-bottom: -38px; position: relative; z-index: 2; display: block; }
.sp-nav { display: flex; align-items: center; gap: 6px; }
.sp-nav--left { justify-self: start; }
.sp-nav--right { justify-self: end; }
.sp-nav__link {
    color: #d6dae2; font-weight: 600; font-size: 14px; letter-spacing: .01em;
    padding: 8px 12px; border-radius: 8px; transition: color .15s, background .15s;
}
.sp-nav__link:hover { color: var(--sp-gold-soft); background: rgba(255, 255, 255, .05); }

.sp-btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 14px; letter-spacing: .01em;
    color: var(--sp-darker); background: linear-gradient(180deg, var(--sp-gold-soft), var(--sp-gold));
    padding: 9px 16px; border-radius: 9px;
    box-shadow: 0 8px 18px -10px rgba(201, 162, 77, .8);
    transition: transform .12s, box-shadow .12s;
}
.sp-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -10px rgba(201, 162, 77, .9); }
.sp-btn--lg { font-size: 15px; padding: 12px 22px; }

/* ---------- hero (home) ---------- */
.sp-hero {
    /* the forum's own hero image, tinted with its dark -> purple gradient (c1/c2) for legible text */
    background:
        linear-gradient(135deg, rgba(13, 15, 21, .72), rgba(42, 31, 61, .74)),
        url('https://community.shatteredpact.com/assets/sp-hero-main.jpg') center / cover no-repeat;
    color: #eef1f6; text-align: center; padding: 92px 0 84px;
    border-bottom: 1px solid rgba(201, 162, 77, .35);
}
.sp-hero__title {
    font-family: var(--sp-serif); font-weight: 700; letter-spacing: .04em;
    font-size: clamp(34px, 6vw, 54px); margin: 0 0 12px; color: var(--sp-gold-soft);
    text-shadow: 0 2px 20px rgba(201, 162, 77, .25);
}
.sp-hero__desc { max-width: 620px; margin: 0 auto 26px; color: #c3c9d4; font-size: 18px; }

/* ---------- post feed ---------- */
.sp-main { min-height: 60vh; }
.sp-feed {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 26px; padding: 46px 0;
}
.sp-card {
    background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: 16px;
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.sp-card:hover { transform: translateY(-3px); box-shadow: var(--sp-shadow); border-color: rgba(201, 162, 77, .5); }
.sp-card__img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--sp-dark); }
.sp-card__img img { width: 100%; height: 100%; object-fit: cover; }
.sp-card__body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.sp-card__title { font-family: var(--sp-serif); font-weight: 600; font-size: 21px; line-height: 1.28; margin: 0; }
.sp-card__title a:hover { color: var(--sp-gold); }
.sp-card__excerpt { margin: 0; color: var(--sp-ink-soft); font-size: 15px; line-height: 1.6; }

.sp-tag {
    align-self: flex-start; text-transform: uppercase; letter-spacing: .08em;
    font-size: 11px; font-weight: 700; color: var(--sp-gold);
    background: rgba(201, 162, 77, .12); padding: 4px 10px; border-radius: 999px;
}
.sp-meta { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--sp-ink-soft); }
.sp-meta__author { font-weight: 600; color: var(--sp-ink); }
.sp-meta__author::after { content: "·"; margin-left: 10px; color: var(--sp-line); }

/* ---------- single post ---------- */
.sp-article__head { padding: 52px 0 20px; }
.sp-article__title { font-family: var(--sp-serif); font-weight: 700; font-size: clamp(30px, 5vw, 46px); line-height: 1.2; margin: 12px 0 14px; }
.sp-article__lede { font-size: 20px; color: var(--sp-ink-soft); margin: 0; }
.sp-meta--article { margin-top: 16px; }
.sp-article__hero { margin: 24px 0 0; }
.sp-article__hero img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 14px; }
.sp-content { padding: 36px 0 8px; font-size: 18px; }
.sp-content p { margin: 0 0 1.4em; }
.sp-content h2, .sp-content h3 { font-family: var(--sp-serif); font-weight: 600; margin: 1.8em 0 .6em; }
.sp-content a { color: var(--sp-gold); text-decoration: underline; text-underline-offset: 2px; }
.sp-content img { border-radius: 12px; margin: 1.6em 0; }
/* Koenig editor wide / full-bleed images (break out of the narrow column) */
.sp-content .kg-width-wide { position: relative; width: 88vw; max-width: 1080px; margin-left: 50%; transform: translateX(-50%); }
.sp-content .kg-width-full { position: relative; width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.sp-content .kg-width-full img { border-radius: 0; }
.sp-content .kg-image { margin-left: auto; margin-right: auto; }
.sp-content blockquote { margin: 1.6em 0; padding: 4px 20px; border-left: 3px solid var(--sp-gold); color: var(--sp-ink-soft); font-style: italic; }
.sp-content pre { background: var(--sp-darker); color: #e6e9f0; padding: 16px 18px; border-radius: 12px; overflow: auto; }
.sp-article__foot { margin: 34px 0 60px; padding-top: 26px; border-top: 1px solid var(--sp-line); }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 8px 0 60px; font-weight: 600; color: var(--sp-ink-soft); }
.pagination a { color: var(--sp-gold); }

/* ---------- footer ---------- */
.sp-footer { background: var(--sp-dark); color: #aeb5c2; border-top: 1px solid rgba(201, 162, 77, .3); margin-top: 40px; }
.sp-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 24px; flex-wrap: wrap; }
.sp-footer__nav { display: flex; gap: 18px; }
.sp-footer__nav a { color: #d6dae2; font-weight: 600; font-size: 14px; }
.sp-footer__nav a:hover { color: var(--sp-gold-soft); }

/* ---------- "From the Community" (forum data) ---------- */
.sp-forum { border-top: 1px solid var(--sp-line); background: #e2cfb0; padding: 46px 0 62px; }
.sp-forum__grid { display: grid; grid-template-columns: 1fr 320px; gap: 34px; align-items: start; }
.sp-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sp-section-title { font-family: var(--sp-serif); font-weight: 600; font-size: 26px; margin: 0; }
.sp-section-link { color: var(--sp-gold); font-weight: 600; font-size: 14px; white-space: nowrap; }
.sp-section-link:hover { color: var(--sp-dark); }

.sp-threads { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.sp-thread { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "tag title" "tag meta"; column-gap: 12px; align-items: center; background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: 12px; padding: 12px 16px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.sp-thread:hover { border-color: rgba(201, 162, 77, .55); transform: translateX(2px); box-shadow: 0 10px 24px -20px rgba(20, 24, 34, .5); }
.sp-thread__tag { grid-area: tag; align-self: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.sp-thread__title { grid-area: title; font-weight: 600; font-size: 15.5px; line-height: 1.3; color: var(--sp-ink); }
.sp-thread__meta { grid-area: meta; font-size: 12.5px; color: var(--sp-ink-soft); margin-top: 2px; }
.sp-empty { color: var(--sp-ink-soft); font-size: 14px; }

.sp-widget { background: var(--sp-dark); color: #dfe3ea; border: 1px solid rgba(201, 162, 77, .28); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.sp-widget:empty { display: none; }
.sp-widget__label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--sp-gold); margin-bottom: 12px; }
.sp-widget__foot { font-size: 11px; color: #8b93a3; margin-top: 12px; }
.sp-token__price { font-family: var(--sp-serif); font-size: 34px; font-weight: 700; color: var(--sp-gold-soft); display: flex; align-items: center; gap: 8px; line-height: 1; }
.sp-token__coin { font-size: 26px; }
.sp-token__g { font-size: 18px; color: #aeb5c2; font-family: var(--sp-sans); align-self: flex-end; }
.sp-token__delta { font-family: var(--sp-sans); font-size: 12px; font-weight: 700; margin-left: auto; align-self: center; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.sp-token__delta--up { color: #4ea865; background: rgba(78, 168, 101, .14); }
.sp-token__delta--down { color: #c65a4e; background: rgba(198, 90, 78, .14); }
.sp-token__delta--flat { color: #8b93a3; background: rgba(139, 147, 163, .14); }
.sp-token__spark { display: block; width: 100%; height: 54px; margin: 14px 0 2px; overflow: visible; }
.sp-event { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.sp-event:first-of-type { border-top: none; padding-top: 2px; }
.sp-event__date { display: flex; flex-direction: column; align-items: center; min-width: 40px; line-height: 1.1; font-size: 11px; text-transform: uppercase; color: #8b93a3; }
.sp-event__date b { font-size: 19px; color: #fff; }
.sp-event__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sp-event__title { font-weight: 600; font-size: 14px; color: #eef1f6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-event__time { font-size: 12px; color: #9aa2b1; }
.sp-event__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

@media (max-width: 860px) { .sp-forum__grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .sp-nav__link { display: none; }
    .sp-nav .sp-btn { display: inline-flex; }
    .sp-header__inner { height: 56px; }
    .sp-brand__logo { height: 46px; margin-bottom: 0; }
    .sp-feed { padding: 30px 0; gap: 20px; }
}

/* ============================================================
   v1.1.0 — "dynamic, but old-world" enhancement layer.
   Motion is slow & atmospheric (embers, ken-burns, reveals) to
   keep the antique feel. Everything here is disabled under
   prefers-reduced-motion (see the media query at the bottom).
   ============================================================ */

/* ---- aged parchment: fibrous grain + soft page-edge vignette ---- */
body {
    background-color: var(--sp-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}
body::before {
    content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(135% 90% at 50% -5%, rgba(255,248,235,.40), transparent 55%),
        radial-gradient(150% 130% at 50% 122%, rgba(74,52,26,.26), transparent 55%);
}
.sp-main, .sp-footer { position: relative; z-index: 1; }

/* ---- header condenses & frosts on scroll ---- */
.sp-header { transition: background .3s ease, box-shadow .3s ease, border-color .3s ease; }
.sp-header.is-scrolled {
    background: rgba(27,32,41,.90);
    -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
    box-shadow: 0 8px 26px -10px rgba(0,0,0,.6);
}

/* ---- hero: ken-burns image, layered tint, embers, entrance ---- */
.sp-hero { position: relative; overflow: hidden; background: var(--sp-darker); isolation: isolate; }
.sp-hero::before {
    content: ""; position: absolute; inset: -6%; z-index: 0;
    background: url('https://community.shatteredpact.com/assets/sp-hero-main.jpg') center / cover no-repeat;
    transform: scale(1.05);
    animation: sp-kenburns 30s ease-in-out infinite alternate;
}
.sp-hero::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        linear-gradient(135deg, rgba(13,15,21,.76), rgba(42,31,61,.72)),
        radial-gradient(120% 90% at 50% 125%, rgba(201,162,77,.20), transparent 60%),
        radial-gradient(100% 100% at 50% 45%, transparent 52%, rgba(9,7,12,.60));
}
.sp-hero .sp-shell { position: relative; z-index: 3; }
@keyframes sp-kenburns {
    from { transform: scale(1.05) translate(0, 0); }
    to   { transform: scale(1.16) translate(-1.6%, -1.2%); }
}

.sp-ember {
    position: absolute; z-index: 2; bottom: -14px; border-radius: 50%; pointer-events: none; opacity: 0;
    background: radial-gradient(circle, var(--sp-gold-soft) 0%, rgba(201,162,77,.55) 45%, rgba(201,162,77,0) 70%);
    box-shadow: 0 0 6px rgba(201,162,77,.5);
    animation-name: sp-rise; animation-timing-function: linear; animation-iteration-count: infinite;
}
@keyframes sp-rise {
    0%   { transform: translateY(0) translateX(0) scale(.55); opacity: 0; }
    12%  { opacity: .9; }
    80%  { opacity: .5; }
    100% { transform: translateY(-360px) translateX(var(--drift, 0)) scale(1.15); opacity: 0; }
}

/* hero text entrance + a slow gold shimmer on the title */
.sp-hero__title, .sp-hero__desc, .sp-hero .sp-btn { animation: sp-rise-in .9s cubic-bezier(.2,.7,.2,1) both; }
.sp-hero__desc { animation-delay: .12s; }
.sp-hero .sp-btn { animation-delay: .24s; }
.sp-hero__title {
    color: var(--sp-gold-soft);
    background: linear-gradient(100deg, var(--sp-gold) 18%, #fff3d4 50%, var(--sp-gold) 82%);
    background-size: 220% auto; -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none; filter: drop-shadow(0 3px 18px rgba(201,162,77,.30));
    animation: sp-rise-in .9s cubic-bezier(.2,.7,.2,1) both, sp-shimmer 8s linear 1s infinite;
}
.sp-hero__title::after {
    content: ""; display: block; height: 12px; width: 132px; margin: 16px auto 0;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='12'%3E%3Cline x1='2' y1='6' x2='50' y2='6' stroke='%23c9a24d' stroke-width='1.5'/%3E%3Cline x1='82' y1='6' x2='130' y2='6' stroke='%23c9a24d' stroke-width='1.5'/%3E%3Cpath d='M66 0l6 6-6 6-6-6z' fill='%23c9a24d'/%3E%3C/svg%3E");
    opacity: .9;
}
@keyframes sp-rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes sp-shimmer { from { background-position: 220% center; } to { background-position: 0% center; } }

/* ---- gold flourish under section & article titles ---- */
.sp-section-title::after, .sp-article__title::after {
    content: ""; display: block; height: 12px; width: 132px; margin: 12px 0 0;
    background: left / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='12'%3E%3Cline x1='2' y1='6' x2='50' y2='6' stroke='%23c9a24d' stroke-width='1.5'/%3E%3Cline x1='82' y1='6' x2='130' y2='6' stroke='%23c9a24d' stroke-width='1.5'/%3E%3Cpath d='M66 0l6 6-6 6-6-6z' fill='%23c9a24d'/%3E%3C/svg%3E");
}

/* ---- illuminated drop-cap on the first paragraph ---- */
.sp-content > p:first-of-type::first-letter {
    font-family: var(--sp-serif); font-weight: 700;
    font-size: 3.6em; line-height: .72; float: left; margin: .06em .12em 0 0;
    color: var(--sp-gold);
    text-shadow: 0 1px 0 #fff8ec, 0 3px 12px rgba(201,162,77,.4);
}

/* ---- scroll reveal (class added by sp.js so no-JS shows everything) ---- */
.sp-reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.sp-reveal.is-in { opacity: 1; transform: none; }

/* ---- richer card motion: lift, gold ring, image push-in ---- */
.sp-card__img { position: relative; }
.sp-card__img img { transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.sp-card:hover .sp-card__img img { transform: scale(1.06); }
.sp-card:hover {
    box-shadow: 0 24px 48px -26px rgba(20,24,34,.6), 0 0 0 1px rgba(201,162,77,.45);
    border-color: rgba(201,162,77,.55);
}

/* ---- thread rows: staggered entrance + sliding chevron ---- */
.sp-threads .sp-thread { animation: sp-rise-in .55s both; }
.sp-threads .sp-thread:nth-child(2) { animation-delay: .05s; }
.sp-threads .sp-thread:nth-child(3) { animation-delay: .10s; }
.sp-threads .sp-thread:nth-child(4) { animation-delay: .15s; }
.sp-threads .sp-thread:nth-child(5) { animation-delay: .20s; }
.sp-threads .sp-thread:nth-child(6) { animation-delay: .25s; }
.sp-thread__title::after {
    content: "\203A"; color: var(--sp-gold); font-weight: 700;
    opacity: 0; margin-left: 4px; transition: opacity .18s ease, margin-left .18s ease;
}
.sp-thread:hover .sp-thread__title::after { opacity: 1; margin-left: 9px; }

/* ---- button shine sweep ---- */
.sp-btn { position: relative; overflow: hidden; }
.sp-btn::after {
    content: ""; position: absolute; top: 0; left: -130%; width: 55%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
    transform: skewX(-20deg); transition: left .55s ease;
}
.sp-btn:hover::after { left: 150%; }

/* ---- animated nav underline ---- */
.sp-nav__link { position: relative; }
.sp-nav__link::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px;
    background: var(--sp-gold); transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.sp-nav__link:hover::after { transform: scaleX(1); }

/* ---- token sparkline draws itself in ---- */
.sp-token__spark path[stroke] { stroke-dasharray: 640; stroke-dashoffset: 640; animation: sp-draw 1.8s .3s ease forwards; }
@keyframes sp-draw { to { stroke-dashoffset: 0; } }

/* ---- respect reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .sp-reveal { opacity: 1 !important; transform: none !important; }
    .sp-ember { display: none !important; }
    .sp-hero__title { -webkit-text-fill-color: initial; color: var(--sp-gold-soft); }
}
