/* ==========================================================================
   Bini — site styles

   Palette is lifted verbatim from lib/core/theme/app_colors.dart so the site
   and the app are the same product. Nothing here introduces a hue the app does
   not already use.

   Structure: tokens, base, layout primitives, then components in the order
   they appear on the page.
   ========================================================================== */

:root {
  /* Brand ramp — app_colors.dart */
  --teal-50:  #ECFAF7;
  --teal-100: #D3F3EE;
  --teal-200: #A8E7DD;
  --teal-300: #74D6C8;
  --teal-400: #45C2B1;
  --teal-500: #2BB09D;
  --teal-600: #24A591;  /* brand */
  --teal-700: #1C8676;
  --teal-800: #16685C;  /* the logo plate */
  --teal-900: #114F46;

  --ground:      #FAFAFB;
  --surface:     #FFFFFF;
  --surface-alt: #F3F4F7;
  --surface-sunken: #EEEFF3;
  --ink:         #16181D;

  --text:   #111827;
  --text-2: #5B6472;
  --text-3: #7E8695;
  --on-dark:   #FFFFFF;
  --on-dark-2: #A9C6BF;

  --rule:        #E8EAEE;
  --rule-strong: #D5D9E0;
  --warning:     #EA580C;
  --warning-soft:#FFF1E4;

  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 22px;
  --pill: 999px;

  --shadow-raised: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .05);
  --shadow-hero:   0 2px 6px rgba(16, 24, 40, .06), 0 18px 40px rgba(16, 24, 40, .09);

  --shell: 1120px;
  --gutter: clamp(1.15rem, .6rem + 2.4vw, 2.5rem);

  --font-display: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(.94rem, .88rem + .3vw, 1.02rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -.028em;
  line-height: 1.08;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 1.3rem + 4vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); font-weight: 700; }
h3 { font-size: clamp(1.05rem, .95rem + .5vw, 1.25rem); font-weight: 600; letter-spacing: -.018em; }
p  { margin: 0; }

a { color: var(--teal-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal-800); }

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

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- Layout primitives -------------------------------------------------- */
.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3rem, 1.8rem + 4.5vw, 5.5rem); }
.section--tight { padding-block: clamp(2.25rem, 1.4rem + 3vw, 3.5rem); }
.stack { display: flex; flex-direction: column; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .69rem;
  font-weight: 500;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: .9rem;
}
.lede { color: var(--text-2); max-width: 60ch; font-size: clamp(1rem, .94rem + .38vw, 1.16rem); }

/* ---- Header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 250, 251, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1rem;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 7px; display: block; }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; letter-spacing: -.03em; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.site-nav a {
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500;
  color: var(--text-2); text-decoration: none;
}
.site-nav a:hover { background: var(--surface-alt); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--teal-700); background: var(--teal-50); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .82rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: .97rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease;
}
.btn:active { transform: scale(.985); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary { background: var(--teal-600); color: #fff; box-shadow: 0 6px 16px -4px rgba(36, 165, 145, .45); }
.btn--primary:hover { background: var(--teal-700); color: #fff; }

.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--rule-strong); }
.btn--ghost:hover { background: var(--surface-alt); color: var(--text); }

.btn--on-dark { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.28); }
.btn--on-dark:hover { background: rgba(255,255,255,.18); color: #fff; }

.btn--light { background: #fff; color: var(--teal-800); }
.btn--light:hover { background: var(--teal-50); color: var(--teal-900); }

.btn__sub { display: block; font-size: .74rem; font-weight: 500; opacity: .8; letter-spacing: 0; }
.btn--stacked { flex-direction: column; gap: .1rem; padding-block: .7rem; }

/* ---- Hero --------------------------------------------------------------- */
.hero {
  background: var(--teal-800);
  color: var(--on-dark);
  /* A second, lighter wash off the top-right corner keeps a large flat teal
     field from reading as a solid brick. */
  background-image: radial-gradient(120% 90% at 88% 4%, rgba(69,194,177,.28), transparent 58%);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: center;
  padding-block: clamp(3rem, 1.8rem + 5vw, 5.5rem);
}
@media (max-width: 860px) { .hero__inner { grid-template-columns: 1fr; } }

.hero .eyebrow { color: var(--teal-300); }
.hero h1 { color: #fff; }
.hero p { color: var(--on-dark-2); max-width: 46ch; margin-top: 1.15rem; font-size: clamp(1rem, .95rem + .4vw, 1.18rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 1.4rem;
  margin-top: 1.75rem; padding-top: 1.4rem;
  border-top: 1px solid rgba(255,255,255,.14);
  font-size: .82rem; color: var(--on-dark-2);
}
.hero__meta b { color: #fff; font-weight: 600; display: block; font-size: .95rem; font-family: var(--font-mono); }

/* Phone frame around the brand video. */
.phone {
  justify-self: center;
  width: min(290px, 74vw);
  aspect-ratio: 406 / 720;
  background: #0C1A18;
  border: 9px solid #0C1A18;
  border-radius: 38px;
  box-shadow: 0 26px 60px rgba(0,0,0,.32);
  overflow: hidden;
}
.phone video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 29px;
  background: var(--ground);
}

/* ---- Legal pages (privacy, terms) ------------------------------------- */
/* Long-form reading: smaller headings than a page section, a rule between
   topics, and room between paragraphs. */
.legal-section { padding-top: clamp(2rem, 1.4rem + 2vw, 3rem); }
.legal {
  font-size: clamp(.98rem, .94rem + .2vw, 1.05rem);
  line-height: 1.72;
  color: var(--text-2);
}
.legal h2 {
  font-size: clamp(1.2rem, 1.08rem + .55vw, 1.45rem);
  letter-spacing: -.02em;
  line-height: 1.25;
  color: var(--text);
  margin: 2.4rem 0 .8rem;
  padding-top: 2.1rem;
  border-top: 1px solid var(--rule);
}
/* Lines capped for reading, but left-aligned with the page title above. */
.legal > * { max-width: 72ch; }
.legal h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal p + p,
.legal ul + p,
.legal p + ul { margin-top: 1rem; }
.legal ul { margin: 0; padding-left: 1.25rem; }
.legal li + li { margin-top: .45rem; }
.legal li::marker { color: var(--teal-600); }
.legal strong { color: var(--text); font-weight: 600; }

/* ---- Download cards ----------------------------------------------------- */
.grid { display: grid; gap: clamp(1rem, .5rem + 1.6vw, 1.6rem); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, .9rem + 1.4vw, 1.9rem);
  box-shadow: var(--shadow-raised);
  display: flex; flex-direction: column; gap: .8rem;
}
.card--feature { box-shadow: none; }
.card__icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--teal-50); color: var(--teal-700);
  display: grid; place-items: center;
}
.card__icon svg { width: 19px; height: 19px; }
.card p { color: var(--text-2); font-size: .93rem; }
.card .btn { margin-top: auto; }

.dl-meta {
  display: flex; flex-wrap: wrap; gap: .5rem .9rem;
  font-size: .78rem; color: var(--text-3);
  font-family: var(--font-mono);
}

/* ---- Steps -------------------------------------------------------------- */
.steps { counter-reset: step; display: grid; gap: 1.1rem; }
.step {
  display: grid; grid-template-columns: 2.1rem 1fr; gap: 1rem;
  align-items: start;
}
.step__n {
  counter-increment: step;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--teal-600); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 500;
}
.step__n::before { content: counter(step); }
.step h3 { margin-bottom: .2rem; }
.step p { color: var(--text-2); font-size: .93rem; }

/* ---- Callout ------------------------------------------------------------ */
.callout {
  display: flex; gap: .9rem;
  background: var(--warning-soft);
  border: 1px solid rgba(234, 88, 12, .22);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-size: .89rem; color: #7C3A0C;
}
.callout svg { width: 19px; height: 19px; flex: none; color: var(--warning); margin-top: .12rem; }
.callout b { color: #6B3209; }

/* A reassuring variant of the callout, in the brand teal rather than the
   warning orange. Used where the message is a guarantee, not a caution. */
.callout--good {
  background: var(--teal-50);
  border-color: rgba(36, 165, 145, .28);
  color: var(--teal-900);
}
.callout--good svg { color: var(--teal-600); }
.callout--good b { color: var(--teal-800); }

/* ---- Trust strip --------------------------------------------------------
   The promises that are easiest to make and hardest to prove, so they get
   their own band rather than being buried in a feature card. */
.promises {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, .5rem + 1.6vw, 1.75rem);
}
@media (max-width: 900px) { .promises { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .promises { grid-template-columns: 1fr; } }
/* Two across when the band shares its row with another column. */
.promises--half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 460px) { .promises--half { grid-template-columns: 1fr; } }

.promise {
  display: flex; flex-direction: column; gap: .55rem;
  padding: 1.35rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.promise__tick {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--teal-50); color: var(--teal-700);
  display: grid; place-items: center;
}
.promise__tick svg { width: 16px; height: 16px; }
.promise h3 { font-size: 1rem; }
.promise p { font-size: .87rem; color: var(--text-2); }

/* ---- FAQ ---------------------------------------------------------------- */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.15rem .25rem;
  cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1rem, .95rem + .3vw, 1.1rem);
  letter-spacing: -.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; margin-left: auto; flex: none;
  width: 11px; height: 11px;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .18s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
.faq summary:hover { color: var(--teal-700); }
.faq__body { padding: 0 .25rem 1.35rem; color: var(--text-2); max-width: 72ch; }
.faq__body p + p { margin-top: .7rem; }

/* ---- Versions ----------------------------------------------------------- */
.release {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: clamp(1rem, .5rem + 2vw, 2.5rem);
  padding-block: clamp(1.6rem, 1rem + 2vw, 2.4rem);
  border-top: 1px solid var(--rule);
}
@media (max-width: 760px) { .release { grid-template-columns: 1fr; gap: .9rem; } }
.release__v { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; }
.release__date { font-family: var(--font-mono); font-size: .78rem; color: var(--text-3); margin-top: .15rem; }
.badge {
  display: inline-block; margin-top: .55rem;
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .16rem .48rem; border-radius: 4px;
}
.badge--latest { background: var(--teal-50); color: var(--teal-700); border: 1px solid rgba(36,165,145,.32); }
.badge--old { background: var(--surface-alt); color: var(--text-3); border: 1px solid var(--rule-strong); }
.release ul { margin: 0; padding-left: 1.15rem; color: var(--text-2); }
.release li { margin-bottom: .3rem; }
.release__dl { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.checksum {
  margin-top: .9rem; font-family: var(--font-mono); font-size: .72rem; color: var(--text-3);
  word-break: break-all; background: var(--surface-alt); border-radius: var(--radius-sm);
  padding: .5rem .7rem;
}

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  background: var(--ink); color: #9AA3AB;
  padding-block: clamp(2.5rem, 1.6rem + 3vw, 3.5rem);
  font-size: .89rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, .8rem + 2.5vw, 3rem);
}
@media (max-width: 780px) { .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  font-size: .7rem; letter-spacing: .15em; text-transform: uppercase;
  color: #6C757D; font-family: var(--font-mono); font-weight: 500; margin-bottom: .9rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.site-footer a { color: #C6CDD2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .brand span { color: #fff; }
.site-footer__note { max-width: 34ch; margin-top: .9rem; color: #7E888F; font-size: .84rem; }
.site-footer__bar {
  margin-top: clamp(2rem, 1.4rem + 2vw, 3rem);
  padding-top: 1.3rem;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; flex-wrap: wrap; gap: .8rem 1.5rem;
  font-size: .8rem; color: #6C757D;
}
.site-footer__bar .mono { color: #8B959C; }

/* ---- Utility ------------------------------------------------------------ */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--text-2); }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---- Modal --------------------------------------------------------------
   Built on <dialog>, so Escape, focus containment and inertness of the page
   behind come from the browser rather than from script. The download itself
   never depends on any of this: the anchor's default action runs first and the
   dialog only ever appears afterwards.
   ------------------------------------------------------------------------ */
.modal {
  width: min(560px, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-hero);
}
.modal::backdrop { background: rgba(16, 24, 40, .55); }

.modal__head {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.5rem 1.5rem 0;
}
.modal__icon {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--teal-50); color: var(--teal-700);
}
.modal__icon svg { width: 21px; height: 21px; }
.modal__title {
  font-family: var(--font-display);
  font-size: 1.22rem; font-weight: 600; line-height: 1.25;
  margin: .25rem 0 0;
}
.modal__close {
  margin-left: auto; flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--text-3);
  cursor: pointer;
}
.modal__close:hover { background: var(--surface-alt); color: var(--text); }
.modal__close svg { width: 17px; height: 17px; }

.modal__body { padding: .9rem 1.5rem 0; }
.modal__body > p { color: var(--text-2); font-size: .93rem; margin: 0 0 1rem; }

.modal__actions {
  display: flex; flex-wrap: wrap; gap: .7rem;
  padding: 1.4rem 1.5rem 1.5rem;
}
.modal__actions .btn { flex: 1 1 auto; justify-content: center; }

/* A scrollable body for the longer of the two dialogs, so the actions stay
   reachable on a short window. */
.modal__body--scroll { max-height: min(56vh, 430px); overflow-y: auto; }

/* Steps inside a dialog sit tighter than the ones on the page. */
.modal .steps { gap: .95rem; }
.modal .step p { font-size: .89rem; }

/* A literal string the reader has to type or paste somewhere else. */
.copy {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: .45rem;
  padding: .3rem .55rem;
  border: 1px solid var(--rule-strong); border-radius: 8px;
  background: var(--surface-sunken);
  font-family: var(--font-mono); font-size: .82rem;
  cursor: pointer;
}
.copy:hover { border-color: var(--teal-400); }
.copy svg { width: 14px; height: 14px; color: var(--text-3); }
.copy[data-copied="true"] { border-color: var(--teal-500); color: var(--teal-800); }

/* The one line about what you need, quieter than the buttons above it. */
.hero__need { font-size: .9rem; margin-top: 1.1rem; }
.hero__need b { color: #fff; font-weight: 600; }

/* Plain lists inside cards: who it suits, and what the app asks for. */
.card ul { margin: .75rem 0 0; padding-left: 1.15rem; color: var(--text-2); font-size: .93rem; }
.card li + li { margin-top: .5rem; }
.card li::marker { color: var(--teal-600); }
.card--no li::marker { color: var(--text-2); }
.card li b { color: var(--text); font-weight: 600; }
