/* WRITTEN BY tools/seo.js — the front door's sheet, loaded after pages.css
   (whose :root block is the game's token block). The source is
   tools/seo/home.css. Edit that, never this file. */
/* ═══════════════════════════════════════════════════════════════════════════
                 THE FRONT DOOR — castlebattle.app, to a browser
   ═══════════════════════════════════════════════════════════════════════════
   The layout half of public/css/home.css, loaded after pages.css: the token
   block, the gilt button, the install seals and the footer all come from
   there, and this only adds what the door has that a guide page does not —
   the painting and its button, the reels, the crests and the march, the
   full-bleed duel, the fanned maps and the send-off.

   A SHOP WINDOW (2026-10-24). One button, then the game shown off in beats of
   one picture and two lines. Every beat is centred and set big, so a scroll
   reads as a run of posters rather than a page of sections to study.

   THE GAME'S RULES HOLD HERE TOO. Every colour is a role. One candle, from
   above (~160°). No italics: the second line of a headline is told apart by
   the gilt, not a slant. A kingdom's colour is cloth — the glow behind its
   crest — and never the colour of a word. The logo dropping onto the painting
   is the screen's one --e-back-lg, and the big button is its one spark. */

.hm {
  --hm-w: min(1240px, calc(100vw - 32px));
  --hm-beat: clamp(84px, 11vw, 160px);
  background: var(--bg);
  overflow-x: hidden;
}
.hm main h1, .hm main h2 { margin: 0; font-family: var(--font-display); color: var(--ink); }

/* ---- the headline: two lines, lettered like the logo -------------------- */
.hm-head {
  width: var(--hm-w); margin: 0 auto;
  font: 900 clamp(40px, 6.4vw, 96px)/0.96 var(--font-logo);
  text-align: center; text-wrap: balance;
  text-shadow: var(--letter-contour), 0 12px 30px rgba(var(--shade-rgb), 0.55);
}
.hm-head span { display: block; color: var(--gold-lt); }

/* ---- the bar: the mark and the button, and only when it is wanted ------- */
/* It holds the button only while neither big button is on the screen (the
   page's script sets .hm-past), so at the top the painting has the screen to
   itself and the door's button is never shown twice at once. With scripting
   off there is no .hm-js and the bar simply stands at the top. */
.hm-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 8px max(16px, calc((100vw - 1240px) / 2));
  background: rgba(var(--bg-rgb), 0.86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge-quiet);
  transition: transform var(--t-3) var(--e-out);
}
.hm-js .hm-top { transform: translateY(-110%); }
.hm-js.hm-past .hm-top { transform: none; }
.hm-brand { flex: none; display: block; line-height: 0; }
.hm-brand img { width: 58px; height: auto; filter: drop-shadow(var(--sh-0)); }
.hm-top .pg-play { padding: 12px 22px; font-size: 15px; }

/* ---- the painting and its button --------------------------------------- */
.hm-hero { padding: 86px 0 0; }
.hm-js .hm-hero { padding-top: 14px; }
/* As wide as the screen allows and no taller than it, so on a big monitor the
   valley fills the screen rather than floating in a navy margin. */
.hm-painting {
  position: relative; margin: 0 auto; width: min(calc(100vw - 24px), calc((100vh - 28px) * 1672 / 941));
  border-radius: var(--r-3xl); overflow: hidden;
  border: 2px solid var(--gilt-deep);
  box-shadow: var(--sh-4), inset 0 1px 0 var(--gold-hi);
  line-height: 0;
}
/* The whole painting where the screen has room for it, and a crop of its
   middle where it has not, so the button is always above the fold. */
.hm-painting > img:first-child {
  width: 100%; height: auto; aspect-ratio: 1672 / 941;
  min-height: 380px; max-height: calc(100vh - 28px);
  object-fit: cover; object-position: 50% 40%;
}
/* Night gathers under the bridge, so the button stands on dark water rather
   than on a crowd. Centred and round so the two heroes in the corners keep
   their daylight. */
.hm-painting::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 55%;
  background: radial-gradient(52% 70% at 50% 100%, rgba(var(--dusk-rgb), 0.72), transparent);
  pointer-events: none;
}
/* The valley's sky is empty between the two castles, which is where the menu
   hangs the logo too — so the door opens on the picture the game opens on.
   Bounded by the height as well as the width, so a short wide screen cannot
   lower it onto the button. */
.hm-logo {
  position: absolute; left: 50%; top: 3%; z-index: 1;
  width: min(33%, 560px, calc(54vh - 20px)); line-height: 0;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 14px rgba(var(--shade-rgb), 0.45));
  animation: hm-drop var(--t-4) var(--e-back-lg) both 120ms;
}
.hm-logo img { width: 100%; height: auto; }
@keyframes hm-drop { from { opacity: 0; transform: translate(-50%, -24px) scale(0.92); } }

.hm-buy { display: flex; flex-direction: column; align-items: center; gap: 14px; }
/* It arrives after the logo has landed, so the drop stays the one big
   entrance. */
.hm-painting .hm-buy {
  position: absolute; left: 50%; bottom: 6%; z-index: 1;
  transform: translateX(-50%);
  animation: hm-rise var(--t-3) var(--e-back) both 520ms;
}
@keyframes hm-rise { from { opacity: 0; transform: translate(-50%, 18px); } }

/* THE BUTTON. The biggest gilt on the site and the screen's one spark: the
   bright lip along its top is --gold-bright, which nothing else near it wears.
   A glint crosses it now and then — a pace, on a long rest, so it catches
   the eye without nagging it; it runs on transform, which costs a phone
   nothing (a box-shadow loop on the rack once cost it a frame in three). */
.hm-cta {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  min-width: clamp(300px, 23vw, 440px); padding: clamp(20px, 1.6vw, 28px) 46px clamp(16px, 1.3vw, 22px);
  border-radius: var(--r-xl);
  border: 1px solid var(--gilt-seat);
  background: linear-gradient(180deg, var(--gold-hi), var(--gilt-lit) 30%, var(--gold) 62%, var(--gold-dk));
  box-shadow: var(--contour), var(--sh-4), inset 0 2px 0 var(--gold-bright), 0 0 42px rgba(var(--gilt-lit-rgb), 0.32);
  color: var(--gilt-ink); text-decoration: none; line-height: 1; white-space: nowrap;
  transition: transform var(--t-2) var(--e-back), box-shadow var(--t-2) var(--e-out);
}
.hm-cta b { font: 900 clamp(28px, 2.1vw, 38px)/1 var(--font-display); letter-spacing: 2px; text-transform: uppercase; }
.hm-cta small { font: 800 13px/1 var(--font-ui); letter-spacing: 1.6px; text-transform: uppercase; opacity: 0.78; }
.hm-cta::after {
  content: ''; position: absolute; z-index: -1; top: -20%; bottom: -20%; left: 0; width: 32%;
  background: linear-gradient(100deg, transparent, rgba(var(--lit-rgb), 0.75), transparent);
  transform: translateX(-140%) skewX(-18deg);
  animation: hm-glint 5.6s ease-in-out infinite 1.6s;
}
@keyframes hm-glint {
  0% { transform: translateX(-140%) skewX(-18deg); }
  24%, 100% { transform: translateX(440%) skewX(-18deg); }
}
.hm-cta:hover, .hm-cta:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--contour-lift), var(--sh-4), inset 0 2px 0 var(--gold-bright), 0 0 56px rgba(var(--gilt-lit-rgb), 0.5);
}
.hm-cta:active { transform: translateY(1px); box-shadow: var(--contour-press), var(--sh-2), inset 0 2px 0 var(--gold-bright); }

/* The other way in: a quiet pill under the button, never a second button. */
.hm-alt {
  display: inline-flex; align-items: center;
  padding: 9px 16px; border-radius: var(--r-pill);
  background: rgba(var(--dusk-rgb), 0.6); border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  font: 800 13px/1 var(--font-ui); letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  transition: border-color var(--t-2) var(--e-out), background-color var(--t-2) var(--e-out);
}
.hm-alt:hover, .hm-alt:focus-visible { border-color: var(--gilt-lit); background: rgba(var(--dusk-rgb), 0.8); }

/* Which of each pair leads. Windows (and a reader with scripting off) is
   offered the download; any other device, marked by the head script before
   the first paint, is offered the install. */
.hm .hm-on-home, [data-get="home"] .hm .hm-on-win { display: none; }
[data-get="home"] .hm .hm-on-home { display: inline-flex; }

/* ---- a beat: two lines over a picture ---------------------------------- */
.hm-band { padding-top: var(--hm-beat); }

/* ---- the reels: real battles drifting past ----------------------------- */
/* Two rows of frames crossing the page, the second against the first, so the
   wall reads as a war going on rather than a slideshow. The window fades at
   both sides, so a frame arrives instead of being guillotined. A reel is a
   pace, like the march, so its one curve is linear; a hand on it stops it. */
.hm-montage {
  --frame: clamp(240px, 30vw, 440px);
  display: grid; gap: 16px; margin: clamp(34px, 4.5vw, 60px) 0 0;
  overflow: hidden; line-height: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--bg) 7%, var(--bg) 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, var(--bg) 7%, var(--bg) 93%, transparent);
}
.hm-reel-run {
  display: flex; gap: 16px; width: max-content;
  animation: hm-reel var(--lap) linear infinite;
}
/* Half a frame along, and the other way, so the two rows never line up. */
.hm-reel:nth-child(2) .hm-reel-run { margin-left: calc(var(--frame) / -2); animation-direction: reverse; }
/* Two copies with a 16px gap between every frame: one lap is half the run
   plus half a gap. */
@keyframes hm-reel { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 8px)); } }
.hm-montage:hover .hm-reel-run { animation-play-state: paused; }
/* Shot at 1280, hung at 640 and shown at 440 or less, so `auto`. */
.hm-frame {
  flex: none; width: var(--frame); height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--r-xl); border: 2px solid var(--edge);
  background: var(--panel-2); box-shadow: var(--sh-3);
}

/* ---- the crests, and the army under them ------------------------------- */
.hm-crests {
  width: var(--hm-w); margin: clamp(30px, 4vw, 54px) auto 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px;
}
.hm-crest {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px 2px 4px; text-decoration: none; text-align: center;
}
/* The kingdom's cloth, as the light the crest hangs in. */
.hm-crest::before {
  content: ''; position: absolute; left: 50%; top: 0; width: 128%; max-width: 150px; aspect-ratio: 1;
  border-radius: var(--r-pill);
  background: radial-gradient(closest-side, rgba(var(--royal-rim-rgb), 0.3), transparent);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--cloth) 55%, transparent), transparent);
  transform: translateX(-50%); opacity: 0.85;
  transition: opacity var(--t-3) var(--e-out), transform var(--t-3) var(--e-back);
}
.hm-crest-art {
  position: relative; width: 100%; max-width: 108px; height: auto;
  filter: drop-shadow(0 6px 10px rgba(var(--shade-rgb), 0.5));
  transition: transform var(--t-3) var(--e-back);
}
.hm-crest span {
  position: relative; font: 800 16px/1.1 var(--font-display); color: var(--cloth-ink);
  text-shadow: var(--sh-1);
}
.hm-crest:hover::before, .hm-crest:focus-visible::before { opacity: 1; transform: translateX(-50%) scale(1.15); }
.hm-crest:hover .hm-crest-art, .hm-crest:focus-visible .hm-crest-art { transform: translateY(-8px) rotate(-4deg) scale(1.08); }

.hm-road {
  position: relative; margin-top: 26px; height: 150px; overflow: hidden;
  background: linear-gradient(180deg, transparent 72%, rgba(var(--shade-rgb), 0.28) 72%, rgba(var(--shade-rgb), 0.12));
  border-bottom: 2px solid var(--gilt-deep);
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--bg) 8%, var(--bg) 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, var(--bg) 8%, var(--bg) 92%, transparent);
}
/* Two copies of the column, so the second walks on as the first walks off and
   -50% is a seamless lap. A march is a constant pace, so the one curve here is
   linear — it is a speed, not a transition, and every curve in the ladder would
   make the column surge. */
.hm-column {
  position: absolute; left: 0; bottom: 6px; display: flex; gap: 6px; width: max-content;
  animation: hm-march 48s linear infinite;
}
@keyframes hm-march { from { transform: translateX(-50%); } to { transform: translateX(0); } }
/* A frame of a 4×2 sheet, at a size under the bake (256px), so `auto`. */
.hm-trooper {
  flex: none; width: 128px; height: 128px;
  background-size: 400% 200%; background-position: 0 0; background-repeat: no-repeat;
  filter: drop-shadow(0 4px 2px rgba(var(--shade-rgb), 0.35));
}
.hm-trooper:nth-child(4n + 2) { margin-bottom: 8px; }
.hm-trooper:nth-child(4n + 3) { margin-left: 18px; }

/* ---- the duel, full-bleed ---------------------------------------------- */
/* The painting fades into the night at both ends, so the page runs through it
   rather than stopping at a frame, and the two lines stand on the lower fade
   between the knight and the orc. */
/* Its own fade is already air, so it sits closer than a beat. */
.hm-feature { position: relative; margin-top: calc(var(--hm-beat) * 0.55); }
.hm-feature-art { position: relative; margin: 0; line-height: 0; }
.hm-feature-art img { width: 100%; height: min(86vh, 820px); min-height: 420px; object-fit: cover; object-position: 50% 58%; }
.hm-feature-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--bg), transparent 14%, transparent 52%, rgba(var(--bg-rgb), 0.82) 86%, var(--bg));
}
.hm-feature .hm-head { position: absolute; left: 0; right: 0; bottom: clamp(26px, 5vw, 72px); z-index: 1; }

/* ---- the campaign: three maps, fanned like a hand of cards -------------- */
.hm-maps {
  display: flex; justify-content: center; align-items: center;
  width: var(--hm-w); margin: clamp(44px, 5.5vw, 76px) auto 0; padding-bottom: 24px;
}
.hm-map {
  position: relative; flex: 0 1 38%; display: block; margin: 0 -3%;
  overflow: hidden; line-height: 0;
  border-radius: var(--r-2xl); border: 2px solid var(--edge-strong);
  box-shadow: var(--sh-4);
  transform: rotate(-6deg) translateY(18px);
  transition: transform var(--t-3) var(--e-back), border-color var(--t-2) var(--e-out);
}
.hm-map:nth-child(2) { z-index: 1; transform: scale(1.1); }
.hm-map:nth-child(3) { transform: rotate(6deg) translateY(18px); }
.hm-map:hover, .hm-map:focus-visible { z-index: 2; transform: translateY(-8px) scale(1.14); border-color: var(--gilt-lit); }
.hm-map img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }

/* ---- the send-off: the button again ------------------------------------ */
.hm-get { position: relative; margin-top: var(--hm-beat); padding-bottom: clamp(70px, 8vw, 110px); scroll-margin-top: 0; }
.hm-get-art { position: relative; margin: 0; line-height: 0; }
.hm-get-art img { width: 100%; height: min(72vh, 660px); min-height: 380px; object-fit: cover; object-position: 50% 32%; }
.hm-get-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg), transparent 16%, transparent 38%, var(--bg) 94%);
}
.hm-get-inner { position: relative; z-index: 1; margin-top: -230px; }
.hm-get .hm-buy { margin-top: 34px; }
/* The send-off already ends on its own air; the guide's gap above the footer
   would double it. */
.hm .pg-foot { margin-top: 0; }

/* ---- the install sheet ------------------------------------------------- */
/* A phone's button opens it where the browser has no install offer of its
   own. It rises from the bottom edge on a phone, where a thumb is, and sits
   in the middle of a wider screen. Only the seals for this device show. */
.hm-sheet {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: end center; padding: 16px;
  background: rgba(var(--shade-rgb), 0.6);
  animation: hm-dim var(--t-2) var(--e-out) both;
}
.hm-sheet[hidden] { display: none; }
@keyframes hm-dim { from { opacity: 0; } }
.hm-sheet-card {
  position: relative; width: min(420px, 100%); padding: 26px 24px 24px;
  border-radius: var(--r-3xl);
  background: var(--plate); border: 1px solid var(--edge-strong);
  box-shadow: var(--sh-4), var(--bevel);
  animation: hm-sheet-in var(--t-3) var(--e-back) both;
}
@keyframes hm-sheet-in { from { opacity: 0; transform: translateY(30px); } }
.hm-sheet-icon {
  display: block; width: 76px; height: 76px; margin: 0 auto 20px;
  border-radius: 18px; box-shadow: var(--sh-3);
}
.hm-sheet-x {
  position: absolute; top: 10px; right: 10px;
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border-radius: var(--r-pill); border: 1px solid var(--edge);
  background: transparent; color: var(--ink); font-size: 20px; cursor: pointer;
  transition: border-color var(--t-2) var(--e-out);
}
.hm-sheet-x:hover, .hm-sheet-x:focus-visible { border-color: var(--gilt-lit); }
.hm-sheet .bt-steps { display: none; }
[data-os="ios"] .hm-sheet .bt-steps[data-os="ios"],
[data-os="android"] .hm-sheet .bt-steps[data-os="android"],
[data-os="desktop"] .hm-sheet .bt-steps[data-os="desktop"] { display: grid; }
.hm-sheet .bt-steps a { color: var(--gold-lt); }

/* ---- smaller glass ----------------------------------------------------- */
@media (min-width: 700px) {
  .hm-sheet { place-items: center; }
}
@media (max-width: 1080px) {
  .hm-crests { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 18px; }
}
@media (max-width: 860px) {
  .hm-cta { min-width: 280px; padding: 18px 34px 15px; }
  .hm-cta b { font-size: 25px; }
  .hm-get-inner { margin-top: -150px; }
}
/* A SCREEN TALLER THAN IT IS WIDE — a phone, or a tablet held upright — is
   keyed by its shape and not its width, because the two problems are shape
   problems: a 16:9 valley a portrait screen wide leaves half the screen empty
   under it, and a portrait crop of the duel cuts off both of its heroes. */
@media (max-aspect-ratio: 1/1) {
  /* The middle of the valley — the logo's sky, the river and the bridge. */
  .hm-painting > img:first-child { aspect-ratio: 1 / 1; min-height: 0; object-position: 50% 42%; }
  .hm-logo { width: min(54%, 560px, calc(54vh - 20px)); top: 4%; }
  /* The duel is the two heroes at the painting's two edges, and any crop to a
     tall shape keeps the bridge between them. So the whole painting, a screen
     wide, and the two lines under it. */
  .hm-feature-art img { height: auto; min-height: 0; }
  .hm-feature-art::after { background: linear-gradient(180deg, var(--bg), transparent 16%, transparent 76%, var(--bg)); }
  .hm-feature .hm-head { position: relative; bottom: auto; margin-top: 18px; }
}
@media (max-width: 560px) {
  .hm-brand img { width: 48px; }
  .hm-top .pg-play { padding: 10px 16px; font-size: 13px; }
  .hm-painting { border-radius: var(--r-xl); }
  .hm-painting > img:first-child { aspect-ratio: 4 / 5; }
  .hm-logo { width: min(70%, calc(54vh - 20px)); }
  .hm-painting .hm-buy { bottom: 5%; gap: 12px; }
  .hm-cta { min-width: 0; padding: 16px 28px 13px; }
  .hm-cta b { font-size: 22px; letter-spacing: 1.5px; }
  .hm-cta small { font-size: 11.5px; }
  .hm-alt { padding: 8px 14px; font-size: 12px; }
  .hm-montage { --frame: 220px; gap: 10px; }
  .hm-reel-run { gap: 10px; }
  @keyframes hm-reel { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 5px)); } }
  .hm-crests { gap: 6px; }
  .hm-crest { padding-top: 6px; }
  .hm-crest span { display: none; }
  .hm-trooper { width: 96px; height: 96px; }
  .hm-road { height: 116px; }
  .hm-map { flex-basis: 42%; }
  .hm-get-inner { margin-top: -110px; }
  /* Three shelves side by side rather than seventeen links in a column. */
  .hm .pg-foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .hm .pg-foot li { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-column, .hm-logo, .hm-painting .hm-buy, .hm-reel-run, .hm-cta::after, .hm-sheet, .hm-sheet-card { animation: none; }
  .hm-top, .hm-cta, .hm-crest::before, .hm-crest-art, .hm-map { transition: none; }
}
