/* ==========================================================================
   Kairo Agency - shared design system
   Tokens first, then primitives, then page sections.
   ========================================================================== */

:root {
  /* THE POSTER SYSTEM (2026-10-26, approved from brand/kairo/mock/home_mockup.html).
     The FRAME (nav, text, buttons, labels) is always Press Black on Paper. Colour lives
     only in poster sections, each printed from the Kairo ink set (two inks at most):
       Laser Orange #E2520F  Coordinate Sky #CFDDE6  Keycap Cobalt #2F5BD3
       Periwinkle #8C95E8    Sunflower #F2C230
     The site is deliberately LIGHT ONLY, like a printed object, so there is no dark block.
     Legacy token names: --ink is the page ground; --green* now hold Press Black, so every
     label, italic, stamp and primary button that used the old accent prints in black. */
  --ink:        #F6F4EF;
  --ink-2:      #EFECE5;
  --surface:    #FBFAF7;
  --surface-2:  #F3F1EB;
  --cell:       #FFFFFF;
  --line:       rgba(var(--ov), 0.14);
  --line-2:     rgba(var(--ov), 0.24);
  --ov:          20, 20, 20;
  --hi:          255, 255, 255;
  --ground-rgb:  246, 244, 239;
  --surface-rgb: 251, 250, 247;

  /* type */
  --text:       #141414;
  --text-2:     #4B4A47;
  --text-3:     #7A7873;

  --green:      #141414;
  --green-fill: #141414;
  --green-2:    #2F5BD3;
  --green-soft: #FBE3D8;
  --violet:     var(--green);
  --violet-2:   var(--green-2);
  --mint:       var(--green-2);
  --amber:      #A8743A;
  --accent:     var(--green);
  /* the ink set */
  --orange:     #E2520F;
  --signal:     #E2520F;
  --sky:        #CFDDE6;
  --cobalt:     #2F5BD3;
  --peri:       #8C95E8;
  --sun:        #F2C230;
  --sky-ground: #CFDDE6;
  --lilac-ground: #DFE2FA;
  color-scheme: light;

  /* geometry: square-cornered, like crossword cells */
  --r-sm: 2px;
  --r-md: 3px;
  --r-lg: 4px;
  --r-xl: 6px;
  --maxw: 1180px;
  --gutter: 24px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 180ms;
  --mid: 420ms;
  --slow: 900ms;

  /* fonts */
  /* --font-sans keeps its name but now holds the brand's text face (Newsreader) */
  --font-sans: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-pixel: "Doto", "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ambient background: plain newsprint with a fine paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* cursor glow, pointer devices only */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px; height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 82, 15, 0.05), transparent 62%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 600ms var(--ease);
}
.cursor-glow.on { opacity: 1; }
/* over the home hero the lit dots are the cool inks, so the glow under them is cool too */
body:has(.home-hero:hover) .cursor-glow { background: radial-gradient(circle, rgba(31, 122, 140, 0.06), transparent 62%); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }

::selection { background: var(--green-soft); }

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
}

.section {
  padding-block: clamp(72px, 10vw, 140px);
  position: relative;
}

.section--tight { padding-block: clamp(48px, 6vw, 84px); }

.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  border: 0;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
/* one green pixel, the brand's cell at its smallest */
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--green);
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variation-settings: "opsz" 72;
  text-wrap: balance;
}

.display {
  font-size: clamp(42px, 7.4vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.display em, .h2 em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--green);
}

.h2 { font-size: clamp(30px, 4.4vw, 54px); }
.h3 { font-size: clamp(20px, 2.2vw, 27px); }

.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-2);
  max-width: 62ch;
  line-height: 1.55;
}

.muted { color: var(--text-2); }
.dim   { color: var(--text-3); }
.mono  { font-family: var(--font-mono); font-size: 0.86em; letter-spacing: 0; }

/* --------------------------------------------------------------------------
   Buttons + chips
   -------------------------------------------------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--text);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  overflow: hidden;
  transition: transform var(--fast) var(--ease), border-color var(--fast), background var(--fast), color var(--fast);
}
.btn:hover { transform: translateY(-2px); background: var(--text); color: var(--ink); }
.btn:active { transform: translateY(0); }

.btn--primary {
  border-color: var(--green-fill);
  background: var(--green-fill);
  color: #fff;
}
.btn--primary:hover { background: var(--ink); border-color: var(--text); color: var(--text); }

.btn--ghost { background: transparent; }

.btn .arrow { transition: transform var(--mid) var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: rgba(var(--ov), 0.025);
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--violet-2); }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 26px;
  overflow: hidden;
  transition: border-color var(--mid) var(--ease), transform var(--mid) var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(226, 82, 15, 0.5), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--mid) var(--ease);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover { transform: translateY(-3px); }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--slow) var(--ease-out), transform var(--slow) var(--ease-out);
  transition-delay: var(--d, 0ms);
}
[data-reveal].in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(var(--ground-rgb), 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color var(--mid), background var(--mid);
}
.nav.stuck {
  border-bottom-color: var(--line);
  background: rgba(var(--ground-rgb), 0.82);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-pixel);
  font-variation-settings: "ROND" 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* logo direction E: the clock-K, a clock at 1:22 whose hands draw a K (Pulse palette, flat).
   The 15-cell dial below 32px, the 21-cell dial with quarter ticks from 32px; files written by
   _build/logo.py. Flat is four colours and is never recoloured, so no filters on it. */
.brand__mark {
  width: 26px; height: 26px;
  background: url("logo-k15.svg?v=c09ba285") center / contain no-repeat;
  image-rendering: pixelated;
  flex: none;
}
.brand__mark--lg { width: 42px; height: 42px; background-image: url("logo-k21.svg?v=c8b41dca"); }
.brand small {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.08em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__links a {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color var(--fast), background var(--fast);
}
.nav__links a:hover { color: var(--green); }
.nav__links a.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--green); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 44px 56px;
  color: var(--text-3);
  font-size: 14px;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.footer a:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  :root { --gutter: 18px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .nav__links a { padding: 8px 10px; font-size: 13.5px; }
  .brand small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---- floating inquiry button (assets/inquire.js) -------------------------- */
#quoteForm, #auditForm, #pricing { scroll-margin-top: 96px; }

.enquire {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px 12px 15px;
  border-radius: 999px;
  background: var(--green-fill);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 10px 30px -6px rgba(226, 82, 15, 0.6), 0 0 0 1px rgba(14, 17, 15, 0.12) inset;
  opacity: 0;
  transform: translateY(14px) scale(0.92);
  pointer-events: none;
  transition: opacity var(--mid) var(--ease), transform var(--mid) var(--ease), background var(--fast);
}
.enquire--on { opacity: 1; transform: none; pointer-events: auto; }
.enquire:hover { background: var(--violet-2); }
.enquire:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.enquire svg { flex: none; }

/* small screens: icon only */
@media (max-width: 560px) {
  .enquire { padding: 14px; }
  .enquire__label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .enquire { transition: opacity var(--fast); transform: none; }
}
body:has(.nav.menu-open) .enquire { display: none; }

/* the HTML hidden attribute must win over component display rules */
[hidden] { display: none !important; }
