/*
 * The marketing site's pages (index.html, legal/index.html, 404.html). The
 * Sylvan Stag's palette, as on the game's loading screen (src/loading.css),
 * dark only, like the game. Set in the game's UI face (src/fonts.css), a
 * copy of its file in fonts/: Noto Sans, one variable file for every weight,
 * bold for headings and the wordmark as in the game's menus. Latin only: the
 * site's English needs no more. No inline styles or scripts: the CSP
 * (marketing/README.md) allows only the site's own files.
 */

@font-face {
  font-family: 'Noto Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/NotoSans-latin.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --bg: #12200c;
  --bg-raised: #1a2e12;
  --card: rgba(255, 255, 255, 0.05);
  --rule: rgba(180, 230, 170, 0.18);
  --text: #f4f8ef;
  --muted: #b8c9b4;
  --accent: #c9f0a8;
  --button: #9be37a;
  --button-text: #10210b;
  --gold: #ffd34d;
  --violet: #c9a2ff;
  --radius: 14px;
  --wrap: 72rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 12px;
}

a {
  color: var(--accent);
}

a:focus-visible,
summary:focus-visible,
video:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--button);
  color: var(--button-text);
}

.skip:focus {
  top: 8px;
}

/* --- header and footer (the same on every page) --------------------------- */

.site-head {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-raised);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 12px 24px;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 36px;
  height: 36px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
}

.site-head .play {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font-weight: 700;
  text-decoration: none;
}

.site-head .play:hover {
  background: var(--accent);
  color: var(--button-text);
}

/*
 * Narrow screens: a Play button and a menu button, and the nav as a drawer.
 * With no scripts, the drawer is open while the address ends in #menu (the
 * menu button's link), so following any of its links closes it, as does its
 * close button or a tap beside it (both link to #top, the header).
 */
.play-short,
.menu-open,
.menu-close,
.menu-backdrop {
  display: none;
}

@media not all and (min-width: 48rem) {
  .site-head .wrap {
    gap: 8px;
  }

  .play-short {
    display: block;
  }

  .menu-open,
  .menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: var(--text);
  }

  .menu-close {
    align-self: flex-end;
    margin-bottom: 8px;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: min(20rem, 85vw);
    padding: 10px 16px 24px;
    overflow-y: auto;
    border-left: 1px solid var(--rule);
    background: var(--bg-raised);
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.45);
    font-size: 1.1rem;
    visibility: hidden;
    transform: translateX(100%);
  }

  .site-nav:target {
    visibility: visible;
    transform: none;
  }

  .site-nav a:not(.menu-close):not(.play) {
    padding: 12px 4px;
    border-bottom: 1px solid var(--rule);
    color: var(--text);
  }

  .site-nav .play {
    margin-top: 20px;
    padding: 12px 20px;
    text-align: center;
  }

  .site-nav:target ~ .menu-backdrop {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 19;
    background: rgba(0, 0, 0, 0.55);
  }

  html:has(.site-nav:target) {
    overflow: hidden;
  }
}

/* The smallest phones: room for the name beside Play and the menu button. */
@media not all and (min-width: 24rem) {
  .brand {
    gap: 8px;
    font-size: 1.05rem;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }
}

.site-foot {
  margin-top: 64px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--rule);
  background: var(--bg-raised);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 12px;
}

.site-foot p {
  margin: 0;
}

/* --- buttons ------------------------------------------------------------- */

.button {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--accent);
}

.button.quiet {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--text);
}

/* --- sections ------------------------------------------------------------ */

section {
  padding: 56px 0 8px;
}

.lede {
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero {
  padding-top: 40px;
  background: radial-gradient(ellipse at 70% 30%, #28461b 0%, var(--bg) 70%);
}

.hero .wrap {
  display: grid;
  gap: 32px;
  align-items: center;
}

.hero .lede {
  font-size: 1.2rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 12px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.95rem;
  list-style: none;
}

.facts li::before {
  content: '✦ ';
  color: var(--gold);
}

.shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

.shot figcaption {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 16px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.cards li {
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
}

.cards p {
  margin: 0;
  color: var(--muted);
}

.gallery {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.devices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 24px;
}

.devices .phone {
  max-width: 300px;
}

.shot video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

/* The hero video's play button (hero.js shows it): the whole poster, with a large icon in the middle. */
.hero .shot {
  position: relative;
}

.play-video {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: radial-gradient(circle at center, rgba(18, 32, 12, 0.05) 0%, rgba(18, 32, 12, 0.45) 100%);
  cursor: pointer;
}

.play-video[hidden] {
  display: none;
}

.play-video svg {
  width: clamp(4.5rem, 18vw, 7rem);
  height: auto;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(201, 240, 168, 0.25), 0 0 36px rgba(155, 227, 122, 0.55);
}

.play-video circle {
  fill: var(--button);
}

.play-video path {
  fill: var(--button-text);
}

.play-video:hover circle {
  fill: var(--accent);
}

.play-video:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -6px;
}

.checks {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  margin-bottom: 12px;
  padding-left: 30px;
}

.checks li::before {
  content: '✓';
  position: absolute;
  left: 4px;
  color: var(--button);
  font-weight: 700;
}

.faq details {
  max-width: 48rem;
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  padding: 14px 0;
  cursor: pointer;
  font-weight: 700;
}

.faq details p {
  color: var(--muted);
}

.closing {
  text-align: center;
}

.closing .actions {
  justify-content: center;
}

/* The policies' index (legal/index.html) and the 404 page. */
.page {
  max-width: 48rem;
  padding-top: 40px;
}

.policy-list {
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.policy-list li {
  margin-bottom: 12px;
}

.policy-list a {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  text-decoration: none;
}

.policy-list strong {
  display: block;
  font-size: 1.15rem;
}

.policy-list span {
  color: var(--muted);
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

@media (min-width: 48rem) {
  .hero .wrap {
    grid-template-columns: 5fr 7fr;
  }

  .gallery {
    grid-template-columns: 1fr 1fr;
  }

  .gallery .wide-first {
    grid-column: 1 / -1;
  }

  .devices {
    grid-template-columns: 2fr 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .site-nav a,
  .site-head .play {
    transition: background-color 0.15s, color 0.15s;
  }

  /* Only the drawer moves: the inline nav never changes visibility or transform. */
  .site-nav {
    transition: transform 0.2s ease-out, visibility 0.2s;
  }

  .play-video svg {
    transition: transform 0.15s;
  }

  .play-video:hover svg {
    transform: scale(1.06);
  }

  .play-video circle {
    transition: fill 0.15s;
  }
}
