/* Familya — familya.app
   Hand-written, no framework. Tokens first, then layout, then components. */

@font-face {
  font-family: "Poppins";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/Poppins-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/Poppins-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/Poppins-Bold.woff2") format("woff2");
}

/* ------------------------------------------------------------ tokens --- */
:root {
  color-scheme: light dark;

  /* brand */
  --c-violet: #5b4be1;
  --c-violet-light: #7b5cff;
  --c-coral: #ff6b6b;
  --c-teal: #22c7a9;
  --c-amber: #ffb020;
  --c-pink: #ff5a7a;
  --c-ink: #1e1b3e;
  --c-night: #1b1837;

  /* semantic */
  --bg: light-dark(#fbfaff, #14122b);
  --bg-tint: light-dark(#f3f0ff, #1b1837);
  --surface: light-dark(#ffffff, #221e44);
  --surface-2: light-dark(#f6f4ff, #2a2552);
  --text: light-dark(var(--c-ink), #f1efff);
  --text-muted: light-dark(#5e5a7d, #b6b2d6);
  --border: light-dark(#e7e3f7, #3a3566);
  --accent: var(--c-violet);
  --accent-contrast: #ffffff;
  --link: light-dark(#4a3bd0, #b3a6ff);
  --focus: var(--c-amber);
  --shadow: 0 1px 2px rgb(30 27 62 / .06), 0 12px 32px -12px rgb(30 27 62 / .18);
  --shadow-phone: 0 30px 60px -20px rgb(30 27 62 / .45);
  --gradient: linear-gradient(135deg, var(--c-violet-light) 0%, var(--c-violet) 48%, var(--c-coral) 100%);

  /* type & spacing */
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 1.375rem;
  --radius-sm: .75rem;
  --space: clamp(1rem, .5rem + 2vw, 2rem);
  --section: clamp(3.5rem, 2rem + 6vw, 7rem);
  --container: 72rem;
}

@media (forced-colors: active) {
  :root {
    --border: CanvasText;
    --link: LinkText;
    --shadow: none;
    --shadow-phone: none;
  }
}

/* ------------------------------------------------------------ base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 1.2rem + 3.6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 1rem + 2.2vw, 2.5rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }

.container { width: min(100% - 2 * var(--space), var(--container)); margin-inline: auto; }
.container--narrow { --container: 46rem; }
.lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--text-muted); }
.eyebrow {
  display: inline-block; font-weight: 500; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent);
  padding: .3em .9em; border-radius: 999px; margin-bottom: 1.25rem;
}

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -100%; z-index: 100;
  background: var(--accent); color: var(--accent-contrast); padding: .5rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

/* ------------------------------------------------------------ buttons -- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px;
  padding: .7em 1.4em; border-radius: 999px; font-weight: 500; text-decoration: none;
  color: var(--accent-contrast); background: var(--accent); border: 2px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--small { min-height: 40px; padding: .45em 1.1em; font-size: .95rem; }
.btn--ghost { background: transparent; color: var(--link); border-color: var(--border); }

.store-buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 1rem; }
.store-btn {
  display: inline-flex; align-items: center; gap: .7rem; min-height: 52px;
  padding: .6em 1.3em .6em 1em; border-radius: var(--radius-sm); text-decoration: none;
  background: var(--c-ink); color: #fff; font-weight: 500; line-height: 1.2;
  transition: transform .18s ease, box-shadow .18s ease;
}
.store-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.store-buttons--light .store-btn { background: #fff; color: var(--c-ink); }
@media (forced-colors: active) { .store-btn, .btn { border: 2px solid ButtonText; } }

/* ------------------------------------------------------------ header --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__row { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.site-nav { display: none; gap: 1.4rem; margin-inline-start: auto; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: .95rem; padding: .4em 0; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--link); }
.site-header__tools { display: flex; align-items: center; gap: .75rem; margin-inline-start: auto; }
.site-nav + .site-header__tools { margin-inline-start: 0; }
@media (min-width: 60rem) { .site-nav { display: flex; } }
@media (max-width: 40rem) { .site-header .btn { display: none; } }

.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem;
  min-height: 40px; padding: .35em .9em; border-radius: 999px; border: 1px solid var(--border);
  font-weight: 500; font-size: .92rem; background: var(--surface);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + .4rem); min-width: 11rem; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: .35rem; z-index: 60;
}
.lang-menu li a {
  display: block; padding: .5rem .8rem; border-radius: .5rem; text-decoration: none; color: var(--text);
}
.lang-menu li a:hover { background: var(--surface-2); }
.lang-menu li a[aria-current] { font-weight: 700; color: var(--link); }

.lang-banner { background: var(--c-ink); color: #fff; font-size: .92rem; }
.lang-banner p { margin: 0; padding: .55rem var(--space); display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: center; }
.lang-banner a { color: var(--c-amber); font-weight: 500; }
.lang-banner__dismiss { background: transparent; border: 0; color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: .2rem .5rem; }

/* ------------------------------------------------------------ hero ----- */
.hero { position: relative; overflow: clip; padding-block: var(--section) 0; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40rem 28rem at 12% 10%, color-mix(in oklab, var(--c-violet-light) 24%, transparent), transparent 70%),
    radial-gradient(30rem 24rem at 90% 30%, color-mix(in oklab, var(--c-coral) 22%, transparent), transparent 70%),
    radial-gradient(24rem 20rem at 60% 90%, color-mix(in oklab, var(--c-teal) 16%, transparent), transparent 70%);
}
.hero__grid { display: grid; gap: 3rem; align-items: center; }
.hero__copy { max-width: 36rem; }
.hero__note { font-size: .9rem; color: var(--text-muted); }
.hero__art { position: relative; justify-self: center; width: min(100%, 26rem); padding-bottom: 2rem; }
@media (min-width: 60rem) {
  .hero__grid { grid-template-columns: 1.1fr .9fr; }
  .hero { padding-block: calc(var(--section) * .9) var(--section); }
}

.phone {
  position: relative; border-radius: 2.6rem; padding: .55rem; background: #17152b; box-shadow: var(--shadow-phone);
  aspect-ratio: 412 / 892;
}
.phone::after {
  content: ""; position: absolute; top: .95rem; left: 50%; translate: -50% 0; width: 28%; height: 1.4rem;
  background: #17152b; border-radius: 999px;
}
/* The captures have no status bar; the padding gives the island a strip to sit in. */
.phone img { width: 100%; height: 100%; border-radius: 2.1rem; object-fit: cover; object-position: top; background: #fff; padding-top: 2.3rem; }
.phone--hero { width: 22rem; max-width: 78%; margin-inline: auto; z-index: 1; animation: float 7s ease-in-out infinite; }
.phone--peek {
  position: absolute; right: 0; bottom: 0; width: 12rem; max-width: 42%; rotate: 8deg; opacity: .95;
  border-radius: 1.8rem; padding: .35rem;
}
.phone--peek::after { height: .9rem; top: .6rem; }
.phone--peek img { border-radius: 1.5rem; padding-top: 1.4rem; }
.phone--small { border-radius: 2rem; padding: .4rem; }
.phone--small::after { height: 1rem; top: .7rem; }
.phone--small img { border-radius: 1.65rem; padding-top: 1.8rem; }

@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@media (prefers-reduced-motion: reduce) { .phone--hero { animation: none; } }

/* ------------------------------------------------------------ sections - */
.section { padding-block: var(--section); }
.section--tint { background: var(--bg-tint); }
.section--dark { background: var(--c-night); color: #f1efff; }
.section--dark .lead, .section--dark p { color: #c9c4ea; }
.section__head { max-width: 44rem; margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem); }

.feature-grid { list-style: none; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
@media (min-width: 60rem) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature {
  --accent: var(--c-violet);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem;
  box-shadow: var(--shadow); contain: layout style paint;
}
.feature__icon {
  display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 1rem; margin-bottom: 1rem;
  color: var(--accent); background: color-mix(in oklab, var(--accent) 14%, transparent);
}
.feature__icon svg { width: 1.6rem; height: 1.6rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: .97rem; }

.steps { list-style: none; counter-reset: step; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-bottom: 3.5rem; }
.step { position: relative; padding-top: .5rem; }
.step__num {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; margin-bottom: 1rem;
  background: var(--gradient); color: #fff; font-weight: 700;
}
.step p { color: var(--text-muted); margin: 0; }

.roles__title { margin-bottom: 1.25rem; }
.roles { list-style: none; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.role { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; }
.role p { margin: .6rem 0 0; font-size: .95rem; color: var(--text-muted); }
.role__badge { display: inline-block; font-weight: 700; font-size: .85rem; padding: .25em .8em; border-radius: 999px; color: #fff; }
.role__badge--admin { background: var(--c-violet); }
.role__badge--parent { background: var(--c-teal); }
.role__badge--child { background: var(--c-amber); color: var(--c-ink); }
.role__badge--other { background: var(--c-pink); }

/* screens rail */
.screens { overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding-block: .5rem 1.5rem; scrollbar-width: thin; }
.screens__track {
  list-style: none; display: flex; gap: 1.5rem; width: max-content; padding-inline: max(var(--space), (100vw - var(--container)) / 2);
}
.screens__item { scroll-snap-align: center; width: 16rem; flex: none; }
.screens figure { margin: 0; }
.screens figcaption { font-size: .9rem; color: var(--text-muted); margin-top: 1rem; text-align: center; text-wrap: pretty; }

.trust-grid { list-style: none; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-bottom: 3rem; }
.trust { border: 1px solid #3a3566; border-radius: var(--radius); padding: 1.5rem; background: #221e44; }
.trust h3 { color: #fff; }
.trust p { margin: 0; font-size: .95rem; }
.langs { border-top: 1px solid #3a3566; padding-top: 2.5rem; max-width: 44rem; }
.langs h3 { color: #fff; }
.langs__list { display: flex; flex-wrap: wrap; gap: .6rem; }
.langs__list a { color: #fff; text-decoration: none; padding: .35em .9em; border-radius: 999px; border: 1px solid #4a4482; }
.langs__list a:hover { background: #2a2552; }

/* faq */
.faq { display: grid; gap: .75rem; }
.faq__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .25rem 1.25rem; }
.faq__item summary { cursor: pointer; font-weight: 500; padding: .9rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; font-size: 1.4rem; color: var(--link); transition: rotate .2s ease; }
.faq__item[open] summary::after { rotate: 45deg; }
.faq__item p { color: var(--text-muted); margin: 0 0 1rem; }

/* cta */
.cta { background: var(--gradient); color: #fff; padding-block: var(--section); text-align: center; }
.cta__inner { display: grid; justify-items: center; gap: .5rem; }
.cta h2 { color: #fff; }
.cta p { color: #fff; opacity: .92; }
.cta .store-buttons { justify-content: center; }

/* ------------------------------------------------------------ footer --- */
.site-footer { padding-block: 3.5rem 2rem; border-top: 1px solid var(--border); background: var(--bg-tint); font-size: .95rem; }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.site-footer__brand p { margin: 0; color: var(--text-muted); }
.site-footer__brand img { margin-bottom: .75rem; }
.site-footer h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .8rem; }
.site-footer ul { list-style: none; display: grid; gap: .5rem; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--link); text-decoration: underline; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--text-muted); }
.site-footer__legal p { margin: 0; }

/* ------------------------------------------------------------ legal ---- */
.legal { padding-block: clamp(2rem, 1rem + 3vw, 4rem) var(--section); }
.legal__grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 60rem) {
  .legal__grid { grid-template-columns: 17rem minmax(0, 1fr); }
  .legal__aside { position: sticky; top: 5.5rem; }
}
.toc h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.toc ol { list-style: none; display: grid; gap: .3rem; font-size: .92rem; max-height: 55vh; overflow: auto; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--link); }
.legal__langs { font-size: .9rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: .4rem .7rem; margin-top: 1.5rem; }

.prose { max-width: 46rem; }
.prose h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.8rem); margin-bottom: .6em; }
.prose h2 { font-size: 1.45rem; margin-top: 2.2em; scroll-margin-top: 5.5rem; }
.prose h3 { font-size: 1.1rem; margin-top: 1.6em; scroll-margin-top: 5.5rem; }
.prose p, .prose li { text-wrap: pretty; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin-bottom: 1em; }
.prose li + li { margin-top: .3em; }
.prose blockquote {
  margin: 1.5em 0; padding: .9em 1.2em; border-inline-start: 4px solid var(--c-amber);
  background: color-mix(in oklab, var(--c-amber) 12%, transparent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: .3em; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.prose .table-wrap { overflow-x: auto; margin-bottom: 1.2em; }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.prose th, .prose td { text-align: start; padding: .6em .8em; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose strong { font-weight: 700; }

/* ------------------------------------------------------------ motion --- */
/* Reveal-on-scroll is opt-in: only once site.js has swapped .no-js for .js,
   so the content is always visible without JavaScript, in print, and for
   people who prefer reduced motion. */
.js .reveal { opacity: 0; translate: 0 18px; transition: opacity .55s ease, translate .55s ease; }
.js .reveal.is-visible { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce), print {
  .js .reveal { opacity: 1; translate: 0 0; transition: none; }
}
