/* Machine Track website. Colours follow the logo: blue gear, charcoal bars,
   light grey on dark. --accent is the logo blue darkened for white button text
   and blue links to pass WCAG AA; the logo's own #2563eb is --logo-blue.
   Form errors stay red: red means "wrong", not the brand. */
:root {
  --bg: #ffffff;
  --bg-alt: #f4f4f4;
  --ink: #1c1c1c;
  --ink-2: #3d3d3d;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-ink: #ffffff;
  --accent-soft: #eef4ff;
  --logo-blue: #2563eb;
  --dark: #1c1c1c;
  --dark-2: #262626;
  --on-dark: #e6e6e6;
  --on-dark-2: #b5b5b5;
  --ok: #15803d;
  --warn: #b45309;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 8px 24px rgb(0 0 0 / .06);
  --wrap: 1180px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-alt); padding: .1em .35em; border-radius: 5px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.narrow { max-width: 820px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 46px; padding: .7em 1.3em;
  border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: transform .1s, background .15s; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-small { min-height: 38px; padding: .45em .95em; font-size: .92rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.5) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: .6em; color: var(--ink); text-decoration: none; }
.brand-mark { width: 36px; height: auto; }
/* The logo's wordmark: heavy, upper case, tight. */
.wordmark { font-weight: 800; text-transform: uppercase; letter-spacing: .02em; font-size: 1.05rem; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { color: var(--ink-2); text-decoration: none; padding: .45em .6em; border-radius: 8px; font-size: .95rem; }
/* Menu items never wrap onto two lines; below 1200 px the menu folds into the Menu button. */
.nav a { white-space: nowrap; }
.nav a:not(.btn):hover { background: var(--bg-alt); color: var(--ink); }
.nav .lang { border: 1px solid var(--line); }
.topbar { border-bottom: 3px solid var(--logo-blue); }
.menu-toggle { display: none; }
@media (max-width: 1199px) {
  .menu-toggle { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 600 .95rem var(--font); color: var(--ink); cursor: pointer; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 16px 18px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: .75em .6em; }
  .nav .btn { margin-top: 8px; }
}

/* Hero */
/* Hero: a drill rig at the face (real photo), darkened so the text reads. */
.hero { position: relative; padding: 56px 0 72px; color: var(--on-dark); overflow: hidden; background-color: var(--dark);
  background-image: linear-gradient(90deg, rgb(20 20 20 / .94) 0%, rgb(20 20 20 / .82) 45%, rgb(20 20 20 / .55) 100%), url("/assets/img/photo/drill.jpg");
  background-size: cover; background-position: center 40%; }
@media (max-width: 999px) { .hero { background-image: linear-gradient(rgb(20 20 20 / .86), rgb(20 20 20 / .94)), url("/assets/img/photo/drill.jpg"); } }
.hero h1 { color: #fff; }
.hero h1::after { content: ""; display: block; width: 72px; height: 5px; margin-top: 18px; background: var(--logo-blue); border-radius: 3px; }
.hero .lead { color: var(--on-dark-2); }
.hero .eyebrow { color: #6ea8ff; }
.hero .btn-ghost { color: #fff; border-color: rgb(255 255 255 / .45); }
.hero .btn-ghost:hover { background: rgb(255 255 255 / .08); }
.hero-grid { position: relative; }
.hero .frame { border-color: #333; box-shadow: 0 24px 60px rgb(0 0 0 / .55); }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: 1fr 1.1fr; } .hero { padding: 88px 0 96px; } }
.eyebrow { display: flex; align-items: flex-end; gap: 10px; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: .8em; }
/* Four rising bars, the logo's chart, in front of every eyebrow. */
.eyebrow::before { content: ""; flex: none; width: 17px; height: 14px; margin-bottom: 2px;
  background: linear-gradient(currentColor 0 0) 0 100% / 3px 55% no-repeat, linear-gradient(currentColor 0 0) 4.6px 100% / 3px 70% no-repeat,
    linear-gradient(currentColor 0 0) 9.3px 100% / 3px 85% no-repeat, linear-gradient(currentColor 0 0) 14px 100% / 3px 100% no-repeat; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.hero-shot { transform: perspective(1600px) rotateY(-4deg); transform-origin: left center; }
@media (max-width: 999px) { .hero-shot { transform: none; } }

/* Screen frames */
.frame { margin: 0; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 20px 50px rgb(0 0 0 / .14); }
.frame-bar { display: flex; gap: 6px; padding: 9px 12px; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d4d4d4; }
.frame-bar i:first-child { background: var(--logo-blue); }
.frame img { width: 100%; height: auto; }
.frame.crop img { max-height: 520px; object-fit: cover; object-position: top; }
.zoomable { cursor: zoom-in; }

/* Sections */
.section { padding: 72px 0; }
@media (max-width: 719px) { .section { padding: 56px 0; } }
.section.alt { background: var(--bg-alt); }
.section.dark { background: var(--dark); color: var(--on-dark); border-top: 4px solid var(--logo-blue); }
.section.dark h2, .section.dark h3 { color: #fff; }
.section.dark .lead, .section.dark p { color: var(--on-dark-2); }
.section.dark .eyebrow { color: #6ea8ff; }
.section-head { max-width: 760px; margin-bottom: 32px; }
.section-head h2 { margin: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-features { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card p { color: var(--ink-2); margin: 0; }

/* Photo band: a real underground loader, full width, one line over it. */
.photo-band { position: relative; height: clamp(260px, 38vw, 440px); overflow: hidden; background: var(--dark); border-top: 4px solid var(--logo-blue); }
.photo-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.photo-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgb(20 20 20 / .85) 0%, rgb(20 20 20 / .1) 60%); }
.photo-band .wrap { position: relative; z-index: 1; height: 100%; display: flex; align-items: flex-end; }
.band-text { color: #fff; font-weight: 800; font-size: clamp(1.3rem, 2.6vw, 2rem); line-height: 1.25; margin: 0 0 32px; max-width: 22ch; }
.band-text::before { content: ""; display: block; width: 56px; height: 5px; background: var(--logo-blue); border-radius: 3px; margin-bottom: 14px; }

/* Phone app section: the crew underground behind it, mostly in shadow. */
.section.photo-bg { background-color: var(--dark);
  background-image: linear-gradient(rgb(28 28 28 / .9), rgb(28 28 28 / .9)), url("/assets/img/photo/crew.jpg"); background-size: cover; background-position: center; }

/* Mobile */
.mobile-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 1000px) { .mobile-grid { grid-template-columns: 1fr 1fr; } }
.phones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.phones .phone:nth-child(2) { transform: translateY(-22px); }
.phone { margin: 0; border: 7px solid #3a3a3a; border-radius: 26px; overflow: hidden; background: #000; box-shadow: 0 20px 50px rgb(0 0 0 / .4); }

/* Demo */
/* Deep brand blue, so the call to action stands apart from the white section above
   and the grey FAQ below; the cards stay white. */
.demo { background: linear-gradient(180deg, #13306b, #0d2350); color: #e8eefc; }
.demo .section-head h2 { color: #fff; }
.demo .section-head .eyebrow { color: #9cc0ff; }
.demo .section-head .lead { color: #c9d6f2; }
.demo-grid { display: grid; gap: 22px; }
@media (min-width: 1000px) { .demo-grid { grid-template-columns: 1fr 1.15fr; align-items: start; } }
/* Without a public demo (demoUrl empty) only the request form is shown. */
.demo-grid.single { grid-template-columns: minmax(0, 760px); }
/* Contact: two cards, general questions and demos, each with its address. */
.contact-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 900px; }
.contact-card h3 { font-size: 1.2rem; }
.contact-card p { margin: .3em 0 1.1em; }
.contact-mail { font-size: 1.1rem; font-weight: 600; word-break: break-all; }
.demo-card h3 { font-size: 1.35rem; }
.demo-card .ticks { margin-bottom: 20px; }
.demo-card > p { margin-bottom: 1em; }
.demo-card h4 { margin-top: 1.2em; }
.callout { background: var(--accent-soft); border: 1px solid #c7d7fe; border-radius: 10px; padding: 12px 14px; color: var(--ink) !important; }
.small { font-size: .88rem; color: var(--muted) !important; margin-top: 1em !important; }
.creds { width: 100%; border-collapse: collapse; margin: 6px 0 18px; font-size: .92rem; }
.creds th, .creds td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.creds td:last-child { white-space: nowrap; }
.copy { margin-left: 8px; }
.pass { margin: 0 0 20px; font-size: .95rem; }
.pass code { font-weight: 600; }
.creds th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.copy { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 2px 8px; font: .78rem var(--font); cursor: pointer; }

.demo-form { display: grid; gap: 14px; margin-top: 8px; }
.demo-form .row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.demo-form label { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.demo-form input:not([type=checkbox]), .demo-form select, .demo-form textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfcfcf; border-radius: 9px; font: 1rem var(--font); color: var(--ink); background: #fff; }
.demo-form textarea { resize: vertical; }
.demo-form .invalid { border-color: #dc2626 !important; }
.demo-form fieldset { border: 0; padding: 0; margin: 0; }
.demo-form legend { font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex !important; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { border: 1px solid #cfcfcf; border-radius: 999px; padding: 6px 12px; font-weight: 500; font-size: .88rem; background: #fff; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.demo-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.demo-form .check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-weight: 600; min-height: 1.4em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: #b91c1c; }

/* FAQ */
details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; margin-bottom: 10px; }
summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; position: relative; padding-right: 28px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0; top: 12px; font-size: 1.4rem; color: var(--accent); }
details[open] summary::after { content: "−"; }
details p { color: var(--ink-2); }

/* Footer */
.footer { background: var(--dark); color: var(--on-dark-2); padding: 44px 0; border-top: 4px solid var(--logo-blue); }
.footer-logo img { width: 140px; height: auto; }
.footer a { color: #7cb2ff; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer p { margin: .5em 0 0; }
.footer .small { color: #8c8c8c !important; }
.footer .credits a { color: #a8a8a8; }
/* The supporter's logo is dark blue: on a white panel so it reads on the dark footer. */
.footer-support { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); }
.footer-support span { font-size: .95rem; color: #a8a8a8; }
.footer-support a { display: inline-flex; line-height: 0; max-width: 100%; }
.footer-support img { width: 420px; max-width: calc(100% - 24px); height: auto; background: #fff; border-radius: 6px; padding: 8px 12px; box-sizing: content-box; }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: auto; }
.lightbox::backdrop { background: rgb(20 20 20 / .88); }
.lightbox img { max-width: 94vw; height: auto; border-radius: 8px; }
.lightbox-close { position: sticky; top: 8px; float: right; margin: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; font-size: 1.5rem; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .hero-shot { transition: none; transform: none; } }

/* Points: every section speaks in short ticked points, not paragraphs. */
.tick { width: 1.1em; height: 1.1em; flex: none; color: var(--accent); margin-top: .22em; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.hero-points { margin-top: 26px; gap: 12px; }
.hero-points li { color: var(--on-dark); font-size: 1.12rem; }
.hero .tick, .section.dark .tick { color: var(--logo-blue); }
.big-ticks { gap: 14px; }
.big-ticks li { color: var(--on-dark); font-size: 1.08rem; }
.section.dark .note { margin: 24px 0 0; font-size: .88rem; color: #8c8c8c; }

/* What it fixes: the problem, struck through, then the fix. */
.fixes { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.fixes li { display: grid; gap: 6px; padding: 20px 22px; border: 1px solid var(--line); border-left: 4px solid var(--logo-blue); border-radius: 12px; background: #fff; }
.fixes .was { color: var(--muted); font-size: .92rem; text-decoration: line-through; text-decoration-color: rgb(29 78 216 / .5); }
.fixes strong { display: flex; gap: 8px; align-items: flex-start; font-size: 1.05rem; }

/* Modules: ten compact tiles, 5 × 2 on desktop (no orphan row). */
.modules { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .modules { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .modules { grid-template-columns: repeat(5, 1fr); } }
.modules li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.modules .icon { width: 38px; height: 38px; padding: 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.modules h3 { font-size: 1rem; margin-bottom: .25em; }
.modules p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }

/* Learning: four numbered points and one promise. */
.learn { list-style: none; padding: 0; margin: 0; counter-reset: l; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.learn li { counter-increment: l; padding: 22px; border-radius: 12px; background: var(--dark); color: var(--on-dark); }
.learn li::before { content: "0" counter(l); display: block; font-weight: 800; font-size: 1.5rem; color: var(--logo-blue); line-height: 1; margin-bottom: 14px; }
.learn h3 { color: #fff; font-size: 1.05rem; margin-bottom: .25em; }
.learn p { margin: 0; color: var(--on-dark-2); font-size: .95rem; }
.pill { display: inline-flex; gap: 8px; align-items: flex-start; margin: 22px 0 0; padding: 10px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-weight: 600; font-size: .95rem; }

/* Workflows: 2 × 2 cards, screenshot on top (click to zoom), three steps. */
.flows { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.flow { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.flow figure { margin: 0; border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.flow img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; object-position: top left; }
.flow-body { padding: 20px 22px 22px; }
.flow h3 { font-size: 1.15rem; margin-bottom: .7em; }
.flow ol { list-style: none; margin: 0; padding: 0; counter-reset: f; display: grid; gap: 8px; }
.flow li { counter-increment: f; display: flex; gap: 10px; align-items: center; color: var(--ink-2); }
.flow li::before { content: counter(f); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .78rem; font-weight: 700; }

/* Trust: four ticked points in a row. */
.trust { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.trust li { display: flex; gap: 12px; align-items: flex-start; }
.trust .tick { width: 1.4em; height: 1.4em; margin-top: 0; }
.trust h3 { font-size: 1.02rem; margin-bottom: .2em; }
.trust p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Phones: let the demo cards shrink to the screen (the sign-in table and chips
   otherwise push them 1 px past it) and give them a smaller padding. */
.demo-grid > * { min-width: 0; }
@media (max-width: 560px) {
  .card { padding: 20px; }
  .creds td:last-child { white-space: normal; }
}
