/* =====================================================================
   Built For Schools — styles
   Mobile-first, accessible, friendly-but-professional.
   Organized as: tokens → base → layout → components → sections.
   ===================================================================== */

/* ---------------------- Design tokens ---------------------- */
:root {
  /* Friendly blues + one bright accent (coral). */
  --blue-900: #0f3a5f;
  --blue-700: #1565a6;
  --blue-500: #2e86d6;
  --blue-100: #e3f0fb;
  --blue-50: #f3f9ff;

  --coral: #ff6f5e;
  --coral-dark: #e85645;
  --sunny: #ffc94d; /* secondary accent, kept subtle */

  --ink: #1b2b38;
  --ink-soft: #4a5b68;
  --white: #ffffff;
  --surface: #ffffff;
  --line: #d9e6f2;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(15, 58, 95, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 58, 95, 0.12);

  --maxw: 1100px;
  --gap: 1.25rem;

  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  /* Offset smooth-scroll targets so they clear the sticky header. */
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--blue-900);
  font-weight: 800;
}

p {
  margin: 0 0 1em;
}

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

a:hover {
  text-decoration: underline;
}

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

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

/* ---------------------- Layout helpers ---------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3.5rem 0;
}

.section__title {
  font-size: clamp(1.6rem, 4.5vw, 2.25rem);
  text-align: center;
}

.section__lead {
  text-align: center;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 auto 2.5rem;
}

/* ---------------------- Skip link ---------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue-900);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ---------------------- Buttons ---------------------- */
.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 1.0625rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background-color 0.12s ease;
  text-decoration: none;
}

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

.btn--primary {
  background: var(--coral);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  background: var(--coral-dark);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .btn--primary:hover {
    transform: none;
  }
}

/* ---------------------- Header / nav ---------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--blue-900);
}

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

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.brand__name {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--blue-900);
}

.site-nav {
  display: flex;
  gap: 0.5rem;
}

.site-nav a {
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-pill);
}

.site-nav a:hover {
  color: var(--blue-700);
  background: var(--blue-50);
  text-decoration: none;
}

/* Hide secondary nav labels on very small screens to avoid crowding. */
@media (max-width: 360px) {
  .site-nav {
    gap: 0.1rem;
  }
  .site-nav a {
    padding: 0.4rem 0.5rem;
    font-size: 0.95rem;
  }
}

/* ---------------------- Hero ---------------------- */
.hero {
  background: linear-gradient(160deg, var(--blue-50) 0%, var(--blue-100) 100%);
  text-align: center;
  padding: 3.5rem 0 4rem;
}

.hero__inner {
  max-width: 720px;
}

.hero__title {
  font-size: clamp(2.1rem, 7vw, 3.5rem);
  margin-bottom: 0.25em;
}

.hero__tagline {
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  font-weight: 700;
  color: var(--blue-700);
  margin-bottom: 0.6em;
}

.hero__sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 52ch;
  margin: 0 auto 2rem;
}

/* ---------------------- Apps grid ---------------------- */
.apps {
  background: var(--white);
}

.apps__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .apps__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 880px) {
  .apps__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.app-card {
  display: flex;
}

.app-card__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  width: 100%;
  padding: 1.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.app-card__link:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-500);
}

@media (prefers-reduced-motion: reduce) {
  .app-card__link:hover {
    transform: none;
  }
}

.app-card__icon {
  width: 96px;
  height: 96px;
  border-radius: 22%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.5rem;
}

/* Neutral placeholder shown when an icon file is missing. */
.app-card__icon--missing {
  display: inline-block;
  background: repeating-linear-gradient(
    45deg,
    var(--blue-50),
    var(--blue-50) 8px,
    var(--blue-100) 8px,
    var(--blue-100) 16px
  );
  border: 1px dashed var(--blue-500);
}

.app-card__name {
  font-size: 1.2rem;
  margin: 0;
  color: var(--blue-900);
}

.app-card__desc {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin: 0.25rem 0 0.75rem;
  flex-grow: 1;
}

/* Official "Download on the App Store" badge. */
.app-card__badge {
  display: inline-block;
  width: 120px;
  height: 40px;
  margin-top: auto;
}

/* ---------------------- Trust section ---------------------- */
.trust {
  background: var(--blue-50);
}

.trust__grid {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .trust__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.trust__card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.trust__card-title {
  font-size: 1.15rem;
  color: var(--blue-700);
  margin-bottom: 0.4rem;
}

.trust__card p {
  margin: 0;
  color: var(--ink-soft);
}

/* ---------------------- Footer ---------------------- */
.site-footer {
  background: var(--blue-900);
  color: var(--blue-100);
  padding: 2.5rem 0;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.site-footer .brand__name {
  color: var(--white);
  font-size: 1.2rem;
}

.site-footer__tagline {
  margin: 0.25rem 0 0;
  color: var(--blue-100);
  opacity: 0.85;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
}

.site-footer__links a {
  color: var(--white);
  font-weight: 600;
}

.site-footer__copyright {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

@media (min-width: 720px) {
  .site-footer__inner {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    text-align: left;
  }
  .site-footer__copyright {
    width: 100%;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
  }
}
