/* Destiny Encounters — App Shell
   Type: Fjalla One + Libre Franklin (confirmed live on destinyencounters.com)
   Palette: pulled directly from destinyencounters.com computed styles 2026-07-17 —
   white body, black text/nav, gold-amber + teal accents, black CTA buttons. */

:root {
  --white: #ffffff;
  --ink: #1f1f1f;
  --ink-soft: #4a4a4a;
  --line: #e6e4de;
  --panel: #faf9f6;
  --gold: #de8a02;
  --gold-lit: #f5c344;
  --teal: #52c2c8;
  --black: #0a0a0a;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --head: "Fjalla One", Impact, sans-serif;
  --body: "Libre Franklin", -apple-system, system-ui, sans-serif;
  --wrap: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

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

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 50; }
.masthead .wrap { display: flex; align-items: center; gap: 14px; height: 66px; }
.masthead img { width: 40px; height: 40px; border-radius: 8px; }
.masthead .org { font-family: var(--head); font-size: 15px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink); line-height: 1.15; }
.masthead .org span { display: block; font-size: 10.5px; color: var(--gold); letter-spacing: .28em; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 62px 0 34px; }
.hero .emblem { width: 128px; height: 128px; margin: 0 auto 26px; display: block; filter: drop-shadow(0 6px 24px rgba(0,0,0,.12)); }
.hero h1 { font-family: var(--head); font-weight: 400; letter-spacing: .045em; text-transform: uppercase; line-height: 1.06; color: var(--ink); }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .kicker { color: var(--muted); font-size: 15px; margin-top: 14px; max-width: 570px; margin-inline: auto; }

/* ---------- section grid ---------- */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.section-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 18px 16px;
  text-decoration: none;
  transition: border-color .18s, transform .18s, background .18s, box-shadow .18s;
}
.section-card:hover { border-color: var(--gold); background: var(--white); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.section-card .card-text { min-width: 0; }
.section-card .tag {
  display: inline-block;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 8px;
}
.section-card h3 {
  font-family: var(--head);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .02em;
  color: var(--ink);
  margin-bottom: 6px;
}
.section-card p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.section-card .thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; margin-bottom: 12px; background: var(--line); }

/* ---------- inline complementary icon (Option C: soft chip, filled icon) ---------- */
.section-card .card-icon {
  flex-shrink: 0;
  width: 60px; height: 60px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(82,194,200,.18), rgba(222,138,2,.12));
  display: flex; align-items: center; justify-content: center;
}
.section-card .card-icon svg { width: 28px; height: 28px; stroke: none; fill: var(--ink); }

/* ---------- home page featured strip: Archive + Academy, the two real differentiators ---------- */
.hero-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px; margin-top: 8px;
}
.hero-card {
  position: relative; display: flex; align-items: flex-end; min-height: 190px;
  border-radius: 14px; overflow: hidden; text-decoration: none;
  background-size: cover; background-position: center; background-color: var(--panel);
  box-shadow: 0 10px 28px rgba(0,0,0,.10); transition: transform .18s;
}
.hero-card:hover { transform: translateY(-2px); }
.hero-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.82)); }
.hero-card.dark { background-color: #0a0a0a; background-size: 130px; background-repeat: no-repeat; background-position: center 30%; }
.hero-card-body { position: relative; z-index: 2; padding: 20px 22px; }
.hero-card-body .tag { display: inline-block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--teal); margin-bottom: 6px; }
.hero-card-body .tag.gold { color: var(--gold-lit); }
.hero-card-body h2 { font-family: var(--head); font-weight: 400; letter-spacing: .02em; font-size: 24px; color: #fff; margin-bottom: 4px; }
.hero-card-body p { color: rgba(255,255,255,.82); font-size: 13.5px; }

/* ---------- black CTA button (matches site's "FREE RESOURCES →" style) ---------- */
.btn-black {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  font-family: var(--head);
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 13px;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 4px;
  transition: background .18s;
}
.btn-black:hover { background: #262626; }

/* ---------- masthead settings gear ---------- */
.gear-btn { color: var(--ink); display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; }
.gear-btn svg { width: 21px; height: 21px; }
.gear-btn:hover { color: var(--gold); }

/* ---------- toggle switch (Settings) ---------- */
.toggle { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .track { position: absolute; inset: 0; background: var(--line); border-radius: 13px; transition: background .18s; cursor: pointer; }
.toggle .track::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle input:checked + .track { background: var(--teal); }
.toggle input:checked + .track::before { transform: translateX(20px); }

/* ---------- settings page cards ---------- */
.settings-grid { max-width: 620px; margin: 22px auto 60px; padding: 0 24px; display: flex; flex-direction: column; gap: 14px; }
.settings-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.settings-card .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.settings-card .row + .row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-card h3 { font-family: var(--head); font-weight: 400; letter-spacing: .02em; font-size: 17px; color: var(--ink); margin-bottom: 3px; }
.settings-card p.desc { color: var(--muted); font-size: 13px; line-height: 1.5; }
.settings-card input[type=text], .settings-card input[type=email] {
  width: 100%; box-sizing: border-box; padding: 10px 12px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 6px; font-family: var(--body); font-size: 14px; background: var(--white);
}
.settings-card label.field { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 12px; }
.settings-card label.field:first-child { margin-top: 0; }
.settings-status { font-size: 12.5px; padding: 3px 10px; border-radius: 12px; font-weight: 700; }
.settings-status.on { background: rgba(82,194,200,.16); color: #1c6266; }
.settings-status.off { background: var(--line); color: var(--muted); }

/* ---------- live alerts banner: sits above the whole section grid, most visible spot on home ---------- */
.live-banner {
  display: flex; align-items: center; gap: 14px;
  background: #131313; border-radius: 14px; padding: 16px 18px;
  text-decoration: none; margin-top: 22px;
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
}
.live-banner .live-dot { width: 10px; height: 10px; border-radius: 50%; background: #e5433c; flex-shrink: 0; animation: livePulse 1.4s infinite; }
.live-banner.offline .live-dot { background: var(--gold-lit); animation: none; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.live-banner-text { flex: 1; min-width: 0; }
.live-banner-tag { display: block; font-family: var(--head); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.live-banner-sub { display: block; font-size: 12.5px; color: rgba(255,255,255,.65); margin-top: 2px; }
.live-banner-arrow { color: var(--gold-lit); font-size: 20px; flex-shrink: 0; }
.live-banner-thumb { display: none; width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.live-banner.countdown .live-banner-thumb { display: block; }
.live-banner.countdown .live-dot { display: none; }
.live-banner.countdown .live-banner-tag { color: var(--gold-lit); }

/* ---------- in-app overlay: external pages open here, app never loses its shell ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--white);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .22s ease;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.overlay.open { transform: translateY(0); }
.overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.overlay-back {
  background: var(--gold);
  color: #0b0c0e;
  border: none;
  font-family: var(--head);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  order: 2;
}
.overlay-title {
  font-family: var(--head);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.overlay iframe { flex: 1; width: 100%; border: none; }

/* ---------- native submenu pages (About / Missions / Media) ---------- */
.submenu-masthead .wrap { justify-content: space-between; }
.submenu-back {
  background: var(--gold); color: #0b0c0e; text-decoration: none; font-family: var(--head);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 7px 12px;
  border-radius: 4px; white-space: nowrap;
}
.submenu-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; max-width: var(--wrap); margin: 26px auto 60px; padding: 0 24px;
}
.submenu-card {
  display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; transition: border-color .18s, transform .18s;
}
.submenu-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.submenu-card .photo { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: var(--line); }
.submenu-card .photo.person { object-position: top center; }
.submenu-card .body { padding: 16px 18px 18px; }
.submenu-card h3 { font-family: var(--head); font-weight: 400; font-size: 18px; letter-spacing: .02em; color: var(--ink); margin-bottom: 5px; }
.submenu-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.submenu-card.text-only .body { padding: 26px 22px; }

/* ---------- placeholder pages (archive/academy stubs) ---------- */
.placeholder {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}
.placeholder img { width: 84px; height: 84px; margin-bottom: 22px; filter: drop-shadow(0 6px 24px rgba(0,0,0,.12)); }
.placeholder h1 { font-family: var(--head); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; font-size: clamp(24px,5vw,34px); margin-bottom: 12px; color: var(--ink); }
.placeholder p { color: var(--muted); max-width: 460px; margin-bottom: 26px; }
.placeholder a.back { color: var(--gold); text-decoration: none; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
