/* drme.tech — stile del sito. Regole: vedi drme-web-rules/RULES.md §3–4. */
:root {
  --bg: #ffffff;
  --bg-alt: #f3f6fb;
  --ink: #11141a;
  --muted: #5a6270;
  --line: #dfe5ee;
  --blue: #1877f2;
  --blue-dark: #0f5bc4;
  --night: #0a0e18;
  --on-night: #ffffff;
  --on-night-muted: #c8d6eb;
  --footer-text: #9fb0c8;
  --placeholder-bg: #fff4c2;
  --led-off: rgba(24, 119, 242, 0.18);
  --led-on: #1877f2;
  --led-glow: rgba(24, 119, 242, 0.55);
  --led-on-blue: rgba(255, 255, 255, 0.35);
  --led-on-blue-lit: #ffffff;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.65; }
img { max-width: 100%; height: auto; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.skip { position: absolute; left: -9999px; top: 8px; background: var(--blue); color: var(--on-night); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 16px; }

/* Barra in alto */
header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: block; margin-right: auto; }
.brand img { height: 46px; width: auto; display: block; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a, .lang { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
nav a:hover, .lang:hover { color: var(--ink); background: var(--bg-alt); }
nav a.on { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); border-radius: 0; }
.lang { border: 1px solid var(--line); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Banner */
.hero { position: relative; overflow: hidden; isolation: isolate; background: var(--night) url("/assets/banner.jpg") center / cover no-repeat; color: var(--on-night); }
/* Con JavaScript attivo il banner è disegnato dal canvas (hero-fx.js); senza JS resta l'immagine. */
.hero.fx-on { background: var(--night); }
.hero-fx { position: absolute; inset: 0; z-index: -1; display: block; pointer-events: none; }
.hero .wrap { position: relative; }
.hero .wrap { padding-block: clamp(64px, 10vw, 120px); }
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.12; font-weight: 700; margin: 0 0 14px; max-width: 16ch; text-wrap: balance; }
.hero p { color: var(--on-night-muted); font-size: clamp(16px, 2vw, 19px); max-width: 46ch; margin: 0 0 28px; }
.hero.small .wrap { padding-block: clamp(44px, 6vw, 72px); }
.hero.small h1 { font-size: clamp(28px, 4vw, 42px); margin: 0; }

.btn { display: inline-flex; align-items: center; gap: 10px; background: var(--blue); color: var(--on-night); text-decoration: none; font-weight: 600; font-size: 15px; padding: 13px 24px 13px 20px; border-radius: 999px; }
.btn:hover { background: var(--blue-dark); }
/* LED di stato nel pulsante: si accende al passaggio, "clic" alla pressione. */
.btn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--led-on-blue); flex: none; }
.btn:hover::before, .btn:focus-visible::before { background: var(--led-on-blue-lit); box-shadow: 0 0 8px 2px var(--led-on-blue); }
.btn:active { transform: translateY(1px); }

/* Sezioni */
section { padding-block: clamp(48px, 7vw, 80px); }
section.alt { background: var(--bg-alt); }
h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; font-weight: 700; margin: 0 0 14px; text-wrap: balance; }
h3, .h3 { font-size: 18px; line-height: 1.35; font-weight: 600; margin: 0 0 6px; }
.lead { color: var(--muted); font-size: 17px; max-width: 62ch; margin: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin: 0 0 10px; }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 32px; }
.tile { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 26px; min-width: 0; }
/* LED in alto a destra: spento a riposo, acceso al passaggio del mouse. */
.tile::after { content: ""; position: absolute; top: 18px; right: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--led-off); }
.tile:hover::after, .tile:focus-within::after { background: var(--led-on); box-shadow: 0 0 10px 2px var(--led-glow); }
.tile:hover { border-color: var(--led-glow); }
.tile p { margin: 0; color: var(--muted); }
.ico { width: 44px; height: 44px; border-radius: 10px; background: var(--blue); display: grid; place-items: center; margin-bottom: 16px; }
.ico svg { width: 24px; height: 24px; stroke: var(--on-night); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px 36px; margin-top: 28px; }
.why div { border-top: 2px solid var(--blue); padding-top: 14px; min-width: 0; }
.why p { margin: 0; color: var(--muted); font-size: 15px; }

.svc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px 40px; padding-block: 26px; border-top: 1px solid var(--line); }
.svc:first-child { border-top: 0; }
.svc p { margin: 0; color: var(--muted); max-width: 62ch; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; padding-block: 22px; border-top: 1px solid var(--line); counter-increment: s; }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(s); width: 40px; height: 40px; border-radius: 10px; background: var(--bg-alt); color: var(--blue); font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.steps p { margin: 0; color: var(--muted); }

.chips { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 500; }

.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 32px; }
.mail { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 20px; font-weight: 600; margin: 8px 0 0; overflow-wrap: anywhere; }
.mail a { color: var(--ink); text-decoration: none; }
.mail a:hover { color: var(--blue); }
.copy { font: inherit; font-size: 13px; font-weight: 500; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 6px 12px; cursor: pointer; }

footer { background: var(--night); color: var(--footer-text); font-size: 13.5px; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 26px; }
footer img { width: 28px; height: 28px; border-radius: 6px; }

@media (max-width: 640px) {
  .svc { grid-template-columns: minmax(0, 1fr); }
  .brand img { height: 36px; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn, .btn::before, .tile, .tile::after { transition: background-color .2s ease, box-shadow .25s ease, border-color .25s ease, transform .08s ease; }
}
