/* Loci Kids Learning — site styles
   Palette and type pulled from the Android app's design tokens. */

:root {
  --primary: #005ac0;
  --primary-light: #3381d4;
  --success: #1a8a4a;
  --stars: #d4910a;
  --ink: #1a2030;
  --ink-2: #4a5568;
  --muted: #6b7a90;
  --line: #e3eaf4;
  --ground: #f4f8fd;
  --ground-2: #eef4fb;
  --white: #ffffff;

  --font: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-card: 20px;
  --radius-card-sm: 16px;
  --shadow-card: 0 10px 30px rgba(26, 32, 48, 0.07);
  --shadow-soft: 0 4px 14px rgba(26, 32, 48, 0.06);
  --container: 1120px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font-family: inherit; }
p a { color: var(--primary); text-underline-offset: 2px; }
p a:hover { color: var(--primary-light); }

h1, h2, h3 { font-weight: 900; line-height: 1.15; color: var(--ink); }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.35rem); }
h3 { font-size: 1.2rem; font-weight: 800; }
.lede { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); color: var(--ink-2); max-width: 62ch; }
p { color: var(--ink-2); max-width: 68ch; }
.eyebrow {
  display: inline-block;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

/* Focus states */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -50px;
  background: var(--primary);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 9999px;
  font-weight: 700;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}
section {
  padding: 64px 0;
}
.section-head {
  max-width: 720px;
  margin-bottom: 36px;
}
@media (min-width: 720px) {
  section { padding: 96px 0; }
}

/* Buttons & badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 1rem;
  padding: 14px 28px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 10px 22px rgba(0, 90, 192, 0.28);
}
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover { background: var(--ground-2); }
.btn-block { width: 100%; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ground-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.95rem;
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--stars);
  flex: none;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pill {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 7px 16px;
  border-radius: 9999px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 248, 253, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--ink);
  flex: none;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  justify-content: flex-end;
  flex: 1;
}
/* :not(.btn) keeps these generic link styles (including color) from ever
   competing with .btn-primary's own color on the CTA anchor — a compound
   selector like ".site-nav a" is more specific than the single ".btn-primary"
   class, so without this scoping it would silently win and leave the
   button's text the wrong colour. */
.site-nav a:not(.btn) {
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 9999px;
  white-space: nowrap;
}
.site-nav a:not(.btn):hover { background: var(--ground-2); color: var(--ink); }
.site-nav .btn { margin-left: 6px; padding: 10px 20px; font-size: 0.9rem; }

/* Below this width, the full link list can't share a row with the brand
   and CTA without wrapping awkwardly mid-item — so collapse to brand +
   CTA only. The links all repeat in the footer. */
@media (max-width: 719px) {
  .site-header .container { flex-wrap: wrap; row-gap: 8px; }
  .site-nav { flex-basis: 100%; justify-content: stretch; gap: 6px; }
  .site-nav a:not(.btn) { display: none; }
  .site-nav .btn { flex: 1; margin-left: 0; text-align: center; }
}

/* Hero */
.hero .container {
  display: grid;
  gap: 40px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 56px;
}
.hero-copy h1 {
  font-size: clamp(2.1rem, 1.7rem + 2.2vw, 3.4rem);
  margin-bottom: 18px;
}
.hero-copy .lede { margin-bottom: 26px; }
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-visual .blob {
  position: absolute;
  width: min(420px, 90%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--ground-2), var(--line) 78%);
  z-index: 0;
}
.hero-visual img {
  position: relative;
  z-index: 1;
  width: min(260px, 60vw);
  height: auto;
  filter: drop-shadow(0 18px 26px rgba(0, 43, 92, 0.18));
}
.hero-visual .star {
  position: absolute;
  z-index: 2;
  width: 54px;
  height: 54px;
}
.hero-visual .star-1 { top: 6%; right: 12%; }
.hero-visual .star-2 { bottom: 12%; left: 6%; width: 32px; height: 32px; }

@media (prefers-reduced-motion: no-preference) {
  .hero-visual img { animation: bob 4.5s ease-in-out infinite; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (min-width: 860px) {
  .hero .container {
    grid-template-columns: 1.05fr 0.95fr;
    padding-top: 76px;
    padding-bottom: 76px;
  }
}

/* Worlds grid */
.worlds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.world-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 26px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Flex/grid items default to min-width:auto, which lets long text force
     the item wider than its track instead of wrapping — min-width:0 makes
     wrapping win instead. */
  min-width: 0;
}
.world-card .icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.world-card .icon svg { width: 28px; height: 28px; }
.world-card .tag {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.world-card h3 { margin-top: 2px; }
.world-card p { font-size: 0.96rem; }

/* For families */
.families-wrap {
  display: grid;
  gap: 36px;
}
.families-list {
  display: grid;
  gap: 18px;
}
.family-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card-sm);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.family-item > div { min-width: 0; }
.family-item .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ground-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.family-item .icon svg { width: 24px; height: 24px; }
.family-item h3 { font-size: 1.05rem; margin-bottom: 4px; }
.family-item p { font-size: 0.95rem; }
.families-shot {
  justify-self: center;
  max-width: 320px;
  width: 100%;
}
.families-shot img {
  border-radius: 26px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
@media (min-width: 900px) {
  .families-wrap { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
}

/* Privacy */
.privacy-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 30px;
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 22px;
}
.privacy-grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 720px) {
  .privacy-grid { grid-template-columns: repeat(2, 1fr); }
}
.privacy-point {
  display: flex;
  gap: 12px;
}
.privacy-point .dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--success);
}
.privacy-point p { font-size: 0.96rem; color: var(--ink-2); }
.privacy-point strong { color: var(--ink); }
.privacy-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

/* Screenshots */
.shots-scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 220px);
  gap: 16px;
  overflow-x: auto;
  padding: 6px 6px 18px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.shot-card {
  scroll-snap-align: start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card-sm);
  padding: 10px 10px 14px;
  box-shadow: var(--shadow-soft);
}
.shot-card img { border-radius: 10px; }
.shot-card figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-2);
  text-align: center;
}
@media (min-width: 960px) {
  .shots-scroller {
    grid-auto-flow: row;
    grid-template-columns: repeat(7, 1fr);
    overflow: visible;
  }
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 12px;
  max-width: 780px;
}
.faq-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card-sm);
  padding: 6px 22px;
  box-shadow: var(--shadow-soft);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-weight: 800;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex: none;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  transition: transform 0.15s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding-bottom: 18px; font-size: 0.97rem; }

/* Support */
.support-box {
  background: var(--primary);
  border-radius: var(--radius-card);
  padding: 40px;
  color: var(--white);
  display: grid;
  gap: 20px;
  box-shadow: var(--shadow-card);
}
.support-box h2 { color: var(--white); }
.support-box p { color: rgba(255, 255, 255, 0.86); max-width: 60ch; }
.support-box .btn-primary {
  background: var(--white);
  color: var(--primary);
  box-shadow: none;
}
.support-box .btn-primary:hover { background: var(--ground-2); }
.support-box a.text-link { color: var(--white); text-decoration: underline; font-weight: 700; }
.support-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 50px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}
.footer-brand img { width: 30px; height: 30px; border-radius: 8px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.footer-links a { text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 0.92rem; }
.footer-links a:hover { color: var(--primary); }
.footer-fine { font-size: 0.85rem; color: var(--muted); max-width: 70ch; }
.footer-fine + .footer-fine { margin-top: 6px; }

/* Generic content page (support.html) */
.page-hero {
  padding: 48px 0 8px;
}
.content-block {
  display: grid;
  gap: 14px;
  max-width: 760px;
  margin-bottom: 8px;
}
.steps {
  display: grid;
  gap: 16px;
  max-width: 780px;
}
.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.step > div { min-width: 0; }
.step .num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ground-2);
  color: var(--primary);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.step h3 { font-size: 1rem; margin-bottom: 4px; }
.step p { font-size: 0.95rem; margin: 0; }

/* 404 */
.notfound {
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}
.notfound-card { max-width: 480px; display: grid; gap: 18px; justify-items: center; }
.notfound img { width: 130px; }
.notfound h1 { font-size: 1.8rem; }
.notfound .btn { margin-top: 6px; }

/* Reduced motion: freeze all decorative animation/transition/smooth-scroll */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
