/* Lunatale website — one stylesheet for every page.
   Colours are the app's "Night Library" tokens; dark only, like the app. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #0d0a1e;
  --night: #15112b;
  --plum: #1f1940;
  --line: #2c2552;
  --violet: #6c4df2;
  --violet-soft: #8f78ff;
  --moon: #ffcf6e;
  --moon-light: #fff1c9;
  --text: #f6f3ff;
  --muted: #ada5cf;

  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 24px;
  --page: 1080px;
  --gutter: 20px;

  --display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font: 17px/1.6 var(--body);
  overflow-x: hidden;
}

a { color: var(--moon); text-underline-offset: 3px; }
a:hover { color: var(--moon-light); }
:focus-visible { outline: 2px solid var(--moon); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 12px; z-index: 10; background: var(--plum); padding: 8px 12px; }

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

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(13, 10, 30, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(44, 37, 82, .7);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 1.3rem var(--display); }
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 10px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--plum); }
.nav .lang { border: 1px solid var(--line); margin-left: 6px; font-weight: 600; letter-spacing: .04em; }

@media (max-width: 720px) {
  .nav .wide { display: none; }   /* page sections; the footer still links everything */
}

/* ---------- Night sky (CSS only, no images) ---------- */

.sky { position: relative; isolation: isolate; overflow: hidden; }
.sky::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(180deg, #1e0c32 0%, #231a4a 55%, var(--ink) 100%);
}
.sky::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 62%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 35% 12%, var(--moon-light) 50%, transparent 51%),
    radial-gradient(1px 1px at 48% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 63% 76%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 24%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 86% 52%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 14%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 14% 84%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 90%, #fff 50%, transparent 51%);
  opacity: .8;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .45; } to { opacity: .9; } }

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

.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px; padding-top: 72px; padding-bottom: 96px; }
.hero p.lead { font-size: 1.2rem; color: #d9d2f5; max-width: 34em; }
.eyebrow { display: inline-block; font-size: .85rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--moon); margin-bottom: 14px; }

.moon-stage { position: relative; aspect-ratio: 1; max-width: 380px; width: 100%; justify-self: center; }
.moon {
  position: absolute; inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, var(--moon-light), var(--moon) 70%);
  box-shadow: 0 0 60px rgba(255, 207, 110, .45), 0 0 140px rgba(255, 207, 110, .2);
  animation: breathe 8s ease-in-out infinite alternate;
}
.moon::after {   /* soft craters */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 62% 38%, rgba(214, 160, 70, .28) 0 9%, transparent 10%),
    radial-gradient(circle at 40% 66%, rgba(214, 160, 70, .22) 0 6%, transparent 7%),
    radial-gradient(circle at 70% 70%, rgba(214, 160, 70, .18) 0 4%, transparent 5%);
}
.moon-stage img {   /* app icon resting on the moon */
  position: absolute; width: 34%; height: auto; left: 6%; bottom: 4%;
  border-radius: 22%; box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .12);
}
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.04); } }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 64px; }
  .moon-stage { max-width: 260px; order: -1; }
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px;
  background: var(--violet); color: #fff; text-decoration: none; font-weight: 600;
}
.button:hover { color: #fff; background: var(--violet-soft); }
.button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.button.ghost:hover { background: var(--plum); }
.badge-soon {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 999px;
  background: var(--moon); color: #2a1d00; font-weight: 600;
}

/* ---------- Sections ---------- */

section.block { padding: 80px 0; }
section.block.alt { background: var(--night); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 40em; margin-bottom: 36px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 24px;
}
.card .icon { font-size: 1.8rem; line-height: 1; display: block; margin-bottom: 14px; }
.card p { color: var(--muted); margin: 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--moon); margin-left: 6px; vertical-align: middle; }

.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); padding: 0; list-style: none; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 24px 24px 24px 72px; border-radius: var(--radius-l); background: var(--plum); }
.steps li::before {
  content: counter(step); position: absolute; left: 22px; top: 22px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--moon); color: #2a1d00; font: 600 1rem var(--display);
}
.steps p { color: var(--muted); margin: 0; }

.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.plan { padding: 28px; border-radius: var(--radius-l); border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.plan.premium { border-color: rgba(255, 207, 110, .6); background: linear-gradient(160deg, rgba(108, 77, 242, .22), rgba(255, 207, 110, .06)); }
.plan ul { margin: 16px 0 0; padding: 0; list-style: none; }
.plan li { padding: 6px 0 6px 28px; position: relative; color: #ddd7f6; }
.plan li::before { content: "✦"; position: absolute; left: 0; color: var(--moon); }

.promise { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.promise span { padding: 8px 14px; border-radius: 999px; background: var(--plum); border: 1px solid var(--line); font-size: .92rem; }

/* ---------- Long text (privacy, terms, support) ---------- */

.doc { padding: 56px 0 80px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.doc h2 { font-size: 1.4rem; margin-top: 2em; padding-top: .4em; }
.doc h3 { margin-top: 1.4em; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: .45em; }
.doc .updated { color: var(--muted); margin-bottom: 2em; }
.callout { background: var(--plum); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; margin: 1.5em 0; }
.callout p:last-child { margin: 0; }
.toc { columns: 2 220px; padding-left: 1.2em; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 1em 0 1.5em; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

details { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0 18px; margin-bottom: 10px; background: rgba(255, 255, 255, .03); }
details[open] { background: var(--night); }
summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style-position: outside; }
details > :not(summary) { color: #d9d2f5; }
details > p:last-child, details > ol:last-child, details > ul:last-child { margin-bottom: 16px; }

.contact-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; padding: 24px; border-radius: var(--radius-l); background: linear-gradient(160deg, rgba(108, 77, 242, .25), rgba(31, 25, 64, .9)); border: 1px solid var(--line); }
.contact-card p { margin: 0; color: var(--muted); }

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

.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

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