/* ==========================================================================
   NewAppx — design system
   1. Tokens  2. Base  3. Layout  4. Header/Footer  5. Components
   6. Sections  7. Legal pages  8. Motion  9. Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: #f6f6fb;
  --bg-elev: #ffffff;
  --bg-soft: #efeefb;
  --ink: #15142b;
  --ink-2: #4b4a66;
  --ink-3: #7b7a96;
  --line: #e3e2f1;
  --brand: #5a4de0;
  --brand-2: #8b5cf6;
  --brand-ink: #4338ca;
  --mint: #34d3b0;
  --coral: #ff8a6b;
  --night: #14122b;
  --night-2: #262155;
  --ok: #12a37f;
  --shadow-sm: 0 1px 2px rgb(21 20 43 / .05), 0 2px 8px rgb(21 20 43 / .04);
  --shadow-md: 0 8px 30px rgb(52 40 140 / .10);
  --shadow-lg: 0 30px 80px rgb(52 40 140 / .22);
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --maxw: 1160px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0d1f;
    --bg-elev: #17162f;
    --bg-soft: #1f1d42;
    --ink: #f1f0ff;
    --ink-2: #b9b8d6;
    --ink-3: #8886a8;
    --line: #2a284d;
    --brand: #8479ff;
    --brand-ink: #b0a8ff;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-md: 0 8px 30px rgb(0 0 0 / .35);
    --shadow-lg: 0 30px 80px rgb(0 0 0 / .5);
  }
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

/* 3. Layout ---------------------------------------------------------------- */
.wrap { width: min(var(--maxw), calc(100% - 40px)); margin-inline: auto; }
.section { padding: 96px 0; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 46px); margin: 14px 0 14px; }
.section-head p { color: var(--ink-2); font-size: 18px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 99px;
  background: var(--bg-soft); color: var(--brand-ink); font-size: 13px; font-weight: 700; letter-spacing: .01em;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgb(52 211 176 / .6); animation: ping 2.2s infinite; }

/* 4. Header / Footer ------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s;
}
.header.scrolled { border-color: var(--line); box-shadow: var(--shadow-sm); }
.nav { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 21px; letter-spacing: -.04em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand b { color: var(--brand); }
.navlinks { display: flex; align-items: center; gap: 6px; }
.navlinks a { text-decoration: none; color: var(--ink-2); font-size: 15px; font-weight: 500; padding: 8px 14px; border-radius: 10px; transition: background .2s, color .2s; }
.navlinks a:hover, .navlinks a[aria-current="page"] { color: var(--ink); background: var(--bg-soft); }
.navlinks .lang { border: 1px solid var(--line); font-weight: 700; font-size: 13px; padding: 6px 11px; margin-left: 8px; }
.navlinks .nav-cta { background: var(--brand); color: #fff; margin-left: 6px; }
.navlinks .nav-cta:hover { background: var(--brand-ink); color: #fff; }
.menu { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink); border-radius: 12px; cursor: pointer; align-items: center; justify-content: center; }
.menu span, .menu span::before, .menu span::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .25s, opacity .25s; }
.menu span::before, .menu span::after { content: ""; position: absolute; left: 0; }
.menu span::before { top: -6px; } .menu span::after { top: 6px; }
.menu[aria-expanded="true"] span { background: transparent; }
.menu[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.footer { margin-top: 40px; background: var(--night); color: #c9c8e4; padding: 64px 0 28px; }
.footer a { text-decoration: none; color: #c9c8e4; transition: color .2s; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer .brand { color: #fff; margin-bottom: 14px; }
.footer .brand b { color: var(--mint); }
.footer p.tag { max-width: 300px; font-size: 15px; color: #a3a2c4; }
.footer h4 { color: #fff; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgb(255 255 255 / .1); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: #8d8cb0; }

/* 5. Components ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-elev);
  color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 10px 28px rgb(90 77 224 / .38); }
.btn.ghost-light { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .25); color: #fff; }
.btn.light { background: #fff; color: var(--night); border-color: #fff; }
.btn[aria-disabled="true"] { cursor: default; opacity: .85; }
.btn[aria-disabled="true"]:hover { transform: none; box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #fff3dc; color: #8a5a00; }
.badge.soon::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f5a524; }
.badge.live { background: #dcf8ef; color: #0b7a5e; }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
@media (prefers-color-scheme: dark) { .badge { background: #3a2f12; color: #ffd687; } .badge.live { background: #0f3a2f; color: #7ff0cf; } }
.textlink { color: var(--brand-ink); font-weight: 700; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.textlink:hover .arr { transform: translateX(4px); }
.arr { transition: transform .2s; }

.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px; box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s, border-color .25s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card h3 { font-size: 21px; margin: 18px 0 8px; }
.card p { color: var(--ink-2); }
.ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--bg-soft); color: var(--brand-ink); }
.ico svg { width: 26px; height: 26px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* App cards (home) */
.app-card { position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; text-decoration: none; min-height: 440px; }
.app-card .art { height: 190px; position: relative; display: grid; place-items: center; overflow: hidden; }
.app-card .art img.appicon { width: 92px; height: 92px; border-radius: 26px; box-shadow: 0 16px 40px rgb(0 0 0 / .25); position: relative; z-index: 1; transition: transform .35s; }
.app-card:hover .art img.appicon { transform: scale(1.08) rotate(-3deg); }
.app-card .body { padding: 26px 28px 28px; display: flex; flex-direction: column; flex: 1; gap: 10px; }
.app-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.app-card h3 { margin: 6px 0 0; font-size: 24px; }
.app-card p { flex: 1; }
.art.aura { background: radial-gradient(circle at 70% 25%, #4b3fb5 0, transparent 55%), linear-gradient(160deg, #1b1745, #0f0d2a); }
.art.audit { background: radial-gradient(circle at 25% 20%, #3ddbb8 0, transparent 50%), linear-gradient(160deg, #5a4de0, #2e2780); }
.stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .8; animation: twinkle 3s infinite; }
.bars { position: absolute; inset: auto 0 0 0; height: 70px; display: flex; align-items: flex-end; justify-content: center; gap: 10px; opacity: .35; }
.bars i { width: 14px; border-radius: 6px 6px 0 0; background: #fff; }

/* The "+" upcoming card */
.app-card.next {
  background: transparent; border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: none; align-items: center; justify-content: center; text-align: center; padding: 36px 28px; gap: 14px;
  cursor: default;
}
.app-card.next:hover { transform: none; box-shadow: none; border-color: var(--brand); background: var(--bg-soft); }
.plus {
  width: 92px; height: 92px; border-radius: 28px; display: grid; place-items: center; position: relative;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 16px 40px rgb(90 77 224 / .35);
}
.plus svg { width: 40px; height: 40px; transition: transform .5s; }
.app-card.next:hover .plus svg { transform: rotate(90deg); }
.plus::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--brand); animation: ring 2.4s infinite; }
.app-card.next h3 { margin-top: 6px; }
.app-card.next p { flex: 0; max-width: 280px; }
.pulse-row { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.pulse-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: bounce 1.2s infinite; }
.pulse-row i:nth-child(2) { animation-delay: .15s; } .pulse-row i:nth-child(3) { animation-delay: .3s; }

/* 6. Sections -------------------------------------------------------------- */
.hero { position: relative; padding: 72px 0 110px; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 760px; height: 760px; z-index: -1;
  background: radial-gradient(circle, rgb(139 92 246 / .28), transparent 62%); filter: blur(10px);
}
.hero::after {
  content: ""; position: absolute; left: -200px; bottom: -280px; width: 640px; height: 640px; z-index: -1;
  background: radial-gradient(circle, rgb(52 211 176 / .22), transparent 62%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6.2vw, 74px); letter-spacing: -.045em; margin: 22px 0 22px; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 20px; color: var(--ink-2); max-width: 560px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { text-decoration: none; color: var(--ink-3); } .crumbs a:hover { color: var(--brand-ink); }

.stage { position: relative; min-height: 460px; }
.stage .glow { position: absolute; inset: 8% 6%; border-radius: 44px; background: linear-gradient(145deg, #6559eb, #2a2370); box-shadow: var(--shadow-lg); overflow: hidden; }
.stage .glow::before, .stage .glow::after { content: ""; position: absolute; border-radius: 50%; }
.stage .glow::before { width: 320px; height: 320px; top: -140px; right: -80px; background: rgb(255 255 255 / .14); }
.stage .glow::after { width: 280px; height: 280px; bottom: -150px; left: -60px; background: rgb(52 211 176 / .6); }
.float { position: absolute; background: var(--bg-elev); color: var(--ink); border-radius: 22px; padding: 18px 20px; box-shadow: 0 22px 50px rgb(18 14 70 / .35); display: flex; align-items: center; gap: 14px; }
.float img { width: 52px; height: 52px; border-radius: 15px; }
.float strong { display: block; font-size: 17px; line-height: 1.2; }
.float span { font-size: 13px; color: var(--ink-3); }
.float.f1 { top: 12%; left: 0; animation: bob 6s ease-in-out infinite; }
.float.f2 { top: 42%; right: -2%; animation: bob 7s ease-in-out -2s infinite; }
.float.f3 { bottom: 10%; left: 12%; border: 2px dashed var(--brand); background: var(--bg-elev); animation: bob 8s ease-in-out -4s infinite; }
.float.f3 .plus-mini { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }

.values .card .ico { background: linear-gradient(135deg, rgb(90 77 224 / .15), rgb(52 211 176 / .2)); }
.band { background: linear-gradient(135deg, var(--night), var(--night-2)); color: #fff; border-radius: var(--r-lg); padding: 56px; display: flex; align-items: center; justify-content: space-between; gap: 28px; position: relative; overflow: hidden; }
.band::after { content: ""; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgb(139 92 246 / .55), transparent 65%); }
.band h2 { font-size: clamp(26px, 3.4vw, 38px); max-width: 560px; }
.band p { color: #c9c8e4; margin-top: 10px; max-width: 520px; }
.band .btn { position: relative; z-index: 1; white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
.stat { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px 26px; }
.stat b { display: block; font-size: 38px; letter-spacing: -.04em; background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--ink-2); font-size: 15px; }

.prose { max-width: 760px; }
.prose p { color: var(--ink-2); font-size: 18px; margin-top: 16px; }
.contact-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.contact-card .mail { color: var(--brand-ink); font-weight: 700; margin-top: 10px; word-break: break-all; }

.hero.compact { padding: 56px 0 72px; }
.hero.compact h1 { font-size: clamp(36px, 5vw, 58px); }
.hero.app-hero { color: #fff; background: linear-gradient(160deg, var(--night), var(--night-2)); }
.hero.app-hero::before { background: radial-gradient(circle, rgb(139 92 246 / .45), transparent 62%); }
.hero.app-hero .lead, .hero.app-hero .crumbs, .hero.app-hero .crumbs a { color: #c9c8e4; }
.hero.app-hero .eyebrow { background: rgb(255 255 255 / .12); color: #fff; }
.hero.app-hero h1 em { background: linear-gradient(120deg, #9d94ff, var(--mint)); -webkit-background-clip: text; background-clip: text; }
.app-hero .app-mark { width: 120px; height: 120px; border-radius: 34px; box-shadow: 0 24px 60px rgb(0 0 0 / .4); margin: 0 auto; animation: bob 6s ease-in-out infinite; }
.app-hero .stage-card { display: grid; place-items: center; min-height: 340px; border-radius: 36px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12); position: relative; overflow: hidden; text-align: center; padding: 30px; }
.app-hero .stage-card strong { display: block; margin-top: 22px; font-size: 26px; }
.app-hero .stage-card span { color: #c9c8e4; }
.app-links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 15px; }
.app-links a { color: #c9c8e4; text-decoration: underline; text-underline-offset: 4px; }
.app-links a:hover { color: #fff; }
.disclaimer { margin-top: 28px; font-size: 14px; color: var(--ink-3); max-width: 760px; }

/* 7. Legal pages ----------------------------------------------------------- */
.legal-hero { padding: 40px 0 8px; }
.legal { max-width: 820px; padding: 8px 0 96px; }
.legal h1 { font-size: clamp(32px, 4.4vw, 46px); margin-bottom: 14px; }
.legal h2 { font-size: 22px; margin: 38px 0 10px; letter-spacing: -.01em; }
.legal h3 { font-size: 18px; margin: 24px 0 8px; }
.legal p, .legal li { color: var(--ink-2); }
.legal p { margin: 10px 0; }
.legal ul, .legal ol { padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--brand-ink); text-underline-offset: 3px; }
.legal .muted, .legal .meta { color: var(--ink-3); font-size: 14px; }
.legal .notice { padding: 14px 18px; border: 1px solid #ead6a1; background: #fff8e6; border-radius: var(--r-sm); color: #6d561f; margin: 18px 0; }
.legal .box { background: var(--bg-soft); border-radius: var(--r-md); padding: 18px 22px; margin: 22px 0; }
.legal .box ul { margin: 8px 0 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 14px 0; display: block; overflow-x: auto; }
.legal th, .legal td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.legal th { background: var(--bg-soft); color: var(--ink); }
@media (prefers-color-scheme: dark) { .legal .notice { background: #2e2710; border-color: #5c4d1d; color: #ecd58f; } }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.legal-nav a { text-decoration: none; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg-elev); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.legal-nav a:hover, .legal-nav a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.notfound { text-align: center; padding: 120px 0; }
.notfound .big { font-size: clamp(90px, 18vw, 180px); font-weight: 900; letter-spacing: -.06em; line-height: 1; background: linear-gradient(120deg, var(--brand), var(--brand-2), var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound p { color: var(--ink-2); margin: 14px auto 0; max-width: 460px; }
.notfound .actions { justify-content: center; }

/* 8. Motion ---------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@keyframes bob { 50% { transform: translateY(-12px); } }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgb(52 211 176 / 0); } 100% { box-shadow: 0 0 0 0 rgb(52 211 176 / 0); } }
@keyframes ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes bounce { 50% { transform: translateY(-7px); opacity: .5; } }
@keyframes twinkle { 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* 9. Responsive ------------------------------------------------------------ */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .stage { min-height: 400px; max-width: 520px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .menu { display: inline-flex; }
  .navlinks {
    display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: var(--shadow-md); margin: 0 20px;
  }
  .navlinks.open { display: flex; }
  .navlinks a { padding: 12px 14px; }
  .navlinks .lang, .navlinks .nav-cta { margin: 6px 0 0; text-align: center; }
  .grid-3, .grid-2, .stats { grid-template-columns: 1fr; }
  .band { flex-direction: column; align-items: flex-start; padding: 36px 28px; }
  .app-card { min-height: 0; }
  .app-card.next { min-height: 320px; }
  .hero { padding: 40px 0 70px; }
  .stage { min-height: 360px; }
  .float.f2 { right: 0; } .float.f3 { left: 4%; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}
