/* LIMBFALL's site. Two skins, picked by date: the corrupted plains (most of the year) and the North Pole (December). */
:root {
  --bg: #120b16; --panel: #1c1222; --panel-edge: #2e1f36; --ink: #efe6f2; --muted: #b9a8c4;
  --blood: #e82c24; --blood-mid: #ba1216; --blood-dark: #84060e; --glint: #ff9682; --edge: #100612;
  --sky-top: #361236; --sky-bottom: #443728;
}
.skin-pole {
  --bg: #0a0f1d; --panel: #111a2e; --panel-edge: #1f2c48; --ink: #eef3ff; --muted: #a9b8d8;
  --sky-top: #18192d; --sky-bottom: #8c94aa;
}
/* THE LIMBFALL TYPE - the game's own "HD" letters (scripts/make_hdfont.py, from its typeface.txt): the body pen and the headings'
   pen. A letter it lacks falls back to the game's 5x7. */
@font-face { font-family: "Limbfall Type"; src: url("../fonts/limbfall-type-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Limbfall Type"; src: url("../fonts/limbfall-type-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Limbfall 5x7"; src: url("../fonts/limbfall-5x7.woff") format("woff"); font-display: swap; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { position: relative; margin: 0; background: var(--bg); color: var(--ink);
       font: 19px/1.6 "Limbfall Type", "Limbfall 5x7", system-ui, sans-serif; }
img, canvas { image-rendering: pixelated; }
a { color: inherit; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--blood); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #000; color: #fff; padding: 8px 12px; }
.skip:focus { left: 8px; }
svg.pix { display: block; max-width: 100%; height: auto; }
.pix-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- the title screen */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 360px; overflow: hidden;
        background: linear-gradient(var(--sky-top), var(--sky-bottom)); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.weather { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.press { position: absolute; inset: 0; }
.press:focus-visible { outline: 4px solid var(--blood); outline-offset: -10px; }
/* THE ARROW where the game's prompt was: tap, click or scroll on */
.arrow { position: absolute; left: 50%; top: 71%; width: 70px; height: auto; margin-left: -35px;
         animation: bob 1.6s steps(4, jump-none) infinite alternate; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(12px); } }
@media (max-aspect-ratio: 1/1) { .arrow { top: 69%; width: 42px; margin-left: -21px; } }
@media (max-aspect-ratio: 1/1) {          /* tall screens: the whole title, then the page right under it */
  .hero { height: auto; min-height: 0; }
  .hero-art { position: relative; height: auto; display: block; }
}
.fog { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fog i { position: absolute; left: -50%; width: 200%; bottom: -12%; height: 60%;
         background: radial-gradient(30% 40% at 30% 60%, rgba(150, 60, 150, .22), transparent 70%),
                     radial-gradient(25% 35% at 75% 55%, rgba(120, 50, 130, .18), transparent 70%);
         animation: drift 46s ease-in-out infinite alternate; }
.fog i + i { bottom: 14%; height: 46%; opacity: .7; animation-duration: 63s; animation-direction: alternate-reverse; }
@keyframes drift { from { transform: translateX(-9%); } to { transform: translateX(9%); } }

/* ---- the bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
       padding: 10px clamp(12px, 4vw, 40px); background: rgba(10, 6, 12, .9); border-bottom: 4px solid var(--edge); }
.skin-pole .bar { background: rgba(6, 9, 18, .9); }
.bar-logo svg { height: 34px; width: auto; }
.bar ul { display: flex; gap: clamp(12px, 3vw, 32px); list-style: none; margin: 0; padding: 0;
          font-size: 16px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.bar a { text-decoration: none; }
.bar ul a:hover { color: var(--blood); }
@media (max-width: 600px) {
  .bar-logo { display: none; }
  .bar ul { width: 100%; justify-content: space-between; font-size: 14px; }
}

/* ---- sections */
main { overflow-x: clip; }
.intro, .section { max-width: 1100px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 32px); }
.intro { padding-bottom: 0; }
.pitch { margin: 0 0 20px; max-width: 24em; font-size: clamp(26px, 3.6vw, 42px); line-height: 1.3; font-weight: 700; }
.lede { max-width: 40em; margin: 0; color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); }
.lede p { margin: 0 0 10px; }
.season { margin: 0 0 36px; }   /* December's heading, standing in for a section's plaque */
.season svg + svg { margin-top: 10px; }

/* THE PLAQUE: a heading on the tagline's stone slab */
.plaque { position: relative; display: inline-block; margin: 0 0 40px; padding: 16px 22px 20px;
          background: #57535a url("../img/stone.png") 0 0 / 64px 64px;
          box-shadow: 0 0 0 4px var(--edge), inset 0 4px 0 rgba(255, 255, 255, .16), inset 0 -6px 0 rgba(0, 0, 0, .38),
                      12px 12px 0 4px rgba(0, 0, 0, .45); }
.plaque::before, .plaque::after { content: ""; position: absolute; top: 100%; width: 4px; background: var(--blood-dark); }
.plaque::before { left: 28%; height: 14px; box-shadow: 0 10px 0 2px var(--blood-dark); }
.plaque::after { left: 64%; height: 22px; box-shadow: 0 18px 0 2px var(--blood-dark); }
.plaque svg { max-width: none; }
@media (max-width: 600px) { .plaque svg { height: 44px; width: auto; } }

/* THE CARDS: the game's talk box, look B PARCHMENT (townsfolk.h) - paper with its grain, a wood frame round a darker paper line,
   the title on a wood tab, dark ink with a soft warm shadow in the game's own 5x7 font. One game pixel = 2 CSS pixels. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 44px 24px; margin: 0; padding: 26px 0 0;
         list-style: none; }
.talk { position: relative; padding: 18px 18px 16px; background: #decca0 url("../img/parchment.png") 0 0 / 256px 256px;
        border: 2px solid #5c3c22; box-shadow: inset 0 0 0 2px #baa070, 6px 6px 0 rgba(0, 0, 0, .5);
        color: #28180e; font: 20px/1.45 "Limbfall Type", "Limbfall 5x7", sans-serif; text-shadow: 1px 1px 0 #c4ac7c; }
.talk h3 { position: absolute; left: 22px; top: -26px; margin: 0; padding: 0 10px; height: 28px; background: #5c3c22;
           border: 2px solid #8c6034; color: #f6e2aa; font: inherit; line-height: 24px; text-shadow: 1px 1px 0 #100612;
           white-space: nowrap; max-width: calc(100% - 30px); overflow: hidden; }
.talk p { margin: 0 0 12px; }
.talk p:last-child { margin-bottom: 0; }
.talk a { color: #8c2818; }

/* THE WORLD */
.world { display: grid; gap: 64px; }
.act { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; align-items: start; }
.act h3 { margin: 0; }
.act h3 svg + svg { margin-top: 8px; }
.act p { margin: 0 0 12px; color: var(--muted); font-size: 19px; }
/* A place with a clip: its heading and words on the left, the clip (game footage, muted, looping; site.js plays it while it's
   on screen) on the right. */
.act.with-clip { align-items: center; }
.act.with-clip h3 { margin-bottom: 20px; }
.clip { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--edge);
        border: 4px solid var(--edge); box-shadow: 8px 8px 0 rgba(0, 0, 0, .45); }
/* A character with a cut-out figure (transparent, looping): the figure at its own pixels, never smoothed; still under reduced
   motion. */
.act.with-art { align-items: center; }
.act.with-art h3 { margin-bottom: 20px; }
.art { display: flex; justify-content: center; }
.art img { display: block; image-rendering: pixelated; max-width: 100%; height: auto; }
@media (max-width: 760px) { .act { grid-template-columns: 1fr; gap: 16px; } }

/* SCREENS */
.screens { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.screens figure { margin: 0; }
.screens a { display: block; border: 4px solid var(--edge); box-shadow: 8px 8px 0 rgba(0, 0, 0, .45); }
/* Screenshots are shown smaller than they are, so they're shrunk smoothly: a pixel-skipping shrink breaks the game's one-pixel
   snow and dither into a moire. Only a screenshot blown up past its own size keeps the hard pixels (.up, site.js). */
.screens img { display: block; width: 100%; height: auto; image-rendering: auto; }
.screens figcaption { margin-top: 10px; color: var(--muted); font-size: 15px; }

/* THE LIGHTBOX: a screenshot big over the page; a tap anywhere (but the arrows), Esc or Back closes it */
body:has(.lightbox[open]) { overflow: hidden; }
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
            padding: 56px clamp(8px, 7vw, 96px) 16px; border: 0; background: rgba(8, 4, 10, .94); color: var(--ink);
            cursor: zoom-out; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { display: grid; justify-items: center; gap: 12px; margin: 0; max-width: 100%; max-height: 100%; }
.lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px);
                width: auto; height: auto; border: 4px solid var(--edge); box-shadow: 8px 8px 0 rgba(0, 0, 0, .55);
                image-rendering: auto; }
.lightbox img.up { image-rendering: pixelated; }
.lightbox figcaption { color: var(--muted); font-size: 17px; text-align: center; }
.lightbox figcaption b { margin-left: 12px; font-weight: 400; opacity: .7; }
.lightbox button { position: absolute; padding: 8px; background: none; border: 0; cursor: pointer; }
.lightbox button:hover svg, .lightbox button:focus-visible svg { filter: drop-shadow(0 0 4px var(--blood)); }
.lightbox button:focus-visible { outline: 3px solid var(--blood); outline-offset: 0; }
.lb-close { top: 8px; right: 8px; }
.lb-prev, .lb-next { top: 50%; translate: 0 -50%; }
.lb-prev { left: 0; rotate: 90deg; }
.lb-next { right: 0; rotate: -90deg; }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: 4px; translate: none; } .lightbox { padding-bottom: 64px; } }

/* THE TEASER */
.film { margin: 0; }
.film video { display: block; width: 100%; height: auto; background: #000; border: 4px solid var(--edge);
              box-shadow: 8px 8px 0 rgba(0, 0, 0, .45); image-rendering: auto; }
.film figcaption { margin-top: 12px; color: var(--muted); font-size: 16px; }

/* THE DEVLOG */
.posts { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.posts li { padding: 16px 20px; background: var(--panel); border-left: 6px solid var(--blood-mid); }
.posts time, .post time { color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; }
.posts h3 { margin: 4px 0 6px; font-size: 22px; line-height: 1.3; }
.posts h3 a { text-decoration: none; }
.posts h3 a:hover { color: var(--blood); }
.posts p { margin: 0; color: var(--muted); }
.more { margin: 28px 0 0; }
.post { max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vw, 80px) clamp(16px, 4vw, 32px); }
.post h1 { margin: 6px 0 4px; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.15; }
.post .crumbs { margin: 0; font-size: 15px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; }
.post .crumbs a { color: var(--muted); }
.post-body { margin-top: 28px; }
.post-body img { max-width: 100%; height: auto; }
.post-body a { color: var(--glint); }

/* buttons: a drip grows off them on hover */
.btn { position: relative; display: inline-block; padding: 10px 20px; background: var(--blood-mid); color: #fff; text-decoration: none;
       font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 4px solid var(--edge);
       box-shadow: inset 0 3px 0 var(--blood), inset 0 -4px 0 var(--blood-dark); }
.btn::after { content: ""; position: absolute; left: 24%; top: 100%; width: 4px; height: 0; background: var(--blood-dark);
              transition: height .7s ease-in; }
.btn:hover::after { height: 16px; }

.error { text-align: center; }
.error svg.pix { margin: 0 auto 24px; }
.error .lede { margin: 0 auto 32px; }

.foot { padding: 48px 16px 64px; text-align: center; color: var(--muted); font-size: 15px; background: #0a060c;
        border-top: 4px solid var(--edge); }
.skin-pole .foot { background: #060913; }
.foot svg.pix { margin: 0 auto 14px; height: 34px; width: auto; }
.foot p { margin: 4px 0; }
.foot .note { font-size: 13px; opacity: .8; }

/* THE STAINS (site.js): drops fall as you scroll and stay where they land */
.drop { position: fixed; z-index: 15; width: 6px; height: 9px; pointer-events: none; background: var(--blood-mid);
        box-shadow: inset 2px 2px 0 var(--glint), inset -2px -2px 0 var(--blood-dark); }
.stains { position: absolute; top: 0; left: 0; width: 100%; height: 0; overflow: visible; pointer-events: none; z-index: 10; }
.stains svg { position: absolute; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fog i { animation: none; }
  .btn::after { transition: none; }
  .arrow { animation: none; }
}
