/* Fonts self-hosted (no requests to third-party servers: GDPR-friendly). SIL Open Font License. */
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); }

:root {
  --bg: #0d0f12;
  --bg-raised: #15181c;
  --line: rgba(255, 255, 255, 0.09);
  --text: #ece8e2;
  --muted: #a0a4ab;
  --faint: #6f747c;
  /* Accent: "arco elettrico" (blu arco). Alternative da provare:
     giallo sicurezza  --accent:#f5c400 --accent-rgb:245,196,0   --accent-soft:#ffe066 --accent-hover:#ffd42e --on-accent:#1a1400
     rosso ossido      --accent:#e5483b --accent-rgb:229,72,59   --accent-soft:#ff9b8f --accent-hover:#f0614f --on-accent:#ffffff
     verde ottanio     --accent:#2fc4a5 --accent-rgb:47,196,165  --accent-soft:#8fe6d3 --accent-hover:#4fd3b7 --on-accent:#00170f */
  --accent: #3db4f2;
  --accent-rgb: 61, 180, 242;
  --accent-soft: #93d5fb;
  --accent-hover: #62c3f6;
  --on-accent: #00141f;

  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Technical-drawing grid, fading out towards the bottom */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 30%, transparent 100%);
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark { width: 26px; height: 21px; flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  line-height: 1;
}
.top-tag { color: var(--muted); text-align: right; }

/* Hero */
main { flex: 1; }

.hero { padding-block: clamp(24px, 5vh, 64px) 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-soft);
  background: rgba(var(--accent-rgb), 0.06);
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); }
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 6.4vw, 5.25rem);
  line-height: 0.92;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hot {
  color: var(--accent);
  text-shadow: 0 0 calc(28px * var(--glow, 0.6)) rgba(var(--accent-rgb), calc(0.55 * var(--glow, 0.6)));
}

.lead {
  max-width: 56ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
}

/* Weld band (full width) */
.weld {
  position: relative;
  margin: 0;
}
.weld::before {
  /* ambient light from the arc, follows the torch */
  content: "";
  position: absolute;
  inset: -20% 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 40% 55% at var(--arc-x, 50%) 62%,
    rgba(150, 200, 255, calc(0.14 * var(--glow, 0))),
    transparent 70%
  );
}
#weld-canvas {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(220px, 24vw, 300px);
  /* soften the top edge so the torch and sparks don't end on a hard line */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 28%);
}
.weld-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  color: var(--faint);
}
[data-weld-status] { color: var(--accent-soft); font-variant-numeric: tabular-nums; }

/* Contact */
.contact { padding-block: clamp(40px, 7vh, 80px) clamp(40px, 8vh, 96px); }
.contact h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.05;
  text-transform: uppercase;
}
.contact-copy { margin: 12px 0 0; color: var(--muted); max-width: 52ch; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.22); color: var(--text); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.04); }
.btn[hidden] { display: none; }

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.facts li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 0 0;
  font-weight: 500;
  line-height: 1.35;
}
.facts .mono { color: var(--accent-soft); }

/* Legal footer */
.legal {
  padding-block: 28px 32px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.875rem;
  line-height: 1.6;
}
.legal p { margin: 0; }
.legal strong { color: var(--muted); font-weight: 600; }
.legal a { color: var(--muted); text-underline-offset: 3px; }
.legal a:hover { color: var(--text); }
.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 16px !important;
}

/* Text page (privacy) */
.doc { padding-block: 24px 80px; }
.doc-inner { max-width: 72ch; }
.doc h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); max-width: none; }
.doc h2 {
  margin: 40px 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.doc p, .doc li { color: #c9c6c0; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc a { color: var(--accent-soft); text-underline-offset: 3px; }
.doc .updated { color: var(--faint); margin-top: 8px; }
.back { display: inline-block; margin-bottom: 24px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }

@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts li { padding-bottom: 18px; }
}

@media (max-width: 560px) {
  .top-tag { display: none; }
  .btn { width: 100%; justify-content: center; }
  .facts { grid-template-columns: 1fr; }
  .facts li { flex-direction: row; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .weld-caption { font-size: 0.6875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .btn { transition: none; }
}
