:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --alt: #eef2f6;
  --ink: #0f1b2a;
  --muted: #56657a;
  --line: #dbe2ea;
  --dark: #0b1420;
  --dark-2: #111e2e;
  --dark-line: #22324a;
  --on-dark: #e8eef5;
  --on-dark-muted: #9aabbf;
  --accent: #10a8a0;
  --accent-ink: #0b7d77;
  --amber: #f2a900;
  --ok: #3ccf7a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 42, .06), 0 8px 24px rgba(15, 27, 42, .06);
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); font-size: .75rem; letter-spacing: .04em; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.eyebrow {
  font-family: var(--mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent-ink);
  margin-bottom: .8em;
}
.lead { font-size: 1.1rem; color: var(--muted); max-width: 64ch; }

/* Buttons */
.btn {
  display: inline-block;
  padding: .8em 1.4em;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--on-dark); border-color: var(--dark-line); }
.btn--ghost:hover { background: var(--dark-2); border-color: var(--on-dark-muted); }
.btn--sm { padding: .5em 1em; font-size: .9rem; color: #fff !important; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 20, 32, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--dark-line);
  color: var(--on-dark);
}
.nav__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.logo__img { width: 30px; height: auto; }
.logo__word { display: flex; align-items: baseline; gap: 2px; }
.logo__mark { color: var(--accent); }
.logo__mark sup { font-size: .6em; }
.logo__text em { font-style: normal; font-weight: 400; color: var(--on-dark-muted); margin-left: 4px; }
.nav__links { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav__links a { text-decoration: none; font-size: .93rem; color: var(--on-dark-muted); transition: color .2s; }
.nav__links a:hover { color: var(--on-dark); }
.nav__tools { display: flex; align-items: center; gap: 12px; }
.lang { display: flex; border: 1px solid var(--dark-line); border-radius: 6px; overflow: hidden; }
.lang button {
  background: none; border: 0; color: var(--on-dark-muted);
  font: 500 .75rem var(--mono); padding: 6px 8px; cursor: pointer;
}
.lang button.active { background: var(--accent); color: #fff; }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 2px; background: var(--on-dark); margin: 4px 0; transition: .2s; }

/* Hero */
.hero {
  position: relative;
  background: radial-gradient(1200px 500px at 80% -10%, rgba(16, 168, 160, .18), transparent 60%), var(--dark);
  color: var(--on-dark);
  padding: 88px 0 96px;
  overflow: hidden;
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero .eyebrow { color: var(--accent); }
.hero .lead { color: var(--on-dark-muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 36px; }
.hero__brands {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; color: var(--on-dark-muted);
}

/* SCADA mimic */
.mimic {
  background: linear-gradient(180deg, #0f1c2c, #0c1623);
  border: 1px solid var(--dark-line);
  border-radius: 14px;
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
  overflow: hidden;
}
.mimic__bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--dark-line); color: var(--on-dark-muted); }
.mimic__clock { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot--ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.mimic__svg { width: 100%; height: auto; padding: 8px 10px 0; }
.pipe { fill: none; stroke: #2b4260; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.flow { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 6 10; stroke-linecap: round; stroke-linejoin: round; animation: flow 1.2s linear infinite; }
.bus { fill: none; stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: .7; }
@keyframes flow { to { stroke-dashoffset: -32; } }
.equip { fill: #13243a; stroke: #4a6a90; stroke-width: 2; }
.equip-fill { fill: #4a6a90; }
.level { fill: rgba(16, 168, 160, .55); transition: y 1s ease, height 1s ease; }
.plc { fill: #13243a; stroke: var(--dark-line); stroke-width: 1.5; }
.led--g { fill: var(--ok); }
.led--a { fill: var(--amber); animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.lbl { fill: var(--on-dark-muted); font: 500 11px var(--mono); text-anchor: middle; }
.mono-sm { fill: var(--on-dark-muted); font: 500 10px var(--mono); }
.mimic__tags { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--dark-line); }
.mimic__tags div { padding: 10px 12px; border-right: 1px solid var(--dark-line); display: flex; flex-direction: column; gap: 2px; }
.mimic__tags div:last-child { border-right: 0; }
.mimic__tags .mono { color: var(--on-dark-muted); font-size: .68rem; }
.mimic__tags strong { font: 500 .9rem var(--mono); color: var(--on-dark); }
.mimic__tags .ok { color: var(--ok); }

/* Stats */
.stats { background: var(--surface); border-bottom: 1px solid var(--line); }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 30px 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-size: 2rem; font-weight: 700; color: var(--accent-ink); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .92rem; }

/* Sections */
.section { padding: 96px 0; }
.section--alt { background: var(--alt); }
.section--dark { background: var(--dark); color: var(--on-dark); }
.section--dark .eyebrow { color: var(--accent); }
.section--dark .lead { color: var(--on-dark-muted); }
.section__head { margin-bottom: 48px; }

/* Cards */
.cards { display: grid; gap: 20px; }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.card, .ind, .role, .platform {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover, .ind:hover, .role:hover, .platform:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c5d1de; }
.card p, .ind p, .role p { color: var(--muted); font-size: .95rem; margin: 0; }
.card__icon, .role__icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(16, 168, 160, .1); margin-bottom: 18px;
}
.card__icon svg, .role__icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent-ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Platforms */
.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.platform--wide { grid-column: 1 / -1; border-top: 3px solid var(--accent); }
.platform__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.platform__head h3 { margin: 0; font-size: 1.2rem; }
.tag { font-family: var(--mono); font-size: .7rem; letter-spacing: .05em; color: var(--accent-ink); background: rgba(16,168,160,.1); padding: 4px 8px; border-radius: 4px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: .85rem; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.chips li.chips__more { border-style: dashed; border-color: var(--accent); color: var(--accent-ink); background: transparent; font-weight: 600; }
.platform--open { border-top-color: var(--amber); background: linear-gradient(135deg, var(--surface), rgba(16, 168, 160, .06)); }
.platform--open p { color: var(--muted); font-size: .95rem; max-width: 80ch; margin: 0 0 14px; }

/* Industries */
.ind { position: relative; padding-top: 30px; }
.ind__n { color: var(--accent-ink); display: block; margin-bottom: 10px; font-size: .8rem; }

/* Split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }

/* Projects */
.btn--line { background: transparent; color: var(--accent-ink); border-color: var(--line); }
.btn--line:hover { background: var(--surface); color: var(--accent-ink); border-color: var(--accent); }
.clients { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 36px; margin: -16px 0 40px; }
.clients__label { color: var(--muted); text-transform: uppercase; }
.clients img { height: 30px; width: auto; filter: grayscale(1); opacity: .75; transition: filter .25s, opacity .25s; }
.clients img:hover { filter: none; opacity: 1; }
.clients__name { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; color: #7d8a9b; }
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.case {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.case:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c5d1de; }
.case__media { height: 190px; background: var(--dark); }
.case__media img { width: 100%; height: 100%; object-fit: cover; }
.case__body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.case__body h3 { margin: 0; }
.case__body > p { color: var(--muted); font-size: .95rem; margin: 0; }
.case__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.case__client { font-size: .82rem; font-weight: 600; color: var(--muted); }
.case__more { border-top: 1px solid var(--line); padding-top: 10px; font-size: .9rem; }
.case__more summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); }
.case__more h4 { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 14px 0 6px; }
.case__more ul { margin: 0; padding-left: 18px; color: var(--ink); display: grid; gap: 4px; }
.case .chips li { font-size: .78rem; padding: 3px 8px; }
.case__link { font-size: .9rem; font-weight: 600; color: var(--accent-ink); text-decoration: none; }
.case__link:hover { text-decoration: underline; }

/* Team: lead engineer profile */
.profile {
  margin-top: 48px; display: grid; grid-template-columns: 300px 1fr;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.profile__side { background: var(--dark); color: var(--on-dark); padding: 32px 28px; }
.profile__avatar {
  width: 112px; height: 112px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--accent); margin-bottom: 18px;
}
.profile__side h3 { font-size: 1.4rem; margin-bottom: 6px; }
.profile__role { color: var(--accent); font-size: .9rem; }
.profile__facts { list-style: none; padding: 0; margin: 20px 0 24px; display: grid; gap: 12px; font-size: .9rem; }
.profile__facts li { display: flex; flex-direction: column; }
.profile__facts .mono { color: var(--on-dark-muted); text-transform: uppercase; font-size: .66rem; }
.profile__cta { display: flex; flex-wrap: wrap; gap: 10px; }
.profile__cta .btn--line { color: var(--on-dark); border-color: var(--dark-line); }
.profile__cta .btn--line:hover { background: var(--dark-2); color: var(--on-dark); }
.profile__main { padding: 32px 36px; }
.profile__summary { font-size: 1.05rem; color: var(--ink); }
.profile__h { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 28px 0 12px; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 0 0 14px 20px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
.timeline li:first-child::before { background: var(--accent); }
.timeline .mono { color: var(--accent-ink); padding-top: 3px; }
.timeline strong { display: block; font-weight: 600; }
.timeline em { font-style: normal; color: var(--muted); font-size: .9rem; }
.skills { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0; font-size: .92rem; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }


/* Contact */
.contact__list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
.contact__list li { display: flex; flex-direction: column; }
.contact__list span { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--on-dark-muted); }
.contact__list a { color: var(--accent); text-decoration: none; font-size: 1.1rem; font-weight: 600; }
.contact__list strong { font-weight: 500; }
.form { background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: 14px; padding: 28px; display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: .88rem; color: var(--on-dark-muted); }
.form input, .form textarea {
  font: inherit; color: var(--on-dark);
  background: var(--dark); border: 1px solid var(--dark-line); border-radius: 8px; padding: 10px 12px;
  resize: vertical;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form__note { font-size: .8rem; color: var(--on-dark-muted); margin: 0; }
.form__note--ok { color: var(--ok); font-size: .9rem; }
.form__note--err { color: #ff7a7a; font-size: .9rem; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form button:disabled { opacity: .6; cursor: wait; }

/* Footer */
.footer { background: #070e17; color: var(--on-dark-muted); font-size: .88rem; padding: 26px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer__logo { width: 160px; height: auto; margin-bottom: 18px; }
.footer a { text-decoration: none; color: var(--on-dark-muted); }
.footer a:hover { color: var(--accent); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .flow, .led--a { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Live PLC demo ---------- */
.demo__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.demo__hw { display: grid; gap: 24px; }

/* Operator panel (RAL 7035 door) */
.panel {
  position: relative;
  background: linear-gradient(160deg, #dfe3e0, #c3c9c5);
  border-radius: 10px;
  padding: 30px 26px 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -2px 0 rgba(0,0,0,.12), 0 20px 40px rgba(0,0,0,.35);
  color: #1b232c;
}
.screw { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f4f6f5, #8d9591); box-shadow: 0 1px 1px rgba(0,0,0,.3); }
.screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 4.5px; height: 1px; background: #5b625e; transform: rotate(35deg); }
.screw--tl { top: 10px; left: 10px; } .screw--tr { top: 10px; right: 10px; }
.screw--bl { bottom: 10px; left: 10px; } .screw--br { bottom: 10px; right: 10px; }
.panel__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; justify-items: center; align-items: end; }
.panel__row--lamps { margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid rgba(0,0,0,.1); }
.dev { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.plate {
  background: #1b1f24; color: #f1f1f1;
  font: 600 .64rem var(--mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 2px; min-width: 64px; text-align: center;
}
.panel__hint { margin: 16px 0 0; font-size: .78rem; color: #4c5660; text-align: center; }

.lamp {
  width: 34px; height: 34px; border-radius: 50%;
  border: 4px solid #9aa2a8;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.35), transparent 45%), var(--lamp-off);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.35), 0 1px 0 #fff;
  transition: background .08s, box-shadow .08s;
}
.lamp--white { --lamp-off: #8f9499; --lamp-on: #fffbe8; --glow: rgba(255,251,220,.9); }
.lamp--green { --lamp-off: #2c5a3c; --lamp-on: #3cf07a; --glow: rgba(60,240,122,.8); }
.lamp--red   { --lamp-off: #5e2a2a; --lamp-on: #ff4a3d; --glow: rgba(255,74,61,.85); }
.lamp.on { background: radial-gradient(circle at 35% 30%, #fff, transparent 50%), var(--lamp-on); box-shadow: 0 0 14px 3px var(--glow), inset 0 -2px 4px rgba(0,0,0,.15); }

.pb {
  width: 58px; height: 58px; border-radius: 50%; padding: 6px; cursor: pointer;
  border: 0; background: linear-gradient(145deg, #eef0f1, #8e979d);
  box-shadow: 0 3px 6px rgba(0,0,0,.35); touch-action: manipulation;
}
.pb span {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  font: 700 1rem Inter, sans-serif; color: rgba(255,255,255,.9);
  background: radial-gradient(circle at 40% 30%, rgba(255,255,255,.35), transparent 55%), var(--cap);
  box-shadow: inset 0 -4px 6px rgba(0,0,0,.35), 0 2px 0 rgba(0,0,0,.25);
  transition: transform .06s, box-shadow .06s;
}
.pb--green { --cap: #1f9d4c; }
.pb--red { --cap: #d4262a; }
.pb.pressed span, .pb:active span { transform: scale(.9); box-shadow: inset 0 3px 6px rgba(0,0,0,.45); }
.pb:focus-visible, .estop:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.estop {
  width: 84px; height: 84px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle, #f5c400 60%, #d6a800 61%, #f5c400 64%);
  box-shadow: 0 3px 8px rgba(0,0,0,.35); display: grid; place-items: center; touch-action: manipulation;
}
.estop span {
  width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #ff7b6e, #c8151b 55%, #8c0c10);
  box-shadow: 0 7px 0 #6d0a0d, 0 10px 12px rgba(0,0,0,.4);
  transform: translateY(-5px);
  transition: transform .12s, box-shadow .12s;
}
.estop[aria-pressed="true"] span { transform: translateY(0) scale(.96); box-shadow: 0 2px 0 #6d0a0d, 0 3px 5px rgba(0,0,0,.35); }

/* PLC rack */
.rack { background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: 12px; padding: 18px; }
.rack__rail {
  display: grid; grid-template-columns: 1fr 1.25fr 1.25fr; gap: 4px;
  padding: 10px 0; position: relative;
  background: linear-gradient(transparent 46%, #3a4656 46%, #56657a 50%, #3a4656 54%, transparent 54%);
}
.mod {
  position: relative;
  background: linear-gradient(180deg, #2a3442, #1d2531);
  border: 1px solid #3a4758; border-radius: 4px;
  padding: 10px 10px 12px; min-height: 196px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 4px 10px rgba(0,0,0,.35);
}
.mod--cpu { background: linear-gradient(180deg, #202a36, #151c26); }
.mod__name { font: 600 .66rem var(--mono); color: var(--on-dark); letter-spacing: .06em; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #3a4758; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod__port { display: flex; gap: 4px; margin-top: 16px; }
.mod__port span { width: 22px; height: 16px; border-radius: 2px; background: #0b1016; border: 1px solid #4a5a6e; }
.mod__foot { font: 500 .6rem var(--mono); color: var(--on-dark-muted); margin-top: 6px; }
.io { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.io li { display: grid; grid-template-columns: 9px 16px 1fr; align-items: center; gap: 5px; font: 500 .62rem var(--mono); color: var(--on-dark-muted); white-space: nowrap; }
.mod--cpu .io li { grid-template-columns: 9px 1fr; }
.io em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.io .led { width: 9px; height: 9px; border-radius: 2px; background: #1b3b27; transition: background .05s, box-shadow .05s; }
.io .led.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.io .led--red { background: #3f1c1c; }
.io .led--red.on { background: #ff4a3d; box-shadow: 0 0 6px #ff4a3d; }
.io .led--amber { background: #3d3212; }
.io li.used em { color: var(--on-dark); }

.rack__bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.motor { display: flex; align-items: center; gap: 12px; }
.motor svg { width: 52px; height: 52px; }
.motor div { display: flex; flex-direction: column; }
.motor .mono { color: var(--on-dark-muted); }
.motor strong { font-size: 1rem; color: var(--on-dark); }
.motor__housing { fill: #13243a; stroke: #4a6a90; stroke-width: 2; }
.motor__rotor { fill: #4a6a90; transition: fill .3s; }
.motor.running .motor__rotor { fill: var(--accent); }
.motor__hub { fill: #0b1420; stroke: #4a6a90; stroke-width: 2; }
.scan { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--on-dark-muted); }
.scan b { color: var(--on-dark); font-weight: 500; }

/* Program editor */
.editor { background: #0c1623; border: 1px solid var(--dark-line); border-radius: 12px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.editor__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 12px; background: #0f1c2c; border-bottom: 1px solid var(--dark-line); color: var(--on-dark-muted); }
.tabs { display: flex; gap: 2px; background: #0b1420; border-radius: 6px; padding: 2px; }
.tab { font: 600 .72rem var(--mono); color: var(--on-dark-muted); background: none; border: 0; padding: 5px 12px; border-radius: 4px; cursor: pointer; }
.tab.active { background: var(--accent); color: #fff; }
.monitoring { margin-left: auto; display: flex; align-items: center; gap: 6px; color: #f2a900; }
.monitoring i { width: 8px; height: 8px; border-radius: 50%; background: #f2a900; animation: blink 1.4s steps(2) infinite; }
.editor__body { padding: 8px 14px 14px; }
.net { border-bottom: 1px dashed var(--dark-line); padding: 10px 0 4px; }
.net:last-child { border-bottom: 0; }
.net__title { font-size: .7rem; color: var(--on-dark-muted); margin-bottom: 4px; }
.lad { width: 100%; height: auto; overflow: visible; }
.lad .rail { stroke: var(--ok); stroke-width: 3; }
.lad .w { fill: none; stroke: #3d5a7c; stroke-width: 2; stroke-dasharray: 4 4; transition: stroke .05s; }
.lad .w.on { stroke: var(--ok); stroke-dasharray: none; stroke-width: 2.5; }
.lad .el path, .lad .el line { fill: none; stroke: #7f95ae; stroke-width: 2; }
.lad .el rect.hit { fill: transparent; }
.lad .el.on path, .lad .el.on line { stroke: var(--ok); }
.lad .el.on .bg { fill: rgba(60, 207, 122, .14); }
.lad .bg { fill: transparent; }
.lad .addr { fill: #7f95ae; font: 500 10px var(--mono); text-anchor: middle; }
.lad .sym { fill: var(--on-dark); font: 600 10px var(--mono); text-anchor: middle; }
.lad .val { font: 600 9px var(--mono); text-anchor: middle; fill: #56657a; }
.lad .el.on .val, .lad .val.on { fill: var(--ok); }

.scl { font: 500 .8rem/1.9 var(--mono); color: var(--on-dark); padding-top: 14px; }
.scl__ln { display: flex; justify-content: space-between; gap: 12px; }
.scl__ln code { font: inherit; white-space: pre-wrap; }
.scl .cm { color: #6f8f78; font-style: normal; }
.scl .kw { color: #c792ea; font-style: normal; }
.scl .tg { color: #82cfff; font-weight: 500; }
.mon:empty { display: none; }
.mon { flex: none; align-self: center; font-size: .66rem; padding: 0 6px; border-radius: 3px; line-height: 1.6; background: #1d2939; color: #7f95ae; }
.mon.on { background: rgba(60, 207, 122, .16); color: var(--ok); }
.editor__foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 14px; border-top: 1px solid var(--dark-line); background: #0f1c2c; font-size: .66rem; color: var(--on-dark-muted); }

.editor__note { padding: 8px 14px; font-size: .68rem; color: var(--on-dark-muted); border-bottom: 1px solid var(--dark-line); background: #0d1826; }

/* FBD + GRAPH shapes */
.lad .box { fill: #0f1c2c; stroke: #7f95ae; stroke-width: 1.5; transition: stroke .05s, fill .05s; }
.lad .box__t { fill: var(--on-dark); font: 700 11px var(--mono); text-anchor: middle; }
.lad .box__sep { stroke: #7f95ae; stroke-width: 1.5; }
.lad .sym--in { text-anchor: end; }
.lad .neg { fill: #0c1623; stroke: #3d5a7c; stroke-width: 2; }
.lad .neg.on { stroke: var(--ok); }
.lad .el.on .box { stroke: var(--ok); fill: rgba(60, 207, 122, .12); }
.lad .el.on .box__sep { stroke: var(--ok); }
.graph .link { fill: none; stroke: #7f95ae; stroke-width: 2; }
.graph .gstep.active .box { stroke: var(--ok); fill: rgba(60, 207, 122, .16); }
.graph .gtrans .bar { stroke: #7f95ae; stroke-width: 4; }
.graph .gtrans.on .bar { stroke: var(--ok); }
.graph .cond { fill: #82cfff; font: 500 10px var(--mono); }
.graph .gtrans.on .cond { fill: var(--ok); }

/* STL with RLO / STA columns */
.stl { font: 500 .8rem/1.9 var(--mono); color: var(--on-dark); }
.stl .net__title { margin: 12px 0 2px; }
.stl__ln { display: grid; grid-template-columns: 44px 1fr 44px 44px; align-items: center; gap: 8px; border-bottom: 1px solid #111e2e; }
.stl__ln .kw { color: #c792ea; font-style: normal; font-weight: 600; }
.stl__ln .tg { color: #82cfff; font-weight: 500; }
.stl__ln .mon { justify-self: center; min-width: 26px; text-align: center; }
.stl__head { font-size: .62rem; color: var(--on-dark-muted); border-bottom: 1px solid var(--dark-line); }
.stl__head span { text-align: center; }

/* ---------- HMI alarms & trends (inside the demo) ---------- */
.hmi { margin-top: 24px; background: #0c1623; border: 1px solid var(--dark-line); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.hmi__bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #0f1c2c; border-bottom: 1px solid var(--dark-line); color: var(--on-dark-muted); }
.hmi__user { margin-left: auto; }
.hmi__user + .mimic__clock { margin-left: 16px; }
.hmi__body { display: grid; grid-template-columns: 1.3fr 1fr; }
.hmi__trend { padding: 14px; border-right: 1px solid var(--dark-line); min-width: 0; }
.hmi__alarms { padding: 14px; display: flex; flex-direction: column; min-width: 0; }
.hmi__head { display: flex; align-items: center; gap: 10px; color: var(--on-dark-muted); margin-bottom: 10px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.hmi__count { background: #1d2939; color: var(--on-dark); border-radius: 10px; padding: 0 8px; font-size: .68rem; }
.hmi__count.alert { background: #c8151b; color: #fff; }
.ack { margin-left: auto; background: #1d2939; color: var(--on-dark); border: 1px solid #3a4758; border-radius: 4px; padding: 4px 12px; font-size: .7rem; cursor: pointer; letter-spacing: .08em; }
.ack:hover { border-color: var(--accent); }
.trend { width: 100%; height: 200px; background: #0a131e; border: 1px solid var(--dark-line); border-radius: 6px; display: block; }
.trend__grid path { stroke: #172537; stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend__limit { stroke: var(--amber); stroke-dasharray: 6 5; stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .8; }
.trend__pen { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.trend__pen--a { stroke: var(--accent); }
.trend__pen--b { stroke: #82cfff; }
.trend__pen--c { stroke: var(--ok); }
.trend__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: .7rem; color: var(--on-dark-muted); }
.trend__legend b { color: var(--on-dark); font-weight: 500; }
.sw { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.sw--a { background: var(--accent); } .sw--b { background: #82cfff; } .sw--c { background: var(--ok); }
.sw--h { background: repeating-linear-gradient(90deg, var(--amber) 0 4px, transparent 4px 7px); }
.alarms { display: grid; gap: 4px; align-content: start; min-height: 228px; }
.al {
  display: grid; grid-template-columns: 62px 20px 1fr auto; gap: 8px; align-items: center;
  font: 500 .72rem var(--mono); padding: 7px 8px; border-radius: 4px;
  background: #111e2e; border-left: 3px solid var(--c); color: var(--on-dark);
}
.al--A { --c: #ff4a3d; } .al--W { --c: var(--amber); } .al--I { --c: #82cfff; }
.al.active.unack { background: color-mix(in srgb, var(--c) 18%, #111e2e); animation: alflash 1s steps(2) infinite; }
.al.gone { color: var(--on-dark-muted); }
.al time { color: var(--on-dark-muted); }
.al .cls { color: var(--c); font-weight: 700; text-align: center; }
.al .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al .st { font-size: .64rem; color: var(--on-dark-muted); text-transform: uppercase; }
@keyframes alflash { 50% { background: #111e2e; } }
.alarms__empty { font: 500 .75rem var(--mono); color: var(--on-dark-muted); padding: 8px; }
.mimic__tags .alert { color: #ff4a3d; animation: blink 1s steps(2) infinite; }

@media (max-width: 1024px) {
  .hmi__body { grid-template-columns: 1fr; }
  .hmi__trend { border-right: 0; border-bottom: 1px solid var(--dark-line); }
}
@media (max-width: 600px) {
  .hmi__user { display: none; }
  .hmi__bar .mimic__clock { margin-left: auto; }
  .al { grid-template-columns: 56px 16px 1fr; }
  .al .st { display: none; }
  .alarms { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .al.active.unack { animation: none; }
}

/* ---------- SFC / GRAFCET approach ---------- */
.sfc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 64px 1fr 64px 1fr 64px 1fr; align-items: center; }
.sfc__step {
  position: relative; align-self: stretch;
  background: var(--surface); border: 2px solid var(--line); border-radius: 6px;
  padding: 24px 22px 22px;
  transition: border-color .4s, box-shadow .4s, opacity .6s ease, transform .6s ease;
}
.sfc__step--init { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--line); }
.sfc__step.active { border-color: var(--accent); }
.sfc__step--init.active { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent); }
.sfc__step.active:not(.sfc__step--init) { box-shadow: 0 10px 30px rgba(16,168,160,.15); }
.sfc__n { display: inline-block; font-size: .8rem; font-weight: 700; color: var(--accent-ink); background: rgba(16,168,160,.1); padding: 2px 8px; border-radius: 4px; margin-bottom: 12px; }
.sfc__token { position: absolute; top: 16px; right: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--line); transition: background .3s, box-shadow .3s; }
.sfc__step.active .sfc__token { background: var(--accent); box-shadow: 0 0 0 4px rgba(16,168,160,.18); }
.sfc__step p { color: var(--muted); font-size: .95rem; margin: 0; }
.sfc__trans { position: relative; height: 100%; min-height: 60px; }
.sfc__trans::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--line); transition: background .3s; }
.sfc__trans::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 26px; margin: -13px 0 0 -1.5px; background: var(--ink); }
.sfc__trans span, .sfc__trans em { position: absolute; left: 0; right: 0; text-align: center; font-size: .66rem; font-style: normal; color: var(--muted); line-height: 1.2; }
.sfc__trans span { top: calc(50% - 34px); font-weight: 700; color: var(--ink); }
.sfc__trans em { top: calc(50% + 18px); }
.sfc__trans.fired::before { background: var(--accent); }

@media (max-width: 1024px) {
  .demo__grid { grid-template-columns: 1fr; }
  .sfc { grid-template-columns: 1fr; max-width: 560px; }
  .sfc__trans { height: 64px; }
  .sfc__trans::before { left: 50%; right: auto; top: 0; bottom: 0; width: 2px; height: auto; margin-left: -1px; }
  .sfc__trans::after { width: 28px; height: 3px; margin: -1.5px 0 0 -14px; }
  .sfc__trans span, .sfc__trans em { left: calc(50% + 24px); right: auto; text-align: left; }
  .sfc__trans span { top: calc(50% - 16px); }
  .sfc__trans em { top: calc(50% + 2px); }
}
@media (max-width: 600px) {
  .panel { padding: 28px 14px 16px; }
  .rack__rail { grid-template-columns: 1fr 1fr; }
  .mod--cpu { grid-column: 1 / -1; min-height: 0; }
  .mod--cpu .io { grid-template-columns: repeat(3, auto); justify-content: start; gap: 5px 16px; }
  .mod--cpu .mod__port, .mod--cpu .mod__foot { display: none; }
  .mod { min-height: 0; }
  .lad .addr, .lad .sym { font-size: 12px; }
  .scl, .stl { font-size: .7rem; }
  .tab { padding: 5px 8px; }
  .editor__bar > .mono:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .monitoring i { animation: none; }
}

/* Responsive */
@media (max-width: 1024px) {
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .hero__inner { grid-template-columns: 1fr; gap: 48px; }
  .mimic { max-width: 560px; }
}
@media (max-width: 900px) {
  .burger { display: block; }
  .nav__links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--dark); border-bottom: 1px solid var(--dark-line);
    padding: 8px 20px 20px;
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 12px 0; border-bottom: 1px solid var(--dark-line); }
  .nav__links a.btn { margin-top: 12px; text-align: center; border-bottom: 0; }
  .cards--3, .platforms { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .cases { grid-template-columns: 1fr 1fr; }
  .profile { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .section { padding: 64px 0; }
  .hero { padding: 56px 0 64px; }
  .cards--4, .cards--3, .platforms { grid-template-columns: 1fr; }
  .cases { grid-template-columns: 1fr; }
  .profile__main, .profile__side { padding: 24px 18px; }
  .timeline li, .skills { grid-template-columns: 1fr; gap: 2px; }
  .skills dd { margin-bottom: 8px; }
  .mimic__tags { grid-template-columns: repeat(2, 1fr); }
  .mimic__tags div:nth-child(2) { border-right: 0; }
  .mimic__tags div:nth-child(-n+2) { border-bottom: 1px solid var(--dark-line); }
  .logo__text em { display: none; }
  .stat { padding: 22px 14px; }
  .stat strong { font-size: 1.6rem; }
}
