/* ============================================================
   Proton Controls — site components & layout
   Requires tokens.css. Plain CSS, no framework.
   ============================================================ */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
input, select, textarea, button { font: inherit; }

:focus-visible { outline: 3px solid var(--hi); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-y) 0; }
.section--alt { background: var(--alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section--band { background: var(--band); color: var(--band-text); }
.section--cobalt { background: var(--cobalt); color: var(--on-cobalt); }
.has-grid {
  /* Dot grid, plus a soft cobalt glow drawn by ::before */
  position: relative; isolation: isolate; overflow: hidden;
  background-image: radial-gradient(var(--texture-dot) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
  background-position: 11px 11px;
}
/* The glow is a blurred ellipse rather than a radial gradient: some graphics cards
   draw a stray black/white pixel at the exact centre of a large radial gradient. */
.has-grid::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 78%; top: 40%; width: 56%; height: 62%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--texture-glow);
  filter: blur(80px);
}
.section--cobalt.has-grid {
  background-image: radial-gradient(var(--texture-dot-on-cobalt) 1.2px, transparent 1.6px);
}
.section--cobalt.has-grid::before { content: none; }
.row { display: flex; flex-wrap: wrap; gap: var(--col-gap); }
.row--center { align-items: center; }
.row--end { align-items: flex-end; justify-content: space-between; }
.cards { display: flex; flex-wrap: wrap; gap: var(--gap); }
.col { flex: 1 1 420px; min-width: 0; }

/* ---------- Type ---------- */
.h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -0.015em; text-wrap: balance;
}
.h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-h2); line-height: 1.06; text-wrap: balance;
}
.h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.3; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--muted); max-width: 540px; text-wrap: pretty; }
.muted { color: var(--muted); }
.hl { color: var(--hi); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: var(--fs-eyebrow);
  letter-spacing: .12em; text-transform: uppercase; color: var(--hi);
  margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: currentColor; }
.section--band .eyebrow { color: var(--band-2); }
.label {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: .12em; text-transform: uppercase; color: var(--dim);
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 13px 26px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease;
}
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--outline:hover { border-color: var(--hi); }
.btn--light { background: #FFFFFF; color: var(--bg); }
.btn--light:hover { background: #E6E9F0; }
.btn--sm { min-height: 44px; padding: 10px 20px; font-size: 15px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.link { color: var(--hi); font-weight: 600; text-decoration: none; }
.link:hover { color: var(--hi-hover); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center;
  font-size: 13px; color: var(--muted); background: var(--raised);
  border-radius: var(--r-pill); padding: 4px 12px;
}
.chip--outline {
  background: transparent; color: inherit; border: 1.5px solid currentColor;
  font-size: 15px; font-weight: 500; padding: 5px 14px;
}
.chip--mono { font-family: var(--font-mono); font-size: 13px; }

/* ---------- Cards ---------- */
.card {
  flex: 1 1 300px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: var(--card-pad);
  display: flex; flex-direction: column; gap: 12px;
}
a.card { text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--border-strong); }
.card p { color: var(--muted); font-size: 16px; }
.card--feature {
  flex: 2 1 600px;
  background: var(--cobalt); color: var(--on-cobalt); border-color: transparent;
  padding: 40px; gap: 16px;
}
.card--feature p { color: var(--on-cobalt); font-size: 18px; max-width: 560px; }
.card--feature .card__title {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-feature); line-height: 1.1;
}
.card--feature .chips { margin-top: auto; padding-top: 12px; }
.icon-tile {
  width: 52px; height: 52px; border-radius: var(--r-tile);
  background: var(--raised); color: var(--hi);
  display: flex; align-items: center; justify-content: center;
}
.icon-tile svg, .icon { width: 26px; height: 26px; }

/* Featured project (photo + text) */
.project-feature {
  display: flex; flex-wrap: wrap; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
}
.project-feature__media { flex: 1 1 480px; min-height: 320px; background: var(--raised); }
.project-feature__media img { width: 100%; height: 100%; object-fit: cover; }
.project-feature__body { flex: 1 1 420px; min-width: 0; padding: 40px; display: flex; flex-direction: column; gap: 14px; }
.project-feature__title { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.1; }
.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--dim); font-size: 14px; height: 100%;
}

/* ---------- Steps (light band) ---------- */
.steps { list-style: none; margin: 64px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.step { flex: 1 1 200px; min-width: 0; border-top: 3px solid var(--border-strong); padding-top: 18px; }
.section--band .step { border-top-color: var(--band-text); }
.step__num {
  display: inline-flex; width: 36px; height: 36px; border-radius: 50%;
  align-items: center; justify-content: center;
  background: var(--cobalt); color: var(--on-cobalt);
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
}
.step__title { font-weight: 600; font-size: 19px; margin-top: 12px; }
.step__text { color: var(--muted); font-size: 15px; }
.section--band .step__text { color: var(--band-2); }

/* ---------- HMI frame ---------- */
.hmi { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hmi-frame {
  padding: 10px; background: var(--hmi-frame); border-radius: 16px;
  box-shadow: var(--shadow-hmi); max-width: 100%;
}
.hmi-frame img { border-radius: 8px; width: 560px; max-width: 100%; height: auto; }
.hmi__caption {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--dim);
}
.hmi__caption::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--hmi-lime); }

/* ---------- Header ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-height: 44px; }
.brand__logo { height: 44px; width: auto; }
.site-footer .brand__logo { height: 40px; }
.nav a[aria-current="page"] { color: var(--text); }
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: var(--r-input);
}
.skip-link:focus { top: 12px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; padding: 10px 14px; font-size: 15px; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--text); }
.nav .btn { margin-left: 8px; }
.nav-toggle { display: none; }

@media (max-width: 767px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 10px;
    background: transparent; color: var(--text); border: 1px solid var(--border-strong); cursor: pointer;
  }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .nav[data-open="true"] { display: flex; }
  .nav .btn { margin: 8px 0 0; }
}

/* ---------- Platforms strip ---------- */
.platforms { padding: 26px 0; }
.platforms__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.platforms__inner--hw { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.platforms__list {
  display: flex; flex-wrap: wrap; gap: 12px 36px; align-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--muted);
  list-style: none; margin: 0; padding: 0;
}
.platforms__tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: .08em;
  color: var(--dim); border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  padding: 2px 8px; vertical-align: 4px; margin-left: 4px; white-space: nowrap;
}

/* ---------- Forms ---------- */
.form-card {
  flex: 1 1 520px; min-width: 0;
  background: var(--surface); color: var(--text);
  border-radius: var(--r-card); padding: var(--card-pad);
  display: flex; flex-wrap: wrap; gap: 18px;
  box-shadow: var(--shadow-panel);
}
.field { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.field--full { flex-basis: 100%; }
.field label { font-size: 14px; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-input);
  padding: 12px 14px; min-height: 48px; width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--hi); box-shadow: 0 0 0 3px var(--focus-ring);
}
.field [aria-invalid="true"] { border-color: var(--error); }
.field__error { font-size: 14px; color: var(--error); }
.check { flex-basis: 100%; display: flex; align-items: flex-start; gap: 12px; font-size: 15px; color: var(--muted); }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--hi); }
.form-actions { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.form-status { flex-basis: 100%; font-size: 15px; }

/* Contact section specifics */
.contact__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 5vw, 56px); line-height: 1.02; text-wrap: balance; }
.contact__lead { margin-top: 20px; font-size: 19px; color: var(--on-cobalt-2); }
.contact__list { margin: 36px 0 0; display: flex; flex-direction: column; gap: 18px; }
.contact__list dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--on-cobalt-2); }
.contact__list dd { margin: 2px 0 0; font-size: 22px; font-weight: 600; }
.contact__list a { text-decoration: none; }

/* Newsletter */
.newsletter__form { flex: 1 1 440px; min-width: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.newsletter__form input {
  flex: 1 1 260px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  padding: 12px 20px; min-height: 50px;
}
.newsletter__form input:focus { outline: none; border-color: var(--hi); box-shadow: 0 0 0 3px var(--focus-ring); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg); }
.site-footer__top { display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between; padding-top: 56px; padding-bottom: 28px; }
.site-footer__cols { display: flex; flex-wrap: wrap; gap: 56px; font-size: 15px; }
.site-footer__col { display: flex; flex-direction: column; gap: 0; }
.site-footer__col .label { margin-bottom: 4px; }
.site-footer__col a, .site-footer__col > span.muted { color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-footer__col a:hover { color: var(--text); }
.site-footer__bottom { border-top: 1px solid var(--border); padding-top: 18px; padding-bottom: 32px; font-size: 14px; color: var(--dim); }

/* ---------- Inner pages ---------- */
.page-hero { padding: 88px 0 72px; border-bottom: 1px solid var(--border); }
.page-hero__title { max-width: 820px; }
.page-hero .lead { margin-top: 20px; max-width: 640px; }

.subnav { padding: 18px 0; }
.chip--link { text-decoration: none; min-height: 32px; padding: 6px 14px; font-size: 14px; }
.chip--link:hover { color: var(--text); background: var(--border-strong); }

.service-detail {
  display: flex; flex-wrap: wrap; gap: 24px var(--col-gap);
  padding: 56px 0; border-top: 1px solid var(--border); scroll-margin-top: 24px;
}
.service-detail:first-child { border-top: 0; padding-top: 0; }
.service-detail__head { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.service-detail__title { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.1; text-wrap: balance; }
.service-detail__body { flex: 1.6 1 460px; min-width: 0; }
.service-detail__body > p { font-size: 18px; color: var(--text-2); max-width: 640px; }
.icon-tile--cobalt { background: var(--cobalt); color: var(--on-cobalt); }

.checklist { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 12px; color: var(--text-2); }
.checklist li::before {
  content: ''; flex: none; width: 8px; height: 8px; margin-top: 10px; border-radius: 50%; background: var(--hi);
}
.checklist--cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px 40px; }

.hw-list { margin: 28px 0 0; display: flex; flex-direction: column; gap: 18px; }
.hw-list dt { color: var(--dim); }
.hw-list dd { margin: 4px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.25; }
.section--band .link { color: var(--cobalt); }
.section--band .steps { margin-top: 56px; }

.fact-card {
  margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: var(--card-pad); display: flex; flex-direction: column; gap: 20px;
}
.fact-card dd { margin: 4px 0 0; font-size: 18px; font-weight: 600; color: var(--text); }

.case-photo img, .project-feature__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-photo img { height: auto; border-radius: var(--r-card); border: 1px solid var(--border); }
.project-feature__media { position: relative; min-height: 360px; }
.project-feature__media picture { position: absolute; inset: 0; }
.project-feature__media:has(.project-feature__hmi) { position: static; }
.project-feature__hmi { height: 100%; display: flex; align-items: center; justify-content: center; padding: 32px; }

/* Long-form text: case studies, legal pages */
.prose { max-width: 720px; color: var(--text-2); }
.prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.15; color: var(--text); margin: 44px 0 12px; }
.prose > h2:first-child, .prose > .notice + .label + h2 { margin-top: 0; }
.prose h3 { font-size: 19px; font-weight: 600; color: var(--text); margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--hi); text-underline-offset: 3px; }
.prose a:hover { color: var(--hi-hover); }
.prose strong { color: var(--text); font-weight: 600; }
.prose .label { display: block; margin-bottom: 28px; }
.notice {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-input);
  padding: 14px 18px; font-size: 15px; color: var(--muted);
}
.cf-turnstile { min-height: 65px; width: 100%; max-width: 300px; }

/* ---------- Why Proton ---------- */
.why__intro { flex: 1 1 380px; min-width: 0; }
.why__grid {
  flex: 1.5 1 520px; min-width: 0; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 36px 40px;
}
.why__item { display: flex; flex-direction: column; gap: 12px; padding-top: 24px; border-top: 1px solid var(--border-strong); }
.why__item p { color: var(--muted); font-size: 16px; }

/* ---------- Project cards with media ---------- */
.project-card { flex: 1 1 300px; padding: 0; overflow: hidden; gap: 0; }
.project-card__media { aspect-ratio: 4 / 3; background: var(--raised); overflow: hidden; }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-card__media--hmi { background: var(--hmi-frame); padding: 14px; display: flex; align-items: center; justify-content: center; }
.project-card__media--hmi img { object-fit: contain; border-radius: 6px; }
.project-card__body { padding: var(--card-pad); display: flex; flex-direction: column; gap: 12px; flex: 1; }

/* ---------- Photos on services and project pages ---------- */
.service-photo { margin-top: 32px; max-width: 520px; }
.service-photo img, .gallery__item img { width: 100%; height: auto; display: block; border-radius: var(--r-card); border: 1px solid var(--border); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 28px; align-items: start; }
.gallery__item { margin: 0; }
.gallery__item--hmi { display: flex; justify-content: center; }

.callout {
  margin-top: 28px; padding: 20px 24px; border-radius: var(--r-card-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline;
}
.callout strong { color: var(--text); }

/* ---------- Inner-page call to action ---------- */
.cta-band { padding: 72px 0; }
.cta-band__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 56px; }
.cta-band__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.cta-band__direct { font-size: 17px; font-weight: 600; line-height: 1.9; }
.cta-band__direct a { color: var(--on-cobalt); text-decoration: none; }
.cta-band__direct a:hover { text-decoration: underline; }

/* ---------- Contact form states ---------- */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile-slot { min-height: 65px; }
.form-status--success { color: var(--text); font-weight: 600; }
.form-status--error { color: var(--error); }
.btn[disabled] { opacity: .6; cursor: progress; }
