/* ==========================================================================
   KINANA ICT — main.css
   Design tokens, reset, base typography, layout primitives.
   Brand system derived from the KINANA identity (connected-node sphere,
   azure blue, charcoal ink) and modernized for a 2026 enterprise AI brand.
   ========================================================================== */

/* ---------- Mobile viewport integrity ------------------------------------
   The mobile drawer is parked off-screen with transform: translateX(100%),
   which is the right way to animate it but leaves a full viewport width of
   content sitting to the right of the fold. That counted as page width: on a
   390px phone the document laid out at 528px, and because the header
   right-aligns its contents, THE HAMBURGER LANDED AT x=464 - past the edge of
   the screen, unreachable. The menu was not missing, it was off the page.

   Clip the horizontal overflow and the header snaps back to the real width.
   'clip' rather than 'hidden' because hidden turns <html> into a scroll
   container, which breaks the sticky header; clip does not. hidden is kept
   as the fallback for browsers without clip (pre-2021).
   Verified at 360 / 390 / 414 / 480px: toggle right edge now 370 < 390. */
html { overflow-x: hidden; }
@supports (overflow-x: clip) { html { overflow-x: clip; } }

/* ---------- Color scheme -------------------------------------------------
   Samsung Internet and Chrome will auto-darken a page that does not say it
   has a scheme, inverting backgrounds and washing out the logo. The site has
   its own dark sections and a white logo lockup, so it must opt out: 'only
   light' tells the browser this page is already designed and not to repaint
   it. Paired with <meta name="color-scheme" content="light"> in each head,
   which takes effect before CSS loads and so avoids a flash of inverted
   colors. */
:root { color-scheme: only light; }

/* ---------- Design tokens ------------------------------------------------ */
:root {
  /* Brand — azure blue family (from the KINANA sphere/lines) */
  --k-blue-700: #0B6FA4;
  --k-blue-600: #0E86C3;
  --k-blue-500: #16A6DE;   /* brand primary */
  --k-blue-400: #3FBBEA;
  --k-blue-300: #7FD2F1;

  /* Navy — deep enterprise backgrounds */
  --k-navy-950: #05121F;
  --k-navy-900: #071B2E;
  --k-navy-800: #0A2740;
  --k-navy-700: #0E3557;

  /* Intelligence accent — cyan (the "AI thread") */
  --k-cyan-500: #17C4E0;
  --k-cyan-400: #2FD3E8;
  --k-cyan-300: #6FE3F1;

  /* Positive accent — echoes the deck's green */
  --k-green-500: #1FB25A;
  --k-green-400: #3ECB76;

  /* Ink & slate neutrals */
  --k-ink: #0E1722;
  --k-slate-800: #1E293B;
  --k-slate-700: #334155;
  --k-slate-600: #475569;
  --k-slate-500: #64748B;
  --k-slate-400: #94A3B8;
  --k-slate-300: #CBD5E1;
  --k-slate-200: #E2E8F0;
  --k-slate-100: #F1F5F9;

  /* Surfaces */
  --k-bg: #FFFFFF;
  --k-bg-soft: #F6F9FC;
  --k-bg-alt: #EDF4FB;
  --k-white: #FFFFFF;
  --k-line: #E4EBF3;

  /* Semantic */
  --k-text: var(--k-slate-800);
  --k-text-muted: var(--k-slate-500);
  --k-heading: var(--k-ink);

  /* Heritage — sampled straight from the KINANA logo artwork */
  --k-menu-text: #D4E8FF;   /* original menu-bar label blue */
  --k-logo-ink: #383737;    /* the charcoal of the wordmark + arrow */
  --k-logo-blue: #417ABE;   /* the tagline blue */

  /* Gradients */
  --k-grad-brand: linear-gradient(120deg, var(--k-blue-600) 0%, var(--k-cyan-400) 100%);
  --k-grad-brand-soft: linear-gradient(120deg, var(--k-blue-500) 0%, var(--k-cyan-400) 100%);
  --k-grad-hero: radial-gradient(1200px 600px at 78% -10%, rgba(47, 211, 232, 0.20), transparent 60%),
                 radial-gradient(900px 500px at 10% 110%, rgba(22, 166, 222, 0.18), transparent 55%),
                 linear-gradient(160deg, var(--k-navy-950) 0%, var(--k-navy-900) 45%, var(--k-navy-800) 100%);
  --k-grad-ink: linear-gradient(160deg, var(--k-navy-900), var(--k-navy-800));

  /* Typography */
  --k-font-body: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --k-font-display: "Sora", "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;

  /* Radii */
  --k-r-sm: 8px;
  --k-r-md: 14px;
  --k-r-lg: 20px;
  --k-r-xl: 28px;
  --k-r-pill: 999px;

  /* Shadows */
  --k-shadow-sm: 0 1px 2px rgba(14, 23, 34, 0.06), 0 1px 3px rgba(14, 23, 34, 0.05);
  --k-shadow-md: 0 10px 30px -12px rgba(11, 42, 64, 0.25);
  --k-shadow-lg: 0 30px 60px -24px rgba(11, 42, 64, 0.35);
  --k-shadow-glow: 0 20px 60px -20px rgba(22, 166, 222, 0.45);

  /* Layout */
  --k-maxw: 1240px;
  --k-maxw-narrow: 880px;
  --k-gutter: clamp(20px, 5vw, 48px);
  --k-section-y: clamp(64px, 9vw, 128px);

  /* Motion */
  --k-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --k-dur: 0.5s;

  /* Tall enough for the brand lockup and the menu rail to breathe */
  --k-header-h: 84px;
}

/* ---------- Reset -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  font-family: var(--k-font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--k-text);
  background: var(--k-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
img { border-style: none; }

a { color: var(--k-blue-600); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--k-blue-500); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

ul, ol { list-style: none; padding: 0; }

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

/* ---------- Typography --------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--k-font-display);
  color: var(--k-heading);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); }
h3 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
h4 { font-size: 1.18rem; }

p { color: var(--k-text); }
p + p { margin-top: 1em; }

.lead {
  font-size: clamp(1.08rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--k-slate-600);
}

strong { font-weight: 650; color: var(--k-slate-800); }

.text-gradient {
  background: var(--k-grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Layout primitives -------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--k-maxw);
  margin-inline: auto;
  padding-inline: var(--k-gutter);
}
.container--narrow { max-width: var(--k-maxw-narrow); }

.section { padding-block: var(--k-section-y); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }
.section--soft { background: var(--k-bg-soft); }
.section--alt { background: var(--k-bg-alt); }
.section--ink {
  background: var(--k-grad-ink);
  color: var(--k-slate-300);
}
.section--ink h1, .section--ink h2, .section--ink h3, .section--ink h4 { color: #fff; }

.stack > * + * { margin-top: 1.1rem; }
.stack-lg > * + * { margin-top: 1.8rem; }

/* Grid helpers */
.grid { display: grid; gap: clamp(20px, 2.4vw, 32px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Section intro block */
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { margin-bottom: 16px; }
.section-head p { margin-top: 16px; color: var(--k-slate-500); font-size: 1.1rem; }
.section--ink .section-head p { color: var(--k-slate-400); }

/* Eyebrow / kicker */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--k-font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--k-blue-600);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--k-grad-brand);
  border-radius: 2px;
}
.section--ink .eyebrow { color: var(--k-cyan-300); }

/* Utility */
.center { text-align: center; }
.muted { color: var(--k-text-muted); }
.mx-auto { margin-inline: auto; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px;
  background: var(--k-navy-900); color: #fff;
  padding: 10px 18px; border-radius: 8px; z-index: 200;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; color: #fff; }

/* Reveal-on-scroll: content is VISIBLE BY DEFAULT; the entrance animation is
   a pure enhancement added by animations.js. If JS never runs (or an observer
   misfires), the page still renders fully — nothing can hide content. */
.reveal { opacity: 1; transform: none; }
.reveal.is-visible { animation: kinReveal 0.7s var(--k-ease) both; }
.reveal.is-visible[data-delay="1"] { animation-delay: 0.08s; }
.reveal.is-visible[data-delay="2"] { animation-delay: 0.16s; }
.reveal.is-visible[data-delay="3"] { animation-delay: 0.24s; }
.reveal.is-visible[data-delay="4"] { animation-delay: 0.32s; }
@keyframes kinReveal {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-visible { opacity: 1 !important; transform: none !important; animation: none !important; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
