/* ============================================================================
   Anilili download page
   Hand-authored. No framework, no build step, no external requests.

   Brand rules honoured here (see .kiro/steering/):
     - Near-black is TINTED TOWARD VIOLET, never pure #000 / #050506.
     - Violet #8979F2 is the only UI/brand accent.
     - Pink #E83A82 carries exactly ONE meaning — "this is the current release" —
       and is used in exactly one place (the version badge).
     - No gradient text, no full-page gradients, no neon glow. Those are the
       documented AI-tell palette and this palette sits right next to it.
     - Inter = editorial/brand, including the wordmark, which matches the
       typeface the app itself uses. Roboto = ONLY inside quoted Android system
       UI strings, because it is the genuine Android typeface.
   ========================================================================= */

/* --- fonts: self-hosted, subset, woff2 (104 KB for both families) -------- */
@font-face {
  font-family: "Inter var";
  src: url("fonts/inter-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Roboto var";
  src: url("fonts/roboto-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
:root {
  --bg: #0a0812;
  --surface: #1b162c;
  --surface-2: #231d3c;
  --outline: #2a2338;
  --outline-strong: #3a3050;
  /* 1.4.11 needs 3:1 for a control's boundary; this is 3.48:1 on --bg */
  --outline-ctl: #6a6280;
  --pink-ink: #14030c;

  --fg: #f1f1f4;
  --fg-72: rgba(241, 241, 244, 0.72);
  --fg-45: rgba(241, 241, 244, 0.45);
  --fg-18: rgba(241, 241, 244, 0.18);

  --violet: #8979f2;
  --violet-ink: #120c2c; /* text on violet — measured 5.46:1 */
  --violet-dim: rgba(137, 121, 242, 0.12);
  --pink: #e83a82;

  --sans: "Inter var", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --android: "Roboto var", "Roboto", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas,
    monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --measure: 40rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  /* single, very soft violet lift behind the hero — a radial wash, NOT a
     full-screen linear gradient, and it never reaches full saturation */
  background-image: radial-gradient(
    62rem 34rem at 50% -8rem,
    rgba(137, 121, 242, 0.13),
    transparent 70%
  );
  background-repeat: no-repeat;
}

/* ------------------------------------------------------------------ a11y -- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--violet);
  color: var(--violet-ink);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 700;
  z-index: 10;
}
.skip:focus {
  left: 0;
}

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

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

section {
  margin-top: 56px;
}

h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-45);
  margin: 0 0 14px;
}

h3 {
  font-size: 1rem;
  font-weight: 650;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 12px;
}

a {
  color: var(--violet);
  text-underline-offset: 2px;
}

/* ------------------------------------------------------------------ hero -- */
.hero {
  text-align: center;
  padding: 52px 0 0;
}

.hero__logo {
  width: 108px;
  height: 108px;
  display: block;
  margin: 0 auto 18px;
}

/* The app's own wordmark is a bold sans, so the page matches the product
   rather than introducing a script face the user never sees in-app. */
.wordmark {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 18px 0 0;
  color: var(--fg);
}

.hero__tag {
  margin: 10px 0 0;
  color: var(--fg-72);
  font-size: 1.0625rem;
}

.hero__meta {
  margin: 18px 0 0;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--fg-45);
}

/* pink appears exactly once on this page, and it means "current release" */
.badge-live {
  background: var(--pink);
  /* #fff on this pink is 3.92:1 and fails AA; dark ink is 5.11:1 */
  color: var(--pink-ink);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
}

.dot::before {
  content: "·";
  margin-right: 10px;
  color: var(--fg-18);
}

/* --------------------------------------------------------- device switch -- */
.switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--outline-ctl);
  border-radius: var(--r-md);
  margin: 0 0 16px;
}

.switch button {
  flex: 1;
  appearance: none;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--fg-72);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 550;
  padding: 11px 8px;
  min-height: 44px;
  cursor: pointer;
}

.switch button[aria-selected="true"] {
  background: var(--violet);
  color: var(--violet-ink);
  font-weight: 700;
}

.switch button:not([aria-selected="true"]):hover {
  background: var(--surface-2);
  color: var(--fg);
}

/* ------------------------------------------------------------- main CTA -- */
.cta {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  background: var(--violet);
  color: var(--violet-ink);
  border: 0;
  border-radius: var(--r-lg);
  text-decoration: none;
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.cta:hover {
  filter: brightness(1.08);
}

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

.cta__icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
}

.cta__label {
  font-size: 1.0625rem;
  line-height: 1.3;
}

.cta__sub {
  display: block;
  font-weight: 550;
  font-size: 0.8125rem;
  opacity: 0.72;
  margin-top: 2px;
}

.cta-note {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  color: var(--fg-45);
  text-align: center;
}

/* ------------------------------------------------------------ build list -- */
details.builds {
  margin-top: 14px;
  border: 1px solid var(--outline-ctl);
  border-radius: var(--r-md);
  background: var(--surface);
}

details.builds > summary {
  cursor: pointer;
  padding: 14px 18px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg-72);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

details.builds > summary::-webkit-details-marker {
  display: none;
}

details.builds > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

details.builds[open] > summary::after {
  transform: rotate(-135deg);
}

details.builds > summary:hover {
  color: var(--fg);
}

.builds__body {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--outline);
}

.builds__note {
  padding-top: 12px;
}

.builds__body h3 {
  margin-top: 20px;
}

/* Name + ABI pill form one flex child so the size always holds its own column
   on the first line, instead of wrapping under long filenames. */

/* ---------------------------------------------------------------- hashes -- */

.copy {
  flex: 0 0 auto;
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--outline-ctl);
  color: var(--fg-72);
  border-radius: 6px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  min-height: 32px;
  cursor: pointer;
}

.copy:hover {
  color: var(--fg);
  border-color: var(--violet);
}

/* ----------------------------------------------------------------- cards -- */
.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  padding: 20px;
}

.card + .card {
  margin-top: 12px;
}

/* Card body copy. Declared here rather than as inline style attributes so the
   page can ship `style-src 'self'` with no 'unsafe-inline'. */
.card p {
  color: var(--fg-72);
  font-size: 0.9375rem;
}

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

.card dl.facts {
  color: var(--fg);
}

/* the fingerprint is the single most security-relevant string on the page, so
   it gets full-strength text rather than the muted treatment other code gets */
/* the one accented card per page region */
.card--accent {
  border-left: 3px solid var(--violet);
  background: var(--violet-dim);
}

/* ------------------------------------------------------------------ steps -- */
ol.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 20px 44px;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--violet-dim);
  border: 1px solid var(--outline-strong);
  color: var(--violet);
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

ol.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 13.5px;
  top: 30px;
  bottom: 6px;
  width: 1px;
  background: var(--outline);
}

ol.steps p {
  margin: 2px 0 0;
  color: var(--fg-72);
  font-size: 0.9375rem;
}

/* Quoted Android system strings. Roboto lives here and ONLY here, because
   this is genuine Android UI text being reproduced verbatim. */
.ui {
  font-family: var(--android);
  font-weight: 550;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid var(--outline);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.9em;
  white-space: nowrap;
}

/* -------------------------------------------------------------- verify -- */
pre {
  margin: 10px 0 0;
  padding: 13px 14px;
  background: var(--bg);
  border: 1px solid var(--outline);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--fg-72);
  /* wrap rather than scroll: a clipped verification command is a command the
     user cannot run, and horizontal scroll inside a card is easy to miss */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fingerprint {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

dl.facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 0.875rem;
}

dl.facts dt {
  color: var(--fg-45);
}

dl.facts dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- footer -- */
footer {
  margin: 64px 0 0;
  padding: 24px 0 48px;
  border-top: 1px solid var(--outline);
  color: var(--fg-45);
  font-size: 0.8125rem;
}

footer p {
  margin: 0 0 8px;
}

/* --------------------------------------------------------------- states -- */
[hidden] {
  display: none !important;
}

.live {
  color: var(--violet);
  font-weight: 650;
}

@media (max-width: 480px) {
  .wordmark {
    font-size: 3.25rem;
  }
  .hero__logo {
    width: 88px;
    height: 88px;
  }
  .cta {
    padding: 16px;
    gap: 12px;
  }
  section {
    margin-top: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Respect a user who prefers light — but this brand is a dark brand, so we
   only lift contrast rather than invert into a different identity. */
@media (prefers-contrast: more) {
  :root {
    --fg-72: rgba(241, 241, 244, 0.9);
    --fg-45: rgba(241, 241, 244, 0.72);
    --outline: #453a5e;
  }
}

/* ---------------------------------------------------------- changelog ----- */

/* a drawn marker rather than a list bullet, so it aligns with the text box */

@media (min-width: 46rem) {
  
  /* the longest group spans both columns so the grid never leaves a gap */
  
}

/* ------------------------------------------------ copy-link icon button --- */

/* copy confirmation for icon buttons — never replaces the icon itself */


/* =========================================================================
   BUILD LIST — one grid so every row aligns on the same columns, and the
   two actions sit on the row rather than wrapping underneath it.
   ========================================================================= */
.grouphead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--fg-60);
}
.grouphead:first-of-type {
  margin-top: 18px;
}
.grouphead__ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--violet);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.builds__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}

.build {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name acts"
    "meta acts"
    "desc desc";
  align-items: center;
  column-gap: 14px;
  row-gap: 4px;
  padding: 13px 14px;
}
.build + .build {
  border-top: 1px solid var(--outline);
}
/* the universal builds are the ones we actually want people to take */
.build[data-recommended] {
  background: var(--violet-dim);
  box-shadow: inset 2px 0 0 var(--violet);
}

.build__name {
  grid-area: name;
  min-width: 0;
  /* 2.5.8 exempts this because the 40px download button beside it performs the
     same action, but a 20px line box is still a mean thing to aim at. */
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.build__name:hover,
.build__name:focus-visible {
  color: var(--violet);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.build__meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.build__abi {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--fg-60);
  white-space: nowrap;
}
.build__size {
  /* tabular figures so the sizes line up down the column */
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--fg-60);
  white-space: nowrap;
}
.build__for {
  grid-area: desc;
  margin: 2px 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--fg-60);
}

.build__acts {
  grid-area: acts;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
/* 40px keeps it clear of WCAG 2.5.8's 24px floor even with the rounded shape */
.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--outline-ctl);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.iconbtn:hover {
  border-color: var(--violet);
  background: var(--violet-dim);
}
.iconbtn__ico {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--violet);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.iconbtn[data-copied] {
  border-color: var(--violet);
  background: var(--violet-dim);
}
.iconbtn[data-copied] .iconbtn__ico {
  stroke: var(--fg);
}

@media (min-width: 34rem) {
  .build {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "name meta acts"
      "desc desc desc";
    padding: 14px 16px;
  }
}

/* =========================================================================
   CHANGELOG — an editorial two-column definition list. The label column is
   fixed so every group's items start on the same vertical line.
   ========================================================================= */
.cl {
  margin: 18px 0 0;
  border: 1px solid var(--outline);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}
.cl__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 18px 18px;
}
.cl__row + .cl__row {
  border-top: 1px solid var(--outline);
}
.cl__key {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
}
.cl__ico {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--violet);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cl__val {
  margin: 0;
}
.cl__val ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}
.cl__val li {
  position: relative;
  padding-left: 16px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg-72);
}
/* a drawn marker, so it aligns to the text box rather than the glyph */
.cl__val li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.66em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--violet);
  opacity: 0.6;
}

@media (min-width: 42rem) {
  .cl__row {
    grid-template-columns: 12.5rem minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    padding: 20px 22px;
  }
  .cl__key {
    padding-top: 1px;
  }
}
