@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Sora:wght@600;700;800&display=swap");

:root {
  --brand: #4f67de;
  --brand-strong: #3f57cd;
  --accent: #e85b83;
  --accent-soft: #ffb86b;

  --ink: #172034;
  --muted: #5f6880;

  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --line: rgba(23, 32, 52, 0.11);

  --bg-a: #eef2fb;
  --bg-b: #f7f4fb;

  --header-bg: rgba(255, 255, 255, 0.9);
  --header-line: rgba(23, 32, 52, 0.09);

  --hero-accent: linear-gradient(135deg, #4f67de, #e85b83);
  --support-gradient: linear-gradient(135deg, #4f67de, #3f80dc, #5ab397);

  --font-display: "Sora", "Avenir Next", sans-serif;
  --font-body: "Manrope", "Avenir Next", sans-serif;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-sm: 0 8px 22px rgba(17, 25, 42, 0.07);
  --shadow-md: 0 14px 34px rgba(17, 25, 42, 0.12);

  --wrap: min(1120px, calc(100% - 2.2rem));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(860px 460px at -8% -12%, rgba(79, 103, 222, 0.16), transparent 70%),
    radial-gradient(780px 420px at 108% -15%, rgba(232, 91, 131, 0.14), transparent 72%),
    linear-gradient(180deg, var(--bg-a), var(--bg-b));
  line-height: 1.58;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
}

body::before {
  width: 280px;
  height: 280px;
  left: -72px;
  top: 22%;
  background: rgba(79, 103, 222, 0.14);
}

body::after {
  width: 300px;
  height: 300px;
  right: -92px;
  top: 50%;
  background: rgba(232, 91, 131, 0.1);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.wrap {
  width: var(--wrap);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  backdrop-filter: saturate(145%) blur(14px);
}

.nav-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.72rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid rgba(23, 32, 52, 0.1);
  box-shadow: 0 6px 16px rgba(17, 25, 42, 0.08);
}

.nav-links {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.46rem;
}

.nav-links a {
  color: #2f3952;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(23, 32, 52, 0.12);
  background: rgba(255, 255, 255, 0.78);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease;
}

.nav-links a:hover {
  text-decoration: none;
  background: #ffffff;
  border-color: rgba(23, 32, 52, 0.2);
  color: #1f2a45;
  transform: translateY(-1px);
}

.nav-links a[aria-current="page"] {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.mode-switch-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.mode-switch-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6a7389;
}

.mode-switch-note {
  font-size: 0.66rem;
  font-weight: 700;
  color: #6f7890;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(23, 32, 52, 0.12);
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(17, 25, 42, 0.08);
}

.mode-switch button {
  border: 0;
  margin: 0;
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #52607f;
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
  display: inline-flex;
  align-items: center;
  gap: 0.26rem;
}

.mode-switch button::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.mode-switch button[data-mode="toddler"]::before {
  background: linear-gradient(135deg, #ff6ea7, #ff9f4f);
}

.mode-switch button[data-mode="kid"]::before {
  background: linear-gradient(135deg, #5770df, #5ab397);
}

.mode-switch button[data-mode="adult"]::before {
  background: linear-gradient(135deg, #475a7d, #6c7e9d);
}

.mode-switch button:hover {
  transform: translateY(-1px);
  background: rgba(23, 32, 52, 0.06);
}

.mode-switch button.is-active,
.mode-switch button[aria-pressed="true"] {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

main {
  padding: 1.5rem 0 2.6rem;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.14;
  margin: 0;
}

h1 {
  margin-top: 0.66rem;
  margin-bottom: 0.54rem;
  font-size: clamp(1.95rem, 4.05vw, 3.05rem);
}

h2 {
  font-size: clamp(1.14rem, 2vw, 1.42rem);
}

p {
  margin: 0;
}

.hero {
  margin-bottom: 1.25rem;
}

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: clamp(1.1rem, 2.5vw, 2rem);
  display: grid;
  grid-template-columns: 1.26fr 0.74fr;
  gap: 1.05rem;
  align-items: stretch;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-strong);
  background: rgba(79, 103, 222, 0.1);
  border: 1px solid rgba(79, 103, 222, 0.18);
  border-radius: 999px;
  padding: 0.3rem 0.58rem;
}

.lead {
  max-width: 65ch;
  color: var(--muted);
}

.badges {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  color: #3f4963;
  background: var(--surface-soft);
  border: 1px solid rgba(23, 32, 52, 0.11);
}

.actions {
  margin-top: 1.04rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.56rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 800;
  border: 1px solid transparent;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  color: #ffffff;
  background: var(--hero-accent);
  box-shadow: 0 9px 22px rgba(64, 82, 180, 0.28);
}

.btn-secondary {
  color: #2d3650;
  background: #ffffff;
  border-color: rgba(23, 32, 52, 0.15);
}

.latest-release-badge {
  margin-top: 0.86rem;
  display: inline-flex;
  flex-direction: column;
  gap: 0.14rem;
  padding: 0.66rem 0.78rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(79, 103, 222, 0.18);
  background: linear-gradient(160deg, rgba(79, 103, 222, 0.1), rgba(232, 91, 131, 0.08));
}

.latest-release-badge:hover {
  text-decoration: none;
}

.latest-release-kicker {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #5664b1;
}

.latest-release-badge strong {
  font-size: 0.91rem;
  color: #2a3560;
}

.latest-release-badge span {
  font-size: 0.82rem;
  color: #566181;
}

.hero-aside {
  border-radius: calc(var(--radius-lg) + 2px);
  padding: 1.04rem;
  color: #ffffff;
  background: var(--support-gradient);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero-aside img {
  width: 70px;
  height: 70px;
  border-radius: 15px;
  margin-bottom: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.hero-aside h3 {
  margin-bottom: 0.42rem;
}

.hero-aside p {
  color: rgba(255, 255, 255, 0.92);
}

.section-title {
  margin: 1.25rem 0 0.7rem;
}

.section-block + .section-block {
  margin-top: 1rem;
}

.chip-row {
  margin-top: 0.86rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #40507a;
  border: 1px solid rgba(23, 32, 52, 0.14);
  background: rgba(255, 255, 255, 0.86);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.chip:hover {
  text-decoration: none;
  background: #ffffff;
  border-color: rgba(79, 103, 222, 0.32);
  transform: translateY(-1px);
}

.quick-grid {
  margin-top: 0.78rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem;
}

.card,
.timeline-item,
.doc-section,
.faq-item,
.legal-link {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.card {
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.card h3 {
  margin-bottom: 0.36rem;
}

.card p {
  color: var(--muted);
}

.card-muted {
  background:
    radial-gradient(620px 200px at 14% -20%, rgba(79, 103, 222, 0.08), transparent 70%),
    var(--surface-soft);
}

.legal-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem;
}

.legal-link {
  display: block;
  border-radius: var(--radius-md);
  padding: 0.88rem;
  transition: transform 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}

.legal-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(79, 103, 222, 0.28);
  box-shadow: var(--shadow-md);
}

.legal-link strong {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
}

.legal-link span {
  display: block;
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.timeline {
  display: grid;
  gap: 0.72rem;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.84rem;
  align-items: start;
  border-radius: var(--radius-lg);
  padding: 0.94rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), transparent);
  opacity: 0.55;
}

.timeline-item h3 {
  margin-bottom: 0.28rem;
}

.timeline-item p {
  color: var(--muted);
}

#latest-release:target {
  border-color: rgba(79, 103, 222, 0.38);
  box-shadow: 0 0 0 4px rgba(79, 103, 222, 0.12), var(--shadow-sm);
}

.timeline-date {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  color: #4156b2;
  border-radius: 999px;
  border: 1px solid rgba(79, 103, 222, 0.2);
  background: rgba(79, 103, 222, 0.1);
  padding: 0.3rem 0.56rem;
}

.doc-shell {
  display: grid;
  gap: 0.74rem;
}

.doc-section {
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.doc-section h2 {
  margin-bottom: 0.38rem;
  font-size: 1.02rem;
}

.doc-section p,
.doc-section li {
  color: var(--muted);
}

.doc-section ul {
  margin: 0.44rem 0 0;
  padding-left: 1.12rem;
}

.faq-item {
  border-radius: var(--radius-lg);
  padding: 0.12rem 0.88rem;
}

.faq-item + .faq-item {
  margin-top: 0.66rem;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  padding: 0.8rem 0;
  position: relative;
  padding-right: 1.5rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0.14rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 900;
  color: var(--brand);
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.support-banner {
  margin-top: 1.02rem;
  border-radius: var(--radius-lg);
  padding: 1.05rem;
  color: #ffffff;
  background: var(--support-gradient);
  box-shadow: var(--shadow-md);
}

.support-banner a {
  color: #ffffff;
  text-decoration: underline;
}

.last-updated {
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer {
  margin-top: 1.35rem;
  border-top: 1px solid rgba(23, 32, 52, 0.1);
  padding: 0.98rem 0 1.5rem;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.footer-row small {
  color: var(--muted);
}

.footer-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer-links a {
  color: #4f5b77;
  font-weight: 700;
  font-size: 0.87rem;
}

.hero-panel,
.card,
.timeline-item,
.doc-section,
.faq-item,
.legal-link,
.support-banner {
  animation: fade-up 330ms ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-panel,
  .card,
  .timeline-item,
  .doc-section,
  .faq-item,
  .legal-link,
  .support-banner {
    animation: none;
  }
}

/* UI Mode variants */
body[data-ui-mode="toddler"] {
  --brand: #5f66e6;
  --brand-strong: #4d56d6;
  --accent: #ef5f90;
  --accent-soft: #ffb25d;
  --bg-a: #edf1ff;
  --bg-b: #f9f2fd;
  --hero-accent: linear-gradient(135deg, #5f66e6, #ef5f90);
  --support-gradient: linear-gradient(135deg, #5f66e6, #ef5f90, #ff9f52);
  --radius-sm: 11px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
}

body[data-ui-mode="kid"] {
  --brand: #4871de;
  --brand-strong: #3661d2;
  --accent: #2f9e8a;
  --accent-soft: #ffb55e;
  --bg-a: #edf4ff;
  --bg-b: #f4f8ff;
  --hero-accent: linear-gradient(135deg, #4871de, #2f9e8a);
  --support-gradient: linear-gradient(135deg, #4871de, #2f9e8a, #6abf89);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
}

body[data-ui-mode="adult"] {
  --brand: #36558b;
  --brand-strong: #2b436d;
  --accent: #5c708f;
  --accent-soft: #8ba0ba;
  --ink: #1f2734;
  --muted: #626e81;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --line: rgba(28, 38, 56, 0.12);
  --bg-a: #eff3f8;
  --bg-b: #f5f7fb;
  --header-bg: rgba(250, 252, 255, 0.92);
  --hero-accent: linear-gradient(135deg, #36558b, #4e698e);
  --support-gradient: linear-gradient(135deg, #36558b, #4e698e, #6f88a5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 8px 20px rgba(17, 25, 42, 0.06);
  --shadow-md: 0 12px 26px rgba(17, 25, 42, 0.1);
}

body[data-ui-mode="adult"] .brand,
body[data-ui-mode="adult"] h1,
body[data-ui-mode="adult"] h2,
body[data-ui-mode="adult"] h3 {
  letter-spacing: -0.02em;
}

body[data-ui-mode="adult"] .badge {
  border-radius: 999px;
  background: #f8fafc;
}

body[data-ui-mode="adult"] .hero-aside {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

@media (max-width: 1080px) {
  .nav-row {
    grid-template-columns: auto 1fr;
  }

  .mode-switch-wrap {
    grid-column: 1 / -1;
    justify-self: start;
    align-items: flex-start;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .legal-link-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quick-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-item::before {
    display: none;
  }
}

@media (max-width: 680px) {
  :root {
    --wrap: min(1120px, calc(100% - 1.3rem));
  }

  .nav-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.56rem;
    padding: 0.62rem 0;
  }

  .nav-links {
    justify-self: auto;
    justify-content: flex-start;
    width: 100%;
  }

  .legal-link-grid {
    grid-template-columns: 1fr;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .footer-row {
    align-items: flex-start;
  }

  main {
    padding-top: 1.02rem;
  }
}
