/* Monso MEP Engineering: website styles
   Theme: dark only (engineering tool feel). One accent: brand blue.
   Plugin hues (water blue, gas amber, heat red) come from the Monso logo and only mark each plugin.
   Radius rule: buttons and inputs 10px, media frames and cards 16px. */

:root {
  --bg: #0b1622;
  --bg-2: #0e1c2b;
  --surface: #122436;
  --surface-2: #17304a;
  --line: rgb(201 211 221 / 0.12);
  --line-strong: rgb(201 211 221 / 0.22);
  --text: #e9eff5;
  --muted: #a7b6c5;
  --faint: #7f93a7;
  --accent: #3d9be3;          /* brand blue #1F7BC1, lifted for dark backgrounds */
  --accent-solid: #1f7bc1;
  --accent-ink: #ffffff;
  --water: #3d9be3;
  --gas: #f2b233;
  --heat: #e05a4f;
  --navy: #14324f;
  --radius-sm: 10px;
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Montserrat", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1240px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent-solid); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100; }
.skip:focus { left: 16px; }

/* Subtle engineering grid behind the page (fixed, no repaint on scroll) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgb(31 123 193 / 0.18), transparent 60%),
    linear-gradient(rgb(201 211 221 / 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgb(201 211 221 / 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}

/* Animated star field and engineering network (assets/js/background.js), over the grid, under the content */
.bg-network {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  display: block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font: 600 15px/1 var(--font-body);
  text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn--primary { background: var(--accent-solid); color: var(--accent-ink); }
.btn--primary:hover { background: #2a8ad3; }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: rgb(255 255 255 / 0.02); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--sm { padding: 10px 16px; font-size: 14px; }
.btn--lg { padding: 18px 28px; font-size: 16px; }
.btn[aria-disabled="true"] { background: var(--surface-2); color: var(--muted); pointer-events: none; }
.btn i { font-size: 1.1em; }

.eyebrow { font: 500 13px/1.4 var(--font-mono); color: var(--accent); letter-spacing: 0.04em; margin-bottom: 18px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgb(11 22 34 / 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav__inner { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__brand img { height: 38px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 32px; }
.nav__links > a:not(.btn) { text-decoration: none; color: var(--muted); font-size: 15px; transition: color .2s; }
.nav__links > a:not(.btn):hover { color: var(--text); }
.nav__toggle { display: none; background: none; border: 1px solid var(--line-strong); color: var(--text); border-radius: var(--radius-sm); width: 44px; height: 44px; font-size: 22px; cursor: pointer; }
.nav__mobile { border-top: 1px solid var(--line); padding: 12px 24px 20px; display: grid; gap: 4px; }
.nav__mobile[hidden] { display: none; }
.nav__mobile a { text-decoration: none; padding: 12px 0; color: var(--text); font-size: 17px; }
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-grid; place-items: center; }
}

/* ---------- Hero ---------- */
.hero { padding: 88px 0 72px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(38px, 4.2vw, 58px); line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; max-width: 14ch; }
.hero__sub { margin-top: 22px; color: var(--muted); font-size: 19px; max-width: 46ch; }
.hero__ctas { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero__media { margin: 0; }
.frame {
  border-radius: var(--radius);
  padding: 8px;
  background: linear-gradient(160deg, rgb(255 255 255 / 0.10), rgb(255 255 255 / 0.02));
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -20px rgb(3 10 18 / 0.85), inset 0 1px 0 rgb(255 255 255 / 0.08);
  transform: perspective(1600px) rotateY(-6deg) rotateX(2deg);
  transition: transform .6s var(--ease);
}
.frame:hover { transform: perspective(1600px) rotateY(-2deg) rotateX(0deg); }
.frame img { border-radius: 10px; }
.hero__media figcaption { margin-top: 16px; font: 400 13px/1.4 var(--font-mono); color: var(--faint); }
@media (max-width: 960px) {
  .hero { padding: 40px 0 32px; }
  .hero__sub { font-size: 17px; }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; min-height: 0; }
  .frame { transform: none; }
}

/* ---------- Standards strip ---------- */
.standards { border-block: 1px solid var(--line); background: rgb(14 28 43 / 0.6); }
.standards__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; padding: 22px 0; }
.standards__row span { font: 500 14px/1 var(--font-mono); color: var(--muted); letter-spacing: 0.02em; }
@media (max-width: 760px) { .standards__row { justify-content: flex-start; } }

/* ---------- Sections ---------- */
section { position: relative; }
.plugins, .why, .flow, .about { padding: 112px 0; }
.section-title { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; max-width: 22ch; }
.section-lead { margin-top: 18px; color: var(--muted); max-width: 62ch; font-size: 18px; }
@media (max-width: 760px) { .plugins, .why, .flow, .about { padding: 72px 0; } }

/* ---------- Plugins: tabs ---------- */
.tabs {
  margin-top: 48px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.tab {
  --hue: var(--accent);
  display: flex; align-items: center; gap: 12px;
  text-align: left; cursor: pointer;
  padding: 14px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); font-family: var(--font-body);
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
  position: relative; overflow: hidden;
}
.tab::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px;
  background: var(--hue); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.tab:hover { border-color: var(--line-strong); }
.tab[aria-selected="true"] { background: var(--surface); border-color: var(--line-strong); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab img { width: 40px; height: 40px; flex: none; }
.tab strong { display: block; font: 700 15px/1.2 var(--font-display); letter-spacing: -0.01em; }
.tab small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.3; }
.tab__mark { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1px dashed var(--line-strong); display: grid; place-items: center; color: var(--faint); font-size: 20px; }
.tab--soon strong { color: var(--muted); }
.tab--wide { grid-column: span 2; }
.tab--super { background: linear-gradient(120deg, rgb(242 178 51 / 0.10), var(--bg-2) 55%); border-color: rgb(242 178 51 / 0.35); }
.tab--super strong { color: var(--text); }
.tab__badge { font: 600 11px/1 var(--font-mono); font-style: normal; color: #0b1622; background: var(--gas); padding: 4px 7px; border-radius: 6px; margin-left: 8px; letter-spacing: 0.02em; vertical-align: 2px; white-space: nowrap; }
@media (max-width: 1080px) {
  .tabs { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .tab { flex: 0 0 240px; scroll-snap-align: start; }
}

/* ---------- Plugins: panel ---------- */
.panel {
  --hue: var(--accent);
  margin-top: 18px;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px;
  padding: 32px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  animation: panel-in .45s var(--ease);
}
.panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel__tag { font: 500 13px/1 var(--font-mono); color: var(--hue); }
.panel h3 { margin-top: 14px; font-size: clamp(24px, 2.2vw, 30px); line-height: 1.2; font-weight: 700; }
.outcomes { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.outcomes li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; color: var(--text); font-size: 16px; line-height: 1.5; }
.outcomes i { color: var(--hue); font-size: 22px; margin-top: 1px; }
.how { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.how__title { font: 600 14px/1 var(--font-body); color: var(--muted); }
.how ol { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: how; display: grid; gap: 10px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 28px 1fr; gap: 10px; color: var(--muted); font-size: 15px; }
.how li::before { content: counter(how); font: 500 13px/24px var(--font-mono); width: 24px; height: 24px; text-align: center; border-radius: 6px; background: var(--surface-2); color: var(--text); }
.panel__actions { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.trial { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.trial i { color: var(--hue); font-size: 18px; }
.soon-text { margin-top: 18px; color: var(--muted); }
.soon-icon { width: 72px; height: 72px; margin-bottom: 18px; }
@media (max-width: 960px) {
  .panel { grid-template-columns: 1fr; gap: 28px; padding: 20px; }
}

/* Video slot */
.video {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: #08111b; border: 1px solid var(--line);
}
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; opacity: 0.35; filter: saturate(0.8); }
.video__empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px;
  background: radial-gradient(60% 60% at 50% 50%, rgb(11 22 34 / 0.35), rgb(11 22 34 / 0.85));
}
.video__icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); background: rgb(11 22 34 / 0.7); font-size: 26px; color: var(--hue, var(--accent)); }
.video__empty strong { font: 700 17px/1.2 var(--font-display); }
.video__empty span { color: var(--muted); font-size: 14px; max-width: 34ch; }
.video__play { all: unset; cursor: pointer; position: absolute; inset: 0; }
.video__play .video__icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--accent-solid); color: #fff; border: 0; transition: transform .25s var(--ease); }
.video__play:hover .video__icon { transform: translate(-50%, -50%) scale(1.06); }
.video__play:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }

.thumbs { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.thumb { all: unset; cursor: zoom-in; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; background: #fff; transition: border-color .2s, transform .25s var(--ease); }
.thumb:hover { border-color: var(--hue); transform: translateY(-2px); }
.thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }

/* ---------- Why: bento ---------- */
.bento {
  margin-top: 48px;
  display: grid; gap: 16px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.cell { border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); padding: 30px; overflow: hidden; position: relative; }
.cell h3 { font-size: 22px; line-height: 1.25; font-weight: 700; }
.cell p { margin-top: 10px; color: var(--muted); font-size: 16px; max-width: 46ch; }
.cell--wide { grid-column: span 8; grid-row: span 2; padding: 0; display: flex; flex-direction: column; }
.cell--wide img { width: 100%; flex: 1; object-fit: cover; object-position: left top; min-height: 280px; border-bottom: 1px solid var(--line); }
.cell__text { padding: 28px 30px 30px; }
.cell--tint { grid-column: span 4; background: linear-gradient(150deg, var(--navy), var(--bg-2)); }
.cell__icon { font-size: 30px; color: var(--accent); margin-bottom: 18px; display: block; }
.cell--report { grid-column: span 4; padding-bottom: 0; display: flex; flex-direction: column; }
.cell--report img { margin-top: 22px; border-radius: 10px 10px 0 0; height: 150px; object-fit: cover; object-position: top; box-shadow: 0 -10px 40px rgb(0 0 0 / 0.35); }
.cell--grid {
  grid-column: span 12;
  background:
    linear-gradient(90deg, rgb(31 123 193 / 0.22), transparent 70%),
    linear-gradient(rgb(201 211 221 / 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgb(201 211 221 / 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg-2);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 40px;
}
.cell--grid p { margin-top: 0; max-width: 60ch; }
@media (max-width: 960px) {
  .bento { grid-template-columns: 1fr; }
  .cell--wide, .cell--tint, .cell--report, .cell--grid { grid-column: auto; grid-row: auto; }
}

/* ---------- Workflow ---------- */
.flow__line { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.flow__line::before { content: ""; position: absolute; left: 0; right: 0; top: 23px; height: 1px; background: linear-gradient(90deg, var(--accent), var(--line) 80%); }
.flow__line li { padding-right: 28px; position: relative; }
.flow__line i { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--bg); border: 1px solid var(--line-strong); color: var(--accent); position: relative; }
.flow__line h3 { margin-top: 22px; font-size: 20px; font-weight: 700; }
.flow__line p { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 30ch; }
@media (max-width: 860px) {
  .flow__line { grid-template-columns: 1fr; gap: 32px; }
  .flow__line::before { left: 23px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; background: var(--line); }
  .flow__line li { padding-left: 70px; padding-right: 0; }
  .flow__line i { position: absolute; left: 0; top: 0; }
  .flow__line h3 { margin-top: 8px; }
}

/* ---------- About ---------- */
.about { border-top: 1px solid var(--line); }
.about__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 72px; align-items: center; }
.about__photo { margin: 0; width: 60%; justify-self: end; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); background: linear-gradient(160deg, var(--navy), var(--bg-2)); position: relative; }
.about__photo > img:not(.about__fallback) { width: 100%; height: 100%; object-fit: cover; }
.about__fallback { display: none; }
.about__photo--empty { display: grid; place-items: center; }
.about__photo--empty .about__fallback { display: block; width: 38%; opacity: 0.9; }
.about__copy h2 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
.about__copy p:not(.eyebrow) { margin-top: 20px; color: var(--muted); font-size: 18px; max-width: 58ch; }
.about__copy .signature { color: var(--text); font: 500 14px/1.4 var(--font-mono); margin-top: 28px; }
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; gap: 36px; }
  .about__photo { width: 60%; max-width: 216px; justify-self: start; }
}

/* ---------- Custom plugin request ---------- */
.custom { padding: 112px 0 72px; border-top: 1px solid var(--line); }
.custom__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: start; }
.custom__copy h2 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
.custom__copy > p:not(.eyebrow) { margin-top: 20px; color: var(--muted); font-size: 18px; max-width: 52ch; }
.custom__list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; color: var(--text); }
.custom__list li { display: flex; gap: 12px; align-items: flex-start; }
.custom__list i { color: var(--accent); font-size: 22px; line-height: 1.2; }
.custom__form {
  display: grid; gap: 16px; padding: 32px; border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgb(23 48 74 / 0.85), rgb(14 28 43 / 0.92));
  backdrop-filter: blur(6px);
}
.custom__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.custom__form label { display: grid; gap: 8px; font: 500 14px/1.3 var(--font-body); color: var(--muted); }
.custom__form input, .custom__form textarea {
  font: 400 16px/1.5 var(--font-body); color: var(--text);
  background: rgb(8 17 27 / 0.7); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 12px 14px; width: 100%;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.custom__form textarea { resize: vertical; min-height: 140px; }
.custom__form input:focus, .custom__form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(61 155 227 / 0.2); }
.custom__form .btn { justify-self: start; border: 0; cursor: pointer; }
.custom__note { font-size: 13px; color: var(--faint); }
.custom__hp { position: absolute; left: -9999px; }
@media (max-width: 900px) {
  .custom { padding: 72px 0 40px; }
  .custom__grid { grid-template-columns: 1fr; gap: 36px; }
  .custom__row { grid-template-columns: 1fr; }
  .custom__form { padding: 22px; }
}

/* ---------- Contact ---------- */
.contact { padding: 40px 0 120px; }
.contact__box {
  text-align: center; padding: 72px 32px; border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(70% 120% at 50% 0%, rgb(31 123 193 / 0.28), transparent 70%),
    var(--bg-2);
}
.contact__box h2 { font-size: clamp(28px, 3vw, 42px); line-height: 1.15; font-weight: 800; letter-spacing: -0.03em; max-width: 24ch; margin-inline: auto; }
.contact__box > p:not(.contact__mail) { margin: 16px auto 32px; color: var(--muted); max-width: 52ch; }
.contact__mail { margin-top: 18px; font: 400 14px/1 var(--font-mono); color: var(--faint); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 44px 0 56px; }
.footer__grid { display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: start; }
.footer p { color: var(--faint); font-size: 14px; line-height: 1.7; }
.footer a { color: var(--muted); }
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1400px, 94vw); max-height: 92dvh; overflow: visible; }
.lightbox::backdrop { background: rgb(5 11 18 / 0.86); backdrop-filter: blur(4px); }
.lightbox img { max-height: 82dvh; width: auto; margin-inline: auto; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; }
.lightbox__caption { margin-top: 14px; text-align: center; color: var(--muted); font-size: 15px; }
.lightbox__close { position: absolute; top: -18px; right: -18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 20px; cursor: pointer; display: grid; place-items: center; }

/* ---------- Reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .reveal--late { transition-delay: .12s; }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .js .flow__line .reveal:nth-child(2) { transition-delay: .08s; }
  .js .flow__line .reveal:nth-child(3) { transition-delay: .16s; }
  .js .flow__line .reveal:nth-child(4) { transition-delay: .24s; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame, .frame:hover { transform: none; }
  .panel { animation: none; }
  .btn, .thumb, .tab::after { transition: none; }
}
