/* ==========================================================================
   Kelbari — site styles
   Brand rules (see Kelbari Brand Guidelines v1.0):
   - Deep 60% / Paper 30% / Aqua 7% / Teal 3%. Aqua is an accent only.
   - Never aqua text on white or on teal. Teal text only at 24px and up.
   - Manrope 800 display + headings, 600 labels + buttons, 400 body.
   - JetBrains Mono for small technical details.
   - Utility colours (--success, --error) are for interface states only.
   ========================================================================== */

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --deep: #07322F;
  --teal: #0F9B85;
  --aqua: #34D3B4;
  --mint: #E3F7F2;
  --ink: #0C1412;
  --graphite: #4C5754;
  --mist: #A9B4B1;
  --paper: #F2F6F5;
  --white: #FFFFFF;

  /* interface states only */
  --success: #2FA36B;
  --error: #D64545;

  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1240px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/28px var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

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

.skip {
  position: absolute; left: 12px; top: -64px; z-index: 100;
  background: var(--deep); color: var(--white);
  padding: 12px 16px; border-radius: 2px;
  font-weight: 600; text-decoration: none;
  transition: top .15s;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.on-deep :focus-visible { outline-color: var(--aqua); }

/* ---------- Type ---------- */
h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.08;
  text-wrap: balance;
}
.display {
  font-size: clamp(42px, 5.6vw, 80px);
  line-height: 1.02;
  letter-spacing: -.035em;
}
h2 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.08; }
h3 { font-size: clamp(20px, 2vw, 24px); font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }

.mono { font-family: var(--mono); font-size: 14px; line-height: 22px; letter-spacing: 0; }

.sec-head { max-width: 46rem; margin-bottom: clamp(40px, 5.5vw, 72px); }
.sec-head p { margin-top: 20px; max-width: 56ch; color: var(--graphite); }
.on-deep .sec-head p { color: var(--mint); }

section { padding: clamp(72px, 9vw, 120px) 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px;
  padding: 14px 22px;
  border: 0; border-radius: 2px;
  font: 600 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s, color .18s, box-shadow .18s;
}
.btn-deep { background: var(--deep); color: var(--white); }
.btn-deep:hover { background: var(--ink); }
.btn-aqua { background: var(--aqua); color: var(--ink); }
.btn-aqua:hover { background: var(--mint); }
.btn-line { background: transparent; color: var(--deep); box-shadow: inset 0 0 0 1.5px var(--deep); }
.btn-line:hover { background: var(--deep); color: var(--white); }
.on-deep .btn-line { color: var(--aqua); box-shadow: inset 0 0 0 1.5px var(--aqua); }
.on-deep .btn-line:hover { background: var(--aqua); color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(242, 246, 245, .92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(169, 180, 177, .45);
}
.bar { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--deep); text-decoration: none;
  font-weight: 800; font-size: 23px; letter-spacing: -.03em;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 30px; }
.nav a:not(.btn) {
  color: var(--graphite); font-weight: 600; font-size: 15px; text-decoration: none;
  padding: 8px 0; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav a:not(.btn):hover { color: var(--deep); border-bottom-color: var(--deep); }

.menu-btn {
  display: none; margin-left: auto;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 0; cursor: pointer; color: var(--deep);
}
.menu-btn span { display: block; width: 22px; height: 2px; background: currentColor; margin: 6px auto; transition: transform .2s var(--ease), opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-12px) rotate(-45deg); }

@media (max-width: 859px) {
  .menu-btn { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--mist);
    padding: 8px var(--gutter) 24px;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { font-size: 20px; padding: 16px 0; border-bottom: 1px solid rgba(169, 180, 177, .45); }
  .nav .btn { margin-top: 20px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--deep); color: var(--white);
  padding: clamp(48px, 7vw, 104px) 0 clamp(40px, 5vw, 72px);
  touch-action: pan-y;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.hero-mark { justify-self: center; width: min(100%, 360px); aspect-ratio: 1; }
.hero-mark svg { width: 100%; height: 100%; overflow: visible; }

.tagline { color: var(--aqua); font-weight: 600; font-size: 16px; line-height: 24px; }
.hero h1 { margin-top: 20px; max-width: 15ch; }
.rule { width: 64px; height: 4px; background: var(--aqua); margin: 32px 0; }
.lede { max-width: 50ch; color: var(--mint); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px;
  margin-top: clamp(48px, 7vw, 88px);
  padding-top: 26px;
  border-top: 1px solid rgba(52, 211, 180, .3);
}
.facts strong { display: block; font-size: 28px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; color: var(--white); }
.facts span { display: block; margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--mist); }

@media (max-width: 899px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-mark { order: -1; justify-self: start; width: 120px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* the K draws itself once on load */
@media (prefers-reduced-motion: no-preference) {
  .hero-mark .k-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: k-draw .5s var(--ease) forwards; }
  .hero-mark .k-stem { animation-delay: .2s; }
  .hero-mark .k-up { animation-delay: .45s; }
  .hero-mark .k-down { animation-delay: .6s; }
  .hero-mark .k-node { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: k-pop .4s var(--ease) forwards; }
  .hero-mark .k-hub { animation-delay: 0s; }
  .hero-mark .k-n1 { animation-delay: .5s; }
  .hero-mark .k-n2 { animation-delay: .65s; }
  .hero-mark .k-n3 { animation-delay: .85s; }
  .hero-mark .k-n4 { animation-delay: 1s; }
}
@keyframes k-draw { to { stroke-dashoffset: 0; } }
@keyframes k-pop { to { transform: scale(1); } }

/* ---------- Services: the hub and its three branches ---------- */
.services { background: var(--paper); }
.tree { position: relative; }
.tree-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.tree-lines .branch { fill: none; stroke: var(--deep); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tree-lines .end { fill: var(--paper); stroke: var(--deep); stroke-width: 2.5; transition: fill .4s; }
.tree-lines .end.is-linked { fill: var(--aqua); }

.tree-hub { display: flex; justify-content: center; }
.hub { position: relative; display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--deep); }
.hub svg { width: 28px; height: 28px; flex: none; }
/* on wide screens the ring sits exactly on the centre line, the label hangs beside it */
@media (min-width: 900px) {
  .hub { display: block; width: 28px; height: 28px; }
  .hub-label { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); white-space: nowrap; }
}

.pillars {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 32px);
  margin-top: clamp(64px, 8vw, 96px);
}
.pillar {
  background: var(--white);
  border-top: 3px solid var(--mist);
  padding: clamp(26px, 3vw, 40px);
  transition: border-color .4s;
}
.pillar.is-linked { border-top-color: var(--deep); }
.pillar h3 { margin-bottom: 14px; }
.pillar > p { color: var(--graphite); font-size: 16px; line-height: 26px; }
.pillar ul { margin-top: 22px; border-top: 1px solid var(--paper); }
.pillar li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--paper);
  font-size: 15px; line-height: 22px; color: var(--graphite);
}
.pillar li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

@media (max-width: 899px) {
  .tree-hub { justify-content: flex-start; }
  .pillars { grid-template-columns: 1fr; margin-top: 40px; padding-left: 44px; gap: 24px; }
}

/* ---------- Process: a connected line with a travelling node ---------- */
.process { background: var(--deep); color: var(--white); }
.process h2 { color: var(--white); }
.steps-wrap { position: relative; }
.steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
  padding-top: 52px;
}
.step { position: relative; }
.step .dot {
  position: absolute; left: 0; top: -38px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--deep); border: 2px solid var(--mist);
  transition: background-color .3s, border-color .3s;
}
.step.is-reached .dot { background: var(--aqua); border-color: var(--aqua); }
.step-n { font-family: var(--mono); font-size: 14px; line-height: 20px; color: var(--mist); margin-bottom: 10px; }
.step h3 { color: var(--white); }
.step p { margin-top: 10px; font-size: 16px; line-height: 26px; color: var(--mint); max-width: 34ch; }

.rail-track, .rail-fill, .traveler { position: absolute; pointer-events: none; display: none; }
.js .rail-track, .js .rail-fill, .js .traveler { display: block; }
.rail-track { background: rgba(169, 180, 177, .4); }
.rail-fill { background: var(--aqua); }
.rail-fill[data-orient="h"] { transform-origin: left center; }
.rail-fill[data-orient="v"] { transform-origin: center top; }
.traveler {
  left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%;
  background: var(--aqua); border: 3px solid var(--deep);
  box-sizing: content-box; margin: -12px 0 0 -12px;
  transition: transform .18s linear;
  z-index: 2;
}
.rail-fill { transition: transform .18s linear; }

@media (max-width: 759px) {
  .steps { grid-template-columns: 1fr; gap: 40px; padding-top: 0; padding-left: 44px; }
  .step .dot { left: -44px; top: 6px; }
}

/* ---------- Work ---------- */
.work { background: var(--white); }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.projects[hidden], .empty[hidden] { display: none; }
.project { display: flex; flex-direction: column; border: 1px solid var(--mist); background: var(--white); }
.project .thumb { aspect-ratio: 16 / 10; background: var(--deep); overflow: hidden; }
.project .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project .pbody { display: flex; flex-direction: column; gap: 10px; padding: 24px; flex: 1; }
.project .cat { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--graphite); }
.project h3 { font-size: 22px; }
.project p { font-size: 15px; line-height: 24px; color: var(--graphite); }
.project .more { margin-top: auto; padding-top: 12px; font-weight: 600; font-size: 15px; color: var(--deep); text-underline-offset: 4px; }

.empty {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
  background: var(--paper);
  padding: clamp(28px, 5vw, 64px);
}
.empty h3 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.025em; }
.empty p { margin-top: 14px; max-width: 46ch; color: var(--graphite); }
.empty .btn { margin-top: 28px; }
.empty-art { width: 100%; max-width: 340px; justify-self: center; }
.empty-art .e-line { stroke: var(--mist); stroke-width: 2.5; stroke-dasharray: 3 8; stroke-linecap: round; fill: none; }
.empty-art .e-node { fill: var(--paper); stroke: var(--mist); stroke-width: 2.5; }
.empty-art .e-hub { fill: var(--paper); stroke: var(--deep); stroke-width: 3; }
@media (max-width: 759px) { .empty { grid-template-columns: 1fr; } .empty-art { max-width: 220px; justify-self: start; order: -1; } }

/* ---------- About ---------- */
.about { background: var(--mint); }
.two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.about h2 { color: var(--deep); }
.about .copy p { margin-top: 20px; max-width: 56ch; color: var(--graphite); }
.about .copy h2 + p { margin-top: 24px; }
.about .cta { margin-top: 34px; }
.founders { background: var(--deep); color: var(--white); padding: clamp(28px, 4vw, 48px); }
.founders .quote { margin-top: 22px; color: var(--mint); font-size: 18px; line-height: 28px; }
.founder { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(52, 211, 180, .3); }
.founder .nm { font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -.03em; }
.founder .rl { margin-top: 2px; color: var(--aqua); font-weight: 600; font-size: 15px; }
.founders .em { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(52, 211, 180, .3); color: var(--mist); }
@media (max-width: 859px) { .two { grid-template-columns: 1fr; } }

/* ---------- Contact: the hub ---------- */
.contact { background: var(--deep); color: var(--white); color-scheme: dark; }
.contact h2 { color: var(--white); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(40px, 7vw, 96px); align-items: start; }

.field { margin-top: 24px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin-top: 24px; }
.pair .field { margin-top: 0; }
.hp + .pair { margin-top: 0; }
.field label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; line-height: 20px; color: var(--mint); }
.field .opt { font-weight: 400; color: var(--mist); }
.field input, .field select, .field textarea {
  display: block; width: 100%;
  background: transparent; border: 0; border-radius: 0;
  border-bottom: 1.5px solid rgba(169, 180, 177, .55);
  color: var(--white); font: 400 17px/26px var(--sans);
  padding: 10px 0; outline: none;
  transition: border-color .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--mist); opacity: 1; }
.field textarea { resize: vertical; min-height: 112px; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--mist) 50%), linear-gradient(135deg, var(--mist) 50%, transparent 50%);
  background-position: calc(100% - 9px) 50%, calc(100% - 4px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field select option { color: var(--ink); background: var(--white); }
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--aqua); border-bottom-width: 2px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 0; }
.field [aria-invalid="true"] { border-bottom-color: var(--error); }
.field .err { display: none; margin-top: 8px; font-size: 14px; line-height: 20px; color: var(--white); padding-left: 12px; border-left: 3px solid var(--error); }
.field [aria-invalid="true"] ~ .err { display: block; }

.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.form-note { margin-top: 16px; color: var(--mist); max-width: 52ch; }
.form-status { margin-top: 20px; min-height: 28px; font-weight: 600; }
.form-status:empty { display: none; }
.form-status[data-state="ok"] { padding-left: 12px; border-left: 3px solid var(--success); }
.form-status[data-state="error"] { padding-left: 12px; border-left: 3px solid var(--error); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.hubline { position: relative; }
.hl-item { position: relative; padding: 0 0 30px 52px; }
.hl-item:last-child { padding-bottom: 0; }
.hl-item::before { content: ""; position: absolute; left: 6px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--aqua); }
.hl-item::after { content: ""; position: absolute; left: 12px; top: 28px; bottom: -4px; width: 2px; background: rgba(52, 211, 180, .4); }
.hl-item:last-child::after { display: none; }
.hl-hub::before { left: 3px; top: 3px; width: 20px; height: 20px; background: var(--deep); border: 3px solid var(--white); box-sizing: border-box; }
.hl-hub::after { top: 26px; left: 12px; }
.hl-hub .nm { font-weight: 800; font-size: 22px; line-height: 28px; letter-spacing: -.03em; color: var(--white); }
.hl-label { font-size: 14px; line-height: 20px; color: var(--mist); }
.hl-value { display: block; margin-top: 2px; font-weight: 600; font-size: 18px; line-height: 28px; color: var(--white); overflow-wrap: anywhere; }
a.hl-value { text-decoration: underline; text-decoration-color: rgba(52, 211, 180, .6); text-underline-offset: 5px; transition: color .15s; }
a.hl-value:hover { color: var(--aqua); text-decoration-color: var(--aqua); }
.hl-hub p { color: var(--mist); font-size: 16px; line-height: 24px; margin-top: 2px; }

@media (max-width: 859px) { .contact-grid { grid-template-columns: 1fr; } .pair { grid-template-columns: 1fr; gap: 24px 0; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--mist); padding: 44px 0 96px; font-size: 14px; line-height: 22px; }
.frow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px; }
.site-footer a { color: var(--mist); text-underline-offset: 4px; }
.site-footer a:hover { color: var(--white); }

/* ---------- Floating WhatsApp ---------- */
.wa {
  position: fixed; z-index: 60;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px;
  background: #25D366; color: #072B18;
  font: 600 15px/1 var(--sans); text-decoration: none;
  padding: 16px 20px; border-radius: 40px;
  box-shadow: 0 10px 30px rgba(7, 50, 47, .3);
  transition: background-color .15s;
}
.wa:hover { background: #20BD5B; }
.wa:focus-visible { outline-color: var(--deep); }
@media (max-width: 859px) {
  .wa span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wa { width: 56px; height: 56px; padding: 0; justify-content: center; border-radius: 50%; }
}

/* ---------- Simple pages (thanks, 404) ---------- */
.page-simple { min-height: 100vh; display: flex; flex-direction: column; }
.page-simple main { flex: 1; background: var(--deep); color: var(--white); display: flex; align-items: center; }
.page-simple main .wrap { padding-top: 72px; padding-bottom: 72px; }
.page-simple h1 { font-size: clamp(36px, 5vw, 64px); max-width: 16ch; }
.page-simple p { margin-top: 20px; max-width: 46ch; color: var(--mint); }
.page-simple .btn { margin-top: 32px; }

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