/* ==========================================================================
   Lou Lindal — Agami landing page
   Visual language mirrors the Agami app "night" (dark mode) theme.
   ========================================================================== */

/* --- Dyslexia-friendly font (OpenDyslexic), loaded locally ---------------- */
@font-face {
  font-family: "OpenDyslexic";
  src: url("fonts/OpenDyslexic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "OpenDyslexic";
  src: url("fonts/OpenDyslexic-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "OpenDyslexic";
  src: url("fonts/OpenDyslexic-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "OpenDyslexic";
  src: url("fonts/OpenDyslexic-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* --- Theme tokens (from the Agami palette / night theme) ------------------ */
:root {
  --brand: #21323d; /* dark background */
  --brand-soft: #2b404e; /* slightly lighter surface */
  --white: #ffffff;
  --yellow: #fae632; /* primary accent */
  --dark-yellow: #b7a504; /* hover accent */
  --grey: #a5a093;

  --font-body: "Inter", sans-serif;
  --font-title: "Barlow", sans-serif;

  --focus-ring: 3px solid var(--yellow);
  --maxw: 60rem;
}

/* Text-size levels: change the root font-size, everything scales in rem. */
:root[data-text-size="standard"] {
  font-size: 100%;
} /* 15px */
:root[data-text-size="large"] {
  font-size: 120%;
} /* 17px */
:root[data-text-size="xlarge"] {
  font-size: 150%;
} /* 20px */

/* Dyslexia mode: swap every typeface for OpenDyslexic. */
:root.dyslexia,
:root.dyslexia * {
  font-family: "OpenDyslexic", "Inter", sans-serif !important;
  letter-spacing: 0.02em;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--brand);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* Visible focus indicator for every interactive element. */
a:focus-visible,
button:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Screen-reader-only helper (visually hidden, still announced). */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Skip link — present for screen readers / keyboard users but visually
   invisible until focused. Using opacity (not a transform) means changing the
   root font size never animates it briefly into view. pointer-events:none keeps
   it from intercepting clicks while hidden. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  background: var(--yellow);
  color: var(--brand);
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.skip-link:focus {
  opacity: 1;
  pointer-events: auto;
}

/* --- Header & accessibility toolbar --------------------------------------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end; /* accessibility toolbar sits at the top-right */
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
}

.a11y-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* All buttons grouped together; wraps only as a last resort on tiny screens. */
.a11y-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
/* The three size buttons always stay on one line together. */
.a11y-size-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
}
.a11y-group__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--grey);
}

/* Toolbar buttons */
.a11y-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem; /* >= 44px touch target */
  min-width: 2.75rem;
  padding: 0.4rem 0.7rem;
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}
.a11y-btn:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

/* Active / selected state (also conveyed via aria-pressed for screen readers) */
.a11y-btn[aria-pressed="true"] {
  background: var(--yellow);
  color: var(--brand);
  border-color: var(--yellow);
}

.a11y-btn__icon {
  line-height: 1;
}
.a11y-btn__icon--sm {
  font-size: 0.85rem;
}
.a11y-btn__icon--md {
  font-size: 1.1rem;
}
.a11y-btn__icon--lg {
  font-size: 1.4rem;
}

.dyslexia-btn__text {
  font-size: 0.85rem;
}

/* --- Main: two stacked hero blocks ---------------------------------------- */
.main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(0.75rem, 2.5vw, 1.25rem) clamp(1rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  /* Center the content vertically when the screen is tall enough; on short
     screens flex:1 0 auto keeps main at content height, so nothing clips. */
  justify-content: center;
  gap: clamp(0.85rem, 2.5vw, 1.5rem);
}

.hero {
  text-align: center;
  padding: clamp(0.75rem, 2.5vw, 1.5rem) 1rem;
}

.hero__lead {
  margin: 0 auto 1.35rem;
  max-width: 28ch;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(1.35rem, 4.5vw, 2.1rem);
  line-height: 1.3;
  color: var(--white);
  text-wrap: balance;
}

/* Call-to-action — styled like the Agami "contained primary" button. */
.cta {
  display: inline-block;
  background: var(--yellow);
  color: var(--brand);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 0.85rem 4rem;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.cta:hover {
  background: var(--dark-yellow);
}
.cta:active {
  transform: translateY(1px);
}

.divider {
  width: min(100%, 18rem);
  margin: 0 auto;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Footer logos --------------------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  padding: clamp(1rem, 3vw, 1.5rem) clamp(1rem, 4vw, 3rem) clamp(1.25rem, 3vw, 1.75rem);
}

/* --maxw keeps the strip from getting too wide on desktop.
   --logo-gap is the single spacing value used both between logos and between
   the two rows, so every gap stays equal in any wrap scenario. */
.logos {
  --logo-gap: clamp(2rem, 6vw, 4.5rem);
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: var(--maxw);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--logo-gap);
}

/* Each group is a flex row of logos sharing the same gap; on desktop the two
   groups sit side by side, reading as one evenly spaced row of five. */
.logos__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--logo-gap);
}

.logo {
  height: 3rem;
  width: auto;
  object-fit: contain;
}
/* Per-logo tuning so the marks read at a balanced optical size. */
.logo--mf {
  height: 5.25rem;
}
.logo--eu {
  height: 2.25rem;
}
.logo--mic {
  height: 2.25rem;
}
/* White-foreground transparent SVG — sits directly on the dark footer. */
.logo--ostana {
  height: 3.25rem;
}

/* --- Responsive tweaks (phone-first target) ------------------------------- */
@media (max-width: 700px) {
  .site-header {
    justify-content: center;
    text-align: center;
    gap: 0.85rem;
    padding: 1rem 1rem 0.5rem;
  }
  .a11y-toolbar {
    justify-content: center;
    gap: 0.5rem;
  }

  .main {
    /* tighter, more even rhythm between the two blocks on a phone */
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }
  .hero {
    padding: 0.75rem 0.5rem;
  }

  /* Full-width, thumb-friendly buttons */
  .cta {
    display: block;
    width: 100%;
    max-width: 22rem;
    margin: 0 auto;
    padding: 0.95rem 1.25rem;
  }

  .site-footer {
    padding: 1rem 1rem 1.25rem;
  }
  /* Phones: stack the two groups; horizontal gap between logos aims for 10vw,
     vertical gaps (between stacked logos / rows) use a steady 1.25rem. */
  .logos {
    flex-direction: column;
    row-gap: 1.25rem;
  }
  .logos__row {
    gap: 1.25rem 10vw;
  }
  /* Scale logos down a little so they wrap cleanly on narrow screens */
  .logo {
    height: 2.5rem;
  }
  .logo--mf {
    height: 4rem;
  }
  .logo--eu,
  .logo--mic {
    height: 1.9rem;
  }
  .logo--ostana {
    height: 2.75rem;
  }
}

/* Very small phones: keep controls compact (dyslexia label always stays visible) */
@media (max-width: 400px) {
  .a11y-group__label {
    flex-basis: 100%;
    text-align: center;
    margin: 0 0 0.15rem;
  }
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
