/* Ailancer app pages — shared design system.
 * ---------------------------------------------------------------------------
 * THE RULE: an app page declares three tokens and nothing else.
 *
 *   <style>:root{--accent-1:#3B82F6;--accent-2:#8B5CF6;--on-accent:#fff}</style>
 *
 * Every other colour on the page derives from them — the aurora behind the
 * content, link colour, focus ring, button gradient, card glow, selection.
 * So a new app gets its own identity in one line and still reads as part of
 * the same family. Nothing here is app-specific; nothing here loads from a
 * third party (no fonts, no scripts, no images) so the pages stay fast and
 * keep working no matter what else breaks.
 */

/* ─────────────────────────────────────────────────────────── tokens ───── */

:root {
  /* Per-app identity. OneLine's amber → rose is the family default. */
  --accent-1: #F59E0B;
  --accent-2: #FB7185;
  --on-accent: #0F172A;

  /* Derived — never set these per app. */
  --grad: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  --glow: color-mix(in srgb, var(--accent-1) 40%, transparent);

  /* Light theme. */
  --bg: #FDFBF7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #FFFFFF;
  --text: #101828;
  --muted: #667085;
  --line: rgba(16, 24, 40, 0.09);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 24px 48px -24px rgba(16, 24, 40, .18);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --measure: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08090D;
    --surface: rgba(22, 25, 34, 0.66);
    --surface-solid: #161922;
    --text: #ECEDF0;
    --muted: #9AA1AE;
    --line: rgba(255, 255, 255, 0.09);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 32px 64px -28px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16.5px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

::selection { background: var(--accent-1); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────── aurora ───── */
/* Two soft blobs in the app's own colours. This is what makes each app page
   feel like the app without anyone hand-picking a background. */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* Colour belongs behind the hero, not behind body text — the wash fades out
     before it reaches the reading column, which would otherwise go muddy. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 18%, transparent 64%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 18%, transparent 64%);
}

.aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .40;
  will-change: transform;
}

.aurora span:nth-child(1) {
  width: 46vmax; height: 46vmax;
  top: -24vmax; left: -10vmax;
  background: var(--accent-1);
  animation: drift-a 26s var(--ease) infinite alternate;
}

.aurora span:nth-child(2) {
  width: 38vmax; height: 38vmax;
  top: -16vmax; right: -12vmax;
  background: var(--accent-2);
  animation: drift-b 32s var(--ease) infinite alternate;
}

@media (prefers-color-scheme: dark) {
  .aurora span { opacity: .26; filter: blur(96px); }
}

@keyframes drift-a {
  to { transform: translate3d(9vmax, 7vmax, 0) scale(1.14); }
}
@keyframes drift-b {
  to { transform: translate3d(-8vmax, 11vmax, 0) scale(1.09); }
}

/* ─────────────────────────────────────────────────────────── topbar ───── */
/* The Ailancer mark rides along on every page, so an app's legal page is
   visibly ours before anyone reads a word of it. */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.topbar[data-scrolled] { border-bottom-color: var(--line); }

.topbar-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; flex: 0 0 auto; }
.brand .bars rect { transform-box: fill-box; transform-origin: bottom; }
.brand:hover .bars rect { animation: bar-pop .5s var(--ease) both; }
.brand:hover .bars rect:nth-child(2) { animation-delay: .06s; }
.brand:hover .bars rect:nth-child(3) { animation-delay: .12s; }

@keyframes bar-pop {
  50% { transform: scaleY(.55); }
  to  { transform: scaleY(1); }
}

.crumb {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  background-image: none;
  transition: color .2s;
}
.crumb:hover { color: var(--text); }
.crumb::before {
  content: "";
  width: 1px; height: 15px;
  background: var(--line);
}
.crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────────────────────────────────────────────────────────── shell ───── */

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

/* ─────────────────────────────────────────────────────────────  hero ───── */

header { padding: 68px 0 34px; text-align: center; }

.mark {
  width: 76px; height: 76px;
  margin: 0 auto 22px;
  border-radius: 23px;
  background: var(--grad);
  box-shadow: 0 14px 40px -8px var(--glow);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 6px;
  animation: mark-in .8s var(--ease) both;
}
.mark .spark { color: var(--on-accent); font-size: 25px; line-height: 1; }
.mark .bar { width: 38px; height: 4px; border-radius: 2px; background: var(--on-accent); }

@keyframes mark-in {
  from { opacity: 0; transform: translateY(14px) scale(.86) rotate(-8deg); }
}

header h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 6vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

header > p {
  margin: 0 auto;
  max-width: 34ch;
  color: var(--muted);
  font-size: 16px;
}

/* Language switch */
.langs { display: flex; gap: 6px; justify-content: center; margin: 26px 0 0; }

.langs button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--muted);
  transition: color .2s, border-color .2s, transform .2s var(--ease);
}
.langs button:hover { color: var(--text); transform: translateY(-1px); }
.langs button[aria-selected="true"] {
  background: var(--grad);
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: 0 6px 18px -6px var(--glow);
}

/* ─────────────────────────────────────────────────────────── content ───── */

main {
  position: relative;
  background: var(--surface);
  backdrop-filter: saturate(160%) blur(22px);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 34px 32px 38px;
  margin-top: 26px;
}

@media (max-width: 560px) {
  main { padding: 26px 20px 30px; border-radius: 22px; }
  header { padding: 46px 0 26px; }
}

[lang]:not([hidden]) { display: block; }

h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 38px 0 12px;
  scroll-margin-top: 84px;
}
h2:first-child { margin-top: 0; }

p, li { color: var(--text); }
p { margin: 0 0 14px; }
ul { padding-left: 20px; margin: 0 0 14px; }
li { margin: 7px 0; }
li::marker { color: var(--accent-1); }

strong { font-weight: 650; }

a {
  color: var(--accent-1);
  text-decoration: none;
  font-weight: 600;
  background-image: var(--grad);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .3s var(--ease);
}
a:hover { background-size: 100% 1.5px; text-decoration: none; }

.updated {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 24px;
}

.callout {
  position: relative;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent-1) 11%, transparent),
    color-mix(in srgb, var(--accent-2) 11%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent-1) 26%, transparent);
  border-radius: var(--r-md);
  padding: 17px 19px 17px 22px;
  margin: 0 0 26px;
  overflow: hidden;
}
.callout::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--grad);
}
.callout p { margin: 0; font-weight: 600; }

/* ───────────────────────────────────────────────── app directory ───── */

.apps { display: grid; gap: 12px; }

.app-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-solid);
  text-decoration: none;
  color: inherit;
  font-weight: 400;
  background-image: none;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.app-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent-1) 40%, transparent);
  box-shadow: 0 18px 34px -20px var(--glow);
}

.app-card .icon {
  flex: 0 0 50px;
  height: 50px;
  border-radius: 15px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  color: var(--on-accent);
  font-size: 21px;
}
.app-card h3 { margin: 0 0 1px; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.app-card p { margin: 0; font-size: 14px; color: var(--muted); }

/* ────────────────────────────────────────────────────── nav + foot ───── */

nav {
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}
nav a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  background-image: none;
  transition: color .2s, background-color .2s;
}
nav a:hover { color: var(--text); background: var(--surface-solid); }
nav a[aria-current="page"] { color: var(--accent-1); }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 22px;
}

/* ────────────────────────────────────────────────────────── motion ───── */
/* Content lifts in as it enters the viewport. site.js adds [data-shown];
   without JS the rule below never applies and everything is simply visible. */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js .reveal[data-shown] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
