/* ALAZ Vision marketing site. Colours: ALAZ navy #001033 and orange #ff6a00 (cloud/pwa icons).
   Light is the base; dark comes from data-theme="dark" (explicit choice) or prefers-color-scheme (System).
   test/contrast.test.js checks the tokens below for WCAG AA in both themes. */

:root {
  --bg: #ffffff;
  --surface: #f4f6fa;
  --surface-2: #e8edf6;
  --text: #0b1630;
  --muted: #4a5670;
  --link: #b34700;
  --accent: #ff6a00;
  --on-accent: #001033;
  --accent-soft: #fff1e6;
  --border: #d5dbe6;
  --border-strong: #7a869e;
  --danger: #b3261e;
  --success: #1e7a3c;
  --focus: #b34700;
  --header: #ffffff;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #001033;
  --surface: #0a1f4d;
  --surface-2: #12295e;
  --text: #f2f5fb;
  --muted: #b6c0d8;
  --link: #ff8a3d;
  --accent: #ff6a00;
  --on-accent: #001033;
  --accent-soft: #2b1d16;
  --border: #24386a;
  --border-strong: #6f80a8;
  --danger: #ff8a80;
  --success: #5fd38d;
  --focus: #ff8a3d;
  --header: #001033;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #001033;
    --surface: #0a1f4d;
    --surface-2: #12295e;
    --text: #f2f5fb;
    --muted: #b6c0d8;
    --link: #ff8a3d;
    --accent: #ff6a00;
    --on-accent: #001033;
    --accent-soft: #2b1d16;
    --border: #24386a;
    --border-strong: #6f80a8;
    --danger: #ff8a80;
    --success: #5fd38d;
    --focus: #ff8a3d;
    --header: #001033;
    color-scheme: dark;
  }
}

/* Screenshots that exist in both themes: one copy per theme, the other is display:none (and, being lazy, not loaded).
   !important: these hide rules must win over any layout rule that sets display on the same element. */
:root[data-theme="dark"] .only-light,
:root[data-theme="light"] .only-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-light { display: none !important; }
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .only-dark { display: none !important; }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.i18n-pending body { visibility: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
main { flex: 1 0 auto; }
main:focus { outline: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.02rem; margin-bottom: 0.25em; }
p { margin: 0 0 1em; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.footnote { color: var(--muted); font-size: 0.92rem; margin-top: 1.25rem; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
.section { padding: 72px 0; }
.section-alt { background: var(--surface); }
.section-after { margin-top: 2rem; }

.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-badge { width: 46px; height: 46px; padding: 11px; border-radius: 12px; background: var(--accent); color: var(--on-accent); margin-bottom: 14px; }

/* Skip link */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Header */
.site-header { background: var(--header); border-bottom: 1px solid var(--border); position: relative; z-index: 10; }
.header-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.15rem; text-decoration: none; margin-right: auto; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.site-nav { display: flex; align-items: center; }
.nav-list { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; }
.nav-list a { color: var(--text); text-decoration: none; font-weight: 500; padding: 6px 0; display: inline-block; }
.nav-list a:hover { color: var(--link); }
.nav-list .nav-cta { color: var(--link); font-weight: 700; }
.menu-toggle { display: none; }
.header-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px; }
.switch button {
  font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text); background: transparent;
  border: 0; border-radius: 999px; min-height: 34px; min-width: 40px; padding: 0 10px; cursor: pointer;
}
.switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.switch button:hover:not([aria-pressed="true"]) { background: var(--surface-2); }

@media (min-width: 1100px) {
  .site-header { position: sticky; top: 0; }
}
@media (max-width: 1099px) {
  .has-js .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; color: var(--text);
    background: transparent; border: 1px solid var(--border-strong); border-radius: 999px; min-height: 40px; padding: 0 14px; cursor: pointer;
  }
  .has-js .site-nav { order: 2; }
  .has-js .nav-list:not(.is-open) { display: none; }
  .has-js .nav-list.is-open {
    position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0;
    background: var(--header); border-bottom: 1px solid var(--border); padding: 8px 20px 16px; box-shadow: 0 12px 24px rgba(0, 16, 51, 0.18);
  }
  .has-js .nav-list.is-open a { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .header-controls { order: 3; width: 100%; justify-content: flex-end; }
}
@media (min-width: 700px) and (max-width: 1099px) {
  .header-controls { width: auto; }
}

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 2px solid transparent;
}
.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { filter: brightness(1.06); }
.button-primary:disabled { opacity: 0.6; cursor: progress; }
.button-secondary { border-color: var(--accent); color: var(--text); background: transparent; }
.button-secondary:hover { background: var(--accent-soft); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }

/* Hero */
.hero { padding: 56px 0 72px; background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1fr 1.05fr; } }
.kicker { color: var(--link); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; margin-bottom: 12px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hero-points li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.hero-points .icon { color: var(--link); }
.hero-shot { margin: 0; }
.hero-shot img, .shot img, .card-shot img { border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 18px 40px rgba(0, 16, 51, 0.18); }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 10px; }

/* Cards */
.cards { display: grid; gap: 20px; margin-top: 28px; }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: 0; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.section:not(.section-alt) .card { background: var(--surface); }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--muted); }
.card-accent { border: 2px solid var(--accent); }
.card-shot { display: block; margin-top: 18px; }

/* How it works diagram */
.diagram { margin: 32px 0 0; }
.diagram-flow { display: grid; gap: 14px; align-items: stretch; }
@media (min-width: 900px) { .diagram-flow { grid-template-columns: 1fr 48px 1fr 48px 1fr; } }
.diagram-box { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.diagram-box.is-core { border: 2px solid var(--accent); background: var(--accent-soft); }
.diagram-box ul { margin: 0; padding-left: 1.1em; }
.diagram-box li { margin-bottom: 6px; }
.diagram-arrow { position: relative; min-height: 36px; }
.diagram-arrow::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-50%, -50%) rotate(90deg);
  border-left: 18px solid var(--accent); border-top: 13px solid transparent; border-bottom: 13px solid transparent;
}
@media (min-width: 900px) { .diagram-arrow::before { transform: translate(-50%, -50%); } }

.positioning { display: flex; gap: 18px; align-items: flex-start; margin-top: 36px; padding: 24px; border-radius: 16px; background: var(--accent-soft); border-left: 6px solid var(--accent); }
.positioning .icon-badge { margin: 0; }
.positioning-sentence { font-weight: 700; font-size: 1.1rem; }
.positioning p:last-child { margin-bottom: 0; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.steps li { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.section:not(.section-alt) .steps li { background: var(--surface); }
.steps p { color: var(--muted); margin: 0; }
.step-num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; margin-bottom: 12px; }
.steps-vertical { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.steps-vertical li { display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; padding: 16px; }
.steps-vertical .step-num { grid-row: span 2; margin: 0; }
.pilot-title { font-size: 1.3rem; }
.mini-steps { padding-left: 1.3em; }
.mini-steps li { margin-bottom: 8px; }

/* Two columns */
.split { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1.15fr 0.85fr; }
  .split-contact { grid-template-columns: 0.8fr 1.2fr; }
}
.split > .cards { margin-top: 0; }

.feature-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 18px; }
.feature-list li { display: flex; gap: 16px; align-items: flex-start; }
.feature-list .icon-badge { margin: 0; }
.feature-list h3 { margin-bottom: 4px; }
.feature-list p { color: var(--muted); margin: 0; }
.bullets { padding-left: 1.2em; margin: 0; }
.bullets li { margin-bottom: 10px; }

/* Screenshots */
.shot { margin: 0; }
.shot-narrow { max-width: 440px; justify-self: center; }
.phones { margin: 0; max-width: 480px; justify-self: center; }
.phone-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.phone-row img { border-radius: 22px; border: 1px solid var(--border); box-shadow: 0 18px 40px rgba(0, 16, 51, 0.22); }
.gallery { display: grid; gap: 28px; margin-top: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.shot-portrait img { width: auto; max-height: 460px; margin: 0 auto; }

/* Downloads */
.downloads { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.download { display: flex; gap: 16px; align-items: flex-start; height: 100%; padding: 20px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.download:hover { border-color: var(--accent); }
.download .icon-badge { margin: 0; }
.download-text { display: grid; gap: 4px; }
.download-text strong { color: var(--link); }
.download-text span { color: var(--muted); font-size: 0.95rem; }
.download-text .download-meta { font-size: 0.82rem; font-weight: 600; }

/* Contact form */
.contact-form { display: grid; gap: 16px; }
.form-note { color: var(--muted); font-size: 0.92rem; margin: 0; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; gap: 16px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field label { font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 14px;
}
.field textarea { resize: vertical; min-height: 140px; }
.field [aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.contact-form .field-error { color: var(--danger); font-size: 0.92rem; font-weight: 600; margin: 0; }
.consent { grid-template-columns: 24px 1fr; column-gap: 12px; align-items: start; }
.consent input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--accent); }
.consent label { font-weight: 400; }
.consent .field-error { grid-column: 2; }
.captcha { display: grid; gap: 6px; min-height: 78px; }
.visually-hidden-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .button { justify-self: start; }
.form-status { margin: 0; padding: 12px 16px; border-radius: 10px; background: var(--surface-2); border-left: 5px solid var(--border-strong); font-weight: 600; }
.form-status.is-success { border-left-color: var(--success); color: var(--success); background: var(--surface); }
.form-status.is-error { border-left-color: var(--danger); color: var(--danger); background: var(--surface); }
.section-alt .contact-form { background: var(--bg); }

/* Privacy page */
.prose h2 { font-size: 1.35rem; margin-top: 2rem; }
.prose .lead { max-width: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0; font-size: 0.95rem; }
.footer-grid { display: grid; gap: 18px 40px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1fr 1.6fr auto; align-items: start; } }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 6px; }
.footer-brand img { width: 32px; height: 32px; border-radius: 8px; }
.footer-grid p { color: var(--muted); margin: 0; }
.footer-grid .footer-positioning { color: var(--text); font-weight: 600; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-small { grid-column: 1 / -1; font-size: 0.85rem; }

@media (max-width: 599px) {
  body { font-size: 16px; }
  .section { padding: 52px 0; }
  .hero { padding: 36px 0 52px; }
  .card, .diagram-box { padding: 20px; }
  .positioning { flex-direction: column; }
}

/* Screenshot carousel and lightbox (js/gallery.js). Colours come from the theme tokens, so both themes work. */
img[data-shot] { cursor: zoom-in; }
.gallery.is-carousel { display: none; }
.carousel { position: relative; margin-top: 28px; padding: 16px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); }
.carousel:focus-visible, .carousel img:focus-visible, .carousel-button:focus-visible, .carousel-dot:focus-visible, .lightbox-close:focus-visible, img[data-shot]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.carousel-stage { margin: 0; display: grid; justify-items: center; }
.carousel-stage img { width: auto; max-width: 100%; max-height: 70vh; height: auto; border-radius: 12px; border: 1px solid var(--border); }
.carousel-stage figcaption { margin-top: 12px; text-align: center; max-width: 70ch; }
.carousel-button, .lightbox-close { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; transition: background-color 0.2s ease; }
.carousel-button:hover, .lightbox-close:hover { background: var(--accent-soft); }
.carousel-prev { left: 12px; top: 40%; }
.carousel-next { right: 12px; top: 40%; }
.carousel-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 12px; }
.carousel-dot { width: 24px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative; }
.carousel-dot::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--bg); }
.carousel-dot[aria-current="true"]::before { background: var(--accent); border-color: var(--accent); }
.carousel-status { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 0.85rem; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); }
.lightbox[hidden] { display: none; }
.lightbox .carousel { width: min(100%, 1400px); max-height: 100%; overflow: auto; margin: 0; }
.lightbox .carousel-stage img { max-height: 78vh; cursor: default; }
.lightbox-close { top: 12px; right: 12px; z-index: 1; }
html.lightbox-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .carousel-button, .lightbox-close { transition: none; }
}
