/* ==========================================================================
   Trusted Tools & Utilities — shared stylesheet
   Single source of truth. No page should carry its own <style> block.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  /* Palette: lavender/purple accents on near-white, per brand direction */
  --bg:          #ffffff;
  --bg-soft:     #f7f5fd;
  --bg-tint:     #efeafb;
  --ink:         #1b1730;
  --ink-soft:    #56506e;
  --ink-faint:   #7d7794;
  --line:        #e6e1f4;
  --accent:      #6c4fd6;
  --accent-deep: #4a2fa8;
  --accent-wash: #f1ecfe;
  --focus:       #2f1d7a;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(27, 23, 48, .05);
  --shadow:    0 4px 16px rgba(27, 23, 48, .06);
  --shadow-lg: 0 14px 40px rgba(27, 23, 48, .09);

  --wrap: 1140px;
  --wrap-read: 720px;

  /* System stack — zero network requests, renders instantly on every device.
     To swap in a webfont, drop the .woff2 into /assets/fonts/, add an
     @font-face block below, and prepend the family name here. */
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
svg { display: block; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.2rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); letter-spacing: -0.02em; }
h3 { font-size: 1.16rem; }

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

a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

ul, ol { margin: 0 0 1.1em; padding-left: 1.35em; }
li { margin-bottom: .4em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--accent-deep); color: #fff;
  padding: .7rem 1.1rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 200; transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* --- Layout helpers ----------------------------------------------------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-read { width: min(100% - 2.5rem, var(--wrap-read)); margin-inline: auto; }

.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section--soft { background: var(--bg-soft); }

.section-head { max-width: 62ch; margin-bottom: 2.5rem; }
.section-head p { color: var(--ink-soft); margin-bottom: 0; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.35rem;
  border-radius: 999px;
  font-size: .97rem; font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn--primary { background: var(--accent-deep); color: #fff; }
.btn--primary:hover { background: var(--accent); color: #fff; }
.btn--ghost { background: #fff; color: var(--accent-deep); border-color: var(--line); }
.btn--ghost:hover { background: var(--accent-wash); color: var(--accent-deep); border-color: var(--accent); }
.btn--play { background: var(--ink); color: #fff; }
.btn--play:hover { background: #33294f; color: #fff; }
.btn--sm { padding: .55rem 1rem; font-size: .9rem; }
.btn svg { flex: none; }

/* --- Header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 72px;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 700; font-size: 1.02rem; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name { white-space: nowrap; }
@media (max-width: 440px) {
  .brand { font-size: .9rem; }
  .brand__name { white-space: normal; line-height: 1.2; }
}

.nav ul {
  display: flex; align-items: center; gap: .25rem;
  list-style: none; margin: 0; padding: 0;
}
.nav a {
  display: block; padding: .5rem .8rem;
  border-radius: 8px;
  font-size: .95rem; font-weight: 500;
  color: var(--ink-soft); text-decoration: none;
}
.nav a:hover { background: var(--accent-wash); color: var(--accent-deep); }
.nav a[aria-current="page"] { color: var(--accent-deep); font-weight: 600; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; color: var(--ink);
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 18px; height: 2px;
  background: currentColor; border-radius: 2px;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after  { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav[data-open="true"] { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: .6rem 1.25rem 1.1rem; }
  .nav a { padding: .8rem .2rem; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1rem; }
  .nav li:last-child a { border-bottom: 0; }
}

/* --- Hero --------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(900px 420px at 88% -10%, var(--bg-tint) 0%, rgba(239,234,251,0) 70%),
    var(--bg);
  padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line);
}
.hero__grid {
  display: grid; gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
}
.hero__lead {
  font-size: clamp(1.02rem, .97rem + .3vw, 1.18rem);
  color: var(--ink-soft);
  max-width: 54ch;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }
.hero__stats {
  display: flex; flex-wrap: wrap; gap: 2.2rem;
  margin-top: 2.6rem; padding-top: 1.7rem;
  border-top: 1px solid var(--line);
}
.hero__stat strong { display: block; font-size: 1.55rem; letter-spacing: -0.02em; }
.hero__stat span { font-size: .9rem; color: var(--ink-faint); }

.hero__art {
  background: linear-gradient(160deg, #fff 0%, var(--bg-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.4rem, 3vw, 2.2rem);
}
.hero__art-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .9rem;
}
.hero__art-tile {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.hero__art-tile svg { width: 52%; height: auto; }
.hero__art-caption {
  margin-top: 1.4rem; font-size: .88rem; color: var(--ink-faint);
  text-align: center;
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  /* Text before illustration on small screens */
  .hero__art { order: 2; }
  .hero__copy { order: 1; }
}

/* --- App grid ----------------------------------------------------------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.35rem;
  list-style: none; margin: 0; padding: 0;
}
.app-card {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin: 0;
}
.app-card__top { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.app-card__icon {
  width: 56px; height: 56px; flex: none;
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* Real icons arrive wrapped in <picture>; the wrapper must not collapse. */
.app-card__top picture,
.app-hero__icon picture,
.hero__art-tile picture { display: block; flex: none; line-height: 0; }
.app-hero__icon picture { width: 100%; height: 100%; }
.hero__art-tile picture { width: 52%; }
.hero__art-tile picture .app-card__icon { width: 100%; height: auto; border-radius: 22%; }
img.app-card__icon { object-fit: cover; }
.app-card__title { margin: 0; font-size: 1.05rem; }
.app-card__title a { color: var(--ink); text-decoration: none; }
.app-card__title a:hover { color: var(--accent-deep); text-decoration: underline; }
.app-card__kicker { font-size: .82rem; color: var(--ink-faint); }
.app-card__desc { color: var(--ink-soft); font-size: .95rem; flex: 1 1 auto; margin-bottom: 1.25rem; }
.app-card__actions { display: flex; flex-wrap: wrap; gap: .55rem; }

/* --- Feature list ------------------------------------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.35rem;
  list-style: none; margin: 0; padding: 0;
}
.feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 0;
}
.feature h3 { margin-bottom: .45rem; }
.feature p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.feature__icon {
  width: 38px; height: 38px; margin-bottom: 1rem;
  color: var(--accent-deep);
}

/* --- Privacy band ------------------------------------------------------- */
.privacy-band {
  background: linear-gradient(140deg, var(--accent-deep) 0%, #6a45c9 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3.2rem);
  display: grid; gap: 2rem;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
}
.privacy-band h2 { color: #fff; }
.privacy-band p { color: rgba(255, 255, 255, .88); margin-bottom: 0; }
.privacy-band .btn--ghost { background: #fff; border-color: #fff; }
.privacy-band__list { list-style: none; margin: 0; padding: 0; }
.privacy-band__list li {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .6rem 0;
  border-top: 1px solid rgba(255, 255, 255, .2);
  color: rgba(255, 255, 255, .92);
  font-size: .95rem;
}
.privacy-band__list li:first-child { border-top: 0; }
.privacy-band__list svg { flex: none; margin-top: .25rem; color: #fff; }
@media (max-width: 800px) { .privacy-band { grid-template-columns: 1fr; } }

/* --- Contact ------------------------------------------------------------ */
.contact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 4vw, 2.8rem);
  box-shadow: var(--shadow);
  text-align: center;
}
.contact-card__mail {
  display: inline-block; margin: .4rem 0 1.5rem;
  font-size: clamp(1.05rem, .95rem + .6vw, 1.5rem);
  font-weight: 700; letter-spacing: -0.02em;
  color: var(--accent-deep); word-break: break-word;
}

/* --- Article (legal / long-form) ---------------------------------------- */
.page-head {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.page-head p { color: var(--ink-soft); margin-bottom: 0; max-width: 60ch; }
.page-head .breadcrumb { margin-bottom: 1rem; }

.breadcrumb { font-size: .88rem; color: var(--ink-faint); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--ink-faint); }

.article { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.article h2 { margin-top: 2.4rem; font-size: 1.45rem; }
.article h3 { margin-top: 1.8rem; font-size: 1.1rem; }
.article > :first-child { margin-top: 0; }
.article p, .article li { color: var(--ink-soft); }
.article strong { color: var(--ink); }
.article ul { padding-left: 1.2em; }
.article a { word-break: break-word; }
.article .updated {
  display: inline-block;
  background: var(--accent-wash); color: var(--accent-deep);
  border-radius: 999px; padding: .35rem .9rem;
  font-size: .85rem; font-weight: 600; margin-bottom: 1.5rem;
}

/* --- App detail page ---------------------------------------------------- */
.app-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.app-hero__icon { width: 88px; height: 88px; flex: none; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.app-hero__icon .app-card__icon { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.app-hero__text { min-width: 260px; flex: 1 1 320px; }
.app-hero__text h1 { margin-bottom: .35rem; }
.app-hero__text p { color: var(--ink-soft); margin-bottom: 0; }
.app-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }

.legal-links {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  list-style: none; margin: 1.5rem 0 0; padding: 0;
}
.legal-links li { margin: 0; }
.legal-links a {
  display: block; padding: 1.1rem 1.3rem;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none;
  font-weight: 600; color: var(--ink);
}
.legal-links a:hover { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-deep); }
.legal-links span { display: block; font-weight: 400; font-size: .88rem; color: var(--ink-faint); margin-top: .2rem; }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: clamp(2.8rem, 5vw, 4rem) 0 2rem;
  margin-top: 0;
}
.site-footer__grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1.4fr 1fr 1fr;
  margin-bottom: 2.4rem;
}
.site-footer h2 { font-size: .95rem; margin-bottom: .9rem; letter-spacing: 0; }
.site-footer p { color: var(--ink-soft); font-size: .93rem; max-width: 42ch; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .55rem; }
.site-footer a { color: var(--ink-soft); text-decoration: none; font-size: .93rem; }
.site-footer a:hover { color: var(--accent-deep); text-decoration: underline; }
.site-footer .brand { margin-bottom: .9rem; }
.site-footer__bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between;
  font-size: .88rem; color: var(--ink-faint);
}
@media (max-width: 760px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__about { grid-column: 1 / -1; }
}

/* --- Motion ------------------------------------------------------------- */
/* One orchestrated entrance on the hero only; everything else stays still. */
.reveal { opacity: 0; transform: translateY(14px); }
.js .reveal { transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* --- Print -------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .skip-link, .app-actions { display: none; }
  body { font-size: 12pt; }
  a { color: #000; }
}
