/* Direction C, "floodlit match night". Fonts are self-hosted (SIL OFL, licences in fonts/). */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --night: #07130F;
  --grass: #123526;
  --flood: #F4F7F2;
  --muted: #9FB3A8;
  --lime: #C8E86B; /* primary button and focus rings only */

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Source Sans 3", system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
}

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

html {
  background: var(--grass);
  color: var(--flood);
  font-family: var(--body);
  line-height: 1.55;
}

body {
  margin: 0;
  min-height: 100vh;
  /* Floodlight glows are sized to the first screen so they stay soft on a long page. */
  background:
    radial-gradient(60% 55% at 12% -5%, #ffffff30, transparent 60%) top / 100% 100vh no-repeat,
    radial-gradient(60% 55% at 88% -5%, #ffffff26, transparent 60%) top / 100% 100vh no-repeat,
    linear-gradient(180deg, var(--night), var(--grass));
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding: 28px var(--gutter) 0;
}

/* images/wordmark.svg is the wordmark set in Big Shoulders Display 800, outlined so it never depends on font loading. */
.wordmark { display: block; }

.wordmark img {
  display: block;
  height: 1.125rem;
  width: auto;
}

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header nav a {
  color: var(--flood);
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a:hover { text-decoration: underline; }

/* Hero */

.hero {
  position: relative;
  padding: 72px var(--gutter);
}

/* Faint pitch lines; a CSS background, so assistive tech never sees them. */
.hero::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60%;
  background: url("images/pitch-lines.svg") center bottom / cover no-repeat;
  pointer-events: none;
}

.hero > * { position: relative; }

h1 {
  margin: 0;
  max-width: 10em; /* the headline needs about 8.4em for its longer line: two lines on desktop */
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.2rem, 10vw, 8.5rem);
  line-height: 0.88;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.lede {
  max-width: 48ch;
  margin: 22px 0 0;
  font-size: 1.15rem;
  color: var(--muted);
}

.btn {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 24px;
  border-radius: 40px;
  background: var(--lime);
  color: var(--night);
  font-weight: 600;
  text-decoration: none;
}

/* Sections below the hero */

main > section:not(.hero) {
  padding: 56px var(--gutter) 0;
}

h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

h3 {
  margin: 32px 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
}

main > section:not(.hero) :is(p, dl, ul) {
  max-width: 65ch;
}

/* Every section below the hero sits in a centred column; text inside stays left-aligned. */
main > section:not(.hero) {
  max-width: calc(65ch + 2 * var(--gutter));
  margin-inline: auto;
}

.families dt {
  margin-top: 16px;
  font-weight: 600;
}

.families dd {
  margin: 2px 0 0;
  color: var(--muted);
}

/* Contact */

.contact form {
  display: grid;
  gap: 6px;
  max-width: 36rem;
}

.contact label {
  margin-top: 12px;
  font-weight: 600;
}

.contact input,
.contact select,
.contact textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--muted);
  border-radius: 6px;
  background: var(--night);
  color: var(--flood);
  font: inherit;
}

/* The display: grid above would override the hidden attribute; the form stays hidden until contact.js runs. */
.contact form[hidden] {
  display: none;
}

.contact [aria-invalid="true"] {
  border: 2px solid var(--flood);
}

.contact .error {
  margin: 2px 0 0;
  padding-left: 10px;
  border-left: 3px solid var(--flood);
  font-weight: 600;
}

/* Honeypot: not rendered, so browser autofill leaves it empty for people; bots still see it in the markup. */
.contact .hp {
  display: none;
}

.contact .note {
  margin: 12px 0 4px;
  color: var(--muted);
}

.contact .btn {
  justify-self: start;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Footer */

.site-footer {
  padding: 72px var(--gutter) 40px;
  color: var(--muted);
  font-size: 0.9rem;
}
