/* ==========================================================================
   AURA — site design system
   --------------------------------------------------------------------------
   Ported verbatim from the Android app's design language ("Mono"), defined in
   aura-android/.../ui/theme/Mono.kt. The rule the app enforces and this site
   inherits:

       black  = content / action
       white  = canvas
       red    = "look here now"   (never decorative)

   Red therefore appears in exactly three places site-wide, all of them
   semantic: the Set-of-Marks selection highlight (the element AURA chose),
   the download CTA, and the restricted-settings warning.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Canvas — the white world (Mono.kt lines 20-24) */
  --canvas: #fafaf8;
  --canvas-high: #ffffff;
  --outline: #e8e8e4;
  --text-primary: #111111;
  --text-secondary: #6b6b68;

  /* Ink — the black world (Mono.kt lines 27-32) */
  --ink: #0a0a0a;
  --ink-soft: #171717;
  --ink-pressed: #262626;
  --text-on-ink: #f5f5f2;
  --text-on-ink-dim: #9c9c98;
  --outline-on-ink: #2e2e2b;

  /* Blood — semantic attention only (Mono.kt lines 35-37) */
  --blood: #a31621;
  --blood-pressed: #7a1019;
  --blood-container: #fbebec;
  --blood-on-container: #7a1019;

  /* Radius language — one vocabulary, ported 1:1 from Mono.kt shapes */
  --r-card: 24px;
  --r-card-sm: 16px;
  --r-chip: 12px;
  --r-pill: 999px;

  /* Motion — Mono.kt MotionFast/Normal/Slow */
  --t-fast: 150ms;
  --t-normal: 220ms;
  --t-slow: 400ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Type */
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --gutter: 24px; /* Mono.ScreenH = 24dp */
  --measure: 1180px;
  --section-y: clamp(4.5rem, 3rem + 7vw, 8.5rem);
}

/* Dark world — values from Mono.kt's DarkScheme (lines 107-116), so the site
   and the app render the same grey in the same place. */
:root[data-theme="dark"] {
  --canvas: #151311;
  --canvas-high: #1f1c19;
  --outline: #2e2b26;
  --text-primary: #f0ede5;
  --text-secondary: #97938a;

  --ink: #000000;
  --ink-soft: #131110;
  --ink-pressed: #262320;
  --text-on-ink: #f0ede5;
  --text-on-ink-dim: #97938a;
  --outline-on-ink: #2e2b26;

  --blood-container: #3c241b;
  --blood-on-container: #f3b0a4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #151311;
    --canvas-high: #1f1c19;
    --outline: #2e2b26;
    --text-primary: #f0ede5;
    --text-secondary: #97938a;

    --ink: #000000;
    --ink-soft: #131110;
    --ink-pressed: #262320;
    --text-on-ink: #f0ede5;
    --text-on-ink-dim: #97938a;
    --outline-on-ink: #2e2b26;

    --blood-container: #3c241b;
    --blood-on-container: #f3b0a4;
  }
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--t-normal) var(--ease), color var(--t-normal) var(--ease);
}

img,
svg,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

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

::selection {
  background: var(--ink);
  color: var(--canvas);
}

/* --------------------------------------------------------------------------
   3. Type scale
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}

.t-hero {
  font-size: clamp(2.25rem, 1.2rem + 3.9vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.042em;
}

.t-section {
  font-size: clamp(2rem, 1.1rem + 3.4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.038em;
}

.t-card {
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  line-height: 1.12;
  letter-spacing: -0.028em;
  font-weight: 700;
}

.t-lead {
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1rem + 0.42vw, 1.3rem);
  line-height: 1.55;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
  text-wrap: pretty;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* Utility face — used for anything the machine says: som ids, tool names,
   commands, labels. */
.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--tight {
  padding-block: clamp(3rem, 2rem + 4vw, 5rem);
}

.rule {
  height: 1px;
  background: var(--outline);
  border: 0;
  margin: 0;
}

/* --------------------------------------------------------------------------
   5. The signature: som markers
   --------------------------------------------------------------------------
   AURA numbers every element it can see and then picks one by number — it
   never uses raw coordinates. These chips are that addressing scheme, reused
   as the site's structural device. The number is information, not decoration:
   it is how the agent refers to a thing.
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 1.4rem;
}

.eyebrow__som {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 5px;
  border: 1px solid var(--text-primary);
  border-radius: 5px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-primary);
  line-height: 1;
}

/* On ink surfaces the marker inverts, exactly as it does over a dark screen. */
.ink .eyebrow {
  color: var(--text-on-ink-dim);
}

.ink .eyebrow__som {
  border-color: var(--text-on-ink);
  color: var(--text-on-ink);
}

/* --------------------------------------------------------------------------
   6. Surfaces
   -------------------------------------------------------------------------- */

.ink {
  background: var(--ink);
  color: var(--text-on-ink);
}

.ink h1,
.ink h2,
.ink h3,
.ink h4 {
  color: var(--text-on-ink);
}

.ink .t-lead,
.ink p {
  color: var(--text-on-ink-dim);
}

.ink strong {
  color: var(--text-on-ink);
}

.card {
  background: var(--canvas-high);
  border: 1px solid var(--outline);
  border-radius: var(--r-card);
  padding: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
}

.ink .card {
  background: var(--ink-soft);
  border-color: var(--outline-on-ink);
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.975rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.95rem 1.6rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  text-align: center;
}

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

/* Ink button — the default action. Black = action, per the app. */
.btn--ink {
  background: var(--ink);
  color: var(--text-on-ink);
}

.btn--ink:hover {
  background: var(--ink-pressed);
}

:root[data-theme="dark"] .btn--ink,
.ink .btn--ink {
  background: var(--text-on-ink);
  color: var(--ink);
}

:root[data-theme="dark"] .btn--ink:hover,
.ink .btn--ink:hover {
  background: #ffffff;
}

/* Blood button — RESERVED for the download CTA. The one thing on the site
   that says "look here now". */
.btn--blood {
  background: var(--blood);
  color: #fff;
}

.btn--blood:hover {
  background: var(--blood-pressed);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--outline);
}

.btn--ghost:hover {
  border-color: var(--text-primary);
}

.ink .btn--ghost {
  color: var(--text-on-ink);
  border-color: var(--outline-on-ink);
}

.ink .btn--ghost:hover {
  border-color: var(--text-on-ink);
}

.btn--lg {
  padding: 1.15rem 2rem;
  font-size: 1.0625rem;
}

.btn__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.62;
}

/* --------------------------------------------------------------------------
   8. Header
   -------------------------------------------------------------------------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-normal) var(--ease);
}

.hdr[data-stuck="true"] {
  border-bottom-color: var(--outline);
}

.hdr__in {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  margin-right: auto;
}

/* The real launcher icon, and the only colour on the site that isn't the
   semantic red. It earns that the same way it does in the app: it is the
   product's identity, not decoration — so it appears at brand size and
   nowhere else. */
.brand__mark {
  width: 28px;
  height: 28px;
  flex: none;
  object-fit: contain;
  /* The mark is a gradient shape with a cut-out centre, so it needs its own
     ground to read against — otherwise the hole fills with whatever is behind
     it and the silhouette collapses in dark mode. White, always: the disc is
     part of the mark, not a themed surface. */
  background: #FFF;
  border-radius: 50%;
  padding: 2px;
  box-sizing: border-box;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--t-fast) var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text-primary);
}

.hdr .btn {
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-pill);
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.icon-btn:hover {
  border-color: var(--text-primary);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.theme-btn .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-btn .icon-moon {
  display: block;
}

:root[data-theme="dark"] .theme-btn .icon-sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .icon-moon {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-btn .icon-sun {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   8b. Mobile navigation
   --------------------------------------------------------------------------
   Most visitors reach this site on the phone they're about to install on, so
   the desktop nav collapsing to nothing was a dead end. It collapses to a
   panel instead: large editorial type, one tap per destination.
   -------------------------------------------------------------------------- */

.nav-btn {
  display: none;
}

@media (max-width: 860px) {
  .nav {
    display: none;
  }

  /* Only offered when scripting can actually open the panel. Without JS the
     button would be a control that does nothing — worse than absent. Non-JS
     visitors still reach every page from the footer's link lists. */
  :root[data-js] .nav-btn {
    display: inline-grid;
  }

  /* The header CTA duplicates the panel's own download link on small screens,
     and two competing buttons in a 68px bar is one too many. */
  .hdr .btn--ink {
    display: none;
  }
}

.nav-btn .icon-close {
  display: none;
}

.nav-btn[aria-expanded="true"] .icon-close {
  display: block;
}

.nav-btn[aria-expanded="true"] .icon-menu {
  display: none;
}

.mnav {
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  background: var(--canvas);
  padding: 1.5rem var(--gutter) 2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: mnav-in 260ms var(--ease-out-expo);
}

.mnav[hidden] {
  display: none;
}

@keyframes mnav-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.mnav a:not(.btn) {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.032em;
  padding: 1rem 0;
  border-bottom: 1px solid var(--outline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
}

.mnav a[aria-current="page"] {
  color: var(--text-secondary);
}

.mnav a:not(.btn)::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--text-secondary);
  border-bottom: 1.5px solid var(--text-secondary);
  transform: rotate(-45deg);
}

.mnav .btn {
  margin-top: auto;
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
  font-size: 1.0625rem;
}

.mnav__note {
  margin: 1.75rem 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-align: center;
}

/* When the panel owns the screen, the page behind it must not scroll. */
body.is-locked {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   9. Reveal on scroll
   -------------------------------------------------------------------------- */

/* Gated on [data-js], which the inline head script sets before first paint.
   The hidden state is only ever safe if something is guaranteed to come and
   un-hide it; with scripting off these rules must not exist at all, or the
   entire page is an invisible document with working scrollbars. */
[data-js] [data-reveal],
[data-js] [data-reveal-group] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms var(--ease-out-expo), transform 620ms var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
  /* Deliberately no compositor hint. It would be live while the element sits
     below the fold doing nothing, and dropped the moment the transition
     actually runs — backwards, and ~40 promoted layers deep on this page.
     opacity and transform are compositor properties already. */
}

[data-js] [data-reveal].is-in,
[data-js] [data-reveal-group] > .is-in {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   9a. Reading progress
   --------------------------------------------------------------------------
   A hairline along the bottom edge of the sticky header. It restates what the
   scrollbar already says, so it is decoration: aria-hidden, and never built
   at all when reduced motion is asked for.
   -------------------------------------------------------------------------- */

.prog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.prog i {
  display: block;
  height: 100%;
  /* Scaled from the left rather than sized, so every frame of this is a
     compositor transform and never a layout. */
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--blood), color-mix(in srgb, var(--blood) 55%, var(--text-primary)));
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-js] [data-reveal],
  [data-js] [data-reveal-group] > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--outline);
  padding-block: 3.5rem 3rem;
}

.foot__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2.5rem;
}

.foot h4 {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.foot a {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: color var(--t-fast) var(--ease);
}

.foot a:hover {
  color: var(--text-primary);
}

.foot__note {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--outline);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

@media (max-width: 860px) {
  .foot__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 520px) {
  .foot__grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   11. Skip link
   -------------------------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--text-on-ink);
  padding: 0.85rem 1.25rem;
  border-radius: 0 0 var(--r-chip) 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.skip:focus {
  left: 0;
}
