/* ==========================================================================
   Kremtek
   Brand colors live here. Change them once and the whole site follows.
   Navy #273043 and olive #9a9b73 come straight from the logo file.
   ========================================================================== */

/* Fonts are self-hosted and trimmed to English characters (see README).
   Figtree (body), Newsreader (headings), IBM Plex Mono (small labels). All SIL OFL.
   If you replace a font file, give it a new name: /fonts/* is cached for a year. */
@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/plexmono.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --navy-950: #121722;
  --navy-900: #171d2a;
  --navy-800: #1d2434;
  --navy: #273043;          /* logo navy */
  --navy-600: #3f4c65;
  --navy-100: #e6e9ef;

  --olive: #9a9b73;         /* logo olive */
  --olive-700: #66673f;     /* olive text on light backgrounds (passes contrast) */
  --olive-300: #c9caa4;     /* olive text on dark backgrounds */
  --olive-100: #ecedde;

  --paper: #f4f3ee;
  --white: #fbfbf8;
  --card: #ffffff;
  --ink: #1b2231;
  --muted: #535b6a;
  --line: rgba(39, 48, 67, 0.12);
  --line-strong: rgba(39, 48, 67, 0.22);
  --on-dark: #eeede4;
  --on-dark-muted: rgba(238, 237, 228, 0.72);
  --on-dark-line: rgba(238, 237, 228, 0.16);

  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max: 1200px;
  --gutter: 20px;
  --header-h: 68px;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 29, 42, 0.05), 0 18px 40px -18px rgba(23, 29, 42, 0.25);
  --shadow-lg: 0 2px 4px rgba(23, 29, 42, 0.06), 0 30px 60px -24px rgba(23, 29, 42, 0.4);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 720px) { :root { --gutter: 36px; } }
@media (min-width: 1080px) { :root { --header-h: 80px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 720px) { body { font-size: 1.125rem; } }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
p { margin: 0 0 1em; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { margin: 0 0 0.5em; }
h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
}
h1 em, h2 em { font-style: italic; font-weight: 400; color: var(--olive-700); }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); color: var(--navy-800); }
h3 { font-size: 1.2rem; font-weight: 650; line-height: 1.3; letter-spacing: -0.005em; color: var(--navy-800); }
:focus-visible { outline: 3px solid var(--olive); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--olive-300); color: var(--navy-900); }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--card); color: var(--navy); padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Eyebrow labels ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--olive-700);
  margin-bottom: 18px;
}
.eyebrow-dark { color: var(--olive-300); }
.px { width: 8px; height: 8px; background: var(--olive); flex: none; box-shadow: 8px 8px 0 -4px transparent; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  font: 600 1rem/1 var(--font);
  text-decoration: none;
  border-radius: 999px; border: 1.5px solid transparent;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease-out), box-shadow 0.2s;
  cursor: pointer; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-light { background: var(--on-dark); color: var(--navy-900); }
.btn-light:hover { background: #fff; box-shadow: 0 0 0 4px rgba(201, 202, 164, 0.25); }
.btn-ghost { color: var(--on-dark); border-color: var(--on-dark-line); background: rgba(18, 23, 34, 0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--olive-300); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-800); box-shadow: 0 0 0 4px rgba(154, 155, 115, 0.3); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 0.9375rem; }
.btn-lg { min-height: 58px; padding: 0 30px; font-size: 1.0625rem; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  color: var(--on-dark);
  transition: background-color 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
.site-header.is-solid {
  background: rgba(23, 29, 42, 0.86);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 var(--on-dark-line);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand img { height: 22px; width: auto; }
@media (min-width: 1080px) { .brand img { height: 26px; } }
.nav { margin-left: auto; display: none; }
.nav ul { display: flex; gap: 6px; }
.nav a {
  display: block; padding: 8px 14px; border-radius: 999px;
  font-size: 0.9688rem; font-weight: 500; text-decoration: none; color: var(--on-dark-muted);
  transition: color 0.2s, background-color 0.2s;
}
.nav a:hover { color: #fff; background: rgba(238, 237, 228, 0.08); }
.nav a.is-active { color: #fff; }
.header-cta { display: none; }
@media (min-width: 900px) {
  .nav, .header-cta { display: flex; }
}

.menu-btn {
  margin-left: auto; width: 44px; height: 44px; position: relative;
  background: none; border: 0; color: inherit; cursor: pointer; border-radius: 10px;
}
.menu-btn span {
  position: absolute; left: 11px; width: 22px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s;
}
.menu-btn span:nth-child(1) { top: 15px; }
.menu-btn span:nth-child(2) { top: 21px; }
.menu-btn span:nth-child(3) { top: 27px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (min-width: 900px) { .menu-btn { display: none; } }

.mobile-menu {
  position: absolute; top: var(--header-h); left: 0; right: 0;
  background: rgba(23, 29, 42, 0.97);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--on-dark-line);
  padding: 8px var(--gutter) 24px;
  box-shadow: 0 30px 40px -20px rgba(0, 0, 0, 0.5);
}
.mobile-menu a:not(.btn) {
  display: block; padding: 14px 4px; font-size: 1.125rem; font-weight: 500; text-decoration: none;
  border-bottom: 1px solid var(--on-dark-line);
}
.mobile-menu .btn { margin-top: 20px; width: 100%; }
@media (min-width: 900px) { .mobile-menu { display: none !important; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: max(780px, 100svh); /* on short phones, a little taller than the screen so the art has room above the text */
  background: var(--navy-900);
  color: var(--on-dark);
  display: flex; align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
@media (min-width: 900px) { .hero { align-items: center; min-height: clamp(680px, 100svh, 980px); } }
.field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; image-rendering: pixelated; }
.hero::before {
  /* a soft shade behind the text block */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 70% at 18% 58%, rgba(18, 23, 34, 0.55), transparent 70%);
}
.hero::after {
  /* keep the header readable over the scene */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 140px; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(18, 23, 34, 0.55), transparent);
}
.hero-inner { padding-top: calc(var(--header-h) + 40px); padding-bottom: 96px; }
@media (min-width: 900px) { .hero-inner { padding-bottom: 40px; } }
.hero-copy { max-width: 620px; }
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  color: #fff;
  margin-bottom: 22px;
  text-wrap: balance;
}
.hero h1 em { color: var(--olive-300); }
.lede { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: var(--on-dark-muted); max-width: 540px; margin-bottom: 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Client logo strip ---------- */
.logos { padding: 8px 0 36px; }
.logos-inner { display: grid; gap: 22px; justify-items: center; text-align: center; }
.logos-label {
  margin: 0;
  font: 500 0.75rem/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.logo-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 28px 56px; }
.logo-row img { height: 44px; width: auto; filter: grayscale(1) contrast(1.1); opacity: 0.62; transition: filter 0.3s, opacity 0.3s; }
.logo-row li:nth-child(2) img { height: 52px; }
.logo-row li:nth-child(4) img { height: 22px; }
@media (max-width: 599px) {
  .logo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; justify-items: center; width: 100%; }
  .logo-row img { height: 36px; }
  .logo-row li:nth-child(2) img { height: 44px; }
  .logo-row li:nth-child(4) img { height: auto; width: 100%; max-width: 150px; }
}
.logo-row img:hover { filter: none; opacity: 1; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
@media (min-width: 900px) { .section { padding: 120px 0; } }
.section-white { background: var(--white); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { text-wrap: balance; }
.section-head-left { text-align: left; margin: 0 0 40px; }
.section-lede { color: var(--muted); font-size: 1.125rem; max-width: 600px; margin: 0 auto; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cards { display: grid; gap: 20px; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.service { padding: 32px 30px 30px; position: relative; display: flex; flex-direction: column; transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out); }
.service:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.service .icon { width: 56px; height: 56px; image-rendering: pixelated; margin-bottom: 26px; }
.card-num { position: absolute; top: 30px; right: 30px; margin: 0; font: 500 0.75rem/1 var(--mono); color: var(--muted); letter-spacing: 0.08em; }
.service p { color: var(--muted); font-size: 1rem; }
.ticks { display: grid; gap: 8px; margin-top: auto; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.ticks li { position: relative; padding-left: 22px; font-size: 0.9688rem; font-weight: 500; color: var(--ink); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; background: var(--olive);
}

/* ---------- Approach ---------- */
.approach { display: grid; gap: 64px; align-items: center; }
@media (min-width: 1000px) { .approach { grid-template-columns: 1.05fr 1fr; gap: 80px; } }
.steps { display: grid; gap: 4px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 22px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.step-num { font: 500 0.8125rem/1.9 var(--mono); color: var(--olive-700); letter-spacing: 0.06em; }
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); font-size: 1rem; }

.demo { margin: 0; }
.demo-stack { position: relative; padding: 0 0 0 0; max-width: 480px; margin: 0 auto; }
.demo-stack::before {
  /* dithered pixel backdrop behind the cards */
  content: ""; position: absolute; inset: -28px -20px 40px 40px; border-radius: 22px; z-index: 0;
  background-color: var(--olive-100);
  background-image:
    linear-gradient(45deg, rgba(154, 155, 115, 0.28) 25%, transparent 25%, transparent 75%, rgba(154, 155, 115, 0.28) 75%),
    linear-gradient(45deg, rgba(154, 155, 115, 0.28) 25%, transparent 25%, transparent 75%, rgba(154, 155, 115, 0.28) 75%);
  background-size: 8px 8px; background-position: 0 0, 4px 4px;
  -webkit-mask-image: linear-gradient(160deg, #000 20%, transparent 85%);
  mask-image: linear-gradient(160deg, #000 20%, transparent 85%);
}
.demo-card { position: relative; z-index: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.demo-back {
  width: 62%; margin-left: auto; padding: 18px 20px 22px; transform: translate(10px, 0) rotate(2.5deg);
  box-shadow: var(--shadow);
}
.demo-title-sm { margin: 0 0 12px; font: 500 0.6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.health { display: grid; gap: 8px; font-size: 0.875rem; font-weight: 500; }
.health li { display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; background: #5f9a6e; box-shadow: 0 0 0 3px rgba(95, 154, 110, 0.18); }
.demo-front { margin-top: -54px; padding: 24px 26px 24px; transform: rotate(-1deg); }
.demo-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.demo-head img { width: 40px; height: 40px; border-radius: 10px; }
.demo-from { margin: 0; font-weight: 650; font-size: 0.9688rem; line-height: 1.3; }
.demo-time { margin: 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.3; }
.demo-title { font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; color: var(--navy-800); margin-bottom: 10px; }
.demo-body { color: var(--muted); font-size: 0.9688rem; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; }
.chip-ok { background: #e6efe6; color: #3d6a48; }
.chip-ok::before { content: "✓"; font-weight: 700; }
.chip-warn { background: #f3eedc; color: #7a6326; }
.chip-warn::before { content: ""; width: 6px; height: 6px; background: currentColor; }
.demo figcaption { text-align: center; margin-top: 22px; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 0.9688rem; }

/* ---------- Clients ---------- */
.clients { display: grid; gap: 20px; }
@media (min-width: 680px) { .clients { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .clients { grid-template-columns: repeat(4, 1fr); } }
.client {
  display: flex; flex-direction: column; height: 100%;
  padding: 26px 24px 22px; text-decoration: none;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.3s;
}
.client:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.client-logo { height: 84px; display: grid; place-items: center; margin-bottom: 22px; border-radius: var(--radius-sm); background: var(--paper); }
.client-logo img { max-height: 50px; max-width: 78%; width: auto; height: auto; object-fit: contain; }
.client-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.client-meta dt { font: 500 0.6875rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.client-meta dd { font-weight: 600; font-size: 0.9688rem; color: var(--navy-800); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tags li { font-size: 0.8125rem; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--olive-100); color: #4c4d2e; }
.client-link { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line-strong); font-size: 0.875rem; font-weight: 600; color: var(--navy); }
.client:hover .client-link span { display: inline-block; transform: translate(2px, -2px); transition: transform 0.2s; }

/* ---------- About ---------- */
.about { position: relative; background: var(--navy-900); color: var(--on-dark); isolation: isolate; overflow: hidden; padding: 150px 0; }
@media (min-width: 900px) { .about { padding: 180px 0; } }
.about-inner { display: grid; gap: 56px; align-items: center; }
@media (min-width: 1000px) { .about-inner { grid-template-columns: 1.1fr 1fr; gap: 80px; } }
.about h2 { color: #fff; text-wrap: balance; }
.about h2 em { color: var(--olive-300); }
.about-copy p { color: var(--on-dark-muted); max-width: 560px; }
.stats { display: grid; gap: 14px; }
.stat {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 20px;
  padding: 22px 26px; border-radius: var(--radius);
  background: rgba(18, 23, 34, 0.55); border: 1px solid var(--on-dark-line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.stat dt { grid-column: 1; font-weight: 600; font-size: 1.0625rem; color: #fff; }
.stat dd { grid-column: 2; grid-row: 1 / span 2; font-family: var(--serif); font-size: clamp(2.6rem, 5vw, 3.4rem); line-height: 1; color: #fff; font-variant-numeric: lining-nums tabular-nums; }
.stat .plus { color: var(--olive-300); }
.stat p { grid-column: 1; margin: 0; font-size: 0.9375rem; color: var(--on-dark-muted); }

/* ---------- Contact ---------- */
.contact-card {
  display: grid; gap: 40px;
  background: var(--card); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg);
  padding: 40px 28px;
}
@media (min-width: 900px) { .contact-card { grid-template-columns: 1.4fr 1fr; padding: 64px; gap: 64px; align-items: center; } }
.contact-main p { color: var(--muted); max-width: 520px; margin-bottom: 28px; }
.contact-main .btn { white-space: normal; }
.contact-side { padding: 28px; border-radius: var(--radius); background: var(--paper); }
.side-label { font: 500 0.75rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--olive-700); margin-bottom: 4px; }
.contact-side .ticks { border-top: 0; padding-top: 14px; gap: 12px; }

/* ---------- Footer ---------- */
.site-footer { position: relative; background: var(--navy-900); color: var(--on-dark-muted); isolation: isolate; padding-top: 230px; overflow: hidden; }
.band { height: 240px !important; bottom: auto !important; }
.footer-inner { display: grid; gap: 28px; padding-bottom: 40px; padding-top: 28px; }
@media (min-width: 900px) { .footer-inner { grid-template-columns: 1fr auto; align-items: center; } }
.footer-brand img { height: 24px; width: auto; margin-bottom: 10px; }
.footer-brand p { margin: 0; font-size: 0.9375rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 0.9375rem; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.copyright { grid-column: 1 / -1; margin: 0; font-size: 0.8125rem; color: rgba(238, 237, 228, 0.5); }

/* ---------- Scroll-in (only when motion is OK and JS runs) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}
