/* Revenant [REV] — static alliance site
   Mobile-first neumorphism based on the supplied reference site. */

:root {
  --header-h: 78px;
  --content-max: 1120px;
  --side-pad: 18px;

  --radius-lg: 16px;
  --radius-md: 11px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --font: "Nunito", "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --lift-x: 6px;
  --lift-y: 6px;
  --lift-blur: 13px;
  --inset-x: 5px;
  --inset-y: 5px;
  --inset-blur: 10px;

  /* Default palette: lilac. app.js can replace these from THEMES. */
  --bg: #ede8fb;
  --bg2: #e9e2fb;
  --surface: #eee9fc;
  --surface-strong: #f2effd;
  --text: #2c2a39;
  --muted: rgba(44, 42, 57, .60);
  --accent: #7a4dff;
  --accent-2: #b9a7ff;
  --accent-soft: rgba(122, 77, 255, .14);
  --shadow-dark: rgba(160, 150, 190, .34);
  --shadow-light: rgba(255, 255, 255, .78);
  --overlay: rgba(34, 28, 50, .42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(950px 650px at 20% 12%, rgba(255,255,255,.18) 0%, transparent 58%),
    radial-gradient(1100px 700px at 84% 28%, rgba(255,255,255,.12) 0%, transparent 62%),
    linear-gradient(145deg, var(--bg2), var(--bg));
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }

button, select, input { font: inherit; }
button, select { border: 0; }
a { color: inherit; }
img { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.neu {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--lift-x) var(--lift-y) var(--lift-blur) var(--shadow-dark),
    calc(var(--lift-x) * -1) calc(var(--lift-y) * -1) var(--lift-blur) var(--shadow-light);
}
.neu-inset {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow:
    inset var(--inset-x) var(--inset-y) var(--inset-blur) color-mix(in srgb, var(--shadow-dark) 44%, transparent),
    inset calc(var(--inset-x) * -1) calc(var(--inset-y) * -1) var(--inset-blur) color-mix(in srgb, var(--shadow-light) 72%, transparent);
}

/* ---------- Site header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  min-height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: calc(12px + env(safe-area-inset-top)) calc(var(--side-pad) + env(safe-area-inset-right)) 10px calc(var(--side-pad) + env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(255,255,255,.24), rgba(255,255,255,.06));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand {
  min-width: 0;
  margin-right: auto;
  text-decoration: none;
  display: block;
}
.brand-name {
  display: block;
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: .1px;
  white-space: nowrap;
}
.brand-tag {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.icon-btn,
.theme-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  box-shadow:
    var(--lift-x) var(--lift-y) var(--lift-blur) var(--shadow-dark),
    calc(var(--lift-x) * -1) calc(var(--lift-y) * -1) var(--lift-blur) var(--shadow-light);
}
.icon-btn,
.theme-btn {
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn:active,
.theme-btn:active {
  box-shadow:
    inset var(--inset-x) var(--inset-y) var(--inset-blur) color-mix(in srgb, var(--shadow-dark) 46%, transparent),
    inset calc(var(--inset-x) * -1) calc(var(--inset-y) * -1) var(--inset-blur) color-mix(in srgb, var(--shadow-light) 72%, transparent);
}
.theme-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, var(--theme-next-1, #f2a0cc), var(--theme-next-2, #d34f92));
  box-shadow: inset 2px 2px 6px rgba(0,0,0,.1), inset -2px -2px 6px rgba(255,255,255,.46);
}
.lang-shell {
  position: relative;
  width: 78px;
  height: 42px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow: hidden;
}
.language-globe {
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
}
.language-code {
  min-width: 18px;
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: .035em;
  text-align: center;
  pointer-events: none;
}
.language-arrow {
  margin-top: -1px;
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
}
.language-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
/* ---------- Main ---------- */
.site-main {
  flex: 1 0 auto;
  width: 100%;
  padding: calc(var(--header-h) + 26px + env(safe-area-inset-top)) var(--side-pad) calc(34px + env(safe-area-inset-bottom));
}
.content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}
.hero {
  padding: 24px 4px 22px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
.hero h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(31px, 9vw, 58px);
  line-height: 1.02;
  font-weight: 420;
  letter-spacing: -.025em;
}
.hero p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 4.5vw, 19px);
  line-height: 1.55;
  font-weight: 520;
}


/* ---------- Leader quote ---------- */
.leader-quote {
  width: 100%;
  margin: 4px 0 28px;
  padding: 20px 22px;
}
.leader-quote blockquote > p,
.leader-quote blockquote footer {
  font-size: 16px;
  line-height: 1.55;
  font-weight: 520;
}
.quote-label {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 22px;
  font-weight: 520;
}
.leader-quote blockquote {
  margin: 0;
}
.leader-quote blockquote > p {
  margin: 0;
  color: var(--muted);
}
.leader-quote blockquote > p::before { content: "“"; }
.leader-quote blockquote > p::after { content: "”"; }
.leader-quote blockquote footer {
  margin-top: 10px;
  color: var(--muted);
}
.leader-quote cite { font-style: normal; }

.card-grid {
  display: grid;
  gap: 18px;
}
.card {
  padding: 20px;
}
.card h2,
.card h3 {
  margin: 0;
  font-weight: 520;
}
.card h2 { font-size: 22px; }
.card h3 { font-size: 19px; }
.card p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 520;
}
.card-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.action-link,
.action-btn {
  min-height: 42px;
  padding: 0 15px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 750;
  background: var(--surface);
  color: var(--text);
  box-shadow:
    var(--lift-x) var(--lift-y) var(--lift-blur) var(--shadow-dark),
    calc(var(--lift-x) * -1) calc(var(--lift-y) * -1) var(--lift-blur) var(--shadow-light);
}
.action-link.primary,
.action-btn.primary {
  color: #fff;
  background: radial-gradient(180px 90px at 30% 20%, var(--accent-2) 0%, var(--accent) 76%);
}
.action-link:active,
.action-btn:active {
  box-shadow:
    inset var(--inset-x) var(--inset-y) var(--inset-blur) rgba(0,0,0,.12),
    inset calc(var(--inset-x) * -1) calc(var(--inset-y) * -1) var(--inset-blur) rgba(255,255,255,.28);
}

.home-grid { margin-top: 8px; }
.quick-card {
  display: flex;
  flex-direction: column;
  min-height: 175px;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.quick-card:hover { transform: translateY(-2px); }
.quick-card:active { transform: translateY(0); }
.card-cta {
  margin-top: auto;
  padding-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 800;
}

.notice {
  margin-top: 18px;
  padding: 16px 18px;
  color: var(--muted);
  line-height: 1.5;
}

.tbd {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
}
.tbd-inner { max-width: 500px; }
.tbd-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 27px;
  color: var(--accent);
}


/* Preserve intentional line breaks from translation resources. */
.i18n-preline { white-space: pre-line; }

/* ---------- Reference lists ---------- */
.rules-grid {
  display: grid;
  gap: 18px;
}
.rule-card p { font-size: 16px; }
.ratio-list {
  margin-top: 14px;
  padding: 13px 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 11px;
  color: var(--text);
  font-weight: 750;
}
.ratio-list span:nth-child(2) {
  color: var(--muted);
  font-weight: 520;
}
.gift-card { padding: 8px 20px; }
.gift-list {
  margin: 0;
  padding: 0 0 0 28px;
}
.gift-list li {
  padding: 14px 0;
  line-height: 1.5;
  font-weight: 520;
}
.gift-list li + li {
  border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}
.gift-list li::marker {
  color: var(--accent);
  font-weight: 800;
}
.gift-list li > span:first-child {
  font-weight: 750;
}
.gift-separator {
  margin: 0 7px;
  color: var(--muted);
}

/* ---------- Bear map ---------- */
.map-section + .map-section { margin-top: 30px; }
.map-section > h2 {
  margin: 0 4px 12px;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 560;
}
.map-card { padding: 14px; }
.map-frame {
  overflow: hidden;
  min-height: 280px;
  border-radius: var(--radius-md);
  background: var(--surface);
  position: relative;
  touch-action: none;
  box-shadow:
    inset var(--inset-x) var(--inset-y) var(--inset-blur) color-mix(in srgb, var(--shadow-dark) 38%, transparent),
    inset calc(var(--inset-x) * -1) calc(var(--inset-y) * -1) var(--inset-blur) color-mix(in srgb, var(--shadow-light) 68%, transparent);
}
.map-image {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 50%;
  transition: transform .08s linear;
  user-select: none;
  -webkit-user-drag: none;
  cursor: zoom-in;
}
.map-toolbar {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.map-toolbar .action-btn,
.map-toolbar .action-link { min-width: 44px; padding-inline: 13px; }
.map-hint { margin: 11px 2px 0; color: var(--muted); font-size: 13px; }

/* Full screen map viewer */
.map-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  background: var(--overlay);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  padding: 14px;
}
.map-modal[aria-hidden="false"] { display: flex; flex-direction: column; }
.modal-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-bottom: 12px;
}
.modal-stage {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  touch-action: none;
}
.modal-stage img {
  max-width: none;
  width: min(96vw, 1500px);
  transform-origin: center;
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
}
.modal-stage img.dragging { cursor: grabbing; }

/* ---------- Footer ---------- */
.footer {
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--content-max);
  margin: auto auto 0;
  padding: 20px var(--side-pad) calc(20px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
}

/* ---------- Desktop ---------- */
@media (min-width: 760px) {
  :root { --side-pad: 30px; }
  .site-header {
    padding-left: max(var(--side-pad), calc((100vw - var(--content-max)) / 2));
    padding-right: max(var(--side-pad), calc((100vw - var(--content-max)) / 2));
  }
  .brand-name { font-size: 22px; }
  .brand-tag { font-size: 13px; }
  .site-main { padding-top: calc(var(--header-h) + 34px); }
  .hero { padding-top: 14px; }
  .card-grid.home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map-card { padding: 18px; }
}

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

/* ---------- RTL language support ---------- */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .site-header { direction: ltr; }
html[dir="rtl"] .brand { direction: rtl; text-align: left; }
html[dir="rtl"] .language-select { direction: rtl; }
html[dir="rtl"] .card-cta { flex-direction: row-reverse; }
html[dir="rtl"] .ratio-list { direction: ltr; unicode-bidi: isolate; }
