:root {
  /* Navy palette anchored on the brand logo colour #1E3A8A */
  --bg: #0A0F1A;
  --bg-elev: #111827;
  --border: #1E293B;
  --text: #E8ECF4;
  --muted: #93A1BD;
  --brand: #1E3A8A;
  --accent: #5B8DEF;       /* brightened brand navy, legible on dark */
  --accent-soft: #85A9F5;  /* hover / highlight */
  --accent-deep: #1E3A8A;  /* brand anchor for gradients */
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Code",
    "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --max: 1080px;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* iOS/iPadOS Safari inflates text in landscape unless this is pinned. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.6;
  font-size: 16px;
  /* Paired so macOS Safari/Chrome and macOS Firefox weigh glyphs the same way. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  /* Kills the grey flash box iOS paints on tap, which no other platform draws. */
  -webkit-tap-highlight-color: transparent;
}

/* One focus ring everywhere — browser defaults differ (Safari glow, Chrome ring,
   Firefox dotted outline). */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px; /* fallback for engines without env() */
  /* max() keeps copy clear of the rounded corners / notch in iOS landscape. */
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}

/* Header — light bar carrying the logo */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #F7F7F5;
  border-bottom: 1px solid #E4E4DE;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 104px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  /* Scales instead of snapping at a breakpoint, so tablet widths stay in
     proportion with desktop. */
  margin-left: clamp(0px, 5vw, 70px);
}
.brand .logo {
  height: clamp(76px, 9vw, 96px);
  width: auto;
  display: block;
}
.nav a {
  color: #5A667E;
  /* 700, not 600: most monospace faces ship only Regular + Bold, so a 600 gets
     synthesised on Linux/Android and renders heavier than on macOS/iPadOS. */
  font-weight: 700;
  margin-left: 22px;
  font-size: 0.98rem;
}
.nav a.active { color: var(--brand); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #061024;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.15s ease;
}

/* Hero */
.hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: radial-gradient(120% 120% at 72% 40%, #0d1526 0%, var(--bg) 70%);
  min-height: 560px;
  display: flex;
  align-items: center;
}
/* Dependency-graph animation canvas, sitting behind the text */
.hero-graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
/* Overlay keeps the left half dark so the text stays fully clear of the graph,
   which lives in the right half of the hero. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(10, 15, 26, 0.96) 0%,
    rgba(10, 15, 26, 0.93) 48%,
    rgba(10, 15, 26, 0.34) 74%,
    rgba(10, 15, 26, 0.16) 100%);
}
/* Lift hero text above the ::before overlay so it never darkens (matters on
   the contact page, whose hero uses a plain .container). */
.hero .container {
  position: relative;
  z-index: 2;
}
.hero-content {
  padding-top: 104px;
  padding-bottom: 84px;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  width: 100%;
}

/* Text "float up" entrance, staggered */
@keyframes floatUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-content > * { opacity: 0; }
.hero-content > h1 { animation: floatUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.20s both; }
.hero-content > p  { animation: floatUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.36s both; }
.hero-content > .btn { animation: floatUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.52s both; }
/* Widths in rem, not ch: `ch` is the width of "0" in the resolved font, and the
   monospace stack lands on a different face per OS (SF Mono on Apple, Consolas
   or Cascadia on Windows, DejaVu on Linux). With ch, every platform broke these
   lines in a different place; rem pins the break points. */
.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  max-width: 37rem;
}
.hero p {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
  max-width: 45rem;
  margin: 0 0 32px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-content > * { animation: none; opacity: 1; transform: none; }
}

/* Sections */
.section { padding: 36px 0 72px; border-bottom: 1px solid var(--border); }
.section h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.01em;
  /* The lead follows directly now, so this carries the gap the removed eyebrow
     line used to provide — matching the hero's h1-to-paragraph rhythm. */
  margin: 0 0 18px;
}
/* Intro copy is held to exactly one card's width, so its right edge lines up
   with the gutter of the two-column grid below (see .grid: 2 cols, 24px gap). */
.section .lead { color: var(--muted); max-width: calc(50% - 12px); margin: 0 0 40px; }

/* Service cards */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* Every row takes the height of the tallest card, so all six match. */
  grid-auto-rows: 1fr;
  gap: 24px;
}
.card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 38px 34px;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
/* accent edge that fills in on hover, Altis-style */
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.25s ease;
}
/* All hover styling is gated on a real pointer. On iPad and other touch devices
   a tap otherwise latches :hover, leaving the card lifted with an accent edge
   until something else is tapped — the main reason the page looked different
   there. */
@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--accent-soft); }
  .nav a:hover { color: var(--brand); }
  .btn:hover { background: var(--accent-soft); color: #061024; transform: translateY(-1px); }
  .card:hover {
    border-color: var(--accent-deep);
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  }
  .card:hover::before { transform: scaleY(1); }
}
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: rgba(91, 141, 239, 0.12);
  border: 1px solid rgba(91, 141, 239, 0.28);
  color: var(--accent);
}
.card-icon svg { width: 26px; height: 26px; display: block; }
.card h3 {
  margin: 0 0 10px; /* tighter than the icon's 22px, so title and body read as one block */
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.card p { margin: 0; color: var(--muted); font-size: 1rem; }

/* iPad portrait (768px CSS px) and similar: a two-column grid squeezes the intro
   paragraph into a ~350px ribbon, so it goes full width before the grid does. */
@media (max-width: 900px) {
  .section .lead { max-width: none; }
}
/* Below this a card is too narrow to hold a 1.3rem monospace card title on one
   line, and each platform's font wraps it somewhere else — collapse to one
   column while there is still room. */
@media (max-width: 700px) {
  /* Stacked, no card sits beside another, so equal heights would only pad the
     short ones out with empty space. */
  .grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
}

/* Call-to-action card — sits in the last cell of the services grid. Same icon,
   heading and spacing as every other card; only the fill, the border and the
   accent heading mark it out, with the button standing in for the body copy. */
.card-cta {
  background: linear-gradient(140deg, rgba(30, 58, 138, 0.35), var(--bg-elev) 70%);
  border-color: rgba(91, 141, 239, 0.32);
}
.card-cta h3 { color: var(--accent-soft); }
.card-cta .card-icon {
  background: rgba(91, 141, 239, 0.2);
  border-color: rgba(91, 141, 239, 0.45);
  color: var(--accent-soft);
}
/* Same size as the other cards' body copy — only the colour sets it apart. The
   22px below it echoes the icon's own bottom margin. */
.card-cta p { margin: 0 0 22px; color: var(--text); }

/* Contact — the hero here has no .hero-content wrapper (no entrance animation),
   so it carries the same vertical padding on its own instead of the hard-coded
   inline margins it used to, which did not scale down on phones. */
.hero-copy {
  padding-top: 104px;
  padding-bottom: 104px;
}
.contact-list {
  list-style: none;
  padding: 0;
  margin: 32px 0 40px;
  display: grid;
  gap: 20px;
}
.contact-list .value { font-size: 1.15rem; }
/* Two blank lines' worth of breathing room above and below the email. */
.contact-list .spaced { margin: 0.5rem 0; }
/* Belt and braces for the <meta name="format-detection"> on contact.html: in
   in-app webviews iOS can still wrap the ABN in its own tel: link, and it is
   injected with UA styling that only !important overrides. */
a[x-apple-data-detectors] {
  color: inherit !important;
  text-decoration: none !important;
  pointer-events: none;
}

/* Footer */
.site-footer {
  padding: 36px 0;
  /* clears the iOS home indicator in landscape */
  padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .hero { min-height: 420px; }
  /* keeps the safe-area side padding from the base rule */
  .hero-content { padding-top: 72px; padding-bottom: 76px; }
  .hero-copy { padding-top: 72px; padding-bottom: 76px; }
  .section { padding: 28px 0 56px; }
  .nav a { margin-left: 16px; }
}
