/* Eluna — shared site styles. One file for every page. */

/* Manrope, self-hosted. No request ever leaves this site for a font: a page
   that promises "your data stays on your device" must not ship its visitors'
   IPs to a fonts CDN just to render that promise. */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0c0a13;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-elev: #171221;
  --text: #ece8f4;
  --text-dim: #a79fbc;
  --accent: #a586ff;
  --accent-2: #e879b9;
  --accent-soft: rgba(157, 123, 255, 0.13);
  --border: rgba(157, 123, 255, 0.16);
  --border-strong: rgba(157, 123, 255, 0.38);
  --shadow: rgba(0, 0, 0, 0.45);
  --header-bg: rgba(12, 10, 19, 0.72);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf9fd;
    --bg-card: #ffffff;
    --bg-elev: #ffffff;
    --text: #1e1930;
    --text-dim: #625a7c;
    --accent: #6a3de8;
    --accent-2: #c2418f;
    --accent-soft: rgba(106, 61, 232, 0.07);
    --border: rgba(106, 61, 232, 0.14);
    --border-strong: rgba(106, 61, 232, 0.35);
    --shadow: rgba(30, 25, 48, 0.07);
    --header-bg: rgba(250, 249, 253, 0.78);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Soft ambient glow, echoing the apps' background */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(55% 38% at 18% -4%, var(--accent-soft), transparent 70%),
    radial-gradient(45% 32% at 92% 8%, rgba(232, 121, 185, 0.08), transparent 70%),
    radial-gradient(60% 45% at 50% 110%, var(--accent-soft), transparent 72%);
  pointer-events: none;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Header ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -22px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: "🌙";
  font-size: 1.05rem;
  filter: hue-rotate(20deg);
}

.brand span { color: var(--accent); }

nav.site a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

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

main { padding: 28px 0 56px; }

/* ---------- Type ---------- */

h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0.6em 0 0.4em;
}

h2 {
  font-size: 1.45rem;
  letter-spacing: -0.015em;
  font-weight: 800;
  margin: 2.2em 0 0.5em;
}

h3 { font-size: 1.08rem; font-weight: 700; margin: 1.7em 0 0.4em; }

p { margin: 0.7em 0; }

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

::selection { background: var(--accent); color: #fff; }

/* ---------- Hero ---------- */

.hero { padding: 56px 0 8px; }

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.1rem);
  margin: 0 0 0.35em;
  max-width: 15em;
}

.hero em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  color: var(--text-dim);
  font-size: 1.12rem;
  max-width: 40em;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 8px;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.97rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn.primary {
  color: #fff;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(157, 123, 255, 0.35);
}

.btn.ghost {
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
}

/* ---------- Pillars ---------- */

.pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 10px;
  padding: 0;
  list-style: none;
}

.pillars li {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 999px;
  padding: 7px 16px 7px 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pillars li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 800;
}

/* ---------- App cards ---------- */

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 26px 0;
  padding: 0;
  list-style: none;
}

.app-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 28px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 36px var(--shadow);
}

.app-card .icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--accent-soft), rgba(232, 121, 185, 0.12));
  border: 1px solid var(--border);
  margin-bottom: 6px;
}

.app-card h3 { margin: 0; font-size: 1.08rem; }

.app-card .kind {
  color: var(--text-dim);
  font-size: 0.93rem;
  flex: 1;
  margin: 0;
}

.app-card .links { margin-top: 12px; }

.app-card .links a {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 16px;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-card .links a:hover {
  background: var(--accent);
  color: #fff;
}

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 14px;
  margin-top: 12px;
  width: fit-content;
}

/* ---------- Policy page ---------- */

article.policy { font-size: 1rem; }

article.policy .meta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  margin: 20px 0 24px;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.9;
}

article.policy .meta strong { color: var(--text); }

nav.toc {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  padding: 14px 20px;
  margin: 0 0 30px;
  font-size: 0.93rem;
}

nav.toc strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

nav.toc a {
  display: inline-block;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  margin: 3px 14px 3px 0;
}

nav.toc a:hover { color: var(--accent); }

article.policy h2, article.policy h1[id] { scroll-margin-top: 84px; }

article.policy h2::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  margin-bottom: 10px;
}

article.policy blockquote {
  margin: 1.1em 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 12px 12px 0;
}

.tablewrap {
  overflow-x: auto;
  margin: 1.1em 0;
  border: 1px solid var(--border);
  border-radius: 14px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

tr:nth-child(even) td { background: var(--accent-soft); }

th {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  background: var(--bg-card);
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.87em;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}

/* ---------- Footer ---------- */

footer.site {
  border-top: 1px solid var(--border);
  padding: 26px 0 44px;
  color: var(--text-dim);
  font-size: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}

footer.site a { color: var(--text-dim); }
footer.site a:hover { color: var(--accent); }

@media (max-width: 560px) {
  .hero { padding-top: 40px; }
  nav.site a { margin-left: 14px; }
  .apps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .app-card, .btn { transition: none; }
}
