/* Last Stand site. Colours follow the in-game interface (scripts/interface.gd). */
@font-face {
  font-family: "Rubik";
  src: url("fonts/Rubik.woff2") format("woff2"), url("fonts/Rubik.ttf") format("truetype");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --bg: #12261f;
  --bg-deep: #0d1d18;
  --panel: #1c352c;
  --panel-raised: #234237;
  --line: #3d5a4b;
  --line-strong: #536850;
  --cream: #f4edd9;
  --muted: #a8b7a4;
  --soft: #cfdbc3;
  --gold: #efc276;
  --amber-top: #ffca64;
  --amber: #f2ad35;
  --ink: #1f362d;
  --teal: #a8d7bb;
  --danger: #e48a5a;
  --radius: 18px;
  --wrap: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font: 400 17px/1.6 "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--amber-top); }

:focus-visible { outline: 3px solid var(--amber-top); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 10px; z-index: 20; }
.skip:focus { left: 8px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13, 29, 24, 0.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(83, 104, 80, 0.45);
}
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-weight: 700; letter-spacing: 0.01em; margin-right: auto; white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { color: var(--soft); text-decoration: none; font-size: 15px; padding: 8px 10px; border-radius: 10px; }
.nav a:hover { color: var(--cream); background: var(--panel); }
.lang { display: flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; font-size: 13px; font-weight: 700; }
.lang a, .lang span { padding: 5px 11px; text-decoration: none; color: var(--muted); }
.lang span { background: var(--gold); color: var(--ink); }

/* Hero */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: min(88vh, 760px);
  display: flex; align-items: center;
  padding: 72px 0 96px;
}
.hero-art { position: absolute; inset: 0; z-index: -2; background: url("img/hero.jpg") center 40% / cover no-repeat; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(13, 29, 24, 0.94) 0%, rgba(13, 29, 24, 0.82) 38%, rgba(13, 29, 24, 0.25) 75%, rgba(13, 29, 24, 0.15) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(18, 38, 31, 0) 28%);
}
.hero-copy { max-width: 560px; }
.eyebrow { color: var(--gold); font-weight: 700; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 14px; }
.wordmark { width: min(100%, 520px); height: auto; margin: 0 0 18px -6px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45)); }
.hero h1.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--soft); margin: 0 0 28px; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.store {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 20px 8px 16px;
  border-radius: 14px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--cream);
  transition: transform 0.15s ease, background 0.15s ease;
}
.store:hover { transform: translateY(-2px); background: var(--panel-raised); color: var(--cream); }
.store.primary { background: linear-gradient(180deg, var(--amber-top), var(--amber)); border-color: transparent; color: var(--ink); }
.store.primary:hover { color: var(--ink); }
.store svg { width: 26px; height: 26px; flex: none; }
.store small { display: block; font-size: 12px; line-height: 1.1; opacity: 0.8; }
.store b { display: block; font-size: 18px; line-height: 1.2; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li { font-size: 14px; color: var(--teal); background: rgba(28, 53, 44, 0.85); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }

/* Sections */
section { padding: 88px 0; scroll-margin-top: 64px; }
section.alt { background: var(--bg-deep); }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 12px; font-weight: 800; }
.section-head p { color: var(--muted); margin: 0; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card .icon { width: 64px; height: 64px; margin-bottom: 14px; }
.card h3 { margin: 0 0 8px; font-size: 20px; }
.card p { margin: 0; color: var(--soft); font-size: 16px; }

/* Screenshots */
.shots {
  /* Phones: the strip runs edge to edge; the first shot lines up with the text (scroll-padding). */
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 20px 18px; margin: 0 -20px;
  scroll-padding-inline: 20px; scrollbar-color: var(--line-strong) transparent;
}
/* Wide screens: the strip matches the text column exactly, four whole shots per view. */
@media (min-width: 761px) {
  .shots { margin: 0; padding: 4px 0 18px; scroll-padding-inline: 0; grid-auto-columns: calc((100% - 3 * 16px) / 4); }
}
.shots figure { margin: 0; scroll-snap-align: start; }
.shots img { width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.shots figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* Enemies */
.roster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.foe { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 14px 16px; text-align: center; }
.foe img { width: 84px; height: 84px; margin: 0 auto 10px; object-fit: contain; }
.foe b { display: block; font-size: 16px; }
.foe span { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; margin-top: 4px; }

/* Bosses: a block of their own, two wide cards */
.bosses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.boss-card { display: flex; gap: 22px; align-items: center; background: linear-gradient(180deg, #2b3d2c, var(--panel)); border: 1px solid var(--gold); border-radius: var(--radius); padding: 24px; }
.boss-card img { width: 128px; height: 128px; flex: none; object-fit: contain; }
.boss-tag { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.boss-card h3 { margin: 0 0 8px; font-size: 24px; color: var(--gold); }
.boss-card p:last-child { margin: 0; color: var(--soft); font-size: 16px; }

/* Achievements */
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.ach { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 10px 14px; }
.ach img { width: 64px; height: 64px; border-radius: 12px; }
.ach span { font-size: 14px; line-height: 1.3; color: var(--soft); }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0; }
.facts div { border-top: 2px solid var(--gold); padding-top: 12px; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; }

.cta { text-align: center; }
.cta .stores { justify-content: center; }
.cta h2 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 10px; font-weight: 800; }
.cta p { color: var(--muted); margin: 0 0 28px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: auto; }
footer a { color: var(--soft); }
/* CODENTICO credit: sphere logo, link to codentico.tech, trademark line */
footer .maker { display: inline-flex; align-items: center; gap: 12px; color: var(--cream); text-decoration: none; }
footer .maker:hover { color: var(--cream); }
.maker-mark { width: 40px; height: 40px; color: #ffb84d; flex: none; }
footer .maker small { display: block; font-size: 12px; line-height: 1.2; color: var(--muted); }
footer .maker b { display: block; font-size: 16px; line-height: 1.25; letter-spacing: 0.16em; }
footer .maker sup { font-size: 9px; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-left: 1px; }
footer .legal { flex-basis: 100%; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Privacy policy */
.doc { padding: 56px 0 80px; }
.doc article { max-width: 760px; }
.doc h1 { font-size: clamp(22px, 7vw, 44px); line-height: 1.1; margin: 0 0 8px; font-weight: 800; overflow-wrap: break-word; hyphens: auto; }
.doc .game { color: var(--gold); font-weight: 700; margin: 0 0 24px; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 36px; font-size: 16px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.doc section { padding: 0; margin: 0 0 30px; }
.doc h2 { font-size: 21px; margin: 0 0 8px; color: var(--cream); }
.doc p { color: var(--soft); margin: 0 0 14px; overflow-wrap: anywhere; }
.doc .note { color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 40px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .hero { min-height: 0; padding: 48px 0 64px; }
  .hero-art { background-position: 70% center; }
  .hero::before { background: linear-gradient(0deg, var(--bg) 0%, rgba(13, 29, 24, 0.86) 35%, rgba(13, 29, 24, 0.55) 100%); }
  section { padding: 64px 0; }
  /* First screen: smaller type, both store buttons in one row. */
  .hero { padding: 32px 0 48px; }
  .eyebrow { font-size: 12px; margin-bottom: 10px; }
  .wordmark { width: min(80%, 300px); margin: 0 0 12px -4px; }
  .lead { font-size: 15px; line-height: 1.5; margin-bottom: 20px; }
  .stores { flex-wrap: nowrap; gap: 8px; margin-bottom: 18px; }
  .store { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 6px 10px; gap: 8px; border-radius: 12px; }
  .store svg { width: 20px; height: 20px; }
  .store small { font-size: 11px; }
  .store b { font-size: 15px; white-space: nowrap; }
  .chips { gap: 6px; }
  .chips li { font-size: 12px; padding: 4px 10px; }
  /* Policy links on the privacy page keep their long labels: one per row. */
  .doc .stores { flex-direction: column; }
  .doc .store b { white-space: normal; }
  .bosses { grid-template-columns: 1fr; gap: 14px; }
  .boss-card { gap: 14px; padding: 16px; align-items: flex-start; }
  .boss-card img { width: 84px; height: 84px; }
  .boss-card h3 { font-size: 20px; margin-bottom: 6px; }
  .boss-card p:last-child { font-size: 15px; }
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foe b, .ach span { overflow-wrap: break-word; hyphens: auto; }
  .foe { padding: 16px 8px 14px; }
  .foe b { font-size: 15px; }
  .achievements { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
  .ach { padding: 12px 6px 10px; }
  .ach span { font-size: 13px; }
  .meta { grid-template-columns: 1fr; gap: 2px; }
  .meta dd { margin-bottom: 8px; }
  footer nav { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .store { transition: none; }
}

/* Store button before the store page exists */
.store.soon { cursor: default; opacity: 0.92; }
.store.soon:hover { transform: none; }
.store.soon.primary:hover { background: linear-gradient(180deg, var(--amber-top), var(--amber)); }
.store.soon:not(.primary):hover { background: var(--panel); }

/* Motion: hidden only while GSAP is about to animate them (html.motion, see motion.js). */
.motion .hero-art,
.motion .hero .eyebrow,
.motion .hero .wordmark,
.motion .hero .lead,
.motion .hero .store,
.motion .hero .chips li { visibility: hidden; }
.hero-art { will-change: transform; }
.foe { cursor: default; }

/* Narrow phones (320–360 px): header and enemy cards must fit without horizontal scroll. */
@media (max-width: 360px) {
  .top .wrap { gap: 10px; }
  .brand { gap: 8px; font-size: 15px; }
  .brand img { width: 30px; height: 30px; }
  .lang a, .lang span { padding: 5px 9px; }
  .foe { padding: 14px 6px; }
  .foe b { font-size: 13px; }
  .store { padding: 6px 8px; gap: 6px; }
  .store svg { width: 18px; height: 18px; }
  .store b { font-size: 14px; }
  .foe span { font-size: 13px; }
}

