/* Fantasia — the page is the app's night sky.
   Colours are taken from the app: the sky colour sampled from its background image,
   lavender and moonlight from its asset catalog (dark appearance). */
:root {
  color-scheme: dark;
  --night: #08102b;
  --night-deep: #050a1f;
  --ink: #efeaf7;
  --mist: #b7b1cc;
  --lavender: #b091f6;
  --moonlight: #f4dda7;
  --hairline: rgba(244, 221, 167, 0.18);
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --measure: 34rem;
}

* { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  /* Long German compounds and addresses break inside the column rather than past it. */
  overflow-wrap: break-word;
  min-height: 100vh;
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  background: var(--night);
}

/* The sky: the app's own background, pinned right with the moon on top, fading left
   into the same blue it is painted in. On a phone it simply fills the screen. */
.sky {
  position: fixed;
  inset: 0 0 0 auto;
  /* 46rem keeps the upscale on a 4K screen near 1.6×. The large file is the app image
     enlarged once with Lanczos and softened a touch, which hides the faint pixel grid the
     original has and reads as night haze rather than a blurry photo. */
  width: min(46rem, 100%);
  background: url("assets/night-large.jpg") right top / cover no-repeat;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.2) 18%, rgba(0,0,0,.6) 40%, #000 72%);
          mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.2) 18%, rgba(0,0,0,.6) 40%, #000 72%);
  pointer-events: none;
  z-index: 0;
}

/* Text sits on a photograph of the sky; a shadow in the sky's own colour keeps it
   legible over a bright star without looking like a shadow. */
.page { text-shadow: 0 1px 14px rgba(8, 16, 43, 0.85); }
.store { text-shadow: none; }

/* Behind the sky: the night the picture is painted in, continued across the window.
   Colours measured along the image's left edge (#08102b at the top, the lavender of the
   low clouds further down); no warm tones, so the moonlight stays in the picture. */
.sky-ambient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 80% 100%, rgba(53, 53, 95, 0.45), transparent 70%),
    radial-gradient(ellipse 45% 60% at 35% 75%, rgba(60, 50, 110, 0.16), transparent 70%),
    linear-gradient(to bottom, #08102b 0%, #0a1231 55%, #10183b 100%);
  pointer-events: none;
  z-index: 0;
}

/* Stars drawn by stars.js between the night and the picture. */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
}

a { color: var(--lavender); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
a:focus-visible, .store:focus-visible {
  outline: 2px solid var(--moonlight);
  outline-offset: 4px;
  border-radius: 6px;
}

/* Header. On a phone the links move under the name when they do not fit beside it,
   instead of pushing past the edge and letting the whole page slide sideways. */
.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.5rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font: 600 1.25rem/1 var(--serif);
  letter-spacing: -0.01em;
}
.brand img { width: 2rem; height: 2rem; border-radius: 22.5%; box-shadow: 0 0 0 0.5px rgba(255,255,255,.18); }
.nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; font-size: 0.95rem; }
.nav a { color: var(--mist); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

main { flex: 1; }

/* Hero */
.hero {
  max-width: var(--measure);
  padding: clamp(3rem, 10vh, 7rem) 0 clamp(3rem, 8vh, 5rem);
}
.hero-icon {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 22.5%;
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.2),
    0 1.5rem 4rem -1rem rgba(244, 221, 167, 0.28),
    0 0.75rem 2rem rgba(0, 0, 0, 0.45);
  animation: rise 1.2s cubic-bezier(.2, .7, .2, 1) both;
}
.hero h1 {
  margin: 2rem 0 0.25rem;
  font: 500 clamp(3.25rem, 8vw, 5rem)/1 var(--serif);
  letter-spacing: -0.03em;
}
.tagline {
  margin: 0 0 1.75rem;
  font: 400 clamp(1.25rem, 2.6vw, 1.5rem)/1.35 var(--serif);
  color: var(--moonlight);
}
.lead { margin: 0; color: var(--ink); font-size: 1.125rem; line-height: 1.65; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
  margin-top: 2.25rem;
}
.store img { display: block; height: 3rem; width: auto; }

/* Three things the app does. Parallel, not a sequence: no numbers, no boxes. */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  max-width: 46rem;
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--hairline);
}
.features h2 {
  margin: 0 0 0.5rem;
  font: 500 1.25rem/1.3 var(--serif);
  color: var(--ink);
}
.features p { margin: 0; color: var(--mist); font-size: 0.98rem; }

.support {
  max-width: var(--measure);
  padding: 0 0 4rem;
}
.support h2 { margin: 0 0 0.5rem; font: 500 1.5rem/1.3 var(--serif); }
.support p { margin: 0 0 0.6rem; color: var(--mist); }

/* Policy pages: a reading column on the quiet left side of the sky. */
.policy {
  max-width: 42rem;
  padding: clamp(2rem, 7vh, 4rem) 0 4rem;
}
.policy .updated { margin: 0 0 0.5rem; color: var(--moonlight); font: 400 1rem/1.4 var(--serif); }
.policy h1 { margin: 0 0 1.5rem; font: 500 clamp(2.5rem, 6vw, 3.5rem)/1.05 var(--serif); letter-spacing: -0.025em; }
.policy h2 { margin: 2.5rem 0 0.6rem; font: 500 1.35rem/1.3 var(--serif); color: var(--ink); }
.policy p, .policy li { color: #d9d4e6; line-height: 1.72; }
.policy .note { color: var(--mist); font-size: 0.95rem; }
.policy ul { padding-left: 1.2rem; }

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--hairline);
  color: var(--mist);
  font-size: 0.9rem;
}
.footer a { color: var(--mist); }
/* A straight bar between the two names: equal footing, quieter than the names. */
.footer .sep { margin: 0 0.35em; color: rgba(183, 177, 204, 0.5); }
.footer a:hover { color: var(--ink); }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.75rem) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-icon { animation: none; }
}

/* Reading pages keep the sky, but calmer, so long text stays easy on the eyes. */
.reading .sky { opacity: 0.55; }
.reading .sky-ambient { opacity: 0.3; }
.reading .stars { opacity: 0.6; }

@media (max-width: 52rem) {
  .features { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* Phones: the portrait sky fills the screen as it does in the app; a veil on the lower
   half keeps text over the clouds legible. */
@media (max-width: 40rem) {
  .sky {
    width: 100%;
    background-image: url("assets/night.jpg");
    -webkit-mask-image: none;
            mask-image: none;
    background-position: center top;
  }
  .sky::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(8,16,43,.15) 0%, rgba(8,16,43,.55) 35%, rgba(8,16,43,.8) 100%);
  }
  .reading .sky { opacity: 0.45; }
  .sky-ambient { display: none; }
  .hero-icon { width: 6rem; height: 6rem; }
  .nav { gap: 0.4rem 1.1rem; }
}

/* The one call to action: moonlight on night, like the glow on the app icon. */
.store {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  background: var(--moonlight);
  color: #1a1530;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 0.75rem 2rem -0.75rem rgba(244, 221, 167, 0.55);
  transition: background-color .2s ease, transform .2s ease;
}
.store:hover { background: #fff3d6; color: #1a1530; }
.store:active { transform: scale(0.98); }
.store svg { width: 1.1rem; height: 1.1rem; }
.text-link { color: var(--lavender); }

/* Who made Fantasia. A signature, not a section: moonlight serif like the tagline, so the
   names read as part of the app's voice rather than as fine print. */
.credit {
  max-width: var(--measure);
  padding: 0 0 4rem;
}
.credit .signature {
  margin: 0;
  font: 400 clamp(1.2rem, 2.2vw, 1.35rem)/1.4 var(--serif);
  color: var(--moonlight);
}
