/* Kepler Innovation Lab — site styles */

:root {
  --navy: #152247;
  --accent: #e2462f;
  --text: #000;
  --grey-bg: #f5f5f5;
  --chip-grey: #f3f3f3;
  --white: #fff;

  --font-heading: "Fira Sans", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-button: "Poppins", "Inter", Arial, sans-serif;

  --gutter: max(16px, 4vw);
  --header-h: 98px;
  --radius: 8px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.216rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--grey-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 500; margin: 0; line-height: 1.12; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.accent { color: var(--accent); }
.navy { color: var(--navy); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 1000;
  background: var(--navy); color: var(--white); padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

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

.container { width: 100%; max-width: 1440px; margin: 0 auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 1120px; }
.container--contact { max-width: 1216px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 215px; min-height: 61px; padding: 14px 28px;
  background: var(--navy); color: var(--white);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.2; text-align: center; text-decoration: none;
  border: 0; border-radius: var(--radius); cursor: pointer;
  transition: opacity .2s ease;
}
.btn:hover { opacity: .85; }
.btn--wide { min-width: min(374px, 100%); min-height: 68px; }
.btn--header { min-width: 0; min-height: 57px; padding: 14px 20px; font-family: var(--font-button); font-size: 1rem; }
.btn--light {
  min-width: 0; min-height: 0; max-width: 320px; padding: 14px 36px;
  background: var(--white); color: var(--navy);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 18px; border-radius: 12px;
}

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid var(--navy);
  transition: background-color .2s ease;
}
.site-header.is-scrolled, .nav-open .site-header, body:not(.page-home) .site-header { background: var(--grey-bg); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.site-header__logo { flex: 0 0 auto; }
.site-header__logo img { width: 235px; }
.site-nav { flex: 1; display: flex; justify-content: center; gap: 29px; }
.site-nav a { text-decoration: none; font-size: 1.216rem; }
.site-nav a:hover { color: var(--accent); }
.site-nav .site-nav__cta-mobile { display: none; }
.site-header__cta { flex: 0 0 auto; }
.nav-toggle { display: none; }

@media (max-width: 1024px) {
  :root { --header-h: 80px; }
  .site-header__inner { justify-content: space-between; }
  .site-header__logo img { width: 160px; }
  .site-header__cta { display: none; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 8px;
    width: 44px; height: 44px; padding: 8px; background: none; border: 0; cursor: pointer;
  }
  .nav-toggle__bar { display: block; height: 2px; background: var(--text); transition: transform .2s ease; }
  .nav-open .nav-toggle__bar:nth-child(2) { transform: translateY(5px) rotate(45deg); }
  .nav-open .nav-toggle__bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

  .site-nav {
    display: none;
    position: fixed; inset: var(--header-h) 0 0; z-index: 99;
    flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    background: var(--grey-bg); padding: 32px var(--gutter);
  }
  .nav-open .site-nav { display: flex; }
  .nav-open { overflow: hidden; }
  .site-nav a { font-size: 2rem; }
  .site-nav .site-nav__cta-mobile { display: inline-flex; position: absolute; bottom: 24px; font-size: 1.2rem; min-width: 210px; }
}

/* Sections */
.section { padding-block: 96px; position: relative; overflow: hidden; }
.section--white { background: var(--white); }
.section--grey { background: var(--grey-bg); }

.section-title { font-size: clamp(2.4rem, 5vw, 3.16rem); margin-bottom: 1.6rem; }
.lead { font-size: 1.216rem; line-height: 1.5; }
.small { font-size: 1.05rem; line-height: 1.5; }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 9fr); gap: 48px 112px; }
.split__aside .btn { margin-top: 1.6rem; }
.split__main { padding-top: 140px; }
.split__main--center { align-self: center; padding-top: 0; }

.shape { margin-bottom: 1rem; }
.shape--donut { width: 105px; }
.shape--cross { width: 160px; }

/* Hero */
.hero {
  min-height: 775px;
  padding: calc(var(--header-h) + 44px) 0 48px;
  background: #eaf3fa url("/assets/img/hero-bg.webp") center / cover no-repeat;
}
.hero__title { font-size: clamp(2.4rem, 5vw, 3.16rem); }
.hero__subtitle {
  font-family: var(--font-heading); font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.08rem); line-height: 1.15;
  margin: 72px 0 96px;
}
.features { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; margin-bottom: 96px; }
.features li { display: flex; flex-direction: column; gap: 32px; }
.features img { width: 44px; height: 44px; }
.features strong { font-weight: 600; line-height: 1.5; max-width: 250px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1.8rem; }
.chips li {
  flex: 1 1 auto;
  display: flex; align-items: center; justify-content: center;
  min-height: 92px; padding: 16px 20px;
  border-radius: 24px;
  font-size: 1rem; font-weight: 600; line-height: 1.5; text-align: center;
}
.chips--grey li { background: var(--chip-grey); }
.chips--grey li:nth-child(3) { flex-basis: 40%; }
.chips--grey li:nth-child(n+4) { min-height: 126px; flex-basis: 35%; }
.chips--white li { background: var(--white); flex-basis: 30%; }
.chips--white li:nth-child(n+4) { min-height: 126px; }
.chips--white .chip--accent { background: var(--accent); color: var(--white); }

/* Program */
.program { padding-top: 48px; }
.program__title { font-size: clamp(1.6rem, 3vw, 2.08rem); margin-bottom: 48px; }
.program__grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: 32px 80px;
  grid-template-areas: "steps scheme" "cta .";
}
.steps { grid-area: steps; display: flex; flex-direction: column; gap: 28px; }
.steps h3 { font-size: clamp(1.4rem, 2.2vw, 1.65rem); margin-bottom: 4px; }
.steps p { margin: 0; }
.program__scheme { grid-area: scheme; align-self: start; margin-top: 0; }
.program__cta { grid-area: cta; justify-self: start; }
.program__blob {
  position: absolute; right: -360px; bottom: 60px; width: 660px; pointer-events: none;
}

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px 128px; align-items: start; }
.about__photo { width: 100%; max-width: 429px; aspect-ratio: 429 / 502; object-fit: cover; object-position: center 40%; }
.people { margin-top: 40px; display: flex; flex-direction: column; gap: 34px; }
.people a { display: inline-flex; align-items: center; gap: 20px; text-decoration: none; padding-left: 8px; }
.people a:hover span { color: var(--accent); }
.people img { width: 28px; height: 28px; }
.people span:not(.visually-hidden) { font-family: var(--font-heading); font-weight: 500; font-size: 1.65rem; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 48px 56px; align-items: start; }
.contact__form { min-height: 560px; }
.form-fallback { font-size: 1rem; }
/* "Loading form…" shows until the HubSpot form is ready or the fallback message replaces it. */
.form-loading { font-size: 1rem; opacity: .7; }
.is-ready + .form-loading, .is-failed + .form-loading,
.hs-form-frame:not(:empty) + .form-loading, .hs-failed .form-loading { display: none; }
.form-fallback--onerror { display: none; }
.hs-failed .form-fallback--onerror { display: block; }

/* Footer */
.site-footer { background: var(--navy); color: var(--white); padding-block: 74px 96px; font-size: 1rem; }
.site-footer__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.site-footer__brands { display: flex; flex-direction: column; gap: 56px; }
.site-footer__brands img { width: 209px; }
.site-footer__brands p { margin: 24px 0 0; }
.site-footer__signup { justify-self: center; }
.site-footer__links { display: flex; flex-direction: column; gap: 14px; font-size: 1.216rem; }
.site-footer__links a { text-underline-offset: 3px; }
.site-footer__email { font-size: .95rem; margin-top: 40px; }

/* Newsletter dialog */
.newsletter {
  width: min(600px, calc(100% - 32px)); max-height: calc(100dvh - 64px);
  padding: 0; border: 0; border-radius: 12px;
  background: var(--navy); color: var(--white);
}
.newsletter__body { position: relative; padding: 40px; }
@media (max-width: 640px) { .newsletter__body { padding: 48px 20px 24px; } }
.newsletter::backdrop { background: rgba(21, 34, 71, .95); }
.newsletter__close {
  position: absolute; top: 8px; right: 12px; width: 40px; height: 40px;
  background: none; border: 0; color: var(--white); font-size: 28px; line-height: 1; cursor: pointer;
}
#newsletter-form { min-height: 200px; }

/* Legal / plain content pages */
.page-content { padding: calc(var(--header-h) + 96px) 0 96px; }
.legal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; }
.legal__title { color: var(--navy); font-weight: 600; font-size: clamp(2.2rem, 4vw, 2.78rem); }
.legal__body { font-size: 1.216rem; line-height: 1.5; }
.legal__body h2, .legal__body h3, .legal__body h4 { color: var(--navy); font-weight: 600; margin: 2.4rem 0 1.4rem; }
.legal__body h2 { font-size: clamp(2.2rem, 4vw, 3.16rem); }
.legal__body h3 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.legal__body h4 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.legal__body ul { list-style: disc; padding-left: 40px; margin-bottom: 1rem; }
.legal__body li { margin-bottom: .6rem; }
.legal__body a { color: var(--navy); }

/* Diagnostic landing page */
.diagnostic {
  min-height: 100vh; padding: 56px 0;
  background: #eaf3fa url("/assets/img/hero-bg.webp") center / cover no-repeat fixed;
}
.diagnostic__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px 96px; }
.diagnostic__title { color: var(--navy); font-weight: 600; font-size: clamp(2.2rem, 3.4vw, 2.78rem); line-height: 1.12; max-width: 380px; margin-bottom: 64px; }
.diagnostic__text p { font-size: .95rem; }
.diagnostic__text .diagnostic__lede { font-weight: 600; font-size: 1.216rem; margin-bottom: 1.4rem; }
.diagnostic__text .diagnostic__scale { font-weight: 600; font-size: 1.216rem; line-height: 1.5; margin-bottom: 2.4rem; }
.diagnostic__powered { margin-top: 96px; font-size: .95rem; }
.diagnostic__powered img { width: 212px; margin-top: 16px; }
.diagnostic__form { padding-top: 32px; min-height: 420px; }

/* 404 */
.not-found { text-align: center; }
.not-found h1 { font-size: clamp(2.4rem, 5vw, 3.16rem); margin-bottom: 1rem; }
.not-found .btn { margin-top: 1.6rem; }

/* Tablet */
@media (max-width: 1024px) {
  .features { grid-template-columns: 1fr; gap: 16px; margin-bottom: 48px; }
  .features li { flex-direction: row; align-items: center; gap: 16px; }
  .hero { min-height: 0; }
  .hero__subtitle { margin: 24px 0 40px; }
  .split, .program__grid, .about, .contact, .site-footer__inner, .legal, .diagnostic__grid { grid-template-columns: minmax(0, 1fr); }
  .program__grid { grid-template-areas: "steps" "scheme" "cta"; }
  .split__main { padding-top: 0; }
  .site-footer__signup { justify-self: start; order: 3; }
  .program__blob { right: -300px; bottom: 120px; width: 420px; }
}

/* Phone */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .section { padding-block: 56px; }
  .program { padding-top: 16px; }
  .chips li, .chips--white li, .chips--grey li:nth-child(n) { flex-basis: 100%; min-height: 0; }
  .btn { min-width: 0; width: 100%; max-width: 320px; }
  .btn--header { width: auto; }
  .site-footer__links { font-size: 1rem; }
  .page-content { padding-top: calc(var(--header-h) + 40px); }
  .diagnostic { background-attachment: scroll; padding: 32px 0; }
  .diagnostic__title { margin-bottom: 32px; }
  .diagnostic__powered { margin-top: 40px; }
}
