/* Site chrome: layout, header, cards, age gate. Post content styles are in post.css. */

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; background: #000; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
  /* Pale light from above, forge glow from below, over a faint hammered grain.
     The gray sinks to black toward the edges and the bottom of the window. */
  background:
    radial-gradient(70rem 30rem at 50% -8rem, color-mix(in srgb, var(--text) 5%, transparent), transparent 70%),
    radial-gradient(60rem 26rem at 50% calc(100% + 6rem), color-mix(in srgb, var(--red) 12%, transparent), transparent 70%),
    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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 120% 90% at 50% 35%, transparent 35%, rgba(0, 0, 0, 0.7) 100%),
    linear-gradient(180deg, var(--bg) 0%, #060505 55%, #000 100%);
  background-attachment: fixed;
}

::selection { background: color-mix(in srgb, var(--spark) 40%, transparent); color: #fff; }

a { color: var(--link); text-underline-offset: 0.2em; transition: color 0.2s, text-shadow 0.2s; }
a:hover { color: var(--spark); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

h1, h2 { font-family: var(--font-heading); font-weight: 400; letter-spacing: 0.04em; line-height: 1.15; margin: 0; text-wrap: balance; }

.label, .card__meta, .post__meta {
  font-family: var(--font-label); font-weight: 500; font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}

.page { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* The side margins on wide screens: a dim, torch-lit wall either side of the page, with black
   banners hanging from two rods and swaying slowly. Each carries the maul. The back layer is lighter and slower. */
.wings { display: none; }
@media (min-width: 84rem) {
  .wings { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
  .wing {
    position: absolute; top: 0; bottom: 0; left: 0; width: calc((100vw - 72rem) / 2); overflow: hidden;
    background:
      radial-gradient(ellipse 90% 40% at 55% 28%, color-mix(in srgb, var(--text) 8%, transparent), transparent 75%),
      linear-gradient(90deg, #151312, transparent);
    /* Fades out toward the page, so there is no hard edge beside it. */
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
    mask-image: linear-gradient(90deg, #000 82%, transparent);
  }
  /* Scrolling moves the sides a little (--drift, set by js/drift.js): the glow least, the back
     banners more, the front ones most. The wing runs past the bottom of the window to allow for it. */
  .wing { bottom: -6rem; translate: 0 calc(var(--drift, 0px) * -0.4); transition: translate 0.35s ease-out; }
  .rod, .banner { translate: 0 calc(var(--drift, 0px) * -0.6); transition: translate 0.35s ease-out; }
  .rod--far, .banner--far { translate: 0 calc(var(--drift, 0px) * -0.25); }
  /* The right side is the left one mirrored. */
  .wing--right { left: auto; right: 0; transform: scaleX(-1); }
  /* Two rods, each ending in a diamond finial: the front one higher, the back one lower and a shade lighter. */
  .rod { position: absolute; left: 0; top: calc(6vh - 7px); width: 64%; height: 7px; background: #000; }
  .rod::after { content: ''; position: absolute; right: -7px; top: -5px; width: 17px; height: 17px; background: inherit; transform: rotate(45deg); }
  .rod--far { top: calc(15vh - 7px); width: 76%; background: #0e0c0b; }
  /* A banner: a flat black strip with a swallow-tail end, swaying from the rod it hangs on.
     It starts at the middle of the rod, not its lower edge, so no gap opens between them as it sways. */
  .banner {
    position: absolute; top: calc(6vh - 4px); left: 6%; width: 22%; height: 58vh; background: #000; transform-origin: 50% 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 2.1rem), 0 100%);
    animation: banner-sway 7s ease-in-out -2s infinite alternate;
  }
  .banner--2 { left: 40%; width: 18%; height: 40vh; animation-duration: 8s; animation-delay: -5s; }
  .banner--far { top: calc(15vh - 4px); left: 24%; width: 19%; height: 66vh; background: #0e0c0b; animation-duration: 9s; animation-delay: 0s; }
  .banner--far.banner--2 { left: 54%; height: 44vh; animation-duration: 11s; animation-delay: -4s; }
  .wing--right .banner { animation-direction: alternate-reverse; }
  /* The emblem: an upright maul, drawn as a shape so its edges stay clean, in one flat iron tone. */
  .banner__emblem {
    position: absolute; left: 13%; top: 12%; width: 74%; aspect-ratio: 100 / 140; background: #2a2521;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 140'%3E%3Cpath d='M44 9 50 0 56 9ZM20 9H80L87 16V45L80 52H20L13 45V16ZM39 52H61V60H39ZM45 60H55V121H45ZM50 116 61 128 50 140 39 128Z'/%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 100 140'%3E%3Cpath d='M44 9 50 0 56 9ZM20 9H80L87 16V45L80 52H20L13 45V16ZM39 52H61V60H39ZM45 60H55V121H45ZM50 116 61 128 50 140 39 128Z'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .banner--far .banner__emblem { background: #302a25; }
}
@keyframes banner-sway {
  from { transform: rotate(-1.6deg) skewX(1deg); }
  to { transform: rotate(1.6deg) skewX(-1deg); }
}
main { flex: 1; width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem 5rem; }

/* Sparks are drawn on one canvas above everything (see /js/sparks.js). */
#sparks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }

/* A plain steel plate: cards, the age gate, the pager. */
.plate {
  position: relative;
  background: linear-gradient(180deg, var(--raised), var(--surface));
  border: 1px solid var(--line);
  border-top-color: var(--line-hi);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 24px rgba(0, 0, 0, 0.35);
}

/* A forged bar with a bone stud: the divider. */
.forge-bar {
  position: relative; height: 6px; border: 0; border-radius: 1px; margin: 2.5rem 0; overflow: visible;
  background: linear-gradient(90deg, transparent, #463e37 12%, #7a6f61 50%, #463e37 88%, transparent);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.forge-bar::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: linear-gradient(135deg, var(--spark), var(--spark-deep));
  border: 1px solid #0c0b0a;
  box-shadow: 0 0 10px color-mix(in srgb, var(--spark) 55%, transparent);
}

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem;
  width: 100%; max-width: 72rem; margin: 0 auto; padding: 1.1rem 1rem;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
.brand { display: flex; align-items: center; gap: 0.75rem; color: var(--text); text-decoration: none; font-family: var(--font-display); font-size: 1.45rem; letter-spacing: 0.01em; line-height: 1.1; }
.brand:hover { color: #fff; }
/* The maul lifts and comes down once every few seconds. Each loop starts on the blow, so the
   animation's repeat event marks the moment of impact: sparks.js throws sparks from the head then ([data-strike]). */
/* The loop begins on the blow, so each maul starts 1.2s into it: at rest, with the first blow 4.8s away. */
.brand img { width: 56px; height: 56px; transform-origin: 85% 90%; animation: maul-strike 6s linear -1.2s infinite; }
@keyframes maul-strike {
  /* After the blow it returns to rest in one unbroken movement: it eases away from the strike and settles. */
  0% { transform: rotate(-13deg); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  18%, 62% { transform: rotate(0deg); animation-timing-function: ease-in-out; }
  93% { transform: rotate(24deg); animation-timing-function: cubic-bezier(0.7, 0, 1, 0.6); }
  100% { transform: rotate(-13deg); }
}

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.6rem; }
.site-nav a { font-family: var(--font-label); font-weight: 500; font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-decoration: none; padding: 0.3rem 0; border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current='page'] { color: var(--link); border-bottom-color: var(--link); }

/* Buttons: dark iron. The primary one has a red edge and heats up on hover. */
.btn {
  display: inline-block; padding: 0.6rem 1.25rem; cursor: pointer; text-decoration: none;
  font-family: var(--font-label); font-weight: 700; font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text); background: linear-gradient(180deg, #26221f, #1a1715);
  border: 1px solid var(--line-hi); border-radius: 3px;
  transition: box-shadow 0.25s, border-color 0.25s, color 0.25s, background 0.25s;
}
.btn:hover { border-color: var(--link-deep); color: var(--link); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  color: #e9dcdc; border-color: #6f2327;
  background: linear-gradient(180deg, #3b181b, #241012);
  box-shadow: 0 -2px 0 rgba(158, 34, 40, 0.55) inset;
}
.btn--primary:hover {
  color: #fff; border-color: var(--red);
  background: linear-gradient(180deg, #55191d, #331215);
  box-shadow: 0 -2px 0 var(--red-hot) inset, 0 0 16px rgba(158, 34, 40, 0.4);
}
.buy-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2rem; }
/* Every button the same width, whatever its label. */
.buy-links--even .btn { flex: 0 0 13rem; max-width: 100%; text-align: center; }

/* Sections */
.section { padding-top: 2.25rem; }
.section--center { text-align: center; padding-top: 5rem; }
.section--center h1 { font-family: var(--font-heading); font-size: clamp(2.2rem, 6.5vw, 3.4rem); letter-spacing: 0.05em; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section__head h1, .section__head h2 { font-family: var(--font-label); font-weight: 500; font-size: 0.95rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.section__more { font-family: var(--font-label); font-weight: 500; font-size: 0.95rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; }
.section__more::after { content: ' \2192'; }
.section__count { font-family: var(--font-label); font-size: 0.95rem; letter-spacing: 0.1em; color: var(--muted); }
/* For headings that screen readers and search engines need but the page does not show. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.empty { color: var(--muted); text-align: center; padding: 4rem 0; font-style: italic; }
.support__blurb { max-width: 34rem; margin: 1.5rem auto 0; font-size: 1.25rem; color: var(--text-soft); text-wrap: balance; }
/* The game's page: logo, tagline, story, countdown, credits. */
.game { padding-top: 4rem; }
/* The logo as the game's main menu draws it: Cinzel Bold, widely spaced, gold, on two lines. */
.game h1.game__logo {
  font-family: 'Cinzel', var(--font-heading); font-weight: 700; font-size: clamp(2.3rem, 10.5vw, 4.5rem); letter-spacing: 0.085em; line-height: 1.12;
  padding-left: 0.085em; text-transform: uppercase; color: #e8b468; text-shadow: 0 2px 0 #000, 0 0 46px rgba(232, 180, 104, 0.28);
}
.game__logo span { display: block; }
.game__tagline { margin: 1.1rem 0 0; font-family: var(--font-label); font-weight: 500; font-size: clamp(0.95rem, 3.4vw, 1.15rem); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-soft); text-wrap: balance; }
/* The line that leads into the credits. */
.game__lead { margin: 0 0 1.2rem; font-size: 1.25rem; font-style: italic; color: var(--text-soft); text-wrap: balance; }
.game__credits { margin-top: 4.5rem; }
.credit { margin-top: 1.9rem; }
.credit .label { margin: 0 0 0.3rem; }
.credit__names { list-style: none; margin: 0; padding: 0; font-family: var(--font-heading); font-size: clamp(1.2rem, 4.4vw, 1.5rem); letter-spacing: 0.04em; line-height: 1.4; }
.credit__names--columns { display: grid; grid-auto-flow: column; grid-template-columns: 1fr 1fr; column-gap: clamp(1.25rem, 5vw, 3rem); max-width: 40rem; margin: 0 auto; text-align: left; }
.credit__names--columns .is-left { text-align: right; }
.game__story { max-width: 40rem; margin: 2.25rem auto 0; text-align: left; font-size: 1.25rem; line-height: 1.6; color: var(--text-soft); }
.game__story p { margin: 0 0 1.1em; text-wrap: pretty; }
/* The last line of the story stands alone. */
.game__story p:last-child {
  margin: 1.6em 0 0; text-align: center; font-family: var(--font-heading); font-size: clamp(1.25rem, 3.4vw, 1.55rem); letter-spacing: 0.05em; line-height: 1.2;
  color: #f4eee0; text-shadow: 0 2px 0 #000, 0 0 28px rgba(216, 67, 63, 0.45);
}
.game__story p:only-child { margin-top: 0; }
.countdown { margin-top: 3.5rem; }
.countdown__label { margin: 0 0 0.9rem; color: var(--link); letter-spacing: 0.18em; }
.countdown__clock { display: flex; justify-content: center; gap: clamp(0.4rem, 2vw, 0.9rem); }
.countdown__clock[hidden], .countdown__done[hidden] { display: none; }
.countdown__unit {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem; flex: 0 1 7.5rem; min-width: 0; padding: 1rem 0.25rem 0.8rem; overflow: hidden;
  background: linear-gradient(180deg, var(--raised), var(--pit)); box-shadow: 0 -2px 0 rgba(179, 32, 42, 0.5) inset, 0 12px 28px rgba(0, 0, 0, 0.5);
}
.countdown__num {
  font-family: var(--font-heading); font-size: clamp(2rem, 9vw, 3.6rem); line-height: 1; letter-spacing: 0.02em; font-variant-numeric: tabular-nums lining-nums;
  color: #f4eee0; text-shadow: 0 2px 0 #000, 0 0 22px rgba(216, 67, 63, 0.4);
}
.countdown__num.is-ticking { animation: count-tick 0.4s var(--bounce); }
@keyframes count-tick { from { transform: translateY(-0.12em) scale(1.06); } }
.countdown__unit .label { font-size: clamp(0.7rem, 2.6vw, 0.9rem); }
.countdown__done { margin: 0; font-family: var(--font-heading); font-size: clamp(2rem, 7vw, 3rem); letter-spacing: 0.06em; color: #f4eee0; text-shadow: 0 0 28px rgba(216, 67, 63, 0.6); }

/* Home page: the quote, on its own. */
.hero__quote {
  margin: 3.5rem 0 0; text-align: center; font-family: var(--font-heading); font-size: clamp(1.6rem, 4.2vw, 2.6rem);
  letter-spacing: 0.06em; line-height: 1.15; text-wrap: balance; color: #f4eee0;
  text-shadow: 0 2px 0 #000, 0 0 30px rgba(207, 58, 63, 0.3);
}
.home__blurb { max-width: 40rem; margin: 1.5rem auto 0; text-align: center; font-size: 1.3rem; color: var(--text-soft); text-wrap: pretty; white-space: pre-line; }
.home__latest { padding-top: 3.25rem; }

/* Tags: coloured from the editor's Tags page (--tag), lightened a little so dark picks stay readable. */
.tag {
  --tag: var(--link);
  display: inline-block; padding: 0 0.5rem; line-height: 1.55; white-space: nowrap; text-decoration: none;
  font-family: var(--font-label); font-weight: 500; font-size: 0.85rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: color-mix(in srgb, var(--tag) 82%, #fff);
  background: color-mix(in srgb, var(--tag) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tag) 50%, transparent); border-radius: 2px;
}
a.tag:hover { color: #fff; border-color: var(--tag); background: color-mix(in srgb, var(--tag) 30%, transparent); }

/* Search box and tag menu above the post list. */
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-bottom: 1.4rem; }
.filter__search {
  flex: 0 1 19rem; min-width: 12rem; padding: 0.5rem 0.8rem; color: var(--text);
  font: 400 1.05rem/1.3 var(--font-body);
  background: var(--pit); border: 1px solid var(--line-hi); border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) inset;
}
.filter__search::placeholder { color: var(--muted); font-style: italic; }
.filter__search:focus { outline: none; border-color: var(--link-deep); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) inset, 0 0 0 1px var(--link-deep); }

/* The tag menu: an iron button that opens a plate with a toggle for each tag, in its colour. */
.tag-select { --tag: var(--muted); position: relative; flex: 0 1 15rem; min-width: 11rem; }
.tag-select__button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.5rem 0.8rem; cursor: pointer; text-align: left;
  font-family: var(--font-label); font-weight: 500; font-size: 1rem; letter-spacing: 0.09em; text-transform: uppercase; line-height: 1.37;
  color: var(--text); background: linear-gradient(180deg, #26221f, #1a1715);
  border: 1px solid var(--line-hi); border-radius: 3px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tag-select__button:hover, .tag-select.is-open .tag-select__button { border-color: var(--link-deep); }
.tag-select.has-tag .tag-select__button {
  border-color: color-mix(in srgb, var(--tag) 60%, transparent);
  box-shadow: 0 -2px 0 color-mix(in srgb, var(--tag) 70%, transparent) inset;
}
.tag-select__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-select__chevron { width: 0.75rem; height: 0.5rem; color: var(--muted); transition: transform 0.2s; }
.tag-select.is-open .tag-select__chevron { transform: rotate(180deg); }
.tag-select__dot {
  flex: none; width: 0.6rem; height: 0.6rem; transform: rotate(45deg);
  background: var(--tag, var(--muted)); border: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 8px color-mix(in srgb, var(--tag, transparent) 60%, transparent);
}
.tag-select__menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; list-style: none; margin: 0; padding: 0.35rem;
  min-width: max-content; box-shadow: 0 16px 34px rgba(0, 0, 0, 0.65);
  animation: tag-menu-in 0.14s ease-out;
}
.tag-select__menu[hidden] { display: none; }
.tag-select__option {
  --tag: var(--muted);
  display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.5rem 0.6rem; cursor: pointer; text-align: left;
  font-family: var(--font-label); font-weight: 500; font-size: 1rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-soft); background: none; border: 0; border-left: 2px solid transparent; border-radius: 2px;
}
.tag-select__option:hover, .tag-select__option:focus-visible {
  outline: none; color: #fff; border-left-color: var(--tag);
  background: color-mix(in srgb, var(--tag) 16%, transparent);
}
.tag-select__option[aria-checked='true'] { color: color-mix(in srgb, var(--tag) 80%, #fff); }
/* The toggle at the end of each tag's row: a small switch that slides and lights up in the tag's colour. */
.tag-select__switch {
  position: relative; flex: none; width: 2rem; height: 1.1rem; margin-left: 0.3rem;
  background: var(--pit); border: 1px solid var(--line-hi); border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) inset; transition: background 0.2s, border-color 0.2s;
}
.tag-select__switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 0.75rem; height: calc(100% - 4px);
  background: #7a6f61; border-radius: 1px; transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}
[aria-checked='true'] > .tag-select__switch { background: color-mix(in srgb, var(--tag) 22%, var(--pit)); border-color: color-mix(in srgb, var(--tag) 60%, transparent); }
[aria-checked='true'] > .tag-select__switch::after {
  transform: translateX(calc(2rem - 0.75rem - 6px)); background: color-mix(in srgb, var(--tag) 85%, #fff);
  box-shadow: 0 0 8px color-mix(in srgb, var(--tag) 70%, transparent);
}
.tag-select__name { flex: 1; white-space: nowrap; }
.tag-select__count { font-size: 0.85rem; color: var(--muted); letter-spacing: 0.04em; }
@keyframes tag-menu-in { from { opacity: 0; transform: translateY(-4px); } }

/* Pages of posts. */
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.4rem; margin-top: 2.25rem; }
.pager[hidden] { display: none; }
.pager__btn {
  min-width: 2.6rem; height: 2.6rem; padding: 0 0.6rem; cursor: pointer;
  font-family: var(--font-label); font-weight: 700; font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-soft); background: linear-gradient(180deg, #26221f, #1a1715);
  border: 1px solid var(--line-hi); border-radius: 3px;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.pager__btn--arrow { display: inline-grid; place-items: center; padding: 0; }
.pager__btn--arrow svg { width: 0.5rem; height: 0.75rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pager__btn:hover:not(:disabled) { color: #fff; border-color: var(--red); box-shadow: 0 -2px 0 var(--red-hot) inset, 0 0 14px rgba(158, 34, 40, 0.35); }
.pager__btn[aria-current='page'] { color: var(--link); border-color: var(--link-deep); box-shadow: 0 -2px 0 var(--link) inset; }
.pager__btn:disabled { opacity: 0.35; cursor: default; }
.pager__gap { color: var(--muted); padding: 0 0.15rem; }

/* Post cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.15rem; }
.card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); text-decoration: none; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.card:hover {
  color: var(--text); transform: translateY(-2px); border-color: #7a2a2e;
  box-shadow: 0 0 0 1px rgba(158, 34, 40, 0.5), 0 0 26px rgba(158, 34, 40, 0.28), 0 10px 24px rgba(0, 0, 0, 0.4);
}
.card__cover { display: block; aspect-ratio: 1200 / 630; border-bottom: 1px solid var(--line); background: var(--pit); overflow: hidden; }
.card__cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s, filter 0.5s; filter: saturate(0.9) brightness(0.92); }
.card:hover .card__cover img { transform: scale(1.03); filter: none; }
.card__blank {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: linear-gradient(180deg, #191614, #110f0e);
}
.card__blank img { width: 64px; height: 64px; opacity: 0.4; }
.card__body { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; padding: 1.05rem 1.25rem 1.35rem; }
.card__title { font-family: var(--font-heading); font-size: 1.45rem; letter-spacing: 0.04em; line-height: 1.15; text-wrap: balance; }
.card__excerpt { color: var(--text-soft); line-height: 1.45; }
/* A card's tags: one line along the bottom left. js/filter.js hides the ones that do not fit and shows
   the "+" after the last that does (its colour is set on the editor's Tags page). */
.card__tags { display: flex; flex-wrap: nowrap; gap: 0.3rem; margin-top: auto; padding-top: 0.6rem; }
.card__tags .tag { flex: none; font-size: 0.78rem; padding: 0 0.42rem; }
.card__tags .tag--more { font-weight: 700; }
.card__tags.is-tight .tag:not(.tag--more) { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tag[hidden] { display: none; }
@media (min-width: 52rem) { .card.card--lead .card__tags { margin-top: 0.3rem; padding-top: 0; } }
/* A tag being searched or filtered for comes first on its card, with a soft light turning round its edge. */
@property --tag-turn { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.tag.is-sought {
  color: color-mix(in srgb, var(--tag) 70%, #fff); border-color: transparent;
  background:
    linear-gradient(color-mix(in srgb, var(--tag) 20%, var(--surface)) 0 0) padding-box,
    conic-gradient(from var(--tag-turn), color-mix(in srgb, var(--tag) 40%, transparent) 0deg, color-mix(in srgb, var(--tag) 85%, #fff) 55deg, color-mix(in srgb, var(--tag) 40%, transparent) 120deg 360deg) border-box;
  box-shadow: 0 0 9px color-mix(in srgb, var(--tag) 28%, transparent);
  animation: tag-orbit 3.6s linear infinite;
}
@keyframes tag-orbit { to { --tag-turn: 360deg; } }
/* Pinned posts and the latest release: the same turning light, round the whole card, in --glow
   (the post's first tag colour, or the release tag's). They keep it when a search moves them. */
.card.card--glow {
  --glow: var(--link); border-color: transparent;
  background:
    linear-gradient(180deg, var(--raised), var(--surface)) padding-box,
    conic-gradient(from var(--tag-turn), color-mix(in srgb, var(--glow) 32%, var(--line)) 0deg, color-mix(in srgb, var(--glow) 88%, #fff) 28deg, color-mix(in srgb, var(--glow) 32%, var(--line)) 64deg 360deg) border-box;
  box-shadow: 0 0 22px color-mix(in srgb, var(--glow) 15%, transparent), 0 10px 24px rgba(0, 0, 0, 0.35);
  animation: rise-in 0.6s var(--bounce) backwards, fade-in 0.35s ease-out backwards, tag-orbit 7s linear infinite;
  animation-delay: calc(var(--i, 0) * 55ms), calc(var(--i, 0) * 55ms), 0s;
}
.card.card--glow:hover { border-color: transparent; box-shadow: 0 0 30px color-mix(in srgb, var(--glow) 30%, transparent), 0 10px 24px rgba(0, 0, 0, 0.4); }
/* Why the card is first: a small plate on the top left of its cover, in the glow's colour. */
.card__cover { position: relative; }
.card__flag {
  position: absolute; top: 0.6rem; left: 0.6rem; padding: 0.05rem 0.55rem; white-space: nowrap;
  font-family: var(--font-label); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.5;
  color: color-mix(in srgb, var(--glow, var(--link)) 78%, #fff);
  background: color-mix(in srgb, var(--glow, var(--link)) 14%, rgba(8, 7, 7, 0.88));
  border: 1px solid color-mix(in srgb, var(--glow, var(--link)) 60%, transparent); border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.card[hidden] { display: none; }

/* The newest post leads the home page as a wide card. */
.card--lead { grid-column: 1 / -1; }
.card--lead .card__title { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
.card--lead .card__excerpt { font-size: 1.2rem; }
@media (min-width: 52rem) {
  .card--lead { display: grid; grid-template-columns: 1.25fr 1fr; }
  .card--lead .card__cover { height: 100%; aspect-ratio: auto; min-height: 19rem; border-bottom: 0; border-right: 1px solid var(--line); }
  .card--lead .card__body { justify-content: center; padding: 1.75rem 2rem; gap: 0.55rem; }
}

.badge {
  display: inline-block; margin-left: 0.5rem; padding: 0 0.45rem;
  font-family: var(--font-label); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #f1d9d9; background: var(--red-deep); border: 1px solid var(--red); border-radius: 2px;
}

/* Post page (the body itself is styled by post.css) */
.post { padding-top: 3rem; container-type: inline-size; }
.post__head { max-width: 46rem; margin: 0 auto 2rem; text-align: center; }
.post__head h1 { font-family: var(--font-display); font-size: clamp(2rem, 5.5vw, 3.1rem); letter-spacing: 0.01em; line-height: 1.12; margin-top: 0.6rem; }
.post__tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin: 1rem 0 0; }
.post__cover { position: relative; overflow: hidden; width: 100%; max-width: 60rem; margin: 0 auto 2.5rem; border: 1px solid var(--line); border-top-color: var(--line-hi); border-radius: 3px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45); }
.post__cover img { display: block; width: 100%; height: auto; }
/* Who made the cover: small writing in its bottom right corner. */
.post__credit {
  position: absolute; right: 0.6rem; bottom: 0.55rem; max-width: calc(100% - 1.2rem); padding: 0.1rem 0.55rem;
  font-family: var(--font-label); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.09em; text-transform: uppercase; line-height: 1.5;
  color: var(--text-soft); background: rgba(8, 7, 7, 0.72); border: 1px solid rgba(236, 228, 211, 0.18); border-radius: 2px;
}
/* A red initial on the opening paragraph, in the size chosen for the post in the editor (or none).
   Site only, so it never fights the editor's cursor. */
.post [class*='post-body--cap-'] > p:first-child::first-letter {
  float: left; font-family: var(--font-display); font-size: 2.2em; line-height: 0.86; padding: 0.08em 0.1em 0 0;
  color: var(--red-hot); text-shadow: 0 0 18px rgba(158, 34, 40, 0.6);
}
.post .post-body--cap-large > p:first-child::first-letter { font-size: 3.1em; }
/* The opening paragraph holds its initial even when it is short, and has more room after it. */
.post [class*='post-body--cap-'] > p:first-child { display: flow-root; margin-bottom: 1.9em; }
.post__pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 46rem; margin: 0 auto; }
.post__pager a { display: block; padding: 0.9rem 1.2rem 1.05rem; color: var(--text); text-decoration: none; font-family: var(--font-heading); font-size: 1.15rem; letter-spacing: 0.04em; line-height: 1.2; transition: border-color 0.2s, box-shadow 0.2s; }
.post__pager a:hover { border-color: #7a2a2e; box-shadow: 0 0 0 1px rgba(158, 34, 40, 0.5), 0 0 22px rgba(158, 34, 40, 0.25); }
.post__pager a span { display: block; font-family: var(--font-label); font-size: 0.9rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; }
.post__pager-newer { text-align: right; }
.post__end { max-width: 46rem; margin: 3.5rem auto 2rem; }
@media (max-width: 34rem) { .post__pager { grid-template-columns: 1fr; } .post__pager-newer { text-align: left; } }

/* Footer: the forge glows underneath. */
.site-footer {
  position: relative; padding: 2rem 1rem 2.5rem; text-align: center; color: var(--muted);
  font-family: var(--font-label); font-size: 0.95rem; letter-spacing: 0.08em;
  border-top: 1px solid #241012;
  background: linear-gradient(180deg, rgba(90, 17, 21, 0.1), transparent 70%);
}
.site-footer::before {
  content: ''; position: absolute; left: 10%; right: 10%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--red) 55%, transparent), transparent);
  box-shadow: 0 0 10px rgba(179, 32, 42, 0.2);
}
.site-footer p { margin: 0.4rem 0 0; }
.site-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
/* Social links: equal square buttons, each holding one icon. */
.icon-link {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; color: var(--text-soft); text-decoration: none;
  background: linear-gradient(180deg, #26221f, #1a1715); border: 1px solid var(--line-hi); border-radius: 3px;
  font-family: var(--font-heading); font-size: 1.3rem; line-height: 1;
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.icon-link svg { width: 1.35rem; height: 1.35rem; fill: currentColor; }
.icon-link:hover {
  color: #fff; border-color: var(--red); background: linear-gradient(180deg, #55191d, #331215);
  box-shadow: 0 -2px 0 var(--red-hot) inset, 0 0 16px rgba(158, 34, 40, 0.4);
}

/* Age gate: the page is hidden until the visitor confirms. */
.gate { display: none; }
.gate-locked .page { visibility: hidden; }
.gate-locked body { overflow: hidden; }
.gate-locked .gate {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 100; padding: 1rem;
  background:
    radial-gradient(40rem 22rem at 50% 105%, rgba(158, 34, 40, 0.3), transparent 70%),
    var(--pit);
}
.gate__panel { width: 100%; max-width: 27rem; padding: 2.5rem 2rem 2.25rem; text-align: center; }
/* The same strike as the header's maul, sparks included (see maul-strike above). */
.gate__logo { width: 96px; height: 96px; animation: maul-strike 6s linear -1.2s infinite; transform-origin: 85% 90%; }
.gate__panel h2 { font-family: var(--font-display); font-size: 1.9rem; letter-spacing: 0.02em; margin-top: 0.6rem; }
.gate__panel p { margin: 0.8rem 0 0; color: var(--text-soft); }
.gate__actions { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1.6rem; }
.gate__note { font-size: 0.9rem; color: var(--muted); }

/* ---- Motion ----
   Things arrive by sliding in, overshooting a little and settling back (--bounce). That happens on
   first load and on every page change: js/nav.js swaps <main> without reloading, so the header,
   the banners and the sparks carry on. --i staggers arrivals, one step each. */
:root { --bounce: cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes rise-in { from { transform: translateY(1.75rem); } }
@keyframes drop-in { from { transform: translateY(-110%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.9); } }

/* Nothing starts moving until the age gate is passed. */
.gate-locked .page, .gate-locked .page *, .gate-locked .wings * { animation-play-state: paused !important; }
.gate-locked .gate__panel { animation: pop-in 0.5s var(--bounce) backwards; }

/* Arrivals */
.site-header { animation: drop-in 0.7s var(--bounce) backwards; }
.hero__quote, .home__blurb, .section__head, .filter, .card, .empty, .pager, .post__head, .post__cover,
.post-body, .post__end, .post__pager, .section--center > *, .site-footer__links > * {
  animation: rise-in 0.6s var(--bounce) backwards, fade-in 0.35s ease-out backwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.home__blurb, .filter, .post__cover, .section--center > :nth-child(2), .site-footer__links > :nth-child(2) { --i: 1; }
.home__latest .section__head, .post-body, .section--center > :nth-child(3), .site-footer__links > :nth-child(3) { --i: 2; }
.site-footer__links > :nth-child(4), .section--center > :nth-child(4) { --i: 3; }
.section--center > :nth-child(5) { --i: 4; }
.section--center > :nth-child(6) { --i: 5; }
.section--center > :nth-child(7) { --i: 6; }
.section--center > :nth-child(8) { --i: 7; }
.site-footer__links > :nth-child(5) { --i: 4; }
.site-footer__links > :nth-child(6) { --i: 5; }
.card:nth-child(1) { --i: 0; } .card:nth-child(2) { --i: 1; } .card:nth-child(3) { --i: 2; } .card:nth-child(4) { --i: 3; } .card:nth-child(5) { --i: 4; } .card:nth-child(6) { --i: 5; } .card:nth-child(7) { --i: 6; } .card:nth-child(8) { --i: 7; } .card:nth-child(9) { --i: 8; } .card:nth-child(10) { --i: 9; }
.home__latest .card:nth-child(1) { --i: 3; } .home__latest .card:nth-child(2) { --i: 4; } .home__latest .card:nth-child(3) { --i: 5; }

/* The page that is being left sinks away quickly before the next one arrives. */
main { transition: opacity 0.14s ease-in, transform 0.14s ease-in; }
main.is-leaving { opacity: 0; transform: translateY(10px); }
main:focus { outline: none; }

/* Hover lifts with a bounce; a press pushes in. Touch screens get the press. */
a, button { -webkit-tap-highlight-color: transparent; }
.card { transition: transform 0.4s var(--bounce), border-color 0.2s, box-shadow 0.2s; }
.btn, .icon-link, .pager__btn, .tag-select__button, .post__pager a, a.tag {
  transition: transform 0.35s var(--bounce), box-shadow 0.25s, border-color 0.25s, color 0.25s, background 0.25s;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-5px); }
  .btn:hover, .icon-link:hover, .pager__btn:hover:not(:disabled), .post__pager a:hover { transform: translateY(-3px); }
  a.tag:hover { transform: translateY(-2px); }
}
.card:active { transform: scale(0.985); transition-duration: 0.08s; }
.btn:active, .icon-link:active, .pager__btn:active:not(:disabled), .tag-select__button:active, .post__pager a:active, a.tag:active {
  transform: translateY(1px) scale(0.96); transition-duration: 0.06s;
}

/* Nav: the underline springs out from the middle, and slides to the new page's link.
   The line is thin and kept darker than the link text above it. */
.site-nav a { position: relative; border-bottom: 0; padding-bottom: calc(0.3rem + 2px); }
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-hi);
  transform: scaleX(0); transition: transform 0.4s var(--bounce), background 0.2s;
}
.site-nav a:hover::after { transform: scaleX(0.55); }
/* The current page's line glows, and a brighter glint runs along it from left to right. */
.site-nav a[aria-current='page']::after {
  transform: scaleX(1);
  background: linear-gradient(90deg, var(--red) 35%, #ff9483 50%, var(--red) 65%) 100% 0 / 300% 100%;
  box-shadow: 0 0 8px rgba(216, 67, 63, 0.6);
  animation: nav-glint 3.4s linear infinite;
}
@keyframes nav-glint { to { background-position: 0 0; } }

/* Tag menu and its switches */
.tag-select__menu { transform-origin: 50% 0; animation: tag-menu-in 0.32s var(--bounce); }
@keyframes tag-menu-in { from { opacity: 0; transform: translateY(-10px) scale(0.95); } }
.tag-select__switch::after { transition: transform 0.35s var(--bounce), background 0.2s, box-shadow 0.2s; }

/* A short note that rises from the bottom of the window (js/toast.js), e.g. when a link that has
   no address yet is clicked. */
.toast {
  /* High enough to clear the footer icons, which are among the things that set it off. */
  position: fixed; left: 50%; bottom: 7.75rem; z-index: 250; width: max-content; max-width: calc(100vw - 2rem); padding: 0.7rem 1.15rem; pointer-events: none;
  font-family: var(--font-label); font-weight: 500; font-size: 1.05rem; letter-spacing: 0.06em; text-align: center; color: var(--text);
  background: linear-gradient(180deg, var(--raised), var(--surface)); border: 1px solid var(--line-hi); border-bottom: 2px solid var(--red); border-radius: 3px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.7), 0 0 22px rgba(179, 32, 42, 0.18);
  opacity: 0; transform: translate(-50%, 1.25rem) scale(0.94);
  transition: opacity 0.2s, transform 0.25s ease-in;
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0) scale(1); transition: opacity 0.15s, transform 0.45s var(--bounce); }

/* ---- Folding menu ----
   The header is always one line. When the links do not fit beside the logo, js/menu.js puts
   .nav-folded on <html> and they fold away behind a button. That is measured, so it holds however
   the nav is edited. The three bars cross into an X, and the list drops down with a small bounce. */
.site-header { position: relative; z-index: 40; flex-wrap: nowrap; }
.brand { flex: none; white-space: nowrap; }
.site-nav { flex: none; flex-wrap: nowrap; white-space: nowrap; }
.nav-toggle { display: none; }

.nav-folded .brand { flex: 0 1 auto; min-width: 0; }
.nav-folded .nav-toggle {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; flex: none;
  width: 2.75rem; height: 2.75rem; padding: 0; cursor: pointer;
  background: linear-gradient(180deg, #26221f, #1a1715); border: 1px solid var(--line-hi); border-radius: 3px;
  transition: transform 0.35s var(--bounce), border-color 0.25s;
}
.nav-folded .nav-toggle:active { transform: scale(0.94); transition-duration: 0.06s; }
.nav-toggle span { display: block; width: 1.25rem; height: 2px; background: var(--text); transition: transform 0.4s var(--bounce), opacity 0.15s, background 0.2s; }
.site-header.is-open .nav-toggle { border-color: var(--red); }
.site-header.is-open .nav-toggle span { background: var(--link); }
.site-header.is-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .nav-toggle span:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
.site-header.is-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-folded .site-nav {
  display: none; position: absolute; top: calc(100% + 6px); right: 1rem; left: auto; width: min(22rem, calc(100% - 2rem));
  flex-direction: column; gap: 0; padding: 0.35rem; white-space: normal;
  background: linear-gradient(180deg, var(--raised), var(--surface)); border: 1px solid var(--line); border-top-color: var(--line-hi); border-radius: 3px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.7); transform-origin: 100% 0;
}
.nav-folded .site-header.is-open .site-nav { display: flex; animation: tag-menu-in 0.32s var(--bounce); }
.nav-folded .site-nav a { padding: 0.8rem 0.9rem; font-size: 1.1rem; border-left: 2px solid transparent; border-radius: 2px; }
.nav-folded .site-nav a::after { display: none; }
.nav-folded .site-nav a:active { background: color-mix(in srgb, var(--red) 16%, transparent); }
.nav-folded .site-nav a[aria-current='page'] { border-left-color: var(--link); background: color-mix(in srgb, var(--red) 10%, transparent); }
/* The links arrive one after another. */
.nav-folded .site-header.is-open .site-nav a { animation: rise-in 0.45s var(--bounce) backwards, fade-in 0.25s ease-out backwards; }
.nav-folded .site-header.is-open .site-nav a:nth-child(2) { animation-delay: 50ms; }
.nav-folded .site-header.is-open .site-nav a:nth-child(3) { animation-delay: 100ms; }
.nav-folded .site-header.is-open .site-nav a:nth-child(4) { animation-delay: 150ms; }
.nav-folded .site-header.is-open .site-nav a:nth-child(5) { animation-delay: 200ms; }

/* Phones: a slightly smaller logo and name, so the name and the button share the line. */
@media (max-width: 40rem) {
  .site-header { padding: 0.7rem 1rem; }
  .brand { font-size: clamp(1.1rem, 5.6vw, 1.45rem); }
  .brand img { width: 48px; height: 48px; flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .btn:hover, .icon-link:hover, .pager__btn:hover, .post__pager a:hover, a.tag:hover,
  .card:active, .btn:active, .icon-link:active, .pager__btn:active, .tag-select__button:active, .post__pager a:active, a.tag:active { transform: none !important; }
}
