/* ==========================================================================
   KIIO — kiio.ai
   Brand tokens from KIIO Brand Guidelines (2026)
   Titles: Sansation · Text: Work Sans
   ========================================================================== */

:root {
  --ink: #1B1B1B;        /* primary dark */
  --graphite: #414042;   /* secondary dark */
  --paper: #FFFFFF;       /* cards and panels */
  --bg: #F9F9F9;          /* page background (matches the process diagram) */
  --mist: #F2F2F2;       /* light surface */
  --orange: #F47A20;     /* primary accent */
  --ember: #DD3D15;      /* deep accent */
  --peach: #FFA15B;      /* soft accent */
  --sky: #51A6E2;        /* secondary accent */

  --font-title: "Sansation", "Trebuchet MS", sans-serif;
  --font-body: "Work Sans", "Helvetica Neue", Arial, sans-serif;

  --radius: 14px;
  --container: 1140px;
  --nav-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--graphite);
  background: var(--bg);
  line-height: 1.7;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

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

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); margin-bottom: 1.25rem; }
h3 { font-size: 1.25rem; margin-bottom: .5rem; }

p + p { margin-top: 1em; }

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--ember); }

/* Eyebrow label with the brand diamond */
.eyebrow {
  display: inline-flex;
  align-items: flex-start;
  gap: .6em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: .62em;
  height: .62em;
  margin-top: .54em; /* centred on the first line, even when the label wraps */
  background: var(--orange);
  border-radius: 20%;
  transform: rotate(45deg);
  flex: none;
}

/* --- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .95em 2.2em;
  border-radius: 999px;
  border: 2px solid var(--orange);
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--ember); border-color: var(--ember); color: #fff; }

.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* --- Navigation --------------------------------------------------------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 3px solid var(--orange);
  z-index: 100;
}
.nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo img { height: 34px; width: auto; }

.nav-links {
  display: flex;
  gap: 2.2rem;
  list-style: none;
}
.nav-links a {
  font-weight: 500;
  font-size: .9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--orange); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform .2s, opacity .2s;
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: var(--nav-h);
  /* Darker towards the bottom (tags row) and the left (text), lighter top-right */
  background:
    linear-gradient(180deg, rgba(27,27,27,.5) 0%, rgba(27,27,27,.6) 50%, rgba(27,27,27,.92) 100%),
    linear-gradient(100deg, rgba(27,27,27,.72) 0%, rgba(27,27,27,.3) 60%, rgba(27,27,27,.1) 100%),
    url("../assets/img/hero-chemical-plant.jpg") center / cover no-repeat;
  color: #fff;
}
.hero-main {
  flex: 1;
  display: flex;
  align-items: center;
  width: 100%;
  padding-top: 48px;
  padding-bottom: 72px;
}
.hero-kicker {
  font-weight: 600;
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  color: var(--peach);
  margin-bottom: 1.2rem;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 1.06;
  letter-spacing: -.01em;
  margin-bottom: 1.8rem;
}
/* Two lines: detect and diagnose on the first, act on the second */
.hero .lede {
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255,255,255,.9);
  max-width: 48ch;
  margin-bottom: 3.6rem;
}
.hero .lede span { display: block; }
.hero-cta { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* Compact hero for sub-pages (News, Careers) */
.page-hero {
  padding: calc(var(--nav-h) + 80px) 0 72px;
  background:
    linear-gradient(105deg, rgba(27,27,27,.92) 0%, rgba(27,27,27,.78) 100%),
    url("../assets/img/hero-chemical-plant.jpg") center / cover no-repeat;
  color: #fff;
}
.page-hero h1 { color: #fff; font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-bottom: .4em; }
.page-hero .lede { font-size: 1.15rem; color: rgba(255,255,255,.9); max-width: 56ch; }
.page-hero .eyebrow { color: var(--peach); }
.page-hero .eyebrow::before { background: var(--peach); }

/* --- Sections ----------------------------------------------------------- */

.section { padding: 104px 0; }
.section-mist { background: var(--mist); }
.section-dark { background: var(--ink); color: rgba(255,255,255,.85); }
.section-dark h2 { color: #fff; }

.section-head { max-width: 720px; margin-bottom: 3.2rem; }

/* About: text + image */
.about-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 4rem;
  align-items: center;
}
.about-grid figure img {
  border-radius: var(--radius);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The problem: fault-propagation diagram + three-step strip */
.problem-head { max-width: 900px; margin-bottom: 2.6rem; }
.problem-head p { font-size: 1.05rem; }
.problem-head p:first-of-type { font-size: 1.15rem; color: var(--ink); }
/* The problem text is three plain paragraphs, with no lead-in emphasis */
#problem .problem-head p:first-of-type { font-size: 1.05rem; color: inherit; }
.problem-head strong { font-weight: 600; color: var(--ink); }
.problem-stage { position: relative; max-width: 1000px; margin: 0 auto; }
/* multiply blends the image's white into the page background */
.problem-stage img { width: 100%; mix-blend-mode: multiply; }

/* Three steps: laid over the rendering's empty areas on wide screens,
   on a propagation rail below it on narrower ones */
.fault-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 1.6rem;
}
.fault-step { position: relative; }
.fault-step::before {
  content: "";
  position: absolute;
  top: calc(1.4rem - 1px);
  left: 3.1rem;
  right: -1.8rem;
  height: 2px;
  background: linear-gradient(90deg, var(--orange), var(--peach));
}
.fault-step:last-child::before { display: none; }
.fault-step h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.fault-step p { font-size: .95rem; }
/* Hollow diamond: the problem. The filled diamonds in Technology are KIIO's answer. */
.fault-num {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 26%;
  transform: rotate(45deg);
  border: 2px solid var(--orange);
  background: var(--bg);
  color: var(--orange);
  margin: .35rem 0 1.3rem .35rem;
  font-family: var(--font-title);
  font-size: 1rem;
  line-height: 1;
}
.fault-num b { transform: rotate(-45deg); font-weight: 700; }
.fault-step.is-late .fault-num { border-color: var(--ember); color: var(--ember); }

@media (min-width: 961px) {
  /* Overlay positions are percentages of the rendering; type scales with the
     figure (cqw) so the text blocks keep their proportions at every width. */
  .problem-stage { container-type: inline-size; }
  .fault-steps { position: absolute; inset: 0; display: block; margin: 0; }
  .fault-step { position: absolute; }
  .fault-step::before { display: none; }
  /* 1 and 2 side by side in the clear top-left, 3 alone in the bottom-right */
  .fault-step:nth-child(1) { left: 1.5%; top: 3%; width: 19%; }
  .fault-step:nth-child(2) { left: 22.5%; top: 3%; width: 20%; }
  .fault-step:nth-child(3) { left: 66%; top: 68%; width: 32%; }
  .fault-step h3 { font-size: .95rem; font-size: clamp(.86rem, 1.5cqw, .95rem); margin-bottom: .2rem; }
  .fault-step p { font-size: .78rem; font-size: clamp(.7rem, 1.25cqw, .78rem); line-height: 1.4; }
  .fault-num { width: 1.7rem; height: 1.7rem; font-size: .85rem; margin: .3rem 0 .5rem .3rem; }
}

/* Steps fade in when they scroll into view and out again when they leave
   (main.js adds .js and toggles .is-visible), so the sequence replays on every pass */
.js .fault-step { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js .fault-step.is-visible { opacity: 1; transform: none; }
.js .fault-step.is-visible:nth-child(2) { transition-delay: .15s; }
.js .fault-step.is-visible:nth-child(3) { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
  .js .fault-step { transition: none; opacity: 1; transform: none; }
}

/* Impact: interactive OEE (Availability x Performance x Quality) */
.section-flush { padding-top: 0; }
.oee-lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 32%);
  gap: 1.6rem;
}
.oee-factors {
  grid-column: 1;
  grid-row: 1;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(27,27,27,.06);
}
.oee-factor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 46%);
  gap: 1rem 2.4rem;
  align-items: center;
  padding: 1.7rem 2rem;
}
.oee-factor + .oee-factor { border-top: 1px solid var(--mist); }
.pillar-label {
  display: block;
  font-weight: 500;
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: .4rem;
}
.pillar-label b { color: var(--orange); font-weight: 600; }
.oee-factor h3 { font-size: 1.4rem; margin-bottom: .9rem; }
.effect-tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.effect-tags li {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .38em .95em .38em .7em;
  border-radius: 999px;
  background: var(--mist);
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}
.effect-tags svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--graphite);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.oee-ctl label {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.2rem;
  font-size: .85rem;
  line-height: 1.4;
  color: var(--graphite);
  margin-bottom: .4rem;
  cursor: pointer;
}
.oee-ctl output {
  flex: none;
  min-width: 2.6em;
  text-align: right;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Range slider: orange fill up to --pct, the brand diamond as the thumb.
   The input is taller than the track so the thumb is easy to grab. */
.oee-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 26px;
  margin: 2px 0;
  background: transparent;
  outline: none;
  cursor: pointer;
}
.oee-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--orange) 0 var(--pct, 50%), #e3e1dd var(--pct, 50%) 100%);
}
.oee-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 24%;
  transform: rotate(45deg);
  background: var(--orange);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(27,27,27,.28);
  transition: transform .15s, background .15s;
}
.oee-range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--orange) 0 var(--pct, 50%), #e3e1dd var(--pct, 50%) 100%);
}
.oee-range::-moz-range-thumb {
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border-radius: 24%;
  transform: rotate(45deg);
  background: var(--orange);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(27,27,27,.28);
}
.oee-range:hover::-webkit-slider-thumb,
.oee-range:active::-webkit-slider-thumb { transform: rotate(45deg) scale(1.12); background: var(--ember); }
.oee-range:hover::-moz-range-thumb,
.oee-range:active::-moz-range-thumb { transform: rotate(45deg) scale(1.12); background: var(--ember); }
.oee-range:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--peach); outline-offset: 2px; }
.oee-range:focus-visible::-moz-range-thumb { outline: 3px solid var(--peach); outline-offset: 2px; }

/* Result panel: dark, matches the factor panel's height. The reading floats in
   the middle, the bar and readouts sit at the bottom, so nothing shifts as values change. */
.oee-result {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: rgba(255,255,255,.75);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(27,27,27,.16);
  padding: 1.8rem 1.9rem 1.7rem;
}
.oee-result-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.oee-reading {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.2rem 0 1.6rem;
}
.oee-result-body { margin-top: auto; }
.oee-result-label {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--peach);
  line-height: 1.3;
}
.oee-result-label::before {
  content: "";
  width: .62em;
  height: .62em;
  background: var(--peach);
  border-radius: 20%;
  transform: rotate(45deg);
  flex: none;
}
.oee-reset {
  flex: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: .5em 1.1em;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.oee-reset:hover { border-color: var(--peach); color: #fff; }
.oee-value {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 5rem;
  line-height: 1;
  color: var(--peach);
  font-variant-numeric: tabular-nums;
}
.oee-value small { font-size: .5em; margin-left: .05em; }
.oee-math { font-size: .95rem; color: rgba(255,255,255,.6); margin-top: .5rem; font-variant-numeric: tabular-nums; }
.oee-math i { font-style: normal; margin: 0 .15em; color: rgba(255,255,255,.4); }
.oee-bar { position: relative; height: 12px; border-radius: 999px; background: rgba(255,255,255,.14); }
.oee-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ember), var(--orange));
  transition: width .25s ease;
}
.oee-tick {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 22px;
  margin-left: -1px;
  border-radius: 2px;
  background: rgba(255,255,255,.8);
}
.oee-tick-top { background: var(--sky); }
.oee-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.2rem;
  margin-top: .8rem;
  font-size: .78rem;
  color: rgba(255,255,255,.6);
}
.oee-legend li { display: inline-flex; align-items: center; gap: .5em; }
.oee-legend li::before { content: ""; width: 2px; height: .95em; border-radius: 2px; background: rgba(255,255,255,.8); }
.oee-legend-top::before { background: var(--sky); }
.oee-deltas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.3rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,.12);
}
.oee-deltas > div { display: flex; flex-direction: column; justify-content: flex-end; }
.oee-deltas dt {
  font-weight: 500;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: .3rem;
}
.oee-deltas dd {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
/* Reserve three lines so a longer sentence never moves the layout */
.oee-verdict {
  min-height: calc(1rem + 4.5em);
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: .95rem;
  line-height: 1.5;
  font-weight: 400;
  color: #fff;
}

/* Stat callouts under About */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  margin-top: 3.2rem;
}
.stat {
  border-top: 3px solid var(--orange);
  padding-top: 1.1rem;
}
.stat-num {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--ink);
  display: block;
  line-height: 1.2;
}
.stat-label {
  font-size: .92rem;
  color: var(--graphite);
  display: block;
  margin-top: .35rem;
}

/* Why KIIO: closed-loop steps */
.loop-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
  margin-bottom: 3.2rem;
}
.loop-step h3 { font-size: 1.1rem; }
.loop-step p { font-size: .95rem; }
.loop-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 26%;
  transform: rotate(45deg);
  background: var(--orange);
  margin: .35rem 0 1.3rem .35rem;
  font-family: var(--font-title);
  font-size: 1rem;
  line-height: 1;
  color: #fff;
}
.loop-num b {
  transform: rotate(-45deg);
  font-weight: 700;
}

/* Comparison table */
.compare-wrap { overflow-x: auto; }
.compare {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(27,27,27,.07);
  font-size: .92rem;
}
.compare th, .compare td {
  padding: .95rem 1.1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--mist);
}
.compare thead th {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--graphite);
  background: var(--mist);
}
.compare tbody th {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.compare td { color: var(--graphite); font-weight: 300; }
.compare .kiio-row th,
.compare .kiio-row td {
  background: rgba(244,122,32,.07);
  color: var(--ink);
  font-weight: 500;
  border-top: 2px solid var(--orange);
}
.compare .kiio-row th { border-left: 3px solid var(--orange); }
.compare-logo { height: 22px; width: auto; display: block; }
.compare tbody tr:last-child th,
.compare tbody tr:last-child td { border-bottom: 0; }

.section-cta { margin-top: 2.8rem; }

/* Feature trio (Early / Robust / Interpretable) */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.feature {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 2.2rem 2rem;
  border-top: 4px solid var(--orange);
}
.feature .num {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: .95rem;
  color: var(--orange);
  letter-spacing: .1em;
  display: block;
  margin-bottom: .8rem;
}
.feature p { font-size: .98rem; }

/* Service cards with imagery */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-4 .card img { height: 160px; }
.card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(27,27,27,.07);
  display: flex;
  flex-direction: column;
}
.card img { height: 200px; width: 100%; object-fit: cover; }
.card-body { padding: 1.8rem 1.8rem 2rem; }
.card-body p { font-size: .98rem; }

/* Team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.2rem;
}
.person {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(27,27,27,.07);
  text-align: center;
  padding-bottom: 1.6rem;
}
.person img.portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.person h3 { margin: 1.2rem 1rem .1rem; font-size: 1.08rem; }
.person .role {
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange);
  display: block;
  margin-bottom: .6rem;
}
.person .bio { font-size: .9rem; padding: 0 1.1rem; color: var(--graphite); }
.person .li-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-top: .9rem;
  border-radius: 50%;
  background: var(--mist);
  color: var(--graphite);
}
.person .li-link:hover { background: var(--orange); color: #fff; }
.person .li-link svg { width: 16px; height: 16px; fill: currentColor; }

/* Supporters */
.logo-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3rem 2.8rem;
  align-items: center;
}
.logo-row img {
  width: 100%;
  max-height: 84px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .65;
  transition: filter .2s, opacity .2s;
}
.logo-row img:hover { filter: none; opacity: 1; }
/* Some logo files have a white box; multiply lets the page background show through */
.logo-row img { mix-blend-mode: multiply; }
/* The Innosuisse lockup is mostly small type and needs more height to stay legible */
.logo-row img.logo-tall { max-height: 120px; }

.more-link { font-weight: 600; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; }

/* News */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.news-card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(27,27,27,.07);
  display: flex;
  flex-direction: column;
}
/* Card / article visual: a logo panel, or a photo with the "cover" modifier */
.news-visual {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--paper);
  border-bottom: 1px solid var(--mist);
}
.news-visual img {
  position: absolute;
  top: 2.8rem;
  left: 2.4rem;
  width: calc(100% - 4.8rem);
  height: calc(100% - 4.6rem);
  object-fit: contain;
}
.news-visual.pair img { width: calc(50% - 3.4rem); }
.news-visual.pair img + img { left: auto; right: 2.4rem; }
.news-visual.cover img { top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.news-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .35em .9em;
  border-radius: 999px;
}
.news-card-body {
  padding: 1.6rem 1.8rem 1.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.news-card h2 { font-size: 1.25rem; margin-bottom: .6rem; }
.news-card h2 a { color: var(--ink); }
.news-card h2 a:hover { color: var(--orange); }
.news-card p { font-size: .95rem; margin-bottom: 1.3rem; }
.news-card .more-link { margin-top: auto; }

/* News article page */
.article { padding-top: calc(var(--nav-h) + 56px); }
.article .container { max-width: 820px; }
.crumbs { font-size: .85rem; margin-bottom: 2rem; color: var(--graphite); }
.article h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 2rem; }
.article-visual {
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 8;
  margin-bottom: 2.4rem;
}
.article-body { margin-bottom: 2.6rem; }
.news-meta {
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange);
  display: block;
  margin-bottom: .5rem;
}
.support-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.support-list li { border-top: 3px solid var(--orange); padding-top: 1.1rem; font-size: .95rem; }
.support-list b { display: block; font-family: var(--font-title); font-size: 1.1rem; color: var(--ink); margin-bottom: .2rem; }

/* Careers */
.prose { max-width: 720px; }
.prose h2 { margin-top: 0; }
.jobs { display: grid; gap: 1.2rem; }
.job {
  background: var(--paper);
  border-radius: var(--radius);
  border-left: 4px solid var(--orange);
  box-shadow: 0 6px 24px rgba(27,27,27,.07);
  padding: 2.2rem 2.4rem;
}
.job h3 { font-size: 1.6rem; margin-bottom: .4rem; }
.job .job-dates { font-size: .88rem; margin-bottom: 1rem; }
.job .job-dates b { font-weight: 600; color: var(--ink); }
.job .job-dates + p { margin-top: 0; }
.job p { font-size: .98rem; max-width: 80ch; }
.job-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.4rem;
  margin: 1.8rem 0 2rem;
}
.job h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: .7rem;
}
.job ul { list-style: none; font-size: .95rem; }
.job li { position: relative; padding-left: 1.3em; }
.job li + li { margin-top: .5em; }
.job li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: .45em;
  height: .45em;
  background: var(--orange);
  border-radius: 20%;
  transform: rotate(45deg);
}
.job-apply { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; font-size: .95rem; }
.jobs-note { margin-top: 2rem; font-size: .95rem; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 6fr 6fr;
  gap: 4rem;
  align-items: start;
}
.section-dark .eyebrow { color: var(--peach); }
.section-dark .eyebrow::before { background: var(--peach); }

.contact-form { display: grid; gap: 1rem; }
.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 10px;
  padding: .95em 1.2em;
  width: 100%;
}
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 3px solid var(--peach);
}
.form-note { font-size: .85rem; color: rgba(255,255,255,.55); }
.form-msg { display: none; border-radius: 10px; padding: .9em 1.2em; font-size: .95rem; }
.form-msg.ok { background: rgba(81,166,226,.18); color: #cfe6f8; }
.form-msg.err { background: rgba(221,61,21,.22); color: #ffc9b8; }
.form-msg.show { display: block; }

/* Footer */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,.7);
  padding: 56px 0 40px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: .92rem;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 2.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.footer-brand img { height: 30px; width: auto; margin-bottom: .9rem; }
.footer-brand .tagline { font-size: .85rem; letter-spacing: .04em; }
.footer-nav { list-style: none; display: flex; gap: 1.6rem; flex-wrap: wrap; }
.footer-nav a { color: rgba(255,255,255,.7); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.footer-nav a:hover { color: var(--orange); }
.footer address { font-style: normal; }
.footer .copyright {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: .8rem;
  color: rgba(255,255,255,.45);
}

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

@media (max-width: 960px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  /* OEE: result docks under the nav and stays visible while the sliders scroll */
  .oee-lab { grid-template-columns: 1fr; gap: 1.2rem; }
  .oee-factors { grid-column: 1; grid-row: 2; }
  .oee-result {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: calc(var(--nav-h) + 10px);
    z-index: 5;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "head head" "value body";
    column-gap: 1.6rem;
    align-items: center;
    padding: 1rem 1.5rem 1.1rem;
  }
  .oee-result-head { grid-area: head; margin-bottom: .6rem; }
  .oee-reading { grid-area: value; display: block; flex: none; padding: 0; }
  .oee-value { font-size: 3rem; min-width: 2.3em; }
  .oee-result-body { grid-area: body; margin-top: 0; }
  .oee-math, .oee-deltas { display: none; }
  .oee-legend { margin-top: .55rem; }
  .oee-verdict { min-height: 0; margin-top: .6rem; padding-top: 0; border-top: 0; font-size: .88rem; }
  .about-grid figure { order: -1; }
  .about-grid figure img { max-height: 320px; }
  .features, .cards { grid-template-columns: 1fr; }
  .cards-4, .loop-steps { grid-template-columns: repeat(2, 1fr); }
  /* Team stays in one row of five; tighten the cards instead of wrapping */
  .team-grid { gap: .8rem; }
  .person h3 { font-size: .95rem; margin: 1rem .6rem .1rem; }
  .person .role { font-size: .66rem; letter-spacing: .1em; }
  .person .bio { font-size: .8rem; padding: 0 .7rem; line-height: 1.55; }
  .support-list { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .person h3 { font-size: 1.08rem; }
  .person .role { font-size: .78rem; letter-spacing: .14em; }
  .person .bio { font-size: .9rem; padding: 0 1.1rem; line-height: inherit; }
}

/* Nav collapses a little earlier than the content: the links need the room */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    padding: .5rem 0 1rem;
    border-bottom: 3px solid var(--orange);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: .8rem 24px; }
}

@media (max-width: 720px) {
  .section { padding: 72px 0; }

  .hero-main { padding-top: 40px; padding-bottom: 36px; }
  .hero h1 { margin-bottom: 1.3rem; }
  .hero .lede { margin-bottom: 2.8rem; }

  /* Problem: steps stack on a vertical rail */
  .fault-steps { grid-template-columns: 1fr; gap: 1.6rem; }
  .fault-step { display: grid; grid-template-columns: 2.8rem 1fr; column-gap: 1rem; }
  .fault-step::before {
    top: 3.1rem;
    bottom: -1.4rem;
    left: calc(1.4rem - 1px);
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--orange), var(--peach));
  }
  .fault-num { margin-bottom: 0; }
  .fault-step h3 { margin-top: .55rem; }

  /* OEE: sliders stack under their titles; compact result */
  .oee-factor { grid-template-columns: 1fr; gap: 1rem; padding: 1.4rem 1.3rem; }
  .oee-factor h3 { font-size: 1.25rem; margin-bottom: .7rem; }
  .oee-result { padding: .85rem 1.1rem .95rem; column-gap: 1.1rem; }
  .oee-value { font-size: 2.6rem; }
  .oee-verdict { display: none; }
  .oee-legend { font-size: .72rem; gap: .2rem .9rem; }

  .team-grid { grid-template-columns: 1fr; }
  .cards-4, .loop-steps, .stat-row { grid-template-columns: 1fr; }
  .logo-row { grid-template-columns: repeat(2, 1fr); gap: 2.4rem; }
  .news-grid { grid-template-columns: 1fr; }
  .support-list { grid-template-columns: 1fr; }
  .job { padding: 1.8rem 1.6rem; }
  .job-cols { grid-template-columns: 1fr; gap: 1.6rem; }
}

.only-phone { display: none; }

@media (max-width: 640px) {
  .hide-phone { display: none; }
  .only-phone { display: inline; }

  /* Docked OEE card: legend gets its own full-width row under the bar */
  .oee-result { grid-template-areas: "head head" "value bar" "legend legend"; row-gap: .35rem; }
  .oee-result-body { display: contents; }
  .oee-bar { grid-area: bar; }
  .oee-legend { grid-area: legend; flex-wrap: nowrap; margin-top: 0; }
}
