/* ==========================================================================
   Caneri: brand tokens
   Brand colours come from the logo artwork (Design/Logos/New/Caneri.ai).
   Gold fails contrast as text on white (2.1:1), so on light backgrounds it is
   only used for decoration. Gold text is fine on navy (7.7:1).
   ========================================================================== */
:root {
  --navy: #010079;
  --navy-deep: #00004a;
  --gold: #d5ad36;
  --grey: #646464;

  --ink: #1c1c2e;
  --white: #ffffff;
  --tint: #f3f3f9;
  --line: #dcdce8;
  --gold-tint: #fbf4df;
  --gold-ink: #6b5310;
  --on-dark-muted: rgba(255, 255, 255, 0.82);
  --error-on-dark: #ffb4b4;

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 10px;
  --header-h: 72px;
  --section-pad: clamp(64px, 9vw, 112px);
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/montserrat/montserrat-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/montserrat/montserrat-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

/* Safari tints its toolbars from the body background, so html/body match the
   dark footer and <main> carries the white page. No theme-color meta tag. */
html {
  background: var(--navy-deep);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--navy-deep);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

main {
  display: block;
  background: var(--white);
}

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

figure {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
}

h3 {
  font-size: 1.25rem;
  line-height: 1.3;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--navy);
  text-underline-offset: 0.18em;
}

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

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

[id] {
  scroll-margin-top: calc(var(--header-h) + 8px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  /* viewport-fit=cover lets backgrounds reach the screen edges; content stays inside the safe area. */
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  border-radius: 6px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  outline-color: var(--gold);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--grey);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--gold);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: 2px solid var(--navy);
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
}

.button-outline {
  background: transparent;
  color: var(--navy);
}

.button-outline:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.button-small {
  min-height: 42px;
  padding: 8px 18px;
  font-size: 0.9375rem;
}

.button-gold {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy-deep);
}

.button-gold:hover {
  border-color: var(--white);
  background: var(--white);
  color: var(--navy);
}

.button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

/* ==========================================================================
   Header and navigation
   Solid white, not translucent: Safari turns a translucent header grey over
   the dark sections.
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: block;
  flex: none;
  border-radius: 4px;
}

.brand img {
  width: 227px;
  height: auto;
}

@media (max-width: 359px) {
  .brand img {
    width: 190px;
  }
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu a:not(.button) {
  display: inline-block;
  padding: 8px 4px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-menu a:not(.button):hover {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.nav-toggle {
  display: none;
}

/* Without JavaScript the links wrap under the logo instead of collapsing. */
html:not(.js) .header-inner {
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}

@media (max-width: 999px) {
  .js .nav-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-right: -8px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--navy);
    cursor: pointer;
  }

  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    display: block;
    width: 24px;
    height: 2.5px;
    border-radius: 2px;
    background: currentColor;
    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: -7px;
  }

  .nav-toggle-bars::after {
    top: 7px;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars {
    background: transparent;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
    transform: translateY(-7px) rotate(-45deg);
  }

  .js .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px max(var(--gutter), env(safe-area-inset-right)) 20px max(var(--gutter), env(safe-area-inset-left));
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(1, 0, 121, 0.08);
  }

  .js .site-header.is-open .nav-menu {
    display: flex;
  }

  .js .nav-menu a:not(.button) {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.0625rem;
  }

  .js .nav-cta {
    padding-top: 16px;
  }

  .js .nav-cta .button {
    width: 100%;
    min-height: 48px;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px);
}

.hero-grid {
  display: grid;
  gap: 40px;
}

.hero h1 {
  margin-bottom: 20px;
  /* "Sensors that catch" is about 9.3em wide; this keeps it on one line down to
     320px, so the headline is always exactly two lines. */
  font-size: min(9.4vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.hero h1 span {
  display: block;
  white-space: nowrap;
}

.lede {
  max-width: 34em;
  margin-bottom: 28px;
  color: var(--grey);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-media img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--navy);
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
  }

  .hero h1 {
    font-size: min(4.8vw, 3.75rem);
  }
}

/* ==========================================================================
   Who it's for
   ========================================================================== */
.audience {
  background: var(--navy);
  color: var(--white);
}

.audience-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.audience-title {
  margin: 0;
  color: var(--gold);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.audience-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  font-weight: 600;
}

.audience-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audience-list li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding: var(--section-pad) 0;
}

.section-tint {
  background: var(--tint);
}

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-head p:last-child {
  margin-bottom: 0;
  color: var(--grey);
  font-size: 1.125rem;
}

/* Services: 2 x 2 */
.service-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 760px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

.card {
  position: relative;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.service {
  display: flex;
  flex-direction: column;
}

.service::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  margin-bottom: 20px;
  border-radius: 2px;
  background: var(--gold);
}

.service p {
  color: var(--grey);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: auto 0 0;
  padding: 8px 0 0;
  list-style: none;
}

.tags li,
.tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--navy);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
}

/* ==========================================================================
   Photo band
   ========================================================================== */
.photo-band {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(280px, 36vw, 480px);
  overflow: hidden;
  background: var(--navy);
  isolation: isolate;
}

.photo-band picture,
.photo-band img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

/* Greyscale first, so the navy overlay stays on-brand instead of turning the
   gold traces purple. */
.photo-band img {
  filter: grayscale(1) contrast(1.15);
}

.photo-band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgba(0, 0, 74, 0.9) 0%, rgba(1, 0, 121, 0.78) 55%, rgba(1, 0, 121, 0.6) 100%);
}

.photo-band-inner {
  padding-top: 48px;
  padding-bottom: 48px;
}

.photo-band-line {
  margin: 0;
  color: var(--white);
  font-size: clamp(2rem, 1.2rem + 3.6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Approach
   ========================================================================== */
.steps {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

@media (min-width: 1040px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.step {
  padding: 28px 24px;
  border-radius: var(--radius);
  background: var(--white);
}

.step-num {
  display: block;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--gold);
  color: var(--navy);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.step h3 {
  font-size: 1.125rem;
}

.step p {
  margin: 0;
  color: var(--grey);
  font-size: 1rem;
}

/* ==========================================================================
   About
   ========================================================================== */
.about-grid {
  display: grid;
  gap: 40px;
}

.about-media img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--tint);
}

.about-copy p {
  color: var(--grey);
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(48px, 6vw, 88px);
  }
}

.checklist {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 36px;
  color: var(--ink);
  font-weight: 600;
}

.checklist li::before {
  content: "";
  position: absolute;
  top: 0.15em;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy);
}

.checklist li::after {
  content: "";
  position: absolute;
  top: calc(0.15em + 6px);
  left: 8px;
  width: 6px;
  height: 10px;
  border: solid var(--gold);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* ==========================================================================
   Solutions: three sector solutions, then three products
   ========================================================================== */
.solution-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 680px) {
  .solution-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .solution-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.solution {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--white);
}

.solution-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--line);
}

.solution-body {
  padding: 22px 24px 28px;
}

.solution-body .tag {
  margin-bottom: 12px;
}

.solution-body h3 {
  font-size: 1.25rem;
}

.solution-body p:last-child {
  margin: 0;
  color: var(--grey);
  font-size: 1rem;
}

.tag-dev {
  background: var(--gold-tint);
  color: var(--gold-ink);
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  padding: var(--section-pad) 0;
  background: var(--navy);
  color: var(--white);
}

.contact :focus-visible {
  outline-color: var(--gold);
}

.contact-grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
    gap: clamp(48px, 6vw, 96px);
  }
}

.contact h2 {
  color: var(--white);
}

.contact .eyebrow {
  color: var(--gold);
}

.contact-copy p {
  color: var(--on-dark-muted);
  font-size: 1.125rem;
}

.contact-copy a {
  color: var(--white);
  font-weight: 600;
}

.contact-form {
  display: grid;
  gap: 18px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
}

.optional {
  color: var(--on-dark-muted);
  font-weight: 400;
}

/* 16px or more stops iOS Safari zooming into the field on focus. */
.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--gold);
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.field [aria-invalid="true"] {
  border-color: var(--error-on-dark);
}

.field-error {
  margin: 6px 0 0;
  color: var(--error-on-dark);
  font-size: 0.875rem;
  font-weight: 600;
}

.field-error:empty {
  display: none;
}

/* Honeypot: off-screen for people, still in the form for bots. */
.field-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-footer {
  display: grid;
  gap: 12px;
}

.form-note {
  margin: 0;
  color: var(--on-dark-muted);
  font-size: 0.9375rem;
}

.contact-form .button {
  justify-self: start;
  min-width: 180px;
}

.form-status {
  margin: 0;
  font-weight: 600;
}

/* Results for a form posted without JavaScript: the Worker redirects to #sent or #error. */
.form-result {
  display: none;
  margin: 0;
  padding: 12px 16px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  color: var(--white);
  font-weight: 600;
}

.form-result-error {
  border-color: var(--error-on-dark);
}

/* Extra room: the page can still shift slightly as fonts load after the jump to #sent or #error. */
.form-result {
  scroll-margin-top: calc(var(--header-h) + 32px);
}

.form-result:target {
  display: block;
}

.form-status:empty {
  display: none;
}

.form-status.is-success {
  color: var(--gold);
}

.form-status.is-error {
  color: var(--error-on-dark);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: 56px 0 calc(32px + env(safe-area-inset-bottom));
  background: var(--navy-deep);
  color: var(--on-dark-muted);
  font-size: 0.9375rem;
}

.site-footer :focus-visible {
  outline-color: var(--gold);
}

.site-footer a {
  color: var(--white);
}

.footer-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

.footer-brand img {
  width: 202px;
  margin-bottom: 14px;
}

.footer-brand p {
  margin: 0;
  color: var(--gold);
  font-weight: 600;
}

.footer-nav ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-address {
  font-style: normal;
  line-height: 1.8;
}

.footer-legal {
  margin-top: 40px;
}

.footer-legal p {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.8125rem;
}

/* ==========================================================================
   404 page
   ========================================================================== */
.not-found {
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding: 64px 0;
}

.not-found p {
  max-width: 34em;
  color: var(--grey);
  font-size: 1.125rem;
}

/* ==========================================================================
   Scroll fade-ins (only with JavaScript, and never with reduced motion)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}
