/* Lenvid website.
   Colors come from the app's theme (lib/app.dart): amber #E8A23C is its
   primary color, ink #241F16 and paper #F4F1EA its text colors, #FBF7F1 and
   #0C0A09 its light and dark surfaces. Amber is the only accent. */

:root {
  --paper: #fbf7f1;
  --paper-2: #f2efe9;
  --ink: #241f16;
  --muted: #6b6455;
  --line: rgba(36, 31, 22, 0.12);
  --amber: #e8a23c;
  --amber-text: #8a5a0b; /* amber dark enough to read as link text on paper */
  --dark: #0c0a09;
  --dark-2: #181716;
  --on-dark: #f4f1ea;
  --muted-on-dark: #a9a08c;
  --nav-h: 52px;
  --wrap: 68rem;
  --text: 44rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--amber-text); text-underline-offset: 0.18em; }
a:focus-visible { outline: 2px solid var(--amber-text); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  background: rgba(251, 247, 241, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand img { width: 26px; height: 26px; border-radius: 22%; }

.nav nav { display: flex; align-items: center; gap: 1.35rem; font-size: 0.82rem; }
.nav nav a { color: var(--ink); opacity: 0.78; text-decoration: none; white-space: nowrap; padding: 0.4rem 0; }
.nav nav a:hover, .nav nav a[aria-current="page"] { opacity: 1; }
.nav nav a[aria-current="page"] { font-weight: 600; }
.nav nav a.lang { opacity: 0.55; }
.nav nav a.wide-only { display: none; }
@media (min-width: 640px) {
  .nav nav { gap: 1.75rem; }
  .nav nav a.wide-only { display: inline; }
}

/* ------------------------------------------------------------ sections */

section.band { padding: clamp(4rem, 11vw, 8.5rem) 0; }
section.band.dark { background: var(--dark); color: var(--on-dark); }
section.band.soft { background: var(--paper-2); }
section.band.dark .lead, section.band.dark .eyebrow { color: var(--muted-on-dark); }
section.band.dark a { color: var(--amber); }

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--amber-text);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
section.band.dark .eyebrow { color: var(--amber); }

h1, h2, h3 { margin: 0; letter-spacing: -0.028em; text-wrap: balance; }

.display {
  font-size: clamp(2.7rem, 9.5vw, 5.4rem);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.headline {
  font-size: clamp(2.1rem, 6.4vw, 3.6rem);
  line-height: 1.07;
  font-weight: 700;
}
.lead {
  margin: 1.2rem auto 0;
  max-width: 40rem;
  text-wrap: balance;
  color: var(--muted);
  font-size: clamp(1.12rem, 2.3vw, 1.4rem);
  line-height: 1.4;
  font-weight: 500;
}

.center { text-align: center; }

/* ---------------------------------------------------- download buttons */

/* One button per store (build.mjs, "download buttons"). Three looks:
   .store.soon   the app is not on that store yet: dimmed, not a link
   .store-badge  the store's official badge, linked to the app's page
   .store        our own button as a link, when there is no badge artwork
   The official badges are never restyled: no dimming, no recoloring. */
.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.8rem 0.9rem;
  margin-top: 1.9rem;
}
.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 9.9rem;
  min-height: 3.5rem;
  padding: 0.5rem 1.25rem;
  border: 1.5px solid var(--ink);
  border-radius: 0.95rem;
  background: var(--ink);
  color: var(--paper);
  text-align: left;
  text-decoration: none;
  line-height: 1.2;
}
.store small { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em; opacity: 0.8; }
.store strong { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.015em; }
a.store:hover { background: #000; border-color: #000; }
a.store:focus-visible, a.store-badge:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.store.soon {
  border: 1.5px dashed rgba(36, 31, 22, 0.4);
  background: transparent;
  color: var(--ink);
  cursor: default;
}
.store.soon strong { opacity: 0.6; }
.store.soon small { color: var(--amber-text); opacity: 1; }
.store-badge { display: inline-flex; border-radius: 0.6rem; }
.store-badge img { display: block; max-width: none; }
.fineprint { max-width: 40rem; margin: 2rem auto 0; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }

/* -------------------------------------------------------------- phones */

/* A plain phone outline drawn in CSS around a real screenshot of the app. */
.phone {
  position: relative;
  width: min(100%, 17.5rem);
  margin: 0 auto;
  padding: 0.5rem;
  border-radius: 2.6rem;
  background: #15120d;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 1.2rem 2.4rem -1rem rgba(36, 31, 22, 0.35), 0 2.8rem 5rem -2rem rgba(36, 31, 22, 0.35);
}
.phone img { width: 100%; aspect-ratio: 9 / 20; object-fit: cover; object-position: top; border-radius: 2.15rem; background: var(--paper-2); }
section.band.dark .phone { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 2.8rem 5rem -2rem rgba(0, 0, 0, 0.8); }

.hero { padding-top: clamp(3.2rem, 8vw, 6rem); padding-bottom: 0; overflow: hidden; }
.hero-phones {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(1rem, 3vw, 2.5rem);
  margin-top: clamp(2.8rem, 7vw, 4.5rem);
  /* the phones run off the bottom edge of the hero */
  margin-bottom: -5.5rem;
}
.hero-phones .phone { margin: 0; flex: 0 0 auto; }
.hero-phones .phone.side { width: 14.5rem; display: none; transform: translateY(3.5rem); }
@media (min-width: 760px) { .hero-phones .phone.side { display: block; } }

.split { display: grid; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.split .copy { text-align: center; }
.split .copy .lead { margin-left: auto; margin-right: auto; }
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split .copy { text-align: left; }
  .split .copy .lead { margin-left: 0; }
  .split.flip .copy { order: 2; }
}

.points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 0.7rem; color: inherit; }
.points li { position: relative; padding-left: 1.5rem; text-align: left; max-width: 30rem; margin: 0 auto; }
.points li::before { content: ""; position: absolute; left: 0.15rem; top: 0.62em; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--amber); }
@media (min-width: 860px) { .points li { margin: 0; } }

/* --------------------------------------------------------------- tiles */

.tiles { display: grid; gap: 1rem; margin-top: clamp(2.5rem, 6vw, 4rem); }
@media (min-width: 700px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile {
  border-radius: 1.75rem;
  background: var(--paper);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  text-align: left;
}
section.band.dark .tile { background: var(--dark-2); }
.tile h3 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); line-height: 1.12; }
.tile p { margin: 0.7rem 0 0; color: var(--muted); font-size: 1.05rem; }
section.band.dark .tile p { color: var(--muted-on-dark); }
.tile .num { display: block; margin-bottom: 1.4rem; color: var(--amber-text); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.04em; }
section.band.dark .tile .num { color: var(--amber); }

.more { display: inline-block; margin-top: 1.5rem; font-weight: 600; text-decoration: none; }
.more::after { content: " ›"; }
.more:hover { text-decoration: underline; }

/* ------------------------------------------------------------- updates */

/* A list of versions on the left, the chosen version on the right
   (website/updates-core.js writes the HTML). On a phone the list becomes a
   strip of version chips above the notes. */

.page-head { padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(1rem, 3vw, 2rem); text-align: center; }

.up-layout {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  align-items: start;
  gap: 0 clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

.rel-list {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  max-height: calc(100vh - var(--nav-h) - 2rem);
  overflow-y: auto;
  padding: 0.25rem 0;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.rel-item {
  display: block;
  padding: 0.85rem 1.1rem 0.85rem 1rem;
  margin-left: -1px;
  border-left: 3px solid transparent;
  border-radius: 0 0.75rem 0.75rem 0;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.rel-item:hover { background: var(--paper-2); }
.rel-item.on { border-left-color: var(--amber); background: var(--paper-2); }
.ri-top { display: flex; align-items: center; gap: 0.5rem; }
.ri-ver { font-weight: 700; font-size: 0.98rem; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ri-date { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.8rem; }
.ri-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}
.rel-item.on .ri-title { color: var(--ink); }

.badge {
  display: inline-block;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.35rem;
  letter-spacing: 0.01em;
}

.rel { min-width: 0; padding-top: 0.25rem; }
.rel-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.8rem; }
.rel-ver {
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.rel-date { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.rel-title { margin-top: 1.1rem; font-size: clamp(1.6rem, 3.6vw, 2.4rem); line-height: 1.12; letter-spacing: -0.025em; }
.rel-summary { max-width: var(--text); margin-top: 0.9rem; color: var(--muted); font-size: 1.08rem; line-height: 1.55; }

.rel-shots {
  display: flex;
  gap: 1.25rem;
  margin: 2rem -1.25rem 0;
  padding: 0.5rem 1.25rem 2rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.rel-shots figure { margin: 0; flex: 0 0 auto; width: 13.5rem; scroll-snap-align: center; }
.rel-shots.single figure { width: 15.5rem; }
.rel-shots .phone { width: 100%; border-radius: 2.1rem; padding: 0.4rem; }
.rel-shots .phone img { border-radius: 1.75rem; }
.rel-shots figcaption { margin-top: 1rem; color: var(--muted); font-size: 0.85rem; text-align: center; }

.rel-sec { max-width: var(--text); margin-top: 1.75rem; }
.lbl {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lbl-new { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.lbl-improved { background: var(--paper-2); color: var(--amber-text); }
.lbl-fixed { background: transparent; color: var(--muted); }
.rel-sec ul { margin: 0.75rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rel-sec li { position: relative; padding: 0.8rem 0 0.8rem 1.3rem; border-bottom: 1px solid var(--line); line-height: 1.5; }
.rel-sec li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 1.35rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--amber);
}
.rel code {
  padding: 0 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: var(--paper-2);
  font-size: 0.88em;
}

.rel-pn { display: flex; justify-content: space-between; gap: 0.75rem; max-width: var(--text); margin-top: 2.75rem; }
.pn {
  display: flex;
  flex-direction: column;
  min-width: 8.5rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.15s;
}
.pn:hover { border-color: var(--amber); }
.pn small { color: var(--muted); font-size: 0.75rem; font-weight: 500; }
.pn.newer { margin-left: auto; text-align: right; }

@media (max-width: 860px) {
  .up-layout { grid-template-columns: 1fr; }
  .rel-list {
    position: sticky;
    top: var(--nav-h);
    z-index: 5;
    display: flex;
    gap: 0.5rem;
    max-height: none;
    margin: 0 -1.25rem 1.5rem;
    padding: 0.7rem 1.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    scrollbar-width: none;
  }
  .rel-list::-webkit-scrollbar { display: none; }
  .rel-item {
    flex: none;
    margin: 0;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
  }
  .rel-item.on { border-color: var(--ink); background: var(--ink); }
  .rel-item.on .ri-ver { color: var(--paper); }
  .ri-date, .ri-title { display: none; }
  .pn { min-width: 0; flex: 1; }
}

/* ------------------------------------------------- article (text) pages */

.article { max-width: var(--text); margin: 0 auto; padding: clamp(2.5rem, 7vw, 4.5rem) 1.25rem clamp(3.5rem, 8vw, 6rem); }
.article h1 { font-size: clamp(2.1rem, 6.5vw, 3.2rem); line-height: 1.07; font-weight: 700; margin-bottom: 0.6rem; }
.article h2 { font-size: 1.45rem; line-height: 1.2; margin: 2.8rem 0 0.6rem; letter-spacing: -0.02em; }
.article h3 { font-size: 1.1rem; line-height: 1.3; margin: 1.8rem 0 0.4rem; letter-spacing: -0.01em; }
.article .meta { color: var(--muted); font-size: 0.95rem; margin: 0 0 2rem; }
.article ul { padding-left: 1.25rem; }
.article li { margin: 0.4rem 0; }
.article .contact { font-size: 1.25rem; font-weight: 600; overflow-wrap: anywhere; }
.article .table { overflow-x: auto; }
.article table { border-collapse: collapse; width: 100%; }
.article th, .article td { text-align: left; vertical-align: top; padding: 0.7rem 0.8rem 0.7rem 0; border-bottom: 1px solid var(--line); }

/* -------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--line); background: var(--paper-2); color: var(--muted); font-size: 0.82rem; }
.footer .wrap { padding-top: 1.6rem; padding-bottom: 2.4rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; margin-bottom: 0.9rem; }
.footer a { color: var(--ink); opacity: 0.8; text-decoration: none; }
.footer a:hover { opacity: 1; text-decoration: underline; }
.footer p { margin: 0; }

/* -------------------------------------------------------------- motion */

/* Elements marked .reveal fade up once as they scroll into view (site.js
   adds .in). Without JavaScript, or with reduced motion, they just show. */
.js .reveal { opacity: 0; transform: translateY(1.6rem); transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero-phones .phone.side.reveal.in { transform: translateY(3.5rem); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .hero-phones .phone.side.reveal { transform: translateY(3.5rem); }
}
