/* My Independence Grant: public site styles (brand guide v1.9,
   docs/brand/brand-guidelines-v1.9.md). Colors, fonts and logo rules come
   from the guide. Fonts are self-hosted (SIL Open Font License 1.1; see each
   font folder's OFL.txt). No motion. */

@font-face {
  font-family: "Libre Baskerville";
  src: url("/assets/fonts/libre-baskerville/LibreBaskerville-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3/SourceSans3VF-Upright.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #142d4e;        /* Heritage Navy: headings, body, footer */
  --slate: #526071;       /* Slate: supporting text */
  --link: #1a6fa6;        /* Link Blue: links, underlined */
  --warm-white: #f8f5ee;  /* Warm White: page background */
  --gold: #dfa52b;        /* Rich Honey Gold: decoration only, never text */
  --white: #ffffff;
  --serif: "Libre Baskerville", Georgia, serif;
  --sans: "Source Sans 3", Arial, sans-serif;
  --gutter: 1rem;
}

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

html {
  background: var(--warm-white);
  color: var(--navy);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  background: var(--warm-white);
  color: var(--navy);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  overflow-wrap: break-word;   /* long words wrap rather than scroll at large text sizes */
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* An email address is one long word: let it break anywhere rather than
   scroll sideways with large text on a phone (WCAG 2.1, 1.4.10 Reflow). */
a[href^="mailto:"] {
  overflow-wrap: anywhere;
}

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

/* Skip link: hidden until it has keyboard focus. */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--white);
  color: var(--link);
  z-index: 10;
}

.skip-link:focus {
  top: var(--gutter);
}

.wrap {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* A comfortable reading width, lined up with the logo on the left. */
.measure,
.wrap.measure > * {
  max-width: 42rem;
}

.wrap.measure {
  max-width: 64rem;
}

/* Header and logo. The full logo needs at least 360 px plus clear space (the
   door's width) on each side, so phones get the door icon with the name in
   text instead (brand guide, "Size and spacing"). */
.site-header {
  padding: 2rem 0 1.5rem;
}

/* The name moves under the door icon when it can't fit beside it (large
   text on a phone), and a word longer than the screen still wraps, so the
   header never scrolls sideways (WCAG 2.1, 1.4.10 Reflow). */
.brand-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  color: var(--navy);
  text-decoration: none;
}

.brand-link:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 4px;
}

.logo-full {
  display: none;
  width: 420px;     /* at least 360 px (brand guide) */
  height: auto;     /* the SVG's own margin plus the page gutter give the door's width of clear space */
}

.logo-icon {
  display: block;
  width: 2.5rem;
  height: auto;
}

.brand-name {
  min-width: 0;
  max-width: 100%;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
  overflow-wrap: break-word;
}

@media (min-width: 32em) {
  .logo-full {
    display: block;
  }

  .logo-icon,
  .brand-name {
    display: none;
  }
}

/* Hero */
main {
  flex: 1;
}

.hero {
  padding: 1rem 0 2.5rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 6vw, 3rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.tagline {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.25rem, 3.5vw, 1.625rem);
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.supporting {
  color: var(--slate);
  font-size: 1.25rem;
}

/* A plain gold rule: decoration only. */
.accent {
  width: 4rem;
  height: 0.25rem;
  background: var(--gold);
  border: 0;
  margin: 1.5rem 0;
}

.intro p,
.body-copy p {
  font-size: 1.1875rem;
}

.body-copy {
  padding-bottom: 2.5rem;
}

/* What does financial independence mean to you? */
.meaning {
  background: var(--white);
  border-top: 1px solid #d9dee5;
  border-bottom: 1px solid #d9dee5;
  padding: 2.5rem 0;
}

.meaning h2 {
  font-size: clamp(1.375rem, 4vw, 2rem);
}

/* Columns follow the text size, not the screen: four across on a desktop,
   fewer as text is enlarged, one on a phone. */
.tiles {
  list-style: none;
  margin: 1.75rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
  gap: 1rem;
}

.tile {
  background: var(--warm-white);
  border-top: 0.25rem solid var(--gold);
  padding: 1.25rem 1.25rem 1rem;
}

.tile h3 {
  font-size: 1.1875rem;
  margin-bottom: 0.5rem;
}

.tile p {
  color: var(--slate);
  margin: 0;
}

.risk {
  color: var(--slate);
  font-size: 1rem;
  margin: 0;
}

.contact {
  padding: 2.5rem 0;
}

.contact p {
  margin: 0;
}

/* 404 */
.not-found {
  padding: 1rem 0 3rem;
}

.not-found h1 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
}

/* Footer: navy field, warm white type, gold accent line (brand guide,
   "Example digital applications"). No links here, so no blue on navy. */
.site-footer {
  background: var(--navy);
  color: var(--warm-white);
  border-top: 0.25rem solid var(--gold);
  padding: 2rem 0;
  font-size: 1rem;
}

.site-footer p {
  max-width: 48rem;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

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