/* ==========================================================================
   SparkCloud — styles.css
   Fonts are self-hosted from /fonts (SIL Open Font License, see /fonts/OFL-*.txt)
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Palette */
  /* Palette (from the SparkCloud logo: navy #232E63, yellow #FCB415, grey #A1A1A1) */
  --ink: #232E63;        /* brand navy: primary text, dark surfaces */
  --ink-2: #2E3B7A;      /* raised navy surface */
  --slate: #50587A;      /* secondary text on light */
  --mist: #BCC1D6;       /* secondary text on navy */
  --cloud: #F2F4F8;      /* light section background */
  --paper: #FFFFFF;
  --line: #D6DBE7;
  --brand-grey: #A1A1A1; /* logo grey: decoration only, too light for text */
  --spark: #FCB415;      /* brand yellow: fills only, always with navy text */
  --spark-dark: #EBA200;
  --focus: #1F5BD8;
  --error: #B42318;

  /* Type */
  --font-display: "Bricolage Grotesque", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-space: clamp(4.5rem, 9vw, 7.5rem);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 72px;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h2 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); }
h3 { font-size: 1.375rem; letter-spacing: -0.01em; }

p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1.5px; }

ul, ol { margin: 0; padding: 0; }
[role="list"], .board-list, .includes, .steps, .footer-links, .footer-contact, .site-nav ul { list-style: none; }

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

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

.section { padding-block: var(--section-space); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   Buttons and links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.85rem 1.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn-spark { background: var(--spark); color: var(--ink); }
.btn-spark:hover { background: var(--spark-dark); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-2); }
.btn-small { min-height: 44px; padding: 0.6rem 1.1rem; font-size: 0.975rem; }
.btn[disabled] { opacity: 0.65; cursor: progress; }

.text-link {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--spark);
  text-decoration-thickness: 3px;
}
.text-link:hover { text-decoration-color: var(--ink); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px); }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.brand img { width: auto; height: 34px; }
.brand-light img { height: 54px; }

.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav ul { display: flex; gap: 1.75rem; }
.site-nav ul a {
  font-weight: 700;
  font-size: 0.975rem;
  text-decoration: none;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
}
.site-nav ul a:hover { border-bottom-color: var(--spark); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: 700 0.95rem var(--font-body);
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -20px rgba(35, 46, 99, 0.35);
  }
  .js .site-nav:not(.is-open) { display: none; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .site-nav ul a:hover { border-bottom-color: var(--line); color: var(--slate); }
  .site-nav .btn { width: 100%; }

  /* Without JavaScript the nav simply wraps below the logo */
  html:not(.js) .header-inner { flex-wrap: wrap; padding-block: 0.75rem; }
  html:not(.js) .site-nav { flex-wrap: wrap; gap: 1rem; }
  html:not(.js) .site-nav ul { flex-direction: row; flex-wrap: wrap; gap: 1rem; }
  html:not(.js) .site-nav ul a { border: 0; padding: 0; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background:
    url("/images/network.svg") right -120px top -40px / 900px auto no-repeat,
    var(--cloud);
  padding-block: clamp(3.5rem, 7vw, 6.5rem) clamp(4rem, 8vw, 7rem);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 1.3rem + 3.6vw, 4.2rem);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 18ch;
  font-variation-settings: "opsz" 96;
}

.lede {
  margin-top: 1.75rem;
  max-width: 34em;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.2rem);
  color: var(--slate);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2.25rem;
  margin-top: 2.5rem;
}

.phone-link {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.15;
}
.phone-label { font-size: 0.9rem; color: var(--slate); }
.phone-number {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  border-bottom: 3px solid var(--spark);
}
.phone-link:hover .phone-number { border-bottom-color: var(--ink); }

/* Card-style stripe: navy band with a slanted yellow end */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  background: linear-gradient(100deg, var(--ink) 0 64%, var(--spark) calc(64% + 1px) 100%);
}

/* The board: a quiet "everything is covered" panel */
.board {
  --focus: var(--spark);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 0 30px 60px -30px rgba(35, 46, 99, 0.55);
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.board-head h2 { font-size: 1.2rem; font-weight: 650; letter-spacing: 0; }
.board-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--mist);
  white-space: nowrap;
}

.board-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding-block: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.board-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.board-item { font-weight: 700; }
.board-tag { font-size: 0.875rem; color: var(--mist); }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--spark);
  box-shadow: 0 0 0 4px rgba(252, 180, 21, 0.18);
}

/* Page-load moment: each line of the board switches on in turn. */
@media (prefers-reduced-motion: no-preference) {
  .js .board-list .dot,
  .js .board-status .dot {
    animation: switch-on 0.35s ease-out both;
  }
  .js .board-list li:nth-child(1) .dot { animation-delay: 0.35s; }
  .js .board-list li:nth-child(2) .dot { animation-delay: 0.55s; }
  .js .board-list li:nth-child(3) .dot { animation-delay: 0.75s; }
  .js .board-list li:nth-child(4) .dot { animation-delay: 0.95s; }
  .js .board-list li:nth-child(5) .dot { animation-delay: 1.15s; }
  .js .board-list li:nth-child(6) .dot { animation-delay: 1.35s; }
  .js .board-status .dot { animation-delay: 1.6s; }
}
@keyframes switch-on {
  from { background: #46528C; box-shadow: 0 0 0 0 rgba(252, 180, 21, 0); }
  60%  { box-shadow: 0 0 0 7px rgba(252, 180, 21, 0.32); }
  to   { background: var(--spark); box-shadow: 0 0 0 4px rgba(252, 180, 21, 0.18); }
}

/* --------------------------------------------------------------------------
   Section intros
   -------------------------------------------------------------------------- */
.section-intro p {
  margin-top: 1rem;
  max-width: 30em;
  color: var(--slate);
  font-size: 1.125rem;
}
.section-intro .text-link { margin-top: 1.5rem; }
.section-intro-wide { max-width: 44rem; }

/* --------------------------------------------------------------------------
   Services
   -------------------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}
.services .section-intro {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
}

.service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(2rem, 4vw, 3.5rem);
}
.service {
  padding-block: 2rem 2.25rem;
  border-top: 2px solid var(--ink);
}
.service h3 { margin-bottom: 0.75rem; }
.service p { color: var(--slate); }

.includes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.includes li {
  padding: 0.3rem 0.7rem;
  background: var(--cloud);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Process
   -------------------------------------------------------------------------- */
.process {
  --focus: var(--spark);
  background: var(--ink);
  color: var(--paper);
}
.process .section-intro p { color: var(--mist); }

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  counter-reset: step;
}
/* the line that runs through the step numbers */
.steps::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 28px;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--spark), rgba(252, 180, 21, 0.15));
}
.step { position: relative; }
.step-num {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1.5rem;
  border-radius: 50%;
  background: var(--spark);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 750;
  box-shadow: 0 0 0 8px var(--ink);
}
.step h3 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.step p { color: var(--mist); font-size: 1rem; }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: start;
}
.about h2 { max-width: 16ch; }
.about-copy p { max-width: 36em; font-size: 1.125rem; }
.about-copy p + p { margin-top: 1.25rem; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0 0;
  padding-top: 1.75rem;
  border-top: 2px solid var(--ink);
}
.facts dt { font-size: 0.9rem; color: var(--slate); }
.facts dd {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.25;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact { background: var(--cloud); }

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}
.contact-info > p { margin-top: 1rem; max-width: 28em; color: var(--slate); font-size: 1.125rem; }

.contact-list { margin: 2.25rem 0 0; display: grid; gap: 1.5rem; }
.contact-list dt { font-size: 0.9rem; color: var(--slate); }
.contact-list dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.contact-list a { text-decoration-color: var(--spark); text-decoration-thickness: 3px; }
.contact-list a:hover { text-decoration-color: var(--ink); }

.contact-form {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgba(35, 46, 99, 0.4);
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
.field { display: grid; gap: 0.4rem; align-content: start; }
.field label { font-weight: 700; font-size: 0.975rem; }
.optional { font-weight: 400; color: var(--slate); }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 0.75rem 0.9rem;
  background: var(--paper);
  border: 1.5px solid #B4BBCF;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s ease;
}
.field textarea { resize: vertical; min-height: 140px; }
.field select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23232E63' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--slate); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--ink);
  outline-offset: 1px;
}
.field [aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: 0.9rem; font-weight: 700; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0.25rem;
}
.form-status { font-weight: 700; }
.form-status.is-success { color: #12672F; }
.form-status.is-error { color: var(--error); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  --focus: var(--spark);
  background: var(--ink);
  color: var(--mist);
  padding-block: 3.5rem 2.5rem;
  font-size: 0.975rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 3rem;
}
.footer-brand p { margin-top: 1rem; max-width: 30em; }
.brand-light { color: var(--paper); }
.footer-links, .footer-contact { display: grid; gap: 0.6rem; align-content: start; }
.site-footer a { text-decoration: none; }
.footer-links a, .footer-contact a { color: var(--paper); }
.footer-links a:hover, .footer-contact a:hover { text-decoration: underline; text-decoration-color: var(--spark); }
.copyright {
  grid-column: 1 / -1;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Simple pages (thanks, 404)
   -------------------------------------------------------------------------- */
.simple-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: center;
  background: var(--cloud);
  padding-block: 4rem;
}
.simple-page h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 3.75rem); max-width: 16ch; letter-spacing: -0.03em; }
.simple-page p { margin-top: 1.25rem; max-width: 34em; font-size: 1.125rem; color: var(--slate); }
.simple-page .hero-actions { margin-top: 2rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 3rem; }
  .steps::before { display: none; }
}

@media (max-width: 960px) {
  .hero { background-position: right -240px bottom -160px, 0 0; background-size: 760px auto, auto; }
  .hero-grid,
  .services-grid,
  .about-grid,
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .services .section-intro { position: static; }
  .hero h1 { max-width: 16ch; }
  .board { max-width: 560px; }
  .about h2 { max-width: 18ch; }
}

@media (max-width: 720px) {
  .service-list { grid-template-columns: minmax(0, 1fr); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 1rem; }

  /* Process becomes a vertical timeline */
  .steps { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .steps::before {
    display: block;
    top: 0;
    bottom: 0;
    left: 23px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(to bottom, var(--spark), rgba(252, 180, 21, 0.15));
  }
  .step { padding-left: 4.5rem; }
  .step-num {
    position: absolute;
    left: 0;
    top: -0.35rem;
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .hero-actions .btn { width: 100%; }
  .brand img { height: 28px; }
}

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

@media print {
  .site-header, .board, .contact-form, .site-footer { display: none; }
  .process { background: none; color: var(--ink); }
}
