/* scadamanager.com - ISA-101 "high performance HMI" palette: grey field, colour only for state.
   No inline CSS anywhere (strict-CSP fleet). */

:root {
  --field: #d5d8da;       /* page background, the HMI field grey */
  --panel: #eceeef;       /* raised panels */
  --band: #c9cdd0;        /* alternate section band */
  --line: #a7aeb4;
  --line-soft: #bcc2c6;
  --ink: #1e2932;         /* slate, the HMI text colour */
  --dim: #4d5963;
  --nav: #1f4e79;         /* navigation blue */
  --nav-deep: #163a5a;
  --p1: #b3261e;          /* alarm priority colours: the only saturated colour on the page */
  --p2: #c77700;
  --p3: #d9b300;
  --run: #5c6a75;         /* running equipment: darker grey, not green (ISA-101) */
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font: 400 17px/1.6 "Barlow", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand, .hmi-bar, summary, dt {
  font-family: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}
h1, h2, h3 { line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--nav); text-underline-offset: 3px; }
a:hover { color: var(--nav-deep); }
:focus-visible { outline: 3px solid var(--nav); outline-offset: 2px; }
main:focus { outline: none; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--nav); color: #fff; padding: 6px 12px; }
.skip:focus { left: 8px; z-index: 10; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.section { padding: 72px 24px; }
.band { background: var(--band); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 72px 0; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -.005em; margin-bottom: 14px; }
.intro { max-width: 68ch; color: var(--dim); font-size: 1.05rem; margin-bottom: 36px; }

/* ---------- masthead ---------- */
.masthead { background: var(--panel); border-bottom: 1px solid var(--line); }
.masthead-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.25rem; }
.brand-mark { width: 28px; height: 28px; }
.brand-mark rect { fill: var(--ink); }
.brand-mark path { fill: none; stroke: var(--field); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { color: var(--dim); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--nav); text-decoration: underline; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); font-weight: 700; letter-spacing: -.012em; margin-bottom: 22px; max-width: 16ch; }
.lede { font-size: 1.18rem; color: var(--ink); max-width: 52ch; }
.hero-text p:not(.lede) { color: var(--dim); max-width: 52ch; }
.hero-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-block; padding: 11px 20px; border-radius: var(--radius);
  background: var(--nav); color: #fff; text-decoration: none; font-weight: 600;
  border: 1px solid var(--nav);
}
.btn:hover { background: var(--nav-deep); color: #fff; }
.btn-quiet { background: transparent; color: var(--nav); border-color: var(--line); }
.btn-quiet:hover { background: var(--panel); color: var(--nav-deep); }

/* the overview display */
.hmi { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 1px 0 #fff inset, 0 18px 40px -28px rgba(30, 41, 50, .55); }
.hmi-bar { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); font-weight: 600; font-size: .95rem; color: var(--dim); }
.hmi-clock { font-weight: 500; font-style: italic; }
.mimic { display: block; width: 100%; height: auto; padding: 8px 10px 0; font-family: "Barlow Semi Condensed", "Barlow", sans-serif; }
.mimic .comms { fill: none; stroke: var(--line); stroke-width: 1.6; stroke-dasharray: 5 4; }
.mimic .unit { fill: #f6f7f7; stroke: var(--line); stroke-width: 1.2; }
.mimic .tank { fill: none; stroke: var(--dim); stroke-width: 1.2; }
.mimic .level { fill: #9aa3aa; }
.mimic .pump { fill: #f6f7f7; stroke: var(--dim); stroke-width: 1.4; }
.mimic .pump.on { fill: var(--run); stroke: var(--run); }
.mimic text { fill: var(--ink); text-anchor: middle; }
.mimic text.l { text-anchor: start; }
.mimic .lbl { font-size: 12px; font-weight: 600; fill: var(--dim); }
.mimic .val { font-size: 11px; fill: var(--dim); }
.mimic .big { font-size: 22px; font-weight: 700; }
.mimic .alm-p2 { fill: var(--p2); }
.mimic .alm-p3 { fill: var(--p3); }
.mimic .alm-n { font-size: 9px; font-weight: 700; fill: #fff; }
.mimic .alm-n.dark { fill: var(--ink); }

.alarms { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: 4px; }
.alarms caption { caption-side: top; text-align: left; padding: 10px 14px 6px; font-weight: 600; color: var(--ink); border-top: 1px solid var(--line-soft); }
.alarms th { text-align: left; font-weight: 500; color: var(--dim); padding: 4px 14px; border-bottom: 1px solid var(--line-soft); }
.alarms td { padding: 7px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.alarms tr:last-child td { border-bottom: 0; }
.alarms td:first-child, .alarms th:first-child { width: 3.5em; }
.alarms td:nth-child(2) { white-space: nowrap; color: var(--dim); }
.pri { display: inline-grid; place-items: center; width: 22px; height: 20px; font-weight: 700; font-size: .8rem; clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 5px; }
.pri.p2 { background: var(--p2); color: #fff; }
.pri.p3 { background: var(--p3); color: var(--ink); }

/* ---------- the ten areas ---------- */
.areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin: 0; }
.areas > div { padding: 22px 0 20px; border-top: 2px solid var(--ink); }
.areas dt { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.areas dd { margin: 0; color: var(--dim); max-width: 60ch; }

/* ---------- lifecycle track (a real sequence, so it is numbered) ---------- */
.track { list-style: none; counter-reset: stage; display: grid; grid-template-columns: 1fr 1fr 1fr 2.2fr 1fr 1fr; gap: 0; margin: 0; padding: 0; }
.track li { counter-increment: stage; position: relative; padding: 42px 16px 0 0; }
.track li::before {
  content: counter(stage); position: absolute; top: 0; left: 0;
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--panel); border: 2px solid var(--ink); border-radius: 50%;
  font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: .95rem; z-index: 1;
}
.track li::after { content: ""; position: absolute; top: 13px; left: 28px; right: 0; height: 2px; background: var(--ink); }
.track li:last-child::after { display: none; }
.track li.long::before { background: var(--nav); border-color: var(--nav); color: #fff; }
.track li.long::after { height: 6px; top: 11px; background: var(--nav); }
.track h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 6px; }
.track li.long h3 { color: var(--nav); font-size: 1.3rem; }
.track p { color: var(--dim); font-size: .95rem; margin: 0; }

/* ---------- questions ---------- */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; font-size: 1.22rem; font-weight: 600; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; position: absolute; right: 6px; top: 26px; width: 10px; height: 10px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); transition: transform .2s; }
details[open] summary::after { transform: rotate(225deg); top: 31px; }
details p { color: var(--dim); max-width: 68ch; padding-bottom: 8px; }

/* ---------- help + related ---------- */
.help { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.help-main p { max-width: 60ch; }
.related { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--nav); padding: 22px 24px; border-radius: 0 var(--radius) var(--radius) 0; }
.related h3 { font-size: 1.1rem; margin-bottom: 12px; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.related li:first-child { border-top: 0; padding-top: 0; }
.related a { font-weight: 600; display: block; }
.related span { color: var(--dim); font-size: .93rem; }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: #c9d0d5; padding: 28px 0; font-size: .9rem; }
.foot a { color: #fff; }
.foot-in p { margin: 0 0 6px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero, .help { grid-template-columns: 1fr; gap: 36px; }
  .hero h1 { max-width: none; }
  .track { grid-template-columns: 1fr; }
  .track li { padding: 0 0 22px 46px; }
  .track li::after { top: 28px; left: 13px; right: auto; bottom: 0; width: 2px; height: auto; }
  .track li.long::after { width: 6px; left: 11px; height: auto; top: 28px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .section { padding: 52px 16px; }
  .band { padding: 52px 0; }
  .areas { grid-template-columns: 1fr; }
  .nav { gap: 14px; font-size: .92rem; }
  .alarms td:nth-child(2) { white-space: normal; }
  .masthead-in { padding-top: 10px; padding-bottom: 10px; row-gap: 6px; }
  .hero { padding-top: 36px; padding-bottom: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  summary::after { transition: none; }
}
@media print {
  .masthead nav, .hero-links, .skip { display: none; }
  body, .band { background: #fff; }
  details > p { display: block; }
}
