/* ==========================================================================
   Keshav Chemicals — base.css
   Tokens, reset, typography, layout, buttons, forms, header, footer.
   Page-specific styles live in their own file (home.css, etc.).
   ========================================================================== */

/* ---------- Fonts (self-hosted, OFL) ----------
   Archivo variable: weight 100–900, width 62–125%.
   Wide cuts for display, normal width for reading. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"),
       url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations"),
       url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F,
                 U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  /* Colour: taken from the KC logo, tuned for screen */
  --kc-navy:   #1F2E64;  /* dark surfaces, footer */
  --kc-ink:    #18234A;  /* body text on light */
  --kc-royal:  #1843B8;  /* logo royal blue: buttons, links */
  --kc-royal-dark: #12348F;
  --kc-sky:    #61CFF5;  /* logo cyan: accents on dark only */
  --kc-zinc:   #F2F4F7;  /* zinc white page ground */
  --kc-white:  #FFFFFF;
  --kc-steel:  #56627C;  /* secondary text (AA on zinc and white) */
  --kc-line:   #D3D9E3;  /* rules and borders on light */
  --kc-line-dark: rgba(255, 255, 255, .18);
  --kc-error:  #B3261E;
  --kc-ok:     #1E7A4C;

  /* Type */
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wide: 118%;        /* display width */
  --wider: 125%;
  --step--1: 0.875rem;   /* 14 */
  --step-0:  1.0625rem;  /* 17 body */
  --step-1:  1.25rem;    /* 20 */
  --step-2:  clamp(1.375rem, 1.2rem + .6vw, 1.625rem);   /* 22–26 */
  --step-3:  clamp(1.75rem, 1.4rem + 1.3vw, 2.25rem);    /* 28–36 */
  --step-4:  clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem);    /* 36–52 */
  --step-5:  clamp(2.75rem, 1.6rem + 4.6vw, 5.5rem);     /* 44–88 */

  /* Space */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: clamp(4.5rem, 3rem + 6vw, 8rem);  /* section rhythm */

  /* Layout */
  --wrap: 78rem;
  --gutter: clamp(1rem, .5rem + 2.5vw, 2.5rem);
  --measure: 34em;

  /* Shape: square-shouldered, like sack labels and steel. Small radius on controls only. */
  --radius-control: 3px;

  --header-h: 5.25rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  font-stretch: 100%;
  line-height: 1.6;
  color: var(--kc-ink);
  background: var(--kc-zinc);
  font-kerning: normal;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, address { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
address { font-style: normal; }
a { color: var(--kc-royal); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--kc-royal-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 3px solid var(--kc-royal);
  outline-offset: 3px;
}
.on-dark :focus-visible,
.site-header.is-overlay:not(.is-solid) :focus-visible { outline-color: var(--kc-sky); }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--kc-white); color: var(--kc-ink); font-weight: 600;
}
.skip-link:focus { top: var(--space-4); }

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

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

/* ---------- Typography ---------- */
.display,
h1, h2 {
  font-stretch: var(--wide);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 {
  font-size: var(--step-2);
  font-stretch: 108%;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  max-width: var(--measure);
}
.prose p + p { margin-top: var(--space-4); }
.prose { max-width: var(--measure); }
.muted { color: var(--kc-steel); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--space-9); }
.section--white { background: var(--kc-white); }
.section--navy { background: var(--kc-navy); color: var(--kc-white); }
.section__head { max-width: 46rem; margin-bottom: var(--space-7); }
.section__head h2 + p { margin-top: var(--space-5); }

.on-dark { color: var(--kc-white); }
.on-dark a { color: var(--kc-white); }
.on-dark .muted { color: #C3CBE0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 3rem;
  padding: .75rem 1.375rem;
  border: 2px solid transparent;
  border-radius: var(--radius-control);
  font-size: 1rem;
  font-weight: 650;
  font-stretch: 108%;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn--primary { background: var(--kc-royal); color: var(--kc-white); }
.btn--primary:hover { background: var(--kc-royal-dark); color: var(--kc-white); }
.btn--light { background: var(--kc-white); color: var(--kc-navy); }
.btn--light:hover { background: var(--kc-sky); color: var(--kc-navy); }
.btn--outline { border-color: currentColor; color: var(--kc-ink); background: transparent; }
.btn--outline:hover { background: var(--kc-ink); color: var(--kc-white); border-color: var(--kc-ink); }
.on-dark .btn--outline { color: var(--kc-white); }
.on-dark .btn--outline:hover { background: var(--kc-white); color: var(--kc-navy); border-color: var(--kc-white); }

.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .3em;
}

/* ---------- Forms ---------- */
.field { display: grid; gap: var(--space-2); }
.field label { font-size: .9375rem; font-weight: 600; }
.field__hint { font-size: var(--step--1); color: var(--kc-steel); }
.input, .select, .textarea {
  width: 100%;
  min-height: 3rem;
  padding: .7rem .875rem;
  background: var(--kc-white);
  border: 1.5px solid #B5BFCF;
  border-radius: var(--radius-control);
  color: var(--kc-ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { min-height: 7.5rem; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--kc-steel); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--kc-royal);
  box-shadow: 0 0 0 3px rgba(24, 67, 184, .22);
}
.select {
  appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2318234A' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}
.field--error .input, .field--error .select, .field--error .textarea { border-color: var(--kc-error); }
.field__error { font-size: var(--step--1); color: var(--kc-error); font-weight: 600; }

/* Honeypot: hidden from people, visible to naive bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Header ----------
   Glass bar. The blur lives on ::before, not on the header itself:
   backdrop-filter on the header would trap the fixed mobile menu inside it. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  isolation: isolate;
  color: var(--kc-ink);
  transition: transform .35s var(--ease), color .3s var(--ease);
}
.site-header::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, .78);
  border-bottom: 1px solid rgba(24, 35, 74, .1);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  transition: background-color .35s var(--ease), border-color .35s var(--ease);
}
.site-header.is-overlay {
  position: fixed; left: 0; right: 0;
  color: var(--kc-white);
}
.site-header.is-overlay::before {
  background: linear-gradient(180deg, rgba(14, 22, 56, .42) 0%, rgba(14, 22, 56, .16) 100%);
  border-bottom-color: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}
.site-header.is-overlay.is-solid { color: var(--kc-ink); }
.site-header.is-overlay.is-solid::before {
  background: rgba(255, 255, 255, .8);
  border-bottom-color: rgba(24, 35, 74, .1);
  box-shadow: 0 10px 30px -18px rgba(14, 22, 56, .35);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header::before,
  .site-header.is-overlay.is-solid::before { background: var(--kc-white); }
  .site-header.is-overlay::before { background: rgba(20, 30, 70, .9); }
}
.site-header.is-hidden { transform: translateY(-100%); }

.utility-bar {
  font-size: .8125rem;
  border-bottom: 1px solid rgba(24, 35, 74, .1);
  color: var(--kc-steel);
}
.is-overlay:not(.is-solid) .utility-bar {
  border-bottom-color: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .85);
}
.utility-bar__inner {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-5);
  min-height: 2.25rem;
}
.utility-bar__contact { display: flex; gap: var(--space-5); }
.utility-bar a { color: inherit; text-decoration: none; }
.utility-bar a:hover { text-decoration: underline; }

.site-header__main {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  min-height: var(--header-h);
}
.brand { display: block; flex: none; }
.brand__logo { width: auto; height: 3.25rem; }
.brand__logo--white { display: none; }
.is-overlay:not(.is-solid) .brand__logo--color { display: none; }
.is-overlay:not(.is-solid) .brand__logo--white { display: block; }

.site-nav { display: flex; align-items: center; gap: var(--space-6); }
.site-nav__list { display: flex; gap: var(--space-5); }
.site-nav__list a {
  display: block;
  padding-block: var(--space-2);
  color: inherit;
  font-weight: 550;
  font-stretch: 106%;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav__list a:hover,
.site-nav__list a[aria-current="page"] { border-bottom-color: currentColor; }
.is-overlay:not(.is-solid) .site-nav__cta { background: var(--kc-white); color: var(--kc-navy); }
.is-overlay:not(.is-solid) .site-nav__cta:hover { background: var(--kc-sky); }

.nav-toggle {
  display: none;
  align-items: center; gap: var(--space-3);
  min-height: 2.75rem; padding: 0 var(--space-3);
  background: none; border: 0; color: inherit; cursor: pointer;
  font-weight: 600;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block; width: 22px; height: 2px; background: currentColor;
  transition: transform .25s var(--ease), opacity .2s;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1060px) {
  .utility-bar__note { display: none; }
  .utility-bar__inner { justify-content: flex-end; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; inset: 0 0 0 auto;
    width: min(24rem, 100%);
    flex-direction: column; align-items: stretch; gap: var(--space-6);
    padding: calc(var(--header-h) + 2.5rem) var(--gutter) var(--space-6);
    background: var(--kc-navy); color: var(--kc-white);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .35s var(--ease), visibility 0s linear .35s;
    z-index: -1;
  }
  .site-nav.is-open { transform: none; visibility: visible; transition: transform .35s var(--ease); }
  .site-nav__list { flex-direction: column; gap: 0; }
  .site-nav__list a {
    padding-block: var(--space-4);
    font-size: var(--step-2);
    font-stretch: var(--wide);
    border-bottom: 1px solid var(--kc-line-dark);
  }
  .site-nav__list a:hover,
  .site-nav__list a[aria-current="page"] { border-bottom-color: var(--kc-sky); color: var(--kc-sky); }
  .site-nav__cta,
  .is-overlay:not(.is-solid) .site-nav__cta { background: var(--kc-white); color: var(--kc-navy); }
  body.nav-open .site-header { color: var(--kc-white); }
  body.nav-open .site-header::before {
    background: transparent; border-bottom-color: transparent; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  body.nav-open .brand__logo--color { display: none; }
  body.nav-open .brand__logo--white { display: block; }
  body.nav-open { overflow: hidden; }
}
@media (max-width: 560px) {
  .utility-bar { display: none; }
  .brand__logo { height: 2.5rem; }
  :root { --header-h: 4.25rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--kc-navy);
  color: #D5DBEC;
  padding-top: var(--space-8);
  font-size: .9375rem;
}
/* Slow, endless gradient: three soft light pools in the brand blues drifting
   behind the footer, plus a moving gradient line along the top edge. */
.site-footer__glow {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  background: linear-gradient(160deg, #1A275A 0%, #1F2E64 45%, #18245A 100%);
}
.site-footer__glow span {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.site-footer__glow span:nth-child(1) {
  width: 60vw; height: 60vw; left: -18vw; top: -30vw;
  background: radial-gradient(circle, rgba(24, 67, 184, .75) 0%, rgba(24, 67, 184, 0) 65%);
  animation: kc-pool-a 22s ease-in-out infinite alternate;
}
.site-footer__glow span:nth-child(2) {
  width: 46vw; height: 46vw; right: -12vw; top: -8vw;
  background: radial-gradient(circle, rgba(97, 207, 245, .45) 0%, rgba(97, 207, 245, 0) 65%);
  animation: kc-pool-b 28s ease-in-out infinite alternate;
}
.site-footer__glow span:nth-child(3) {
  width: 52vw; height: 52vw; left: 28vw; bottom: -34vw;
  background: radial-gradient(circle, rgba(40, 90, 210, .55) 0%, rgba(40, 90, 210, 0) 65%);
  animation: kc-pool-c 25s ease-in-out infinite alternate;
}
.site-footer::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--kc-navy), var(--kc-royal), var(--kc-sky), var(--kc-royal), var(--kc-navy));
  background-size: 200% 100%;
  animation: kc-line 8s linear infinite;
}
@keyframes kc-pool-a {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(22vw, 12vw) scale(1.15); }
  100% { transform: translate(40vw, -4vw) scale(.95); }
}
@keyframes kc-pool-b {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-26vw, 16vw) scale(1.2); }
  100% { transform: translate(-10vw, 30vw) scale(.9); }
}
@keyframes kc-pool-c {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-30vw, -14vw) scale(1.1); }
  100% { transform: translate(14vw, -22vw) scale(1.25); }
}
@keyframes kc-line {
  from { background-position: 0% 0; }
  to   { background-position: 200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .site-footer__glow span, .site-footer::before { animation: none; }
}
.site-footer a { color: var(--kc-white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr .8fr;
  gap: var(--space-7) var(--space-6);
}
.site-footer__logo { height: 3.25rem; width: auto; margin-bottom: var(--space-5); }
.site-footer__brand p { max-width: 22rem; }
.site-footer__heading {
  font-size: 1rem;
  font-stretch: 112%;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--kc-white);
  margin-bottom: var(--space-4);
}
.site-footer__list { display: grid; gap: var(--space-2); }
.site-footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-8);
  padding-block: var(--space-5);
  border-top: 1px solid var(--kc-line-dark);
  font-size: var(--step--1);
  color: #AEB8D2;
}
@media (max-width: 900px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}

/* ---------- Preloader ----------
   Shown from first paint. main.js draws the particle logo and removes it.
   If the script never runs, it fades away on its own after 6s. */
.preloader {
  position: fixed; inset: 0; z-index: 200;
  pointer-events: none;
  animation: kc-pre-failsafe .5s ease 6s forwards;
}
.preloader__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 50%, rgba(24, 67, 184, .45) 0%, rgba(24, 67, 184, 0) 70%),
    var(--kc-navy);
}
.preloader__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes kc-pre-failsafe { to { opacity: 0; visibility: hidden; } }
html.is-preloading { overflow: hidden; }
html.is-preloading .site-header .brand { opacity: 0; }
.site-header .brand { transition: opacity .45s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .preloader { display: none; }
}

/* ---------- WhatsApp floating button ---------- */
.wa-float {
  position: fixed;
  right: clamp(1rem, .6rem + 1.2vw, 1.75rem);
  bottom: clamp(1rem, .6rem + 1.2vw, 1.75rem);
  z-index: 90;
  display: flex; align-items: center; gap: .6rem;
  height: 3.5rem;
  padding: 0 .95rem;
  border-radius: 999px;
  background: #25D366;
  color: var(--kc-white);
  text-decoration: none;
  box-shadow: 0 12px 28px -8px rgba(18, 140, 70, .55), 0 4px 10px rgba(0, 0, 0, .12);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s var(--ease);
}
.wa-float::before {                       /* soft ring that pulses outward */
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, .55);
  animation: kc-wa-ring 2.4s ease-out infinite;
  pointer-events: none;
}
.wa-float svg { flex: none; width: 1.6rem; height: 1.6rem; }
.wa-float__label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: .9375rem;
  font-weight: 650;
  transition: max-width .4s var(--ease), margin .4s var(--ease);
}
.wa-float:hover,
.wa-float:focus-visible {
  color: var(--kc-white);
  background: #1EBE5A;
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -8px rgba(18, 140, 70, .6), 0 4px 10px rgba(0, 0, 0, .12);
}
.wa-float:hover .wa-float__label,
.wa-float:focus-visible .wa-float__label { max-width: 9rem; margin-right: .2rem; }
.wa-float:focus-visible { outline: 3px solid var(--kc-navy); outline-offset: 3px; }
@keyframes kc-wa-ring {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
}
html.is-preloading .wa-float { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .wa-float::before { animation: none; }
}
@media print { .wa-float { display: none; } }
