/* ==========================================================
   Karan Controls — switchgear & control panels
   Palette taken from the company logo: signal red + electric blue
   ========================================================== */
:root {
  --kc-red: #e31e24;
  --kc-red-dark: #b8151b;
  --kc-blue: #1b1bd1;
  --kc-blue-dark: #14149e;
  --ink: #12171b;
  --ink-2: #1e262c;
  --muted: #5c666e;
  --ground: #f1f3f2;
  --surface: #ffffff;
  --surface-2: #e9ecec;
  --line: #d9deddff;
  --ok: #1b7f5a;
  --on-dark: #eef1f1;
  --on-dark-muted: #a9b3b7;

  --display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;

  --maxw: 1180px;
  --shadow: 0 12px 34px rgba(18, 23, 27, .10);
  --radius: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 17px/1.65 var(--body); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--kc-blue); text-decoration: none; }
a:hover { color: var(--kc-red); }
:focus-visible { outline: 3px solid var(--kc-blue); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.15; color: var(--ink); margin: 0; text-wrap: balance; }
p { margin: 0 0 1rem; }
.container { max-width: var(--maxw); margin: 0 auto; padding-inline: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 600 .95rem/1 var(--body); letter-spacing: .01em;
  padding: 15px 24px; border-radius: var(--radius); border: 2px solid transparent; cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.btn-red { background: var(--kc-red); color: #fff; }
.btn-red:hover { background: var(--kc-red-dark); color: #fff; }
.btn-blue { background: var(--kc-blue); color: #fff; }
.btn-blue:hover { background: var(--kc-blue-dark); color: #fff; }
.btn-outline { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-outline:hover { border-color: var(--kc-red); color: var(--kc-red); }
.btn-ghost-light { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost-light:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* ---------- Top bar ---------- */
.topbar { background: var(--ink); color: var(--on-dark-muted); font: 400 .85rem/1 var(--body); }
.topbar .container { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; padding-block: 10px; }
.topbar a { color: var(--on-dark-muted); display: inline-flex; align-items: center; gap: .45rem; }
.topbar a:hover { color: #fff; }
.topbar .chips { margin-left: auto; display: flex; gap: 8px; }
.topbar .chip {
  font: 600 .72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--on-dark); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 6px 10px;
}
.topbar .chip.ok { border-color: rgba(27,127,90,.7); color: #7fd9b4; }
@media (max-width: 720px) { .topbar .chips { display: none; } }

/* ---------- Header / nav ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header.scrolled { box-shadow: 0 6px 18px rgba(18,23,27,.09); }
.header-inner { display: flex; align-items: center; gap: 20px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 52px; width: auto; }
.brand .word { font-family: var(--display); font-weight: 700; font-size: 1.22rem; letter-spacing: -.01em; color: var(--ink); line-height: 1.05; }
.brand .word small { display: block; font: 600 .66rem/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  font: 600 .92rem/1 var(--body); color: var(--ink); padding: 12px 13px; border-radius: var(--radius);
  position: relative; white-space: nowrap;
}
.nav a:hover { color: var(--kc-red); }
.nav a.active { color: var(--kc-red); }
.nav a.active::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 3px; background: var(--kc-red); }
.nav .btn { margin-left: 10px; padding: 12px 18px; }
.nav-toggle { display: none; margin-left: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: var(--ink); content: ""; position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%; background: var(--surface);
    border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 20px 18px; box-shadow: var(--shadow);
  }
  .nav[hidden] { display: none; }
  .nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a.active::after { left: 4px; right: auto; width: 24px; bottom: 6px; }
  .nav .btn { margin: 14px 0 0; justify-content: center; }
}

/* ---------- Section plate heading ---------- */
.plate { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.plate .code {
  font: 600 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #fff;
  background: var(--ink); padding: 7px 10px; border-radius: 2px;
}
.plate .code.red { background: var(--kc-red); }
.plate .code.blue { background: var(--kc-blue); }
.plate .rule { flex: 1; height: 1px; background: var(--line); }
.section { padding-block: 84px; }
.section.tight { padding-block: 56px; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.7rem, 3.2vw, 2.5rem); margin-bottom: .6rem; }
.lead { color: var(--muted); font-size: 1.06rem; max-width: 62ch; }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; }
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .34; }
.hero .container { position: relative; padding-block: clamp(70px, 11vw, 128px); }
.hero .eyebrow { font: 600 .78rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: #ff6b63; margin-bottom: 18px; display: block; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5.6vw, 3.9rem); max-width: 16ch; }
.hero h1 .blue { color: #8fa0ff; }
.hero p { color: rgba(255,255,255,.84); font-size: 1.12rem; max-width: 56ch; margin-top: 18px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* rating strip under hero */
.ratings { background: var(--ink-2); color: var(--on-dark); border-top: 1px solid rgba(255,255,255,.1); }
.ratings .container { display: grid; grid-template-columns: repeat(4, 1fr); }
.ratings div { padding: 22px 20px 24px; border-left: 1px solid rgba(255,255,255,.1); }
.ratings div:first-child { border-left: 0; }
.ratings .v { font: 600 1.5rem/1 var(--mono); font-variant-numeric: tabular-nums; color: #fff; }
.ratings .k { font: 400 .78rem/1.4 var(--body); color: var(--on-dark-muted); margin-top: 8px; letter-spacing: .02em; }
@media (max-width: 760px) {
  .ratings .container { grid-template-columns: repeat(2, 1fr); }
  .ratings div:nth-child(3) { border-left: 0; }
  .ratings div { padding: 18px 14px; }
}

/* ---------- Generic grids ---------- */
.grid { display: grid; gap: 22px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; align-items: center; }
@media (max-width: 900px) { .g-3, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; gap: 32px; } }
@media (max-width: 600px) { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } }

/* ---------- Product cards ---------- */
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; scroll-margin-top: 110px; }
.pcard .media { aspect-ratio: 4 / 3; background: var(--ink-2); overflow: hidden; }
.pcard .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.pcard:hover .media img { transform: scale(1.05); }
.pcard .body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.pcard .tag { font: 600 .68rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--kc-blue); margin-bottom: 8px; }
.pcard h3 { font-size: 1.18rem; margin-bottom: 8px; }
.pcard p { color: var(--muted); font-size: .97rem; margin-bottom: 14px; }
.pcard .specs { margin: 0 0 16px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.pcard .specs div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 7px 0; font-size: .88rem; }
.pcard .specs dt { color: var(--muted); }
.pcard .specs dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.pcard .more { margin-top: auto; font: 600 .9rem/1 var(--body); color: var(--kc-red); display: inline-flex; gap: .4rem; align-items: center; }

/* ---------- Capability / feature rows ---------- */
.feature { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--kc-red); border-radius: var(--radius); padding: 22px; }
.feature.blue { border-left-color: var(--kc-blue); }
.feature h3 { font-size: 1.08rem; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: .96rem; margin: 0; }
.feature .n { font: 600 .72rem/1 var(--mono); color: var(--muted); letter-spacing: .1em; display: block; margin-bottom: 10px; }

/* ---------- Steps ---------- */
.steps { counter-reset: st; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.steps > div { background: var(--surface); padding: 22px 24px; counter-increment: st; display: grid; grid-template-columns: 54px 1fr; gap: 18px; align-items: start; }
.steps > div::before { content: counter(st, decimal-leading-zero); font: 600 1.1rem/1 var(--mono); color: var(--kc-red); padding-top: 4px; }
.steps h3 { font-size: 1.05rem; margin-bottom: 4px; }
.steps p { color: var(--muted); font-size: .96rem; margin: 0; }

/* ---------- Page banner ---------- */
.banner { background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.banner img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .26; }
.banner .container { position: relative; padding-block: 64px 58px; }
.banner h1 { color: #fff; font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
.banner .crumbs { font: 400 .86rem/1 var(--body); color: var(--on-dark-muted); margin-top: 14px; }
.banner .crumbs a { color: #ff8b84; }
.banner p { color: rgba(255,255,255,.82); max-width: 60ch; margin-top: 14px; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery figure { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--ink-2); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s ease; }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 14px; color: #fff;
  background: linear-gradient(0deg, rgba(18,23,27,.92), transparent);
  font: 600 .92rem/1.35 var(--body);
}
.gallery figcaption span { display: block; font: 400 .76rem/1.4 var(--mono); color: #ff8b84; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }

/* ---------- Certificate cards ---------- */
.cert { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.cert .seal {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: #fdecec; color: var(--kc-red); font: 700 1rem/1 var(--mono);
}
.cert .seal.blue { background: #eaeaff; color: var(--kc-blue); }
.cert .seal.green { background: #e6f4ee; color: var(--ok); }
.cert h3 { font-size: 1.12rem; }
.cert p { color: var(--muted); font-size: .96rem; margin: 0; }
.cert dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; border-top: 1px solid var(--line); padding-top: 12px; }
.cert dt { color: var(--muted); }
.cert dd { margin: 0; font-family: var(--mono); }
.pending { color: var(--kc-red); font-style: italic; font-family: var(--body); }

/* ---------- Spec table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.spec { border-collapse: collapse; width: 100%; font-size: .94rem; min-width: 520px; }
table.spec th, table.spec td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.spec thead th { background: var(--surface-2); font: 600 .74rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
table.spec tbody tr:last-child td { border-bottom: 0; }
table.spec td.v { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 38px; align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.info-row { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: 0; }
.info-row .ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--radius); background: #fdecec; color: var(--kc-red); display: grid; place-items: center; }
.info-row .ic.blue { background: #eaeaff; color: var(--kc-blue); }
.info-row h3 { font-size: .98rem; margin-bottom: 2px; }
.info-row p, .info-row a { color: var(--muted); font-size: .96rem; margin: 0; }
.info-row a:hover { color: var(--kc-red); }
form .field { margin-bottom: 16px; }
form label { display: block; font: 600 .82rem/1 var(--body); color: var(--muted); margin-bottom: 7px; }
form input, form select, form textarea {
  width: 100%; font: 400 1rem/1.4 var(--body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px;
}
form input:focus, form select:focus, form textarea:focus { outline: 3px solid rgba(27,27,209,.25); border-color: var(--kc-blue); }
form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { form .row2 { grid-template-columns: 1fr; } }
.err { display: none; color: var(--kc-red); font-size: .85rem; margin-top: 6px; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--kc-red); }
.form-note { background: #e6f4ee; border-left: 3px solid var(--ok); padding: 14px 16px; border-radius: var(--radius); font-size: .95rem; margin-bottom: 18px; }
.form-note[hidden] { display: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--on-dark-muted); padding-block: 62px 0; font-size: .95rem; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 16px; }
.site-footer a { color: var(--on-dark-muted); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-logo { background: #fff; border-radius: var(--radius); padding: 10px 14px; display: inline-flex; align-items: center; gap: 10px; }
.footer-logo img { height: 46px; width: auto; }
.footer-logo .word { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 1.05rem; line-height: 1.1; }
.footer-logo .word small { display: block; font: 600 .6rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.flinks { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.fcontact { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fcontact li { display: flex; gap: 10px; }
.fcontact svg { flex-shrink: 0; margin-top: 4px; color: var(--kc-red); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 48px; padding-block: 18px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: .86rem; }

/* ---------- Back to top ---------- */
.totop {
  position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: var(--radius);
  background: var(--kc-red); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: all .25s; z-index: 60;
}
.totop.show { opacity: 1; visibility: visible; transform: none; }
.totop:hover { background: var(--ink); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pcard .media img, .gallery img { transition: none; }
}

/* ---------- Dark theme ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --kc-red: #ff5a52;
    --kc-red-dark: #ff7a73;
    --kc-blue: #8f9cff;
    --kc-blue-dark: #a9b4ff;
    --ink: #e8ecec;
    --ink-2: #161c21;
    --muted: #9aa4ab;
    --ground: #0e1317;
    --surface: #161c21;
    --surface-2: #1d252b;
    --line: #28323a;
    --ok: #4cc191;
  }
  :root:not([data-theme="light"]) .topbar,
  :root:not([data-theme="light"]) .site-footer,
  :root:not([data-theme="light"]) .hero,
  :root:not([data-theme="light"]) .banner { background: #0a0e11; }
  :root:not([data-theme="light"]) .plate .code { background: var(--surface-2); color: var(--ink); }
  :root:not([data-theme="light"]) .plate .code.red { background: var(--kc-red); color: #16191b; }
  :root:not([data-theme="light"]) .plate .code.blue { background: var(--kc-blue); color: #16191b; }
  :root:not([data-theme="light"]) .btn-red,
  :root:not([data-theme="light"]) .btn-blue { color: #121619; }
  :root:not([data-theme="light"]) .cert .seal { background: #2a1d1e; }
  :root:not([data-theme="light"]) .cert .seal.blue { background: #1d2033; }
  :root:not([data-theme="light"]) .cert .seal.green { background: #16271f; }
  :root:not([data-theme="light"]) .info-row .ic { background: #2a1d1e; }
  :root:not([data-theme="light"]) .info-row .ic.blue { background: #1d2033; }
  :root:not([data-theme="light"]) .form-note { background: #16271f; }
}

/* ==========================================================
   Responsive refinements — tablet and phone
   ========================================================== */

/* ---- Tablet (and small laptops): tighten vertical rhythm ---- */
@media (max-width: 1024px) {
  .section { padding-block: 64px; }
  .section.tight { padding-block: 44px; }
  .split { gap: 34px; }
  .banner .container { padding-block: 52px 46px; }
}

/* ---- Phone ---- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding-inline: 16px; }

  .section { padding-block: 48px; }
  .section.tight { padding-block: 36px; }
  .section-title { font-size: clamp(1.45rem, 6.4vw, 1.9rem); }
  .lead { font-size: 1rem; }

  /* header: smaller logo keeps the sticky bar shallow */
  .brand img { height: 42px; }
  .brand .word { font-size: 1.05rem; }
  .brand .word small { font-size: .6rem; letter-spacing: .12em; }
  .header-inner { gap: 12px; padding-block: 10px; }
  .topbar .container { gap: 6px 16px; font-size: .8rem; }
  .nav { max-height: calc(100vh - 150px); overflow-y: auto; }

  /* hero */
  .hero .container { padding-block: 56px 52px; }
  .hero .eyebrow { font-size: .68rem; letter-spacing: .14em; }
  .hero p { font-size: 1rem; }
  .hero .cta { gap: 10px; }
  .hero .cta .btn { flex: 1 1 100%; justify-content: center; }

  /* rating strip reads as a 2x2 block */
  .ratings div { padding: 16px 12px; }
  .ratings .v { font-size: 1.25rem; }
  .ratings .k { font-size: .72rem; }

  /* cards and panels */
  .pcard .body { padding: 16px 16px 18px; }
  .pcard h3 { font-size: 1.1rem; }
  .feature { padding: 18px; }
  .cert { padding: 20px; }
  .steps > div { grid-template-columns: 38px 1fr; gap: 12px; padding: 18px 16px; }
  .gallery { gap: 12px; }
  .plate { gap: 9px; margin-bottom: 12px; }
  .plate .code { font-size: .66rem; padding: 6px 8px; }

  /* tables: narrower before they need sideways scrolling */
  table.spec { min-width: 420px; font-size: .9rem; }
  table.spec th, table.spec td { padding: 10px 12px; }

  /* call-to-action bands: full-width button instead of a squeezed one */
  .section.tight .container > .btn { width: 100%; justify-content: center; }

  /* forms and contact */
  .contact-grid { gap: 26px; }
  form .field { margin-bottom: 14px; }
  form input, form select, form textarea { font-size: 16px; } /* 16px stops iOS zooming on focus */
  form button[type="submit"] { width: 100%; justify-content: center; }
  .info-row { padding: 14px 0; }

  /* footer */
  .site-footer { padding-top: 44px; }
  .footer-grid { gap: 28px; }
  .footer-bottom { margin-top: 32px; }

  .totop { right: 12px; bottom: 12px; width: 42px; height: 42px; }
}

/* ---- Very small phones ---- */
@media (max-width: 380px) {
  .brand .word small { display: none; }
  .ratings .v { font-size: 1.12rem; }
  .btn { padding: 13px 18px; }
}

/* Grid and flex children must be allowed to shrink, otherwise a wide child
   (a spec table, a long word) stretches its track and the page scrolls sideways. */
.split > *, .grid > *, .contact-grid > *, .footer-grid > *, .steps > div > * { min-width: 0; }

/* ==========================================================
   Micro-animations
   Entrances run on CSS alone (no JS dependency), interaction
   feedback stays under 250ms, and everything is disabled for
   visitors who ask for reduced motion (see the block below).
   ========================================================== */

/* ---- Hero entrance: a short staggered rise on load ---- */
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes wipeIn { from { opacity: 0; transform: scaleX(.2); } to { opacity: 1; transform: none; } }

.hero .eyebrow { animation: riseIn .6s ease both .05s; }
.hero h1 { animation: riseIn .7s ease both .15s; }
.hero p { animation: riseIn .7s ease both .28s; }
.hero .cta { animation: riseIn .7s ease both .4s; }
.hero img.bg { animation: riseIn 1.1s ease both; }
.ratings div { animation: riseIn .6s ease both; }
.ratings div:nth-child(2) { animation-delay: .08s; }
.ratings div:nth-child(3) { animation-delay: .16s; }
.ratings div:nth-child(4) { animation-delay: .24s; }

/* ---- Staggered scroll reveal (delay set per item in main.js) ---- */
.reveal { transition-delay: var(--d, 0s); }

/* ---- Section plate: the rule draws itself in ---- */
.plate .rule { transform-origin: left center; }
.reveal.in .plate .rule, .plate.in .rule { animation: wipeIn .55s ease both .1s; }

/* ---- Buttons ---- */
.btn { transition: background .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(18, 23, 27, .18); }
.btn:active { transform: translateY(0); box-shadow: none; }

/* ---- Nav: underline grows from the left on hover ---- */
.nav a::before {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 3px;
  background: var(--kc-red); transform: scaleX(0); transform-origin: left center;
  transition: transform .22s ease;
}
.nav a:hover::before { transform: scaleX(1); }
.nav a.active::before { display: none; }
@media (max-width: 980px) { .nav a::before { left: 4px; right: auto; width: 24px; bottom: 6px; } }

/* ---- Product cards: lift, and the accent edge appears ---- */
.pcard { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.pcard:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: #c9d0ce; }
.pcard .tag { transition: color .2s; }
.pcard:hover .tag { color: var(--kc-red); }
.pcard .more { transition: transform .2s ease, color .2s; }
.pcard:hover .more { transform: translateX(4px); }
.pcard .specs div { transition: background .18s; }
.pcard .specs div:hover { background: var(--surface-2); }

/* ---- Feature blocks: the left rule thickens ---- */
.feature { transition: transform .25s ease, box-shadow .25s ease, border-left-width .2s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-left-width: 6px; }

/* ---- Process steps: row tint and the number steps forward ---- */
.steps > div { transition: background .2s ease; }
.steps > div:hover { background: var(--surface-2); }
.steps > div::before { transition: transform .22s ease, color .22s; }
.steps > div:hover::before { transform: translateX(3px); }

/* ---- Gallery: caption rises into place ---- */
.gallery figcaption { transform: translateY(6px); opacity: .92; transition: transform .3s ease, opacity .3s ease; }
.gallery figure:hover figcaption, .gallery figure:focus-within figcaption { transform: none; opacity: 1; }

/* ---- Certificate seals and contact icons ---- */
.cert { transition: transform .25s ease, box-shadow .25s ease; }
.cert:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cert .seal { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.cert:hover .seal { transform: scale(1.08); }
.info-row .ic { transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.info-row:hover .ic { transform: scale(1.1); }

/* ---- Spec table rows ---- */
table.spec tbody tr { transition: background .18s; }
table.spec tbody tr:hover { background: var(--surface-2); }

/* ---- Links and footer ---- */
.site-footer a, .flinks a, .fcontact a { transition: color .18s, transform .18s; display: inline-block; }
.flinks a:hover { transform: translateX(3px); }

/* ---- Header shadow already fades in; brand reacts to hover ---- */
.brand img { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.brand:hover img { transform: scale(1.06) rotate(-2deg); }

/* ---- Back to top ---- */
.totop:hover { transform: translateY(-3px); }

/* ---- Respect reduced-motion: no entrances, no movement ---- */
@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow, .hero h1, .hero p, .hero .cta, .hero img.bg, .ratings div,
  .reveal.in .plate .rule, .plate.in .rule { animation: none !important; }
  .btn:hover, .pcard:hover, .feature:hover, .cert:hover, .totop:hover,
  .pcard:hover .more, .steps > div:hover::before, .flinks a:hover,
  .brand:hover img, .cert:hover .seal, .info-row:hover .ic { transform: none !important; }
  .nav a:hover::before { transform: scaleX(1); transition: none; }
  .gallery figcaption { transform: none; opacity: 1; }
}
