/*
 * The school's front page (ADR-021): two doors, one for parents and one for
 * the team. Colours, radii and type are the design system's tokens
 * (packages/dart/design_system, app_tokens.g.dart), light and dark; the fonts
 * are its own files, served from here, so the page loads nothing from
 * elsewhere.
 */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist/Geist-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('/fonts/ibm_plex_sans_arabic/IBMPlexSansArabic-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

:root {
  /* colors.light */
  --surface: #f7f5f0;
  --surface-raised: #ffffff;
  --text-primary: #121a2a;
  --text-secondary: #4e5869;
  --text-muted: #636c7d;
  --accent: #0a7a5b;
  --accent-pressed: #075e46;
  --on-accent: #ffffff;
  --accent-container: #ddf2ea;
  --border: #e7e3da;
  --focus-ring: #0a7a5b;
  --shadow: rgb(14 22 40 / 0.06);
  /* radius.control (12) for buttons, radius.lg (20) for the doors */
  --radius-control: 12px;
  --radius-lg: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* colors.dark */
    --surface: #0a1020;
    --surface-raised: #121a2b;
    --text-primary: #e9edf4;
    --text-secondary: #a3adbe;
    --text-muted: #8e99ac;
    --accent: #5be0b3;
    --accent-pressed: #8bebcb;
    --on-accent: #06251a;
    --accent-container: rgb(52 207 156 / 0.16);
    --border: rgb(255 255 255 / 0.08);
    --focus-ring: #5be0b3;
    --shadow: rgb(0 0 0 / 0.3);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--surface);
  color: var(--text-primary);
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.page {
  max-width: 68rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* The school's name in its own script: a quiet mark, read aloud by nothing
   (the Latin name above already says it). */
.name-arabic {
  margin: 0;
  font-family: 'IBM Plex Sans Arabic', 'Geist', sans-serif;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
  color: var(--accent);
}

.intro {
  padding: 4rem 0 3rem;
  max-width: 40rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.intro p {
  margin: 1rem 0 0;
  color: var(--text-secondary);
}

/* Parents first and wider: they are most of the visitors. */
.doors {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.25rem;
}

.door {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.door-primary {
  background: var(--accent-container);
  border-color: transparent;
}

h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.door p {
  margin: 0;
  max-width: 34rem;
  color: var(--text-secondary);
}

.door .note {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  margin-top: 0.5rem;
  padding: 0 1.5rem;
  border-radius: var(--radius-control);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    transform 120ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 2px var(--shadow);
}

.button-primary:hover {
  background: var(--accent-pressed);
}

.button-secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.button-secondary:hover {
  border-color: var(--accent);
}

@media (max-width: 767px) {
  .page {
    padding: 2rem 1rem 3rem;
  }

  .intro {
    padding: 2.5rem 0 2rem;
  }

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

  .door {
    padding: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }

  .button:active {
    transform: none;
  }
}
