/* ==========================================================================
   KerraCell Ltd | site stylesheet
   Fonts: Space Grotesk (headings) + Raleway (paragraphs), matching the
   Squarespace font pack. Base size 16px.
   ========================================================================== */

:root {
  /* Typography ---------------------------------------------------------- */
  --font-logo: "Archivo", "Helvetica Neue", Arial, sans-serif;  /* matches the draft logo */
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Raleway", "Helvetica Neue", Arial, sans-serif;

  /* Colour -------------------------------------------------------------- */
  --bg: #fbfbfb;
  --bg-alt: #f2f1ef;
  --ink: #35312f;          /* headings */
  --ink-strong: #0a0a0a;   /* logo */
  --body: #3f3b38;         /* paragraphs */
  --muted: #6d6762;
  --line: #d8d4d0;
  --btn: #37322e;
  --btn-ink: #ffffff;

  /* Layout -------------------------------------------------------------- */
  --container: 1500px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(64px, 9vw, 150px);
  --radius: 0px;
}

/* Reset -------------------------------------------------------------------*/
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.26;
  margin: 0;
}

h1 { font-size: clamp(2.55rem, 5.25vw, 5.15rem); }
h2 { font-size: clamp(2.15rem, 4.55vw, 4.25rem); }
h3 { font-size: clamp(1.4rem, 2vw, 1.95rem); line-height: 1.26; }
p  { margin: 0 0 1.25em; }
p:last-child { margin-bottom: 0; }

/* Layout ------------------------------------------------------------------*/
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(40px, 5vw, 80px); }
.narrow { max-width: 820px; }
.center { text-align: center; }
.measure { max-width: 66ch; }
.lede-copy p { font-size: clamp(1.02rem, 1.34vw, 1.22rem); text-align: justify; }

/* Header ------------------------------------------------------------------*/
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg);
  transform: translateY(0);
  transition: transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.site-header.is-hidden { transform: translateY(-100%); }
/* main clears the fixed header */
body { padding-top: var(--header-h, 120px); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-block: clamp(22px, 2.6vw, 38px);
}
.brand { text-decoration: none; display: inline-block; text-align: center; }
.brand__name {
  font-family: var(--font-logo);
  font-weight: 750;
  font-size: clamp(2.05rem, 2.95vw, 3.1rem);
  letter-spacing: 0.005em;
  color: var(--ink-strong);
  line-height: 1;
}
.brand__tagline {
  font-family: var(--font-logo);
  font-weight: 700;
  white-space: nowrap;
  font-size: clamp(0.82rem, 1.1vw, 1.12rem);
  letter-spacing: 0;
  color: var(--ink-strong);
  margin-top: 6px;
}

.nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 36px); }
.nav a {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.25vw, 1.3rem);
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease, opacity 0.18s ease;
}
.nav a:hover { border-bottom-color: currentColor; }
.nav a[aria-current="page"] { border-bottom-color: currentColor; }

.nav-toggle {
  display: none;
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 10px 0;
  cursor: pointer;
  color: var(--ink-strong);
}
.nav-toggle span {
  display: block;
  width: 38px;
  height: 2px;
  background: currentColor;
}
.nav-toggle span + span { margin-top: 9px; }
.nav-toggle svg { display: block; }

/* Buttons -----------------------------------------------------------------*/
.btn {
  display: inline-block;
  background: var(--btn);
  color: var(--btn-ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 18px 34px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.btn:hover { opacity: 0.86; }
.btn:active { transform: translateY(1px); }

/* Hero --------------------------------------------------------------------*/
.hero { position: relative; padding-top: clamp(28px, 4vw, 60px); padding-bottom: clamp(40px, 6vw, 90px); }
.hero h1, .hero__sub { position: relative; z-index: 2; }
.hero__sub {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.85vw, 2.9rem);
  color: var(--ink);
  letter-spacing: -0.015em;
  margin-top: clamp(14px, 1.6vw, 24px);
}
.hero__media {
  position: relative;
  z-index: 1;
  margin-top: clamp(-150px, -8vw, -60px);
  width: 100%;
}
.hero__media img { width: 100%; }

/* Page intro (centred big statement) --------------------------------------*/
.page-title { text-align: center; }
.page-title h1 { max-width: none; margin-inline: auto; }
.page-title .line { display: block; }

/* Feature grid ------------------------------------------------------------*/
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(22px, 2.6vw, 40px);
  align-items: start;
}
.feature h3 { margin-bottom: clamp(20px, 2.4vw, 34px); }
.feature figure { margin: 0; }
.feature img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

/* Split (image + text) ----------------------------------------------------*/
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 96px);
  align-items: center;
}
.split--text-right { direction: ltr; }
.split__media img { width: 100%; object-fit: cover; }
.split__body h2 { margin-bottom: clamp(18px, 2vw, 30px); }
.split__body .lede { font-weight: 700; color: var(--ink); margin-bottom: 28px; }

/* Platform blocks (Applications) -----------------------------------------*/
.platform { text-align: center; margin-bottom: clamp(70px, 9vw, 140px); }
.platform:last-child { margin-bottom: 0; }
.platform h2 { font-weight: 500; letter-spacing: -0.03em; margin-bottom: clamp(24px, 3vw, 44px); }
.platform figure { margin: 0 auto; max-width: 1040px; }
.platform figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.platform figcaption {
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  max-width: 62ch;
  margin: clamp(24px, 3vw, 44px) auto 0;
  color: var(--body);
}

/* Stacked centred blocks (About) -----------------------------------------*/
.stack-block { text-align: center; margin-bottom: clamp(60px, 8vw, 120px); }
.stack-block:last-child { margin-bottom: 0; }
.stack-block figure { margin: 0 auto; max-width: 660px; }
.stack-block figure img { width: 100%; }
.stack-block h2 { margin-bottom: clamp(28px, 3.4vw, 52px); }
.stack-block p { font-size: clamp(1rem, 1.25vw, 1.15rem); max-width: 60ch; margin: clamp(24px, 3vw, 40px) auto 0; }

/* Forms -------------------------------------------------------------------*/
.form-section { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.form-section__intro h2 { margin-bottom: 28px; max-width: 12ch; }
.form-section__intro p { max-width: 42ch; }
.form-section__intro .lede { font-weight: 700; color: var(--ink); }

.form-group { margin-bottom: 26px; }
.form-legend,
.form-label {
  display: block;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--body);
  margin-bottom: 8px;
}
.form-legend { font-size: 1.15rem; margin-bottom: 12px; }
.req { color: var(--muted); font-size: 0.9rem; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid #8b8681;
  border-radius: 2px;
  padding: 14px 14px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }

.checks { display: grid; gap: 12px; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 12px; font-size: 1.02rem; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }

.form-note { margin-top: 18px; font-size: 0.95rem; color: var(--muted); }
.form-status { margin-top: 18px; font-weight: 700; color: var(--ink); }

/* CTA band ----------------------------------------------------------------*/
.cta-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.cta-split h2 { max-width: 11ch; margin-bottom: 28px; }

/* Footer ------------------------------------------------------------------*/
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(60px, 8vw, 120px);
  padding-block: clamp(40px, 5vw, 64px);
  font-size: 0.95rem;
  color: var(--muted);
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px 28px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Responsive --------------------------------------------------------------*/
@media (max-width: 900px) {
  body { font-size: 17px; }

  .nav-toggle { display: block; }
  .site-header__inner { position: relative; justify-content: center; text-align: center; }
  .brand { margin-inline: auto; }
  .nav {
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { width: 100%; padding: 14px 0; font-size: 1.15rem; border-bottom: 1px solid transparent; }

  .grid-3 { grid-template-columns: 1fr; gap: 44px; }
  .feature img { aspect-ratio: 4 / 3; }
  .split, .cta-split, .form-section { grid-template-columns: 1fr; }
  .split--media-last .split__media { order: 2; }
  .cta-split .split__media { order: 2; }
  .cta-split .btn, .hero .btn { display: block; width: 100%; text-align: center; }

  /* Narrow screens: headings centre (the logo lockup is centred too),
     body copy stays left-aligned and unjustified so it reads cleanly. */
  .hero h1,
  .hero__sub,
  .section > h2,
  .feature h3,
  .split__body h2,
  .split__body .lede,
  .cta-split h2,
  .form-section__intro h2,
  .form-section__intro p { text-align: center; }

  .split__body h2, .cta-split h2, .form-section__intro h2 { max-width: none; }
  .form-section__intro p { max-width: none; margin-inline: auto; }
  .lede-copy p { text-align: left; }

  /* a little more air in headings once lines start wrapping */
  h1 { line-height: 1.3; }
  h2 { line-height: 1.28; }
  h3 { line-height: 1.32; }
  .page-title .line + .line { margin-top: 0.5em; }
  .platform h2 { margin-bottom: clamp(20px, 5vw, 32px); }
  .feature h3 { margin-inline: auto; }
  .hero__media { margin-top: clamp(-34px, -6vw, -14px); }
  .field-row { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 520px) {
  .brand__tagline { font-size: clamp(0.62rem, 3vw, 0.82rem); }
  .nav-toggle span { width: 32px; }
}

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