:root {
  --bg: #0e0e10;
  --bg-2: #16161a;
  --bg-3: #1f1f24;
  --text: #f5f5f7;
  --text-dim: #a1a1aa;
  --accent: #f6821f;
  --accent-2: #ff9a3c;
  --border: #2a2a30;
  --radius: 12px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; color: var(--text-dim); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,14,16,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; max-width: var(--max); margin: 0 auto;
}
.brand { font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -.5px; }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-dim); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-toggle {
  display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .75rem 0; border-bottom: 1px solid var(--border); }
  .nav-links li:last-child a { border-bottom: 0; }
}

/* Hero */
.hero {
  padding: 5rem 0 4rem;
  background: radial-gradient(ellipse at top, rgba(246,130,31,.15), transparent 60%);
}
.hero h1 { max-width: 20ch; }
.hero .lead { font-size: 1.2rem; color: var(--text-dim); max-width: 55ch; margin-bottom: 2rem; }
.hero .cta-row { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-block; padding: .85rem 1.5rem;
  border-radius: var(--radius); font-weight: 600; font-size: 1rem;
  transition: transform .15s ease, background .15s ease;
  cursor: pointer; border: 0;
}
.btn-primary { background: var(--accent); color: #111; }
.btn-primary:hover { background: var(--accent-2); color: #111; transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Sections */
section { padding: 4rem 0; }
.section-head { max-width: 60ch; margin-bottom: 3rem; }
.section-head p { font-size: 1.1rem; }

/* Grid cards */
.grid { display: grid; gap: 1.25rem; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { color: var(--text); margin-bottom: .5rem; }
.card p { margin: 0; }
.card .icon { font-size: 1.75rem; margin-bottom: .75rem; }

/* Process (numbered steps) */
.steps { counter-reset: step; }
.step { padding-left: 3rem; position: relative; margin-bottom: 1.5rem; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%; background: var(--accent); color: #111;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.step h3 { color: var(--text); }

/* Portfolio project card */
.project { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.project-body { padding: 1.5rem; }
.project-thumb {
  height: 180px;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--accent);
}
.tag { display: inline-block; font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; background: var(--bg-3); color: var(--text-dim); margin-right: .35rem; }
.tag-accent {
  display: inline-block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .25rem .55rem; border-radius: 999px;
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); margin-right: .5rem;
  font-weight: 600;
}
.project-tag-row { margin-bottom: .75rem; }
.project-link {
  display: inline-block; margin-top: 1rem;
  color: var(--accent); font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease;
}
.project-link:hover { border-color: var(--accent); }
.note-small {
  margin-top: 2.5rem; padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-2); color: var(--text-dim);
  font-size: .9rem; border-radius: 0 var(--radius) var(--radius) 0;
}

/* ====== Wizard preventivo v2 ====== */
.wizard {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 640px;
  position: relative;
  overflow: hidden;
}
.wizard::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: .6;
}

.wizard-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
.wizard-head-label {
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 600;
}
.wizard-head-step {
  font-size: .85rem; color: var(--text-dim);
}
.wizard-head-step strong { color: var(--accent); font-weight: 700; }

.wizard-progress {
  display: flex; gap: .3rem; margin-bottom: 1.75rem;
}
.wizard-progress-dot {
  flex: 1; height: 4px; background: var(--bg-3); border-radius: 999px;
  transition: background .3s ease;
}
.wizard-progress-dot.done { background: var(--accent); }
.wizard-progress-dot.current { background: var(--accent); opacity: .55; }

.wizard-step { display: none; }
.wizard-step.active { display: block; animation: wizardFadeIn .3s cubic-bezier(.2,.8,.2,1); }
@keyframes wizardFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.wizard-step h3 {
  color: var(--text); font-size: 1.5rem; margin: 0 0 .35rem;
  font-weight: 700; letter-spacing: -.01em;
}
.wizard-step-hint { color: var(--text-dim); font-size: .95rem; margin: 0 0 1.5rem; }

.wizard-options { display: grid; gap: .6rem; }
.wizard-option {
  display: flex; align-items: center; gap: .9rem;
  padding: 1rem 1.1rem;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; color: var(--text);
  font-size: 1rem;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
  min-height: 56px;
  position: relative;
}
.wizard-option:hover { border-color: var(--accent); background: rgba(246,130,31,.04); }
.wizard-option:active { transform: scale(.99); }
.wizard-option input { position: absolute; opacity: 0; pointer-events: none; }
.wizard-option.selected {
  border-color: var(--accent);
  background: rgba(246,130,31,.1);
  box-shadow: 0 0 0 3px rgba(246,130,31,.12);
}
.wizard-option .opt-icon {
  font-size: 1.5rem; line-height: 1;
  width: 2.25rem; height: 2.25rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border-radius: 8px; flex-shrink: 0;
}
.wizard-option.selected .opt-icon { background: rgba(246,130,31,.15); }
.wizard-option .opt-label { font-weight: 500; }
.wizard-option .opt-check {
  margin-left: auto; opacity: 0; color: var(--accent);
  font-weight: 700; font-size: 1.2rem;
  transition: opacity .15s ease;
}
.wizard-option.selected .opt-check { opacity: 1; }

.wizard-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.75rem; gap: 1rem;
}
.wizard-back {
  background: transparent; color: var(--text-dim);
  border: 0; cursor: pointer; font-size: .95rem;
  padding: .5rem .75rem; border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.wizard-back:hover { color: var(--text); background: var(--bg-3); }
.wizard-back:disabled { opacity: 0; pointer-events: none; }
.wizard-nav .btn { min-width: 8rem; }

.wizard-summary {
  background: var(--bg-3); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; margin-bottom: 1.5rem;
  font-size: .92rem; border: 1px solid var(--border);
}
.wizard-summary dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.25rem; margin: 0; }
.wizard-summary dt { color: var(--text-dim); }
.wizard-summary dd { color: var(--text); margin: 0; font-weight: 500; }

.wizard-form-field { margin-bottom: 1rem; }
.wizard-form-field label {
  display: block; margin-bottom: .4rem;
  color: var(--text); font-weight: 500; font-size: .9rem;
}
.wizard-form-field input, .wizard-form-field textarea {
  width: 100%; padding: .85rem 1rem; border-radius: var(--radius);
  background: var(--bg-3); border: 1.5px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 16px; /* prevent iOS zoom */
  transition: border-color .15s ease;
}
.wizard-form-field input:focus, .wizard-form-field textarea:focus {
  outline: none; border-color: var(--accent);
}

.wizard-consent {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .9rem 1rem; margin: .5rem 0 1rem;
  background: var(--bg-3); border-radius: var(--radius);
  border: 1.5px solid var(--border);
  cursor: pointer;
}
.wizard-consent input { accent-color: var(--accent); margin-top: .2rem; }
.wizard-consent span { font-size: .88rem; color: var(--text-dim); }

.wizard-success {
  text-align: center; padding: 2rem 1rem;
  animation: wizardFadeIn .35s ease;
}
.wizard-success .icon {
  font-size: 3.5rem; margin-bottom: 1rem;
  display: inline-block;
  animation: pop .5s cubic-bezier(.2,.8,.2,1.2);
}
@keyframes pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.wizard-success h3 { color: var(--text); font-size: 1.5rem; }

/* Mobile tweaks */
@media (max-width: 640px) {
  .wizard {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius);
  }
  .wizard-step h3 { font-size: 1.25rem; }
  .wizard-option { padding: .85rem 1rem; font-size: .98rem; min-height: 60px; }
  .wizard-option .opt-icon { width: 2rem; height: 2rem; font-size: 1.35rem; }
  .wizard-nav .btn { flex: 1; }
  .wizard-summary dl { grid-template-columns: 1fr; gap: .1rem; }
  .wizard-summary dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin-top: .5rem; }
  .wizard-summary dt:first-child { margin-top: 0; }
}

/* Blog list */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.post-list li:last-child { border-bottom: 0; }
.post-list a { color: var(--text); font-weight: 600; font-size: 1.15rem; }
.post-list a:hover { color: var(--accent); }
.post-meta { font-size: .85rem; color: var(--text-dim); margin-bottom: .25rem; }

/* Article */
.article { max-width: 70ch; margin: 0 auto; }
.article h1 { margin-bottom: 1rem; }
.article .post-meta { margin-bottom: 2rem; }
.article h2 { margin-top: 2.5rem; color: var(--text); }
.article p, .article li { color: var(--text-dim); }
.article ul { padding-left: 1.5rem; }

/* Contact form */
.form { max-width: 32rem; }
.form label { display: block; margin-bottom: 1rem; }
.form label span { display: block; margin-bottom: .35rem; color: var(--text); font-weight: 500; }
.form input, .form textarea {
  width: 100%;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit; font-size: 1rem;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form textarea { min-height: 140px; resize: vertical; }
.form .btn { margin-top: .5rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { margin: 0 0 .75rem; color: var(--text); font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }
.site-footer .legal {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem; font-size: .85rem; color: var(--text-dim);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}

/* Concept study pages */
.concept-hero {
  padding: 5rem 0 3rem;
  background: radial-gradient(ellipse at top, rgba(246,130,31,.12), transparent 60%);
}
.concept-hero .tag-accent { margin-bottom: 1rem; }
.concept-hero h1 { margin-top: .5rem; }
.concept-hero .lead { color: var(--text-dim); font-size: 1.15rem; max-width: 60ch; }

.concept-meta {
  display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 2rem;
}
.concept-meta-item .label {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 600; display: block; margin-bottom: .2rem;
}
.concept-meta-item .value { color: var(--text); font-weight: 500; }

.concept-mock {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  display: grid; place-items: center;
  color: var(--accent); font-size: 4rem;
  min-height: 200px;
}
.concept-mock.tall { min-height: 280px; }

.concept-stack {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.concept-stack .tag { font-size: .85rem; padding: .35rem .75rem; background: var(--bg-3); }

.concept-cta {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 3rem;
}

/* Utility */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
