/*
 * scout.mmgs.app — the one stylesheet every page shares. No scripts, no web fonts,
 * no third-party requests: the privacy policy promises this site tracks
 * nothing, and the CSP in ../../firebase.json holds it to that.
 *
 * Dark is the app's own stage (StageTheme.swift: bg, cardFill, textPrimary,
 * amber). Light is warm paper inked with the icon's frame colour. Every
 * text/background pair below clears WCAG AA; the light accent is one shade
 * darker than the app's AccentColor, because #B35900 measures only 4.58:1 on
 * this paper and #A14F00 measures 5.47:1.
 */

:root {
  color-scheme: dark light;
  --bg: #14100c;
  --surface: #1c1611;
  --text: #f5ede2;
  --text-2: #b6afa6;
  --accent: #e8a33d;
  --brand: #ff9500;
  --on-brand: #241708;
  --hairline: rgb(255 235 210 / 0.14);
  --font-text: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", var(--font-text);
  --measure: 40rem;
  --radius: 18px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fff8ec;
    --surface: #f7eedd;
    --text: #241c16;
    --text-2: #5d554e;
    --accent: #a14f00;
    --hairline: rgb(36 28 22 / 0.12);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* In-page links land below the sticky bar, not under it. */
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.8 var(--font-text);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

img {
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.wrap {
  width: min(100% - 2.5rem, var(--measure));
  margin-inline: auto;
}

/* Hidden until a keyboard reaches it, then the first stop on every page. */
.skip {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 20;
  padding: 0.5rem 0.875rem;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

/* On a phone the links wrap under the name and the bar is two rows tall;
   pinned, that would cost every page a tenth of the screen. It scrolls away. */
@media (max-width: 40rem) {
  html {
    scroll-padding-top: 1rem;
  }

  .site-header {
    position: static;
  }
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.25rem;
  padding-block: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  font: 700 1.0625rem/1 var(--font-display);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.bar nav {
  display: flex;
  gap: 1.125rem;
  font-size: 0.9375rem;
}

.bar nav a {
  padding-block: 0.25rem;
  color: var(--text-2);
  text-decoration: none;
}

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

.bar nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline 2px var(--brand);
  text-underline-offset: 0.45em;
}

/* ------------------------------------------------------------- documents */

.doc {
  padding-block: 2.5rem 4.5rem;
}

.doc h1,
.hero h1 {
  margin: 0;
  font: 800 clamp(2rem, 1.4rem + 2.6vw, 2.6rem) / 1.2 var(--font-display);
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.meta {
  margin: 0.75rem 0 0;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.lede {
  margin: 1.5rem 0 0;
}

.doc h2 {
  margin: 3rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
  font: 700 1.3125rem/1.45 var(--font-display);
}

.doc h3 {
  margin: 1.75rem 0 0;
  font-size: 1.0625rem;
}

.doc p,
.doc ul,
.doc ol {
  margin: 1rem 0 0;
}

.doc ul,
.doc ol {
  padding-left: 1.4em;
}

.doc li + li {
  margin-top: 0.5rem;
}

.doc li::marker {
  color: var(--accent);
}

.doc strong {
  font-weight: 600;
}

/* The summary is a ticket stub — the same metaphor as the app's cart and
   order tickets. The notches sit exactly on the perforation line. */
.ticket {
  --notch: 11px;
  --stub: 3.25rem;
  --cut-y: calc(var(--stub) - 1px);
  margin-top: 2rem;
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-mask:
    radial-gradient(circle at 0 var(--cut-y), transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% var(--cut-y), transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle at 0 var(--cut-y), transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% var(--cut-y), transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
}

/* After `.doc h2`, same specificity: the stub wins on every page. */
.ticket h2 {
  display: flex;
  align-items: center;
  height: var(--stub);
  margin: 0;
  padding: 0 1.5rem;
  border-top: 0;
  border-bottom: 2px dashed var(--hairline);
  color: var(--accent);
  font: 700 0.8125rem/1 var(--font-text);
  letter-spacing: 0.16em;
}

.ticket-body {
  padding: 1.125rem 1.5rem 1.375rem;
}

.ticket-body > :first-child {
  margin-top: 0;
}

.ticket-body ul {
  margin: 0;
  padding-left: 1.4em;
}

.ticket-body li + li {
  margin-top: 0.5rem;
}

.ticket-body li::marker {
  color: var(--accent);
}

.ticket-body strong {
  font-weight: 600;
}

.mail {
  font: 700 1.375rem/1.4 var(--font-display);
  overflow-wrap: anywhere;
}

/* iMessage is offered only where Apple's own WebKit runs: iPhone and iPad in
   any browser (touch-callout) and Safari on the Mac (Apple Pay styling). A page
   cannot learn whether iMessage is switched on, so the email stays for
   everyone and the note says what the button needs. */
.imessage {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
}

@supports (-webkit-touch-callout: none) or (-apple-pay-button-style: black) {
  .imessage {
    display: flex;
  }
}

.imessage-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease;
}

.imessage-link:active {
  transform: scale(0.97);
}

.imessage-note {
  color: var(--text-2);
  font-size: 0.875rem;
}

.toc {
  margin-top: 2.5rem;
}

.toc-label {
  margin: 0;
  color: var(--text-2);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
}

.doc .toc ol {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  columns: 2 15rem;
  column-gap: 2rem;
}

.doc .toc li {
  margin: 0;
  padding-block: 0.2rem;
  break-inside: avoid;
}

.toc a {
  color: var(--text-2);
  text-decoration: none;
}

.toc a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ------------------------------------------------------------------ FAQ */

.faq {
  margin-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.faq details {
  border-bottom: 1px solid var(--hairline);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.125rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] > summary::after {
  transform: translateY(25%) rotate(-135deg);
}

.faq .answer {
  padding-bottom: 1.25rem;
}

.faq .answer > :first-child {
  margin-top: 0;
}

/* ----------------------------------------------------------------- home */

.home {
  padding-block: 3rem 4.5rem;
}

.hero-icon {
  filter: drop-shadow(0 10px 24px rgb(0 0 0 / 0.28));
}

.hero h1 {
  margin-top: 1.75rem;
  font-size: clamp(2.4rem, 1.5rem + 4.4vw, 3.4rem);
  line-height: 1.15;
}

.hero .lede {
  color: var(--text-2);
  font-size: 1.125rem;
}

.steps {
  display: grid;
  gap: 1.75rem;
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 1.125rem;
}

/* The verb of each step, stamped like the seals the app uses for shops. */
.seal {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font: 800 1.25rem/1 var(--font-display);
  transform: rotate(-8deg);
}

.steps h2 {
  margin: 0.125rem 0 0;
  font: 700 1.125rem/1.5 var(--font-display);
}

.steps p {
  margin: 0.25rem 0 0;
  color: var(--text-2);
}

.partner {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
}

.partner h2 {
  margin: 0;
  font: 700 1.3125rem/1.45 var(--font-display);
}

.partner p {
  margin: 0.75rem 0 0;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--hairline);
  color: var(--text-2);
  font-size: 0.875rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.site-footer a {
  color: var(--text-2);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-footer p {
  margin: 0.75rem 0 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Legal pages get printed and filed. Paper in, paper out. */
@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --text: #000;
    --text-2: #333;
    --accent: #000;
    --hairline: #bbb;
  }

  body {
    font-size: 11pt;
  }

  .skip,
  .site-header,
  .toc,
  .site-footer nav {
    display: none;
  }

  a {
    text-decoration: none;
  }

  .ticket {
    border: 1px solid var(--hairline);
    -webkit-mask: none;
    mask: none;
  }
}
