/* ==========================================================
   AF Coding — stile condiviso da tutte le pagine
   ========================================================== */

:root {
  --bg: #050C1F;
  --bg-alt: #081229;
  --card: #0B1730;
  --line: #16223A;
  --line-2: #1C2B48;
  --line-3: #2A3A58;
  --text: #FFFFFF;
  --text-2: #E2E8F2;
  --muted: #B4C2D8;
  --muted-2: #8597B3;
  --label: #C9D4E5;
  --accent: #5EE6D0;
  --ok: #5EE6D0;
  --error: #FF8A8A;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 14px;
  --max: 1200px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { color: var(--text); }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--accent); color: var(--bg); padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { left: 8px; z-index: 100; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Header e menu ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}
.logo { display: flex; align-items: center; }
.logo img { height: 40px; width: auto; }

.nav-toggle {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text);
  border: 1px solid var(--line-3); border-radius: 10px; cursor: pointer;
}
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }

.nav {
  display: none;
  position: fixed; inset: 68px 0 0 0;
  background: var(--bg);
  padding: 24px 16px 40px;
  flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.nav-open .nav { display: flex; }
.nav-open { overflow: hidden; }

.nav a {
  color: var(--text); text-decoration: none;
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  padding: 16px 4px; border-bottom: 1px solid var(--line);
}
.nav a[aria-current="page"] { color: var(--accent); }
.nav .btn { margin-top: 24px; font-size: 16px; letter-spacing: 0; border-bottom: 0; }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 26px;
  border-radius: 10px; border: 1px solid transparent;
  font-family: var(--font); font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { color: var(--bg); background: #7FF0DE; }
.btn-outline { border-color: var(--line-3); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--text); }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

.btn-row { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Testi ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--accent);
}
.title-xl { font-size: clamp(2.4rem, 7vw, 4.5rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
.title-lg { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 800; }
.lead { font-size: 1.1rem; line-height: 1.65; color: var(--muted); max-width: 640px; }
.text { font-size: 1rem; line-height: 1.65; color: var(--muted); }
.small { font-size: 14px; color: var(--muted-2); }
.mono { font-family: var(--mono); }

/* ---------- Sezioni ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; max-width: 680px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 56px; }
.hero .container { display: grid; gap: 40px; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 20px; }

.terminal {
  background: var(--card); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 22px; font-family: var(--mono); font-size: 14px; line-height: 2;
}
.terminal .dots { display: flex; gap: 8px; margin-bottom: 12px; }
.terminal .dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--line-3); }
.terminal .p { color: var(--accent); }
.terminal .c { color: var(--muted-2); }

/* ---------- Card ---------- */
.grid-cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 10px;
}
.card h3 { font-size: 1.25rem; }
.card-accent { border-color: var(--accent); }
.card-solid { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.card-solid .text, .card-solid .mono { color: var(--bg); }
.card-label { font-family: var(--mono); font-size: 12px; color: var(--muted-2); }
.icon { width: 32px; height: 32px; color: var(--accent); }

/* ---------- Passi numerati ---------- */
.steps { display: grid; grid-template-columns: 1fr; gap: 24px; }
.step { display: flex; gap: 16px; }
.step-num { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1.3; }
.step h3 { font-size: 1.15rem; margin-bottom: 4px; }

/* ---------- Due colonne ---------- */
.split { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }

/* ---------- Moduli ---------- */
.form {
  background: var(--card); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--label); }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-3); border-radius: 8px;
  padding: 14px; font-family: var(--font); font-size: 16px;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field input::placeholder, .field textarea::placeholder { color: #6E7F9C; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { font-size: 15px; display: none; }
.form-msg.ok { display: block; color: var(--ok); }
.form-msg.error { display: block; color: var(--error); }

/* ---------- Progetti ---------- */
.project {
  background: var(--card); border: 1px solid var(--line-2); border-radius: 20px;
  padding: 24px 20px; display: grid; gap: 24px; align-items: center;
}
.shots { display: flex; gap: 12px; justify-content: center; }
.shots img {
  width: 50%; max-width: 220px; height: auto;
  border-radius: 18px; border: 4px solid var(--line-2);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  border: 1px solid var(--line-3); border-radius: 999px; padding: 5px 10px;
}
.bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); }
.bullets li { display: flex; gap: 10px; }
.bullets li::before { content: ">"; color: var(--accent); font-family: var(--mono); }

/* ---------- Chi sono ---------- */
.about { display: grid; gap: 32px; align-items: center; }
.photo {
  width: 200px; height: auto; justify-self: center;
  aspect-ratio: 4 / 5; object-fit: cover; object-position: center 70%;
  border-radius: 20px; border: 1px solid var(--line-2);
}

/* ---------- FAQ ---------- */
.faq-item { border-top: 1px solid var(--line-2); padding: 20px 0; display: flex; flex-direction: column; gap: 6px; }
.faq-item:last-child { border-bottom: 1px solid var(--line-2); }
.faq-item h3 { font-size: 1.1rem; }

/* ---------- Pagina privacy ---------- */
.legal-wrap { display: grid; gap: 32px; }
.toc {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; align-self: start;
}
.toc a { color: var(--label); text-decoration: none; padding: 6px 0; font-size: 15px; }
.toc a:hover { color: var(--accent); }
.legal { display: flex; flex-direction: column; gap: 32px; max-width: 760px; }
.legal section { display: flex; flex-direction: column; gap: 12px; padding-top: 28px; border-top: 1px solid var(--line-2); scroll-margin-top: 90px; }
.legal h2 { font-size: 1.4rem; }
.legal p, .legal li { color: var(--label); line-height: 1.7; }
.legal strong { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; }
.site-footer .container { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted-2); }
.site-footer img { height: 36px; width: auto; align-self: flex-start; }

/* ==========================================================
   Schermi grandi (tablet orizzontale e computer)
   ========================================================== */
@media (min-width: 900px) {
  .container { padding: 0 24px; }

  .nav-toggle { display: none; }
  .nav, .nav-open .nav {
    display: flex; position: static; flex-direction: row; align-items: center;
    gap: 28px; padding: 0; background: transparent; overflow: visible;
  }
  .nav-open { overflow: auto; }
  .nav a { font-size: 15px; font-weight: 500; letter-spacing: 0; padding: 0; border: 0; color: var(--label); }
  .nav a:hover { color: var(--text); }
  .nav a[aria-current="page"] { color: var(--text); box-shadow: 0 2px 0 var(--accent); }
  .nav .btn { margin-top: 0; min-height: 44px; padding: 10px 20px; color: var(--bg); }
  .nav .btn:hover { color: var(--bg); }
  .logo img { height: 48px; }
  .site-header .container { min-height: 88px; }
  .nav { inset: auto; }

  .section { padding: 96px 0; }
  .hero { padding: 96px 0 112px; }
  .hero .container { grid-template-columns: 1.6fr 1fr; gap: 56px; }
  .eyebrow { font-size: 15px; }
  .lead { font-size: 1.2rem; }

  .btn-row { flex-direction: row; flex-wrap: wrap; }

  .grid-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
  .card { padding: 32px; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .step { flex-direction: column; gap: 12px; padding-top: 20px; border-top: 2px solid var(--line-3); }
  .step:first-child { border-top-color: var(--accent); }
  .step-num { font-size: 28px; }

  .split { grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: center; }
  .split.form-split { grid-template-columns: 1fr 1.4fr; align-items: start; }

  .form { padding: 32px; gap: 20px; }
  .form-row { grid-template-columns: 1fr 1fr; gap: 20px; }
  .form .btn { align-self: flex-start; }

  .project { grid-template-columns: 1.2fr 1fr; padding: 48px; gap: 48px; }
  .project.reverse .shots { order: -1; }
  .shots { gap: 20px; }
  .shots img:last-child { margin-top: 48px; }

  .about { grid-template-columns: 300px 1fr; gap: 64px; }
  .photo { width: 100%; justify-self: stretch; border-radius: 24px; }

  .legal-wrap { grid-template-columns: 240px 1fr; gap: 64px; }
  .toc { position: sticky; top: 112px; background: transparent; border: 0; padding: 0; }

  .site-footer .container { flex-direction: row; align-items: center; justify-content: space-between; }
  .site-footer img { height: 40px; align-self: center; }
}