/* Shared skin for the static legal pages (/privacy.html, /terms.html).
   Tokens mirror site/tailwind.config.ts, which mirrors the app's
   lib/theme/app_theme_tokens.dart. */

:root {
  --sky-deep: #dbeafe;
  --sky-page: #eff6ff;
  --ink: #1f2937;
  --muted: #4b5563;
  --brand: #34d399;
  --brand-dark: #059669;
  --footer: #1e3a2f;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sky-page);
  color: var(--ink);
  font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- sky header ---------- */

.sky {
  position: relative;
  overflow: hidden;
  background: linear-gradient(to bottom, #bfdbfe, var(--sky-deep));
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}

.topbar .brand {
  font-family: 'Baloo 2', var(--fallback, sans-serif);
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
}

.topbar .home-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-dark);
  text-decoration: none;
}

.topbar .home-link:hover {
  text-decoration: underline;
}

.hero {
  position: relative;
  z-index: 2;
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1rem;
  text-align: center;
}

.hero .eyebrow {
  margin: 0;
  font-family: 'Caveat', cursive;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--brand-dark);
  transform: rotate(-2deg);
}

.hero h1 {
  margin: 0.25rem 0 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* drifting clouds (shape lifted from Clouds.tsx) */

.clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  color: rgba(255, 255, 255, 0.8);
  animation: float 5s ease-in-out infinite;
}

.cloud.c1 {
  left: 6%;
  top: 18%;
  width: 6rem;
}

.cloud.c2 {
  right: 8%;
  top: 12%;
  width: 8rem;
  color: rgba(255, 255, 255, 0.6);
  animation-delay: 1.2s;
  animation-duration: 7s;
}

.cloud.c3 {
  left: 36%;
  top: 6%;
  width: 4rem;
  color: rgba(255, 255, 255, 0.5);
  animation-delay: 2.4s;
  animation-duration: 6s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .cloud {
    animation: none;
  }
}

/* wavy hand-off, path lifted from Clouds.tsx CloudDivider */

.divider {
  display: block;
  width: 100%;
  height: 3rem;
  fill: var(--sky-page);
}

@media (min-width: 640px) {
  .divider {
    height: 5rem;
  }
}

/* ---------- worksheet card ---------- */

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.card {
  position: relative;
  margin-top: 4.5rem;
  background: var(--card);
  border-radius: 24px;
  box-shadow:
    0 1px 2px rgba(31, 41, 55, 0.06),
    0 12px 32px rgba(96, 165, 250, 0.18);
  padding: 2rem 1.5rem 2.5rem;
}

@media (min-width: 640px) {
  .card {
    padding: 2.75rem 3rem 3.25rem;
  }
}

.card .mascot {
  position: absolute;
  top: -4.35rem;
  right: 1.75rem;
  width: 6rem;
  height: auto;
}

@media (min-width: 640px) {
  .card .mascot {
    width: 7rem;
    top: -5.1rem;
    right: 2.5rem;
  }
}

.updated {
  margin: 0 0 1.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
}

.card h2 {
  scroll-margin-top: 1.5rem;
  margin: 2.25rem 0 0.5rem;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.3;
}

.card h2::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 4px;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--brand);
}

/* handwritten section numerals (terms) */

.card h2 .num {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--brand-dark);
  margin-right: 0.6rem;
  display: inline-block;
  transform: rotate(-4deg) translateY(0.1em);
}

.card p {
  margin: 0.75rem 0;
  color: var(--muted);
  overflow-wrap: break-word;
}

.card ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  color: var(--muted);
}

.card li {
  margin: 0.35rem 0;
}

.card li::marker {
  color: var(--brand);
}

/* mini table of contents (terms) */

.toc {
  margin: 0 0 0.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--sky-page);
  border-radius: 18px;
}

.toc p {
  margin: 0 0 0.5rem;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  color: var(--ink);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 1.5rem;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .toc ol {
    columns: 1;
  }
}

.toc li {
  margin: 0.2rem 0;
  break-inside: avoid;
}

.toc a {
  text-decoration: none;
  font-weight: 700;
}

.toc a:hover {
  text-decoration: underline;
}

.toc .toc-num {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand-dark);
  display: inline-block;
  min-width: 1.4rem;
}

/* ---------- grass + footer (mirrors Footer.tsx) ---------- */

.grass {
  display: block;
  width: 100%;
  height: 6rem;
  object-fit: cover;
  object-position: bottom;
  margin-bottom: -1px;
}

@media (min-width: 640px) {
  .grass {
    height: 8rem;
  }
}

footer {
  background: var(--footer);
  color: #fff;
  text-align: center;
  padding: 2.5rem 1.25rem;
}

footer .footer-title {
  margin: 0 0 1.25rem;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

footer nav a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s;
}

footer nav a:hover {
  color: #fff;
}

footer .copyright {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}
