/* StrataAdvise static site
   Colours and type follow the original StrataAdvise brand.
   Breakpoints: tablet <= 1024px, mobile <= 767px. */

/* ---------- Font (Archivo Narrow, SIL Open Font Licence, see assets/fonts/OFL.txt) ---------- */
@font-face {
  font-family: "Archivo Narrow";
  src: url("../fonts/archivo-narrow-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Brand ---------- */
:root {
  --yellow: #F9C606;        /* primary: button hover */
  --yellow-light: #FFDF00;  /* secondary: headings, links, button, popup border */
  --navy: #00263A;          /* background */
  --white: #FFFFFF;
  --font: "Archivo Narrow", "Arial Narrow", Arial, sans-serif;
  --fade: 0.6s;             /* popup open/close */
  --gutter: 50px;           /* left/right page padding */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

/* ---------- Page: header (logo) / main (message, centred) / footer (documents + legal) ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 6vh, 64px);
  padding: clamp(28px, 6vh, 56px) var(--gutter) clamp(24px, 4vh, 40px);
  /* Fallback for older browsers, then the smaller WebP photo for everyone else */
  background:
    linear-gradient(110deg, var(--navy) 52%, rgba(0, 38, 58, 0) 73%),
    var(--navy) url("../img/hero.jpg") top center / cover no-repeat;
  background-image:
    linear-gradient(110deg, var(--navy) 52%, rgba(0, 38, 58, 0) 73%),
    image-set(url("../img/hero.webp") type("image/webp"), url("../img/hero.jpg") type("image/jpeg"));
}

.hero__logo { width: 300px; }

.hero__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__title {
  margin: 0 0 16px;
  color: var(--yellow-light);
  font-size: 58px;
  font-weight: 600;
  line-height: 1.15;
}

.hero__intro {
  width: 52.3%;        /* stays on the navy side of the photo fade */
  max-width: 34em;     /* about 680px: comfortable line length on big screens */
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

/* Call-to-action row: button + Capability Statement link */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  margin-top: clamp(28px, 6vh, 52px);
}

.btn {
  display: inline-block;
  padding: 11px 28px;
  border: 2px solid var(--yellow-light);
  border-radius: 4px;
  background: var(--yellow-light);
  color: var(--navy);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover,
.btn:focus-visible {
  background: var(--yellow);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* Secondary button: outline, fills yellow on hover */
.btn--outline {
  background: transparent;
  color: var(--yellow-light);
}
.btn--outline:hover,
.btn--outline:focus-visible {
  background: var(--yellow-light);
  color: var(--navy);
}

/* Footer: documents + legal */
.hero__footer { display: flex; flex-direction: column; gap: 22px; }

.docs__title {
  margin: 0 0 2px;
  color: var(--yellow-light);
  font-weight: 700;
  line-height: 22px;
}
.docs__list { margin: 0; padding: 0; list-style: none; }
.docs__list li { font-weight: 700; line-height: 22px; }

.legal { font-size: 13px; font-weight: 500; }
.legal p { margin: 0; line-height: 1.5; }
.legal__gap { display: inline-block; width: 0.8em; }

/* ---------- Load animation: staggered fade-up ---------- */
.reveal { animation: fade-up 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.reveal-1 { animation-delay: 0s; }
.reveal-2 { animation-delay: 0.1s; }
.reveal-3 { animation-delay: 0.2s; }
.reveal-4 { animation-delay: 0.3s; }
.reveal-5 { animation-delay: 0.4s; }

/* ---------- Contact popup ---------- */
.contact {
  width: 635px;
  max-width: 100vw;
  max-height: 92vh;
  max-height: 92svh;  /* phones: fit the visible area with the browser bars showing (vh ignores them) */
  padding: 10px 0 24px;
  border: 2px solid var(--yellow-light);
  border-radius: 10px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 2px 8px 23px 3px rgba(0, 0, 0, 0.2);
  overflow: auto;
}
.contact::backdrop { background: rgba(0, 0, 0, 0.5); }

/* Open: fade in and grow slightly. Close: JS adds .is-closing, then closes after --fade. */
.contact[open] { animation: popup-in var(--fade) cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.contact.is-closing { animation: popup-out var(--fade) ease both; }
.contact[open]::backdrop { animation: fade-in var(--fade) ease both; }
.contact.is-closing::backdrop { animation: fade-out var(--fade) ease both; }

.contact__close {
  position: absolute;
  top: 10px;
  right: 16px;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: #979797;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.contact__close:hover, .contact__close:focus-visible { color: var(--white); }

.contact__inner { width: 500px; max-width: 100%; margin: 0 auto; }

.contact__title {
  margin: 0 0 24px;
  color: var(--yellow-light);
  font-size: 40px;
  font-weight: 600;
  line-height: 41px;
  letter-spacing: 1px;
}

.field { margin-bottom: 10px; }
.field label {
  display: block;
  padding-bottom: 1px;
  font-size: 20px;
  line-height: 24px;
}
.field--required label::after {
  content: "*";
  padding-left: 0.5em;
  color: var(--yellow-light);
  font-size: 0.85em;
  vertical-align: 0.25em;
}
.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 5px 16px;
  border: 1px solid var(--yellow-light);
  border-radius: 5px;
  background: var(--white);
  color: #424242;
  font: 400 14px/24px var(--font);
}
.field textarea { min-height: 108px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: #6b6b6b; }  /* 5.3:1 on white */
.field input:focus,
.field textarea:focus { outline: 2px solid var(--yellow); outline-offset: 1px; }

/* Spam trap field, hidden from people */
.hp { display: none; }

/* Turnstile spam check (Cloudflare). Height reserved so the form doesn't jump when it appears. */
.contact__turnstile { min-height: 65px; margin-top: 6px; }

.contact__actions { margin-top: 10px; }
/* Matches the page buttons */
.contact__submit {
  min-width: 78px;
  min-height: 44px;
  padding: 10px 24px;
  border: 0;
  border-radius: 4px;
  background: var(--yellow-light);
  color: var(--navy);
  font: 600 17px/1 var(--font);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.contact__submit:hover,
.contact__submit:focus-visible { background: var(--yellow); color: var(--navy); }
.contact__submit:disabled { cursor: wait; }

/* Sending: spinner after the label */
.contact__submit.is-busy::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

.contact__status { margin: 10px 0 0; font-size: 14px; line-height: 24px; }
.contact__status:empty { margin: 0; }
.contact__status.is-success { color: var(--yellow-light); }
.contact__status.is-error { color: #FF7A7A; }

/* Sent: yellow tick before the message */
.contact__status.is-success::before {
  content: "\2713";
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--yellow-light);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  animation: tick-pop 0.35s cubic-bezier(0.2, 0.7, 0.2, 1.4) both;
}

.contact__details {
  margin-top: 30px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.contact__details p { margin: 0; line-height: 21px; }

/* ---------- Animations ---------- */
@keyframes fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out  { from { opacity: 1; } to { opacity: 0; } }
@keyframes fade-up   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes popup-in  { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes popup-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.96); } }
@keyframes tick-pop  { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes spin      { to { transform: rotate(360deg); } }

/* Visitors who ask for less motion get none of the decorative effects.
   The Submit spinner stays: it shows that something is happening. */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .contact[open], .contact[open]::backdrop,
  .contact.is-closing, .contact.is-closing::backdrop,
  .contact__status.is-success::before { animation: none; }
  .btn, .contact__submit { transition: none; }
  .btn:hover, .btn:focus-visible { transform: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  :root { --gutter: 30px; }
  .hero__title { font-size: 29px; margin-bottom: 14px; }
  .hero__intro { min-width: 360px; font-size: 15px; }
  .hero__actions { gap: 14px 26px; }
  .btn { padding: 9px 22px; font-size: 18px; }
  .legal { font-size: 12px; }
  .legal__ids { display: block; }

  .contact { width: 75vw; }
  .contact__title { margin-top: 30px; font-size: 24px; line-height: 30px; }
  .field label { font-size: 13px; line-height: 23px; }
  .field input, .field textarea { font-size: 16px; line-height: 23px; }
  .contact__status { font-size: 13px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  :root { --gutter: 20px; }
  .hero { background: var(--navy); }  /* photo hidden on phones, as before */
  .hero__title { font-size: 28px; }
  .hero__intro { width: 100%; min-width: 0; max-width: 394px; }
  .hero__actions .btn { min-width: 220px; text-align: center; }  /* stacked buttons line up */

  .contact { width: 100vw; padding: 10px 5% 20px; }
  .contact__title { margin-top: 10px; }
  .field label { font-size: 12px; line-height: 22px; }
  /* 16px stops iPhones zooming in when a field is tapped */
  .field input, .field textarea { font-size: 16px; line-height: 22px; }
}
