/* ---------- Tokens ---------- */
:root {
  --brand-navy: #0B1626;
  --brand-blue: #1E40AF;
  --brand-cyan: #00D2FF;
  --brand-green: #34D399;

  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --surface-alt: #EEF3F8;
  --text: #0B1626;
  --text-muted: #46566B;
  --border: #D8E1EB;
  --accent: #0369A1;
  --header-bg: rgba(246, 248, 251, 0.85);
  --button-bg: linear-gradient(120deg, #1E40AF 0%, #0369A1 100%);
  --button-text: #FFFFFF;
  --focus: #0369A1;
  /* Hero colours must match the fills baked into brand-light.svg / brand.svg. */
  --hero-bg: #FFFFFF;
  /* Header logo tile; logo-light.svg has no background of its own, and its inner
     fills are #E2E9F2, so --logo-tile-bg must stay that colour in light mode. */
  --logo-tile-bg: #E2E9F2;
  --logo-tile-pad: 4px;
  --hero-glow: rgba(2, 132, 199, 0.10);
  --hero-text: #0B1626;
  --hero-accent-1: #0284C7;
  --hero-accent-2: #059669;

  --header-h: 64px;
  --section-pad: clamp(56px, 9vw, 104px);
  --rail: 48px;        /* space left of the section text reserved for the trace */
  --trace-x: 26px;     /* trace centre, measured from the container's left edge */
  --trace-w: 2.5px;
  --trace-opacity: 0.5;
  --trace-1: #1E3A8A;
  --trace-2: #0284C7;
  --trace-3: #059669;
  --node-a: #0284C7;
  --node-b: #059669;
  --measure: 68ch;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08111E;
    --surface: #0E1A2C;
    --surface-alt: #0B1626;
    --text: #E6EDF6;
    --text-muted: #9FB0C5;
    --border: #1D2D44;
    --accent: #34D399;
    --header-bg: rgba(8, 17, 30, 0.85);
    --button-bg: linear-gradient(120deg, #00D2FF 0%, #34D399 100%);
    --button-text: #0B1626;
    --focus: #00D2FF;
    --hero-bg: #0B1626;
    --logo-tile-bg: transparent; /* logo.svg brings its own navy tile */
    --logo-tile-pad: 0px;
    --hero-glow: rgba(0, 210, 255, 0.16);
    --hero-text: #FFFFFF;
    --hero-accent-1: #00D2FF;
    --hero-accent-2: #34D399;
    --trace-1: #1E40AF;
    --trace-2: #00D2FF;
    --trace-3: #34D399;
    --node-a: #00D2FF;
    --node-b: #34D399;
  }
}

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

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

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

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

a { color: var(--accent); }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

.container {
  max-width: calc(var(--measure) + 32px);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand img {
  box-sizing: content-box;
  padding: var(--logo-tile-pad);
  margin: calc(-1 * var(--logo-tile-pad));
  border-radius: calc(8px + var(--logo-tile-pad));
  background: var(--logo-tile-bg);
}
.brand-name span { color: var(--text-muted); font-weight: 500; }

.main-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.main-nav a {
  position: relative;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s;
}
.main-nav a:hover { color: var(--text); background: var(--surface-alt); }
.main-nav a.active { color: var(--text); }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-green));
}

.lang-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.lang-switch a {
  min-width: 40px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.7;
  text-align: center;
  text-decoration: none;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="page"] {
  background: var(--brand-navy);
  color: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  .lang-switch a[aria-current="page"] {
    background: var(--brand-green);
    color: var(--brand-navy);
  }
}

/* ---------- Hero ---------- */
/* brand.svg (dark) and brand-light.svg hide overlapping strokes with solid fills,
   so the hero background must stay the flat --hero-bg colour behind the artwork. */
.hero {
  height: 40vh;
  height: 40svh;
  min-height: 260px;
  background:
    radial-gradient(ellipse at 50% 120%, var(--hero-glow), transparent 60%),
    var(--hero-bg);
  color: var(--hero-text);
  overflow: hidden;
}

.hero-inner {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.hero-image {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  animation: rise 0.9s ease-out both;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-tagline {
  margin: 0;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(100deg, var(--hero-text) 0%, var(--hero-text) 40%, var(--hero-accent-1) 50%, var(--hero-accent-2) 57%, var(--hero-text) 67%, var(--hero-text) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: rise 0.9s 0.25s ease-out both, shimmer 6s 1.2s ease-in-out infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  60%, 100% { background-position: 0 0; }
}

/* ---------- Sections ---------- */
.service, .contact {
  --section-bg: var(--bg);
  padding: var(--section-pad) 0;
}
.service:nth-of-type(even) {
  --section-bg: var(--surface-alt);
  background: var(--section-bg);
}

/* ---------- Circuit trace (left of the section texts) ---------- */
/* Each section draws its own segment; the colours hand over at the section edges
   so the four segments read as one continuous blue → cyan → green trace. */
#enterprise { --from: var(--trace-1); --to: color-mix(in srgb, var(--trace-1), var(--trace-2)); --node: var(--node-a); }
#websites   { --from: color-mix(in srgb, var(--trace-1), var(--trace-2)); --to: var(--trace-2); --node: var(--node-a); }
#devops     { --from: var(--trace-2); --to: color-mix(in srgb, var(--trace-2), var(--trace-3)); --node: var(--node-b); }
#contact    { --from: color-mix(in srgb, var(--trace-2), var(--trace-3)); --to: var(--trace-3); --node: var(--node-b); }

.service .container,
.contact .container {
  position: relative;
  max-width: calc(var(--measure) + 32px + var(--rail));
  padding-left: calc(16px + var(--rail));
}

.service .container::before,
.contact .container::before {
  content: "";
  position: absolute;
  top: calc(-1 * var(--section-pad));
  bottom: calc(-1 * var(--section-pad));
  left: calc(var(--trace-x) - var(--trace-w) / 2);
  width: var(--trace-w);
  background: linear-gradient(to bottom, var(--from), var(--to));
}
/* The trace starts at the first node and ends in a hollow terminal node. */
#enterprise .container::before { top: 0.68rem; }
#contact .container::before { bottom: 0; }
#contact .container::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: calc(var(--trace-x) - 6px);
  width: 12px;
  height: 12px;
  border: 2.5px solid var(--trace-3);
  border-radius: 50%;
  background: var(--section-bg);
}

.service .eyebrow,
.contact .eyebrow { position: relative; }

/* Glowing node on the trace, level with the eyebrow. */
.service .eyebrow::before,
.contact .eyebrow::before {
  content: "";
  position: absolute;
  top: calc(0.68rem - 6px);
  left: calc(var(--trace-x) - 16px - var(--rail) - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--node);
  box-shadow:
    0 0 0 4px var(--section-bg),
    0 0 14px 4px color-mix(in srgb, var(--node) 55%, transparent);
}
.service .container::before,
.contact .container::before,
#contact .container::after,
.service .eyebrow::after,
.contact .eyebrow::after { opacity: var(--trace-opacity); }

/* Short connector from the node towards the eyebrow text. */
.service .eyebrow::after,
.contact .eyebrow::after {
  content: "";
  position: absolute;
  top: calc(0.68rem - 1px);
  left: calc(var(--trace-x) - 16px - var(--rail) + 10px);
  width: calc(16px + var(--rail) - var(--trace-x) - 20px);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--node), transparent);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow span:first-child { opacity: 0.6; margin-right: 6px; }

h2 {
  margin: 0 0 16px;
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.service p:not(.eyebrow), .contact p:not(.eyebrow) {
  margin: 0 0 28px;
  color: var(--text-muted);
  text-wrap: pretty;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 20px -8px rgba(3, 105, 161, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
}
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(3, 105, 161, 0.7);
}
a.button::after { content: "→"; transition: transform 0.2s; }
a.button:hover::after { transform: translateX(3px); }

/* ---------- Contact ---------- */
.org-data {
  margin: 0;
  padding: 8px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.org-data div {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 2fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.org-data div:last-child { border-bottom: 0; }
.org-data dt { color: var(--text-muted); font-size: 0.95rem; }
.org-data dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}
.footer-inner p { margin: 0; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Privacy dialog ---------- */
.privacy {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.privacy::backdrop { background: rgba(11, 22, 38, 0.6); backdrop-filter: blur(3px); }
.privacy-body { padding: 28px; }
.privacy-body h2 { font-size: 1.5rem; }
.privacy-body p { margin: 0 0 14px; font-size: 0.95rem; color: var(--text-muted); }
.privacy-body strong { color: var(--text); }
.privacy-body form { margin-top: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  :root {
    --header-h: 104px;
    --rail: 32px;
    --trace-x: 22px;
  }
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding-top: 10px;
  }
  .lang-switch { margin-left: auto; }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .main-nav a { padding: 8px 6px; white-space: nowrap; }
  .main-nav a.active::after { left: 6px; right: 6px; }
  .org-data { padding: 4px 16px; }
  .org-data div { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 380px) {
  .brand-name span { display: none; }
}

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