/* Shared styles for the Automation pages (English /automation/ and French /fr/automatisation/) */
:root { --bg: #1b2533; --panel: #222e3d; --panel-2: #253243; --line: #364659; --ink: #f6f8fa; --muted: #c6d0dc; /* brighter steel blue and lighter grey text, easier to read */ --blue: #3d8bff; --blue-soft: #9cc4ff;
  --gold: #f5b041; --champagne: #efe2c6; --led: #3ddc84; --ease: cubic-bezier(.22,.61,.36,1); }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--blue-soft); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }

/* Header */
header.top { position: sticky; top: 0; z-index: 10; background: rgba(16,22,29,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 0; flex-wrap: wrap; }
.home { color: var(--gold); text-decoration: none; font-family: "Cinzel", Georgia, serif; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 1.15rem; }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; letter-spacing: .04em; }
nav a:hover { color: var(--blue-soft); }
/* Menu links look like small panel buttons, each with a pilot light: dim normally, blue on the section you are reading */
header.top nav:not(.lang) { gap: 6px; }
header.top nav:not(.lang) a { position: relative; padding: 6px 12px 6px 26px; border: 1px solid #2c3746; border-radius: 4px; background: rgba(255,255,255,.03);
  transition: background .2s ease, border-color .2s ease, color .2s ease; }
header.top nav:not(.lang) a::before { content: ""; position: absolute; left: 11px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: #2a3646; box-shadow: inset 0 1px 1px rgba(255,255,255,.15); transition: background .2s ease, box-shadow .2s ease; }
header.top nav:not(.lang) a:hover { color: #fff; background: rgba(61,139,255,.12); border-color: rgba(61,139,255,.45); }
header.top nav:not(.lang) a[aria-current] { color: #fff; background: rgba(61,139,255,.2); border-color: var(--blue); box-shadow: 0 0 12px rgba(61,139,255,.25); }
header.top nav:not(.lang) a[aria-current]::before { background: var(--blue-soft); box-shadow: 0 0 7px rgba(61,139,255,.95); }
.short { display: none; } /* shorter menu label, used on phones only */
.back { color: #dfe7f1; font-size: .85rem; font-weight: 600; text-decoration: none; letter-spacing: .08em; text-transform: uppercase; } /* bright enough to notice, but quieter than the menu */
.back:hover, .back:focus-visible { color: var(--gold); }
.lang { display: flex; gap: 2px; font-size: .78rem; font-weight: 700; letter-spacing: .14em; }
.lang a, .lang span { padding: 4px 8px; text-decoration: none; color: var(--muted); }
.lang a:hover { color: var(--ink); }
.lang [aria-current] { color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); }
/* Logo before the ROIBEX name (the logo file is used as a stencil, so it can be colored) */
.home { display: inline-flex; align-items: center; gap: .4em; }
.mark { flex: none; width: .82em; height: 1.25em; background: #3d8bff; transform: translateY(-.07em); /* lines the logo up with the middle of the capital letters */
  -webkit-mask: url("/images/logo.png") center / contain no-repeat; mask: url("/images/logo.png") center / contain no-repeat; }

/* Shared */
h1, h2, h3 { font-family: "Barlow Condensed", system-ui, sans-serif; text-transform: uppercase; letter-spacing: .04em; line-height: 1.05; margin: 0; }
section { padding: clamp(60px, 5vw, 72px) 0; } /* tighter on laptops; phones keep about the same space */
section.alt { background: var(--panel-2); border-block: 1px solid var(--line); }
/* Section labels look like engraved metal nameplates riveted on equipment */
.eyebrow { position: relative; display: inline-block; margin: 0 0 16px; padding: 5px 22px; border-radius: 2px;
  font-family: "Barlow Condensed", sans-serif; font-size: .82rem; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: #dfe6ee;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 3px), linear-gradient(180deg, #5d6876 0%, #47515e 55%, #3b4450 100%); /* darker brushed steel */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.4);
  text-shadow: 0 -1px 0 rgba(0,0,0,.55); } /* engraved letters */
.eyebrow::before, .eyebrow::after { content: ""; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c9d1da, #59636f 70%); box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.eyebrow::before { left: 7px; }
.eyebrow::after { right: 7px; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 700; margin-bottom: 10px; }
.sub { color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.note { display: block; margin-top: 12px; font-size: .85rem; color: var(--gold); }
.note[hidden] { display: none; }
.hint { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }
.btn { display: inline-block; padding: 1em 1.6em; border: 2px solid var(--blue); background: transparent; color: var(--ink); text-decoration: none; font: 500 .85rem "Barlow", sans-serif; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; transition: background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease); }
.btn:hover, .btn:focus-visible { background: var(--blue); color: #fff; }
.btn.solid { background: var(--blue); color: #fff; }
.btn.solid:hover { background: #2f78e6; box-shadow: 0 0 24px rgba(61,139,255,.45); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Hero: same steel lettering as the start page */
.hero { position: relative; padding: clamp(80px, 14vw, 160px) 0 clamp(64px, 10vw, 120px); isolation: isolate; overflow: hidden;
  background: radial-gradient(120% 100% at 15% 0%, #243044 0%, #10151c 60%, #090b0e 100%); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: url("/images/AutomationPicture.jpeg") center / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(rgba(61,139,255,.06) 1px, transparent 1px) 0 0 / 44px 44px, linear-gradient(90deg, rgba(61,139,255,.06) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(to right, rgba(9,11,14,.78) 0%, rgba(9,11,14,.5) 45%, rgba(9,11,14,.12) 100%), linear-gradient(to top, rgba(16,22,29,.9) 0%, transparent 26%); } /* lighter: dark only behind the text on the left */
.kicker { display: block; margin-bottom: .5em; font-family: "Cinzel", Georgia, serif; font-weight: 800; font-size: clamp(.85rem, 1.4vw, 1.05rem); letter-spacing: .32em; color: var(--champagne); }
.word-wrap { position: relative; display: block; width: fit-content; font-size: clamp(2.6rem, 9vw, 6.4rem); }
.word { display: block; width: fit-content; white-space: nowrap; font-size: 1em; font-weight: 700; letter-spacing: .06em; line-height: 1;
  color: #dcebff; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #ffffff 0%, #dbe9fa 40%, #9fb8d6 58%, #eef5ff 80%, #b9cde6 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.9)) drop-shadow(0 2px 8px rgba(0,0,0,.7)) drop-shadow(0 0 16px rgba(61,139,255,.5)); }
.tagline { margin: 22px 0 0; color: var(--blue-soft); font-size: clamp(1.2rem, 2.2vw, 1.6rem); font-weight: 500; }
.lead { max-width: 52ch; color: #d3dbe6; font-size: 1.1rem; margin: 14px 0 34px; }
.actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .wrap > * { animation: rise .8s var(--ease) backwards; }
.hero .wrap > :nth-child(2) { animation-delay: .1s; }
.hero .wrap > :nth-child(3) { animation-delay: .2s; }
.hero .wrap > :nth-child(4) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Stack light standing on top of the quote panel, like on top of a control cabinet: cap, round lamp segments
   (red, yellow, green from the top), chrome pole and black base. Green = ready, yellow blinking = sending, red stays off. */
.console-wrap { position: relative; max-width: 880px; }
/* Quote: the form with a short "what happens next" panel beside it (under it on smaller screens) */
.quote-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; }
.quote-layout .console-wrap { max-width: none; }
.next { position: sticky; top: 90px; padding: 20px 20px 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.next h3 { font-size: 1.05rem; letter-spacing: .12em; color: var(--blue-soft); margin-bottom: 16px; }
.next ol { list-style: none; margin: 0; padding: 0; }
.next li { position: relative; display: grid; padding: 0 0 18px 38px; }
.next li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 28px; bottom: 4px; width: 2px; background: var(--line); } /* line joining the steps */
.next .num { position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff;
  font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: .9rem; }
.next strong { font-weight: 600; line-height: 1.35; padding-top: 2px; }
.next li > span:last-child { color: var(--muted); font-size: .88rem; line-height: 1.45; margin-top: 2px; }
@media (max-width: 900px) {
  .quote-layout { grid-template-columns: 1fr; gap: 20px; }
  .next { position: static; }
}
.beacon { position: absolute; right: 30px; bottom: 100%; display: flex; flex-direction: column; align-items: center; }
.beacon .cap { width: 26px; height: 6px; border-radius: 5px 5px 1px 1px; background: linear-gradient(90deg, #0d0f12, #3a3f46 45%, #0d0f12); }
.seg { --c: #3ddc84; --dim: #123222; width: 26px; height: 18px; border-top: 2px solid #121417;
  background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,0) 30%, rgba(255,255,255,.28) 45%, rgba(0,0,0,0) 62%, rgba(0,0,0,.6)), var(--dim); }
.seg.red { --c: #ff3b3b; --dim: #4a1717; }
.seg.amber { --c: #ffb020; --dim: #4d3a10; }
.seg.green { --c: #3ddc84; --dim: #123222; }
.seg.on { background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,0) 30%, rgba(255,255,255,.55) 45%, rgba(0,0,0,0) 62%, rgba(0,0,0,.4)), var(--c);
  box-shadow: 0 0 14px var(--c), 0 0 30px color-mix(in srgb, var(--c) 45%, transparent); }
.beacon .neck { width: 26px; height: 7px; border-top: 2px solid #121417; background: linear-gradient(90deg, #0d0f12, #3a3f46 45%, #0d0f12); border-radius: 0 0 2px 2px; }
.beacon .pole { width: 6px; height: 30px; background: linear-gradient(90deg, #6e7883, #f2f5f8 45%, #8c96a1 70%, #5a636d); }
.beacon .base { width: 30px; height: 8px; border-radius: 4px 4px 2px 2px; background: linear-gradient(90deg, #0b0c0e, #33373d 45%, #0b0c0e); }
.beacon .foot { width: 42px; height: 4px; border-radius: 2px; background: #0a0b0d; box-shadow: 0 2px 4px rgba(0,0,0,.6); }
/* Sending: green goes off and yellow blinks */
.console-wrap.busy .seg.green { background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,0) 30%, rgba(255,255,255,.28) 45%, rgba(0,0,0,0) 62%, rgba(0,0,0,.6)), var(--dim); box-shadow: none; }
.console-wrap.busy .seg.amber { animation: seg-blink 1s steps(1, end) infinite; } /* 500 ms on, 500 ms off */
@keyframes seg-blink {
  0% { background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,0) 30%, rgba(255,255,255,.55) 45%, rgba(0,0,0,0) 62%, rgba(0,0,0,.4)), #ffb020; box-shadow: 0 0 14px #ffb020; }
  50% { background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,0) 30%, rgba(255,255,255,.28) 45%, rgba(0,0,0,0) 62%, rgba(0,0,0,.6)), #4d3a10; box-shadow: none; }
}

/* Services */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
/* 5 services: 3 cards on the first row and 2 wider ones on the second, so both rows are full */
@media (min-width: 900px) {
  .services-grid { grid-template-columns: repeat(6, 1fr); }
  .services-grid .card { grid-column: span 2; }
  .services-grid .card:nth-child(n+4) { grid-column: span 3; }
}
@media (min-width: 641px) and (max-width: 899px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
  .services-grid .card:last-child { grid-column: 1 / -1; }
}
/* Cards look like control cabinet doors: brushed metal, a screw in each corner and a pilot light */
.card { position: relative; border: 1px solid #2c3746; border-radius: 4px; padding: 22px 22px 20px; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px), linear-gradient(180deg, #1c2431 0%, #151b24 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 0 0 1px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.25);
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease); }
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--blue), rgba(61,139,255,0)); }
.card::after { content: ""; position: absolute; inset: 9px; pointer-events: none;
  background: radial-gradient(circle, #8a95a5 0 1.6px, #3a4452 2.2px, #1c232d 3.2px, transparent 3.8px) 0 0 / 8px 8px no-repeat,
    radial-gradient(circle, #8a95a5 0 1.6px, #3a4452 2.2px, #1c232d 3.2px, transparent 3.8px) 100% 0 / 8px 8px no-repeat,
    radial-gradient(circle, #8a95a5 0 1.6px, #3a4452 2.2px, #1c232d 3.2px, transparent 3.8px) 0 100% / 8px 8px no-repeat,
    radial-gradient(circle, #8a95a5 0 1.6px, #3a4452 2.2px, #1c232d 3.2px, transparent 3.8px) 100% 100% / 8px 8px no-repeat; }
/* Round pilot light with a metal ring, like on a cabinet door: steady green ("available"); a status light, not a button,
   so it never changes when you point at or tap the card */
.pilot { position: absolute; top: 18px; right: 20px; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #b6ffd4, #3ddc84 55%, #1f9a55); box-shadow: 0 0 0 3px #3a4452, 0 0 0 4px #1a2029, 0 0 8px rgba(61,220,132,.55); }
.icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 10px; color: var(--blue-soft);
  background: rgba(61,139,255,.1); border: 1px solid rgba(61,139,255,.28); }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 1.3rem; margin-bottom: 6px; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.card .note { margin-top: 8px; font-size: .8rem; line-height: 1.45; }



/* Equipment experience: styled like status tags on an HMI screen */
.screen { margin-top: 32px; background: #1a2433; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 40px rgba(61,139,255,.05); }
.screen-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: #212d3e; border-bottom: 1px solid var(--line);
  font-size: .75rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.screen-bar h3 { font-size: 1rem; letter-spacing: .14em; color: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--led); white-space: nowrap; }
.status.busy { color: #ffb020; }
.status.busy .led { background: #ffb020; box-shadow: 0 0 8px rgba(255,176,32,.85); animation: led-blink 1s steps(1, end) infinite; } /* blinks with the stack light */
@keyframes led-blink { 0% { opacity: 1; } 50% { opacity: .15; } }
.screen-body { padding: 16px 18px 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 0; }
.chips li { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px; background: #263346; border: 1px solid #3a4c66; border-radius: 4px; font-weight: 600; letter-spacing: .02em; }
.led { width: 9px; height: 9px; border-radius: 50%; background: var(--led); box-shadow: 0 0 8px rgba(61,220,132,.8); animation: led 2.4s ease-in-out infinite; }
.chips li:nth-child(2) .led { animation-delay: .6s; }
.chips li:nth-child(3) .led { animation-delay: 1.2s; }
.chips li:nth-child(4) .led { animation-delay: 1.8s; }
/* Equipment lights are a list, not a status: steady blue (green is kept for real states like Ready, Online, Available) */
.chips .led { background: var(--blue-soft); box-shadow: 0 0 6px rgba(61,139,255,.8); animation: none; }
@keyframes led { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.screen .hint { margin-top: 14px; }

/* Portfolio (placeholders until real projects are added) */
/* About: photo on the left, a few lines and key facts on the right (one column on phones) */
.about { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.portrait { aspect-ratio: 4/5; display: grid; place-items: center; text-align: center; padding: 12px; color: var(--muted); font-size: .85rem; border-radius: 4px;
  background: repeating-linear-gradient(45deg, #1a2230 0 14px, #161d29 14px 28px); border: 1px dashed #3a475c; }
.about h3 { font-size: 1.5rem; margin-bottom: 4px; }
.about-text > .note { margin-top: 6px; max-width: 62ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0 0; }
.fact { padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.fact dt { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.fact dd { margin: 4px 0 0; font-weight: 600; }
@media (max-width: 640px) {
  .about { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .about h3, .fact dd { overflow-wrap: anywhere; } /* long words (like the placeholders) wrap on small phones */
  .portrait { width: 140px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
.project { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.shot { aspect-ratio: 16/9; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); font-size: .9rem;
  background: repeating-linear-gradient(45deg, #1a2230 0 14px, #161d29 14px 28px); border-bottom: 1px dashed #3a475c; }
.project-body { padding: 14px 18px 16px; }
.project h3 { font-size: 1.2rem; margin-bottom: 4px; }
.project .hint { margin: 0; }

/* Quote form: styled like a control panel */
.console { max-width: 880px; background: linear-gradient(180deg, #243142, #1d2838); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.console-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: #1a2433; border-bottom: 1px solid var(--line);
  font-size: .75rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
form { display: grid; gap: 18px; padding: clamp(16px, 2.5vw, 22px); }
/* The quote section is tighter, so the title and the first fields fit on screen together */
#quote { padding-top: clamp(48px, 4vw, 60px); }
#quote h2 { margin-bottom: 8px; }
#quote .sub { margin-bottom: 22px; }
fieldset { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
legend { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; padding: 0; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.1rem; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-soft); }
legend .num { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--blue); color: #fff; font-size: .8em; letter-spacing: 0; }
.row { display: grid; gap: 12px 16px; grid-template-columns: 1fr 1fr; }
label { display: block; font-weight: 500; font-size: .86rem; letter-spacing: .04em; margin-bottom: 4px; }
.opt { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; padding: 10px 12px; background: #141d29; color: var(--ink); border: 1px solid #4a5d78; border-radius: 3px; font: inherit; transition: border-color .2s ease, box-shadow .2s ease; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(61,139,255,.3); }
input[type="file"] { padding: 10px; }
.file-remove { margin-top: 6px; padding: 5px 12px; border: 1px solid #4a5d78; border-radius: 3px; background: #141d29; color: var(--ink); font: 600 .8rem "Barlow", sans-serif; cursor: pointer; }
.file-remove:hover, .file-remove:focus-visible { border-color: #ff6b6b; color: #ff8a8a; }
.file-remove[hidden] { display: none; }
.count { margin: 4px 0 0; text-align: right; color: var(--muted); font-size: .78rem; }
.count.near { color: #ffb020; font-weight: 600; }
textarea { min-height: 80px; resize: vertical; }
#equipment { min-height: 56px; } /* optional field, starts small and can be dragged bigger */
.hp { position: absolute; left: -9999px; }
.submit { display: grid; gap: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
#err { color: #ff8a8a; min-height: 1.4em; margin: 0; }
/* A field with a mistake (for now: an email that isn't valid) gets a red border and a short message under it */
input.invalid { border-color: #ff6b6b; box-shadow: 0 0 0 3px rgba(255,107,107,.22); }
.field-err { margin: 4px 0 0; color: #ff8a8a; font-size: .82rem; }
.field-err:empty { display: none; }
.btn.big { justify-self: start; padding: 1.15em 2.4em; font-size: .9rem; }

/* Contact */
.contact { display: grid; gap: 28px; grid-template-columns: 1fr auto; align-items: center; padding: clamp(24px, 4vw, 40px); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.contact dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 22px; margin: 0; }
.contact dt { color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; padding-top: 3px; }
.contact dd { margin: 0; }
.contact-status { grid-column: 1 / -1; margin: 0; font-size: .75rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }

footer { padding: 36px 0 56px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 640px) {
  html { scroll-padding-top: 44px; } /* menu links stop with the section title just below the taller phone header */
  .row, .contact { grid-template-columns: 1fr; }
  #quote form { padding: 14px; gap: 14px; }
  fieldset { gap: 8px; }
  .row { gap: 8px; }
  textarea { min-height: 72px; }
  .beacon { right: 14px; transform: scale(.75); transform-origin: bottom center; } /* smaller stack light on phones */
  #quote .sub { padding-right: 64px; } /* the text above the panel stays clear of the stack light */
  .console-bar { padding: 10px 16px; }
  /* Compact header on phones: logo, Lab link and language on one line, the menu on a second line that scrolls sideways if needed */
  header.top .wrap { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "home back lang" "menu menu menu"; align-items: center; gap: 4px 12px; padding: 8px 0 6px; }
  .home { grid-area: home; font-size: 1rem; }
  .back { grid-area: back; font-size: .72rem; letter-spacing: .06em; }
  .lang { grid-area: lang; }
  .lang a, .lang span { padding: 6px 7px; }
  header.top nav:not(.lang) { grid-area: menu; flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
  header.top nav:not(.lang)::-webkit-scrollbar { display: none; }
  /* Phones: the four buttons share the row; no dots, the section on screen gets a light blue bar under its button */
  header.top nav:not(.lang) a { flex: 1 1 auto; text-align: center; font-size: .8rem; white-space: nowrap; padding: 5px 4px; }
  header.top nav:not(.lang) a::before { display: none; }
  header.top nav:not(.lang) a[aria-current] { box-shadow: inset 0 -3px 0 var(--blue-soft); }
  .full { display: none; }
  .short { display: inline; }
  .btn.big { justify-self: stretch; text-align: center; }
  .contact dl { grid-template-columns: 1fr; gap: 2px; } /* label above its value, so long values fit */
  .contact dd { margin-bottom: 12px; overflow-wrap: anywhere; }
  /* Phones: icon next to the card title and less padding, so the services list is shorter to scroll */
  .card { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; padding: 16px 16px 14px; }
  .card .icon { width: 34px; height: 34px; margin: 0; border-radius: 8px; }
  .card .icon svg { width: 20px; height: 20px; }
  .card h3 { margin: 0; padding-right: 22px; font-size: 1.2rem; }
  .card p, .card .note { grid-column: 1 / -1; }
  .card p { margin-top: 8px; }
  .pilot { top: 14px; right: 14px; }
  .grid { gap: 12px; }
  /* Phones: portfolio cards become a small picture on the left and the text on the right */
  .project { display: grid; grid-template-columns: 110px 1fr; }
  .shot { aspect-ratio: auto; min-height: 92px; padding: 8px; font-size: .72rem; border-bottom: 0; border-right: 1px dashed #3a475c; }
  .project-body { padding: 10px 14px; }
  .project h3 { font-size: 1.05rem; }
  .project .hint { font-size: .8rem; }
}
@media (max-width: 360px) {
  header.top nav:not(.lang) { gap: 3px; } /* all four menu links fit on the smallest phones */
  header.top nav:not(.lang) a { font-size: .74rem; letter-spacing: .02em; padding: 5px 3px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn, input, textarea, select { transition: none; }
  .card:hover { transform: none; }
  .hero .wrap > *, .led { animation: none; }
  .console-wrap.busy .seg.amber { animation: none; background: #ffb020; box-shadow: 0 0 14px #ffb020; } /* sending: yellow stays on instead of blinking */
  .pilot, header.top nav:not(.lang) a, header.top nav:not(.lang) a::before { transition: none; }
}

/* The site says it handles dark mode itself (so phones don't repaint it) and keeps its own colours in both modes */
:root { color-scheme: light dark; }
