/* ROBOMEC v2, in the colours of the current robomecsrl.it (IONOS theme): night blue #101926, ROBOMEC blue
   #37659E / #4B77BC, light blue-grey #F2F6FA. Dark sections for the cell, light sections like the original site.
   One signature element: the interactive cell in the hero. Everything else stays quiet. */

@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --night: #101926;
  --panel: #16233a;
  --panel-up: #1b365d;
  --line: #2a3d5c;
  --text: #f2f6fa;
  --muted: #9fb0c8;
  --robot: #4b77bc;
  --robot-strong: #37659e;
  --laser: #9cc3ff;
  --light: #f2f6fa;
  --light-line: #d6e0ee;
  --ink: #101926;
  --ink-muted: #4a5a70;
  --stop: #e5484d;
  --run: #2dbe6c;
  --display: "Barlow Condensed", "Bahnschrift", "Arial Narrow", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --measure: 62ch;
  --edge: clamp(1.25rem, 5vw, 4.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--night); color: var(--text); font: 400 1.125rem/1.6 var(--body); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.02; letter-spacing: -0.005em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
svg, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--laser); outline-offset: 3px; border-radius: 2px; }
mark { background: rgba(249, 168, 0, 0.28); color: inherit; padding: 0 0.15em; border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.draft-note { background: #f9a800; color: var(--ink); font-size: 0.95rem; padding: 0.45rem var(--edge); }
.draft-note mark { background: rgba(255, 255, 255, 0.5); }

/* ---- header ------------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
       padding: 0.85rem var(--edge); background: rgba(16, 25, 38, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.brand img { height: 2.4rem; width: auto; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; font: 700 1.55rem/1 var(--display); letter-spacing: 0.08em; }
.brand svg { width: 2.2rem; fill: none; stroke: var(--robot); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand circle { fill: var(--laser); stroke: none; }
.top nav { display: flex; align-items: center; gap: clamp(0.8rem, 2.2vw, 1.8rem); font-weight: 500; font-size: 1rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--text); }
.top .nav-cta { color: #fff; background: var(--robot-strong); padding: 0.45rem 0.9rem; border-radius: 4px; font-weight: 600; }
.top .nav-cta:hover { color: #fff; background: var(--robot); }

/* ---- hero: the cell ----------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
        padding: clamp(2.5rem, 6vw, 5rem) var(--edge) clamp(2rem, 4vw, 3.5rem);
        background: radial-gradient(ellipse 70% 60% at 70% 55%, rgba(75, 119, 188, 0.16), transparent 70%); }
.hero h1 { font-size: clamp(2.7rem, 5.6vw, 5rem); text-wrap: balance; }
.hero-lead { margin-top: 1.4rem; max-width: 44ch; color: var(--muted); font-size: clamp(1.1rem, 1.5vw, 1.3rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0.7rem 1.3rem; border-radius: 4px;
          font: 600 1.05rem/1.2 var(--body); text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.button.primary { background: var(--robot-strong); color: #fff; }
.button.primary:hover { background: var(--robot); }
.button.ghost { border-color: var(--line); color: var(--text); }
.button.ghost:hover { border-color: var(--muted); }

.cell { position: relative; margin: 0; }
.cell canvas { width: 100%; aspect-ratio: 960 / 560; height: auto; border: 1px solid var(--line); border-radius: 8px;
               background: linear-gradient(180deg, #16233a, var(--night) 84%); touch-action: none; cursor: crosshair; }
.cell figcaption { margin-top: 0.7rem; color: var(--muted); font-size: 0.95rem; max-width: var(--measure); }
.pendant { position: absolute; top: 0.9rem; left: 0.9rem; padding: 0.6rem 0.8rem; min-width: 11.5rem; border-radius: 6px;
           background: rgba(15, 24, 32, 0.86); border: 1px solid var(--line); font: 500 0.8rem/1.45 var(--mono); }
.pendant-mode { color: var(--run); letter-spacing: 0.04em; margin-bottom: 0.35rem; }
.pendant-mode[data-state="manual"] { color: var(--laser); }
.pendant-mode[data-state="warn"] { color: #f9a800; }
.pendant-mode[data-state="stop"] { color: var(--stop); }
.pendant dl { margin: 0; display: grid; grid-template-columns: repeat(2, auto); gap: 0 1.2rem; }
.pendant dl div { display: flex; justify-content: space-between; gap: 0.6rem; }
.pendant dt { color: var(--muted); }
.pendant dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---- technologies --------------------------------------------------------- */
.tech { border-block: 1px solid var(--line); padding: 1rem var(--edge); }
.tech ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 2.2rem; justify-content: space-between;
           font: 600 1.15rem/1.4 var(--display); letter-spacing: 0.03em; color: var(--muted); }

/* ---- sections ---------------------------------------------------------------- */
main > section:not(.hero):not(.tech) { padding: clamp(3.5rem, 8vw, 6.5rem) var(--edge); }
.section-head { max-width: var(--measure); margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); }
.section-head p { margin-top: 0.8rem; color: var(--muted); }

.rungs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rungs li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(1rem, 4vw, 4rem); padding: 1.6rem 0; border-bottom: 1px solid var(--line); }
.cond { display: flex; align-items: baseline; gap: 0.8rem; font: 600 clamp(1.3rem, 2vw, 1.6rem)/1.2 var(--display); }
.act { color: var(--muted); }
.act strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 0.25rem; }
.lamp { flex: none; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--run); box-shadow: 0 0 0.6rem rgba(45, 190, 108, 0.6); }
.lamp.stop { background: var(--stop); box-shadow: 0 0 0.6rem rgba(229, 72, 77, 0.7); }
.lamp.warn { background: #f9a800; box-shadow: 0 0 0.6rem rgba(249, 168, 0, 0.6); }

.care { background: var(--panel); border-block: 1px solid var(--line); }
.care-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 5vw, 5rem); }
.care-item { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 0.3rem 1.1rem; align-content: start; }
.care-icon { grid-row: span 2; width: 3rem; fill: none; stroke: var(--laser); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.care-item h3 { font-size: 1.6rem; }
.care-item p { color: var(--muted); max-width: 54ch; }
.care-item p strong { color: var(--text); font-weight: 600; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.2rem; counter-reset: step; }
.steps li { counter-increment: step; border-top: 3px solid var(--line); padding-top: 1rem; }
.steps li:first-child { border-top-color: var(--robot); }
.steps li::before { content: counter(step); display: block; font: 700 2.4rem/1 var(--display); color: var(--robot); margin-bottom: 0.6rem; }
.steps h3 { font-size: 1.35rem; margin-bottom: 0.4rem; }
.steps p { color: var(--muted); font-size: 1rem; }

.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.case { border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem; background: var(--panel); }
.case-sector { color: var(--laser); font-size: 0.95rem; font-weight: 500; }
.case h3 { font-size: 1.55rem; margin: 0.35rem 0 1rem; }
.case dl { margin: 0; display: grid; gap: 0.15rem; }
.case dt { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.case dd { margin: 0; }

/* ---- quote form ----------------------------------------------------------- */
.quote { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(2rem, 5vw, 5rem); background: var(--panel); border-top: 1px solid var(--line); }
.quote h2 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); }
.quote-intro p { margin-top: 0.8rem; color: var(--muted); }
.direct { list-style: none; padding: 0; margin: 1.6rem 0 0; font: 600 1.4rem/1.6 var(--display); }
.direct a { text-decoration: none; }
.direct a:hover { color: var(--laser); }
.quote-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; }
.quote-form label { display: grid; gap: 0.35rem; font-weight: 500; font-size: 1rem; }
.quote-form .wide, .urgency { grid-column: 1 / -1; }
.hint { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--night); border: 1px solid var(--line); border-radius: 4px; padding: 0.65rem 0.75rem; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--laser); outline: none; box-shadow: 0 0 0 3px rgba(67, 211, 232, 0.25); }
.urgency { border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 1rem 1rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; }
.urgency legend { padding: 0 0.4rem; font-weight: 500; }
.urgency label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.urgency input, .consent input { width: auto; accent-color: var(--robot); }
.consent { display: flex !important; align-items: flex-start; gap: 0.6rem; font-weight: 400 !important; color: var(--muted); }
.form-end { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-status { color: var(--laser); }

/* ---- footer ----------------------------------------------------------------- */
.foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; padding: 2.5rem var(--edge) 3rem; border-top: 1px solid var(--line);
        color: var(--muted); font-size: 0.95rem; }
.foot-brand { color: var(--text); font: 700 1.3rem/1.2 var(--display); letter-spacing: 0.06em; margin-bottom: 0.4rem; }

/* ---- light sections, as on the original site ---------------------------------- */
.care, .work, .gallery { background: var(--light); color: var(--ink); border-color: var(--light-line); }
.care .section-head p, .work .section-head p, .gallery .section-head p, .care-item p, .gallery figcaption { color: var(--ink-muted); }
.care-item p strong { color: var(--ink); }
.care-icon { stroke: var(--robot-strong); }
.work .case { background: #fff; border-color: var(--light-line); }
.work .case-sector { color: var(--robot-strong); }
.work .case dt { color: var(--ink-muted); }
.care mark, .work mark { background: rgba(249, 168, 0, 0.35); }

/* ---- gallery: photos and video from the field ----------------------------------- */
.apps { list-style: none; margin: 0 0 1.6rem; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.apps li { background: #fff; border: 1px solid var(--light-line); border-top: 3px solid var(--robot-strong); border-radius: 6px; padding: 0.9rem 1rem 1rem; }
.apps h3 { margin: 0 0 0.35rem; font: 700 1.25rem/1.15 var(--display); letter-spacing: 0.02em; color: var(--ink); }
.apps p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; line-height: 1.45; }
@media (max-width: 960px) { .apps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .apps { grid-template-columns: 1fr; } }
.shots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.8rem; }
.shots figure { margin: 0; grid-column: span 1; }
.shots figure.wide { grid-column: span 2; }
.shots img, .shots video { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: #dfe7f2; }
.shots figure.wide { display: flex; flex-direction: column; }
.shots figure.wide img, .shots figure.wide video { flex: 1 1 0; min-height: 0; height: auto; aspect-ratio: auto; }
.shots video { cursor: pointer; }
.brand img { height: 3.4rem; }
.foot-logo { display: block; width: 7.5rem; height: auto; margin-bottom: 0.6rem; opacity: 0.92; }
.shots figcaption { margin-top: 0.4rem; font-size: 0.9rem; }
.video-slot { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 2px dashed var(--light-line); border-radius: 6px;
              color: var(--ink-muted); text-align: center; padding: 1rem; font-size: 0.95rem; }
@media (max-width: 720px) { .shots { grid-template-columns: 1fr 1fr; } .shots figure.wide { grid-column: span 2; }
  .shots figure.wide img, .shots figure.wide video { flex: none; height: auto; aspect-ratio: 3 / 2; } }

/* ---- small screens ------------------------------------------------------------ */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cases, .care-grid { grid-template-columns: 1fr; }
  .quote { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .top nav a:not(.nav-cta) { display: none; }
  .rungs li { grid-template-columns: 1fr; gap: 0.5rem; }
  .quote-form { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; }
  .pendant { position: static; margin-top: 0.6rem; }
  .tech ul { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.hero-logo { display: block; width: clamp(9rem, 15vw, 13.5rem); height: auto; margin-bottom: 1.4rem; }
.quote-logo { display: block; width: clamp(7rem, 11vw, 10rem); height: auto; margin-bottom: 1.2rem; opacity: 0.95; }
.foot-logo { width: 9.5rem; }
.foot .legal { margin-top: 0.6rem; font-size: 0.9rem; }
@media (max-width: 720px) { .brand img { height: 2.8rem; } .hero-logo { width: 8.5rem; margin-bottom: 1rem; } }

/* ---- D334: the contact box comes alive ------------------------------------------------------------- */
.quote { position: relative; transition: background-color 0.4s ease; }
.quote[data-urgency="ferma"] { background: linear-gradient(180deg, #2a1620 0%, var(--panel) 60%); }
.andon { position: relative; display: grid; gap: 4px; width: 2.3rem; margin: 1.6rem 0 0.4rem; }
.andon span:not(.a-pole) { height: 1.15rem; border-radius: 4px; background: #23324a; border: 1px solid #33496b; transition: background 0.3s, box-shadow 0.3s; }
.andon .a-pole { width: 6px; height: 1.6rem; margin: 0 auto; background: #33496b; border-radius: 0 0 3px 3px; }
.quote[data-urgency="ferma"] .a-red { background: var(--stop); box-shadow: 0 0 18px rgba(229, 72, 77, 0.9); animation: andon 1s steps(2, jump-none) infinite; }
.quote[data-urgency="settimane"] .a-amber { background: #f5a524; box-shadow: 0 0 16px rgba(245, 165, 36, 0.8); }
.quote[data-urgency="progetto"] .a-green { background: var(--run); box-shadow: 0 0 16px rgba(45, 190, 108, 0.8); }
@keyframes andon { 50% { background: #5a2027; box-shadow: none; } }
.urgency { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; padding: 0.6rem 0.8rem 0.8rem; }
.urgency .tile { position: relative; display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--night); cursor: pointer; transition: border-color 0.2s, transform 0.15s, background 0.2s; }
.urgency .tile:hover { border-color: var(--robot); }
.urgency .tile span:last-child { display: grid; line-height: 1.25; font-size: 0.9rem; color: var(--muted); }
.urgency .tile strong { color: var(--text); font-weight: 600; font-size: 1rem; }
.urgency .tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.urgency .tile:has(input:checked) { border-color: var(--laser); background: var(--panel-up); transform: translateY(-2px); }
.urgency .tile.stop:has(input:checked) { border-color: var(--stop); background: #3a1d26; }
.urgency .tile:has(input:focus-visible) { outline: 3px solid var(--laser); outline-offset: 2px; }
.urgent-call { margin: -0.2rem 0 0; padding: 0.7rem 0.9rem; border-left: 3px solid var(--stop); background: rgba(229, 72, 77, 0.12); font-size: 1rem; }
.urgent-call a { font-weight: 600; color: #fff; }
.kinds { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.kinds legend { font-weight: 500; font-size: 1rem; margin-bottom: 0.45rem; padding: 0; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 0.4rem 0.85rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.95rem;
  background: var(--night); transition: background 0.2s, border-color 0.2s, color 0.2s; }
.chip:hover span { border-color: var(--robot); }
.chip input:checked + span { background: var(--robot-strong); border-color: var(--robot); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--laser); outline-offset: 2px; }
.ticket { align-self: end; padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: 6px; background: #0c1420;
  font: 500 0.85rem/1.45 var(--mono); color: var(--laser); }
.ticket-head { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); }
.meter { height: 4px; margin: 0.45rem 0; border-radius: 2px; background: #1e2c42; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--robot), var(--laser)); transition: width 0.35s ease; }
.quote.ready .meter span { background: var(--run); }
.quote.ready #ticket-state { color: var(--run); }
.ticket-line { color: var(--text); overflow-wrap: anywhere; }
.form-end .button.ghost { background: transparent; }
@media (max-width: 720px) { .urgency { grid-template-columns: 1fr; } .andon { display: none; } }
@media (prefers-reduced-motion: reduce) { .quote[data-urgency="ferma"] .a-red { animation: none; } .urgency .tile:has(input:checked) { transform: none; } }

/* release: privacy page */
.privacy { max-width: 46rem; margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) var(--edge); }
.privacy h1 { font-size: clamp(2.2rem, 4.4vw, 3.2rem); margin-bottom: 1rem; }
.privacy h2 { font-size: 1.3rem; margin: 1.8rem 0 0.4rem; }
.privacy p { color: var(--muted); max-width: 70ch; }
.privacy .updated { margin-top: 2rem; font-size: 0.9rem; }
