/* Luna Operations Apps — shared styles (home, app pages, legal, 404) */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0b0c;
  --bg-elev: #131210;
  --bg-card: #161512;
  --bg-glow: #1c1812;
  --ink: #f3efe6;
  --ink-dim: #c9c3b6;
  --muted: #8f8a80;
  --gold: #c4a35a;
  --gold-bright: #d8b56e;
  --line: rgba(196, 163, 90, 0.28);
  --line-strong: rgba(196, 163, 90, 0.55);
  --focus: #e8d5a3;
  --max: 1120px;
  --narrow: 40rem;
  --radius: 1rem;
  --header-h: 4.5rem;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

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

html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, var(--bg-glow) 0%, var(--bg) 62%);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-bright); text-underline-offset: 0.18em; }
a:hover { color: #f0d59a; }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 100;
  padding: 0.5rem 0.85rem;
  background: var(--gold);
  color: #16120a;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.35rem;
  transform: translateY(-150%);
}
.skip:focus-visible { transform: none; }

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 11, 12, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand img {
  height: 3.15rem;
  width: 3.15rem;
  object-fit: contain;
}
.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 1.5rem;
}
.site-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.25rem 0;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--gold);
}
.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  position: relative;
  margin: 0 auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.site-header.is-open .nav-toggle-bars { background: transparent; }
.site-header.is-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.site-header.is-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

/* ----- Layout ----- */
.site-main {
  flex: 1 0 auto;
  width: 100%;
}
.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
}
.wrap-narrow {
  width: min(var(--narrow), calc(100% - 2.5rem));
  margin: 0 auto;
}
.section { padding: 3.5rem 0; }
.section + .section { padding-top: 0; }
.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 550;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 4.2vw, 3.15rem); margin: 0 0 0.85rem; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); margin: 0 0 1.15rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.4rem; font-weight: 600; }
.lead { font-size: 1.15rem; color: var(--ink-dim); max-width: 38rem; margin: 0; }
.goldline,
.page-title::after {
  content: "";
  display: block;
  width: 3.25rem;
  height: 2px;
  background: var(--gold);
  margin: 0.9rem 0 1.4rem;
  border: 0;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--muted);
}
.crumbs a { color: var(--ink-dim); text-decoration: none; }
.crumbs a:hover { color: var(--gold-bright); text-decoration: underline; }
.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--muted);
}

/* ----- Home hero ----- */
.hero-home {
  padding: 4.25rem 0 2.5rem;
  text-align: center;
}
.hero-home .lead { margin: 0 auto; }
.hero-home h1 { margin-left: auto; margin-right: auto; }
.hero-home .goldline { margin-left: auto; margin-right: auto; }

/* ----- App card grid (1 card now, many later) ----- */
#apps { padding: 1rem 0 4.5rem; }
.app-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20.5rem), 1fr));
  gap: 1.5rem;
  justify-content: center;
  justify-items: center;
  max-width: 52rem;
}
.app-card {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 24.5rem;
  width: 100%;
  justify-self: center;
}
.app-card a.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  padding: 1.35rem 1.35rem 1.2rem;
  gap: 0.85rem;
}
.app-card a.card-link:hover { color: inherit; }
.app-card a.card-link:hover .card-cta { color: #f0d59a; }
.app-card a.card-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.card-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1rem;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px var(--line-strong);
}
.card-titles { min-width: 0; }
.card-titles h2,
.card-titles h3 {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
}
.card-tagline {
  margin: 0;
  color: var(--gold);
  font-size: 0.92rem;
  line-height: 1.4;
}
.card-blurb {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.95rem;
  flex: 1 1 auto;
}
.card-cta {
  margin: 0.25rem 0 0;
  color: var(--gold-bright);
  font-weight: 600;
  font-size: 0.92rem;
}
.card-cta::after { content: " →"; }

/* ----- App hero ----- */
.hero-app {
  position: relative;
  isolation: isolate;
  padding: 3.25rem 0 3rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
}
.hero-app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(11, 11, 12, 0.55) 0%, rgba(11, 11, 12, 0.78) 55%, var(--bg) 100%);
  pointer-events: none;
}
.hero-app-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.6rem 2rem;
  align-items: center;
}
.hero-icon {
  width: 8.5rem;
  height: 8.5rem;
  border-radius: 1.4rem;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line-strong), var(--shadow);
}
.hero-app .tagline {
  margin: 0 0 0.65rem;
  color: var(--gold-bright);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 500;
}
.hero-app .subhead {
  margin: 0 0 1.25rem;
  color: var(--ink-dim);
  max-width: 36rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
}
.play-badge {
  display: inline-block;
  line-height: 0;
}
.play-badge img {
  height: 3.6rem;
  width: auto;
  margin-left: -0.55rem; /* official badge has built-in padding */
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.15rem;
  font-size: 0.92rem;
}
.hero-links a { color: var(--ink-dim); }
.hero-links a:hover { color: var(--gold-bright); }

/* ----- Feature highlights ----- */
.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}
.feature-grid li {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1.15rem 1.2rem 1.2rem;
}
.feature-grid h3 { color: var(--gold-bright); font-size: 1.05rem; }
.feature-grid p { margin: 0; color: var(--ink-dim); font-size: 0.95rem; }

/* ----- Gallery ----- */
.gallery-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 0 1rem;
  margin: 0 -0.25rem;
  -webkit-overflow-scrolling: touch;
}
.gallery-scroll figure {
  margin: 0;
  flex: 0 0 auto;
  width: min(14.5rem, 62vw);
  scroll-snap-align: start;
}
.gallery-scroll.landscape figure {
  width: min(28rem, 80vw);
}
.gallery-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  overflow: hidden;
  background: #000;
  cursor: zoom-in;
  box-shadow: var(--shadow);
}
.gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}
.gallery-scroll.landscape .gallery-item img {
  aspect-ratio: 16 / 9;
}
.gallery-scroll figcaption {
  margin: 0.5rem 0.15rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.lightbox {
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  padding: 0;
  background: #0a0a0b;
  color: var(--ink);
  max-width: min(96vw, 1100px);
  width: 96vw;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.84); }
.lightbox-inner { padding: 1rem 1rem 1.15rem; }
.lightbox img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  margin: 0 auto;
}
.lightbox-cap { margin: 0.75rem 0 0; color: var(--ink-dim); text-align: center; }
.lightbox-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 11, 12, 0.85);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
}
.lightbox { position: relative; }

/* ----- Split media sections ----- */
.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: start;
}
.split img {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}
.item-list li:last-child { border-bottom: 1px solid var(--line); }
.item-list strong { color: var(--ink); }
.item-list span.kind {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 500;
}

/* ----- Modes ----- */
.mode-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}
.mode-grid li {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1.15rem 1.2rem;
}
.mode-grid p { margin: 0; color: var(--ink-dim); font-size: 0.95rem; }
.mode-grid h3 a { color: inherit; text-decoration: none; }
.mode-grid h3 a:hover { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 0.15em; }


/* ----- Featured mission ----- */
.mission-feature .eyebrow { margin-bottom: 0.55rem; }
.mission-feature .lead { margin: 0 0 1.15rem; max-width: 44rem; }
.mission-feature .item-list { margin: 0 0 1.25rem; }
.mission-feature > p { max-width: 44rem; }
.mission-ui {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.35rem;
}
.mission-ui figure { margin: 0; }
.mission-ui .gallery-item { border-radius: 0.9rem; }
.mission-ui .gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 844 / 390;
  object-fit: cover;
}
.mission-ui figcaption {
  margin: 0.5rem 0.15rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}
@media (max-width: 700px) {
  .mission-ui { grid-template-columns: 1fr; }
}
/* ----- Privacy strip ----- */
.privacy-strip {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
}
.privacy-strip p { margin: 0 0 0.85rem; color: var(--ink-dim); }
.privacy-strip p:last-child { margin-bottom: 0; }

/* ----- Legal / policy ----- */
.legal-top { padding: 2.4rem 0 3.5rem; }
.policy-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}
.policy-switch a {
  text-decoration: none;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
}
.policy-switch a:hover { color: var(--ink); border-color: var(--line-strong); }
.policy-switch a[aria-current="page"] {
  color: #16120a;
  background: var(--gold);
  border-color: var(--gold);
}
.policy h1 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); }
.policy h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.7rem;
  padding-top: 0.4rem;
}
.policy h3 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.45rem;
}
.policy p, .policy li { color: var(--ink-dim); }
.policy p { margin: 0 0 0.9rem; }
.policy ul, .policy ol { margin: 0 0 1rem; padding-left: 1.25rem; }
.policy li { margin: 0 0 0.35rem; }
.policy li::marker { color: var(--gold); }

/* ----- Contact ----- */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.7rem;
  margin: 1.5rem 0 0;
}
.contact-card .mail {
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--gold-bright);
}
.contact-card .mail:hover { color: #f0d59a; }
.note { color: var(--muted); font-size: 0.95rem; }

/* ----- 404 ----- */
.page-404 {
  text-align: center;
  padding: 5rem 0 6rem;
}
.page-404 .lead { margin: 0 auto 1.5rem; }

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2rem;
  margin-top: auto;
}
.foot-inner {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.foot-inner a { color: var(--ink-dim); text-decoration: none; }
.foot-inner a:hover { color: var(--gold-bright); text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }

/* ----- Buttons (text) ----- */
.btn {
  display: inline-block;
  background: var(--gold);
  color: #16120a;
  font-weight: 600;
  text-decoration: none;
  padding: 0.65rem 1.15rem;
  border-radius: 0.45rem;
}
.btn:hover { color: #16120a; background: var(--gold-bright); }

/* ----- Responsive ----- */
@media (max-width: 800px) {
  .hero-app-inner { grid-template-columns: 1fr; }
  .hero-icon { width: 6.5rem; height: 6.5rem; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: rgba(11, 11, 12, 0.97);
    border-bottom: 1px solid var(--line);
  }
  .site-header.is-open .site-nav { display: flex; }
  .site-nav a { padding: 0.7rem 0; }
  .header-inner { width: min(var(--max), calc(100% - 2rem)); }
  .wrap, .wrap-narrow, .foot-inner { width: min(var(--max), calc(100% - 2rem)); }
  .hero-home { padding-top: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { transition: none; }
}
@media print {
  body { background: #fff; color: #111; }
  .site-header, .site-footer, .nav-toggle, .play-badge, .gallery-scroll, .skip { display: none !important; }
  .policy p, .policy li, a { color: #111; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}

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

#apps > h2 { text-align: center; margin-bottom: 1.75rem; }
.kind { color: var(--gold); font-size: 0.82rem; font-weight: 500; font-family: "IBM Plex Sans", system-ui, sans-serif; }

.page-404 .goldline { margin-left: auto; margin-right: auto; }

.coming-soon {
  margin: 0;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.ver-line {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.subhead + .ver-line { margin: -0.5rem 0 1.15rem; }

.hero-actions .coming-soon,
.hero-actions .coming-soon + .ver-line {
  flex: 1 0 100%;
  margin: 0;
}
.hero-actions .coming-soon + .ver-line { margin-top: -0.45rem; }
