/* DanAivatar (famiglia DanAi). Palette ripresa dal logo DAI: #00B1FF, #1376FF, #3F5EFF, #8730E8. */
:root {
  color-scheme: light;
  --ink: #141833;
  --muted: #4a5070;
  --paper: #f7f8fc;
  --paper-deep: #eceffa;
  --surface: #ffffff;
  --line: #d5daeb;
  --brand: #3f5eff;
  --brand-deep: #1f2a8a;
  --brand-soft: #e6ebff;
  --accent: #8730e8;
  --accent-soft: #f1e8fd;
  --grad: linear-gradient(90deg, #00b1ff 0%, #1376ff 35%, #3f5eff 60%, #8730e8 100%);
  --warning: #7a4a00;
  --warning-bg: #fff3d2;
  --danger: #9a1b2e;
  --danger-bg: #fcebed;
  --success: #145c39;
  --success-bg: #e5f3e8;
  --code-bg: #10132e;
  --code-ink: #eef0ff;
  --code-dim: #9aa6d6;
  --radius: 0.65rem;
  --shadow: 0 14px 40px rgba(20, 24, 51, 0.1);
  --max: 74rem;
  --nav-h: 3.25rem;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1.25rem); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; min-width: 20rem; background: var(--paper); }
img, svg { max-width: 100%; }
a { color: var(--brand-deep); text-underline-offset: 0.16em; }
a:hover { color: var(--brand); }
:focus-visible { outline: 0.2rem solid #8730e8; outline-offset: 0.18rem; border-radius: 0.2rem; }
h1, h2, h3, h4 { line-height: 1.15; color: var(--brand-deep); text-wrap: balance; }
p, li { text-wrap: pretty; }
code, pre, kbd { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; }
:not(pre) > code { font-size: 0.92em; background: var(--paper-deep); border: 1px solid var(--line); border-radius: 0.3rem; padding: 0.05em 0.32em; overflow-wrap: anywhere; }
kbd { font-size: 0.85em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 0.3rem; padding: 0 0.3em; background: var(--surface); }

.skip-link { position: absolute; left: 0.75rem; top: -4rem; z-index: 50; background: var(--brand-deep); color: #fff; padding: 0.6rem 0.9rem; border-radius: var(--radius); }
.skip-link:focus { top: 0.75rem; color: #fff; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- header ---------------------------------------------------------------------------------- */
.site-header { background: var(--surface); color: var(--ink); border-bottom: 3px solid transparent; border-image: var(--grad) 1; }
.site-header .inner { max-width: var(--max); margin: 0 auto; padding: 0.7rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; justify-content: space-between; }
.wordmark { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; }
.wordmark:hover { color: var(--ink); }
.wordmark img { height: 2rem; width: auto; flex: none; display: block; }
.wordmark-text { display: flex; flex-direction: column; line-height: 1.1; padding-left: 0.7rem; border-left: 2px solid transparent; border-image: var(--grad) 1; }
.wordmark-name { font-weight: 800; letter-spacing: -0.02em; font-size: 1.1rem; }
.wordmark-name b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wordmark-sub { font-size: 0.78rem; color: var(--muted); }
.header-links { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: 0.9rem; }
@media (max-width: 30rem) { .wordmark img { height: 1.7rem; } .header-links { width: 100%; } }
.header-links a { color: var(--brand-deep); font-weight: 600; }

/* ---- under-construction notice -------------------------------------------------------------- */
.notice-bar { background: var(--warning-bg); border-bottom: 1px solid #ecd59a; color: var(--warning); }
.notice-bar .inner { max-width: var(--max); margin: 0 auto; padding: 0.65rem 1rem; display: flex; gap: 0.75rem; align-items: flex-start; }
.notice-bar p { margin: 0; flex: 1; font-size: 0.92rem; }
.notice-bar button { flex: none; border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 999px; padding: 0.2rem 0.75rem; font: inherit; font-size: 0.85rem; cursor: pointer; min-height: 2.25rem; }
.notice-bar[hidden] { display: none; }

/* ---- hero ------------------------------------------------------------------------------------ */
.hero { max-width: var(--max); margin: 0 auto; padding: 2rem 1rem 1.25rem; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.76rem; font-weight: 700; color: var(--accent); }
.hero h1 { font-size: clamp(1.85rem, 5.4vw, 3.3rem); letter-spacing: -0.035em; margin: 0.35em 0 0.45em; max-width: 20ch; }
.lead { font-size: clamp(1.02rem, 2.1vw, 1.2rem); color: var(--muted); max-width: 46rem; margin: 0 0 1.25rem; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); }
.facts li { background: var(--surface); border: 1px solid var(--line); border-left: 0.3rem solid var(--brand); border-radius: var(--radius); padding: 0.7rem 0.85rem; }
.facts li.warn { border-left-color: var(--accent); }
.facts strong { display: block; color: var(--brand-deep); font-size: 1.02rem; }
.facts span { color: var(--muted); font-size: 0.9rem; }

/* ---- step navigation -------------------------------------------------------------------------- */
.step-nav { position: sticky; top: 0; z-index: 20; background: rgba(247, 248, 252, 0.96); border-block: 1px solid var(--line); backdrop-filter: blur(6px); }
.step-nav ol { list-style: none; margin: 0; padding: 0.5rem 0.75rem; display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.step-nav ol::-webkit-scrollbar { display: none; }
.step-nav li { flex: none; scroll-snap-align: start; }
.step-nav a { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.25rem; padding: 0.25rem 0.75rem 0.25rem 0.3rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.88rem; white-space: nowrap; }
.step-nav a .n { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; font-size: 0.8rem; }
.step-nav a.extra .n { background: var(--accent-soft); color: var(--accent); }
.step-nav a[aria-current="step"] { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.step-nav a[aria-current="step"] .n { background: #fff; color: var(--brand-deep); }
.nav-title { display: none; }

/* ---- layout ----------------------------------------------------------------------------------- */
.layout { max-width: var(--max); margin: 0 auto; padding: 0 1rem 3rem; }
main { min-width: 0; }

.overview { margin: 1.5rem 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1rem 0.6rem; box-shadow: var(--shadow); }
.overview h2 { margin: 0 0 0.4rem; font-size: 1.3rem; }
.overview > p { margin: 0 0 0.8rem; color: var(--muted); }
.flow { list-style: none; margin: 0; padding: 0; counter-reset: flow; }
.flow li { position: relative; padding: 0 0 0.85rem 2.6rem; }
.flow li::before { counter-increment: flow; content: counter(flow); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; }
.flow li::after { content: ""; position: absolute; left: 0.92rem; top: 2rem; bottom: 0.15rem; width: 2px; background: var(--brand-soft); }
.flow li:last-child::after { display: none; }
.flow a { font-weight: 700; }
.flow .where { display: block; color: var(--muted); font-size: 0.88rem; }

/* ---- steps ------------------------------------------------------------------------------------ */
.step { margin-top: 2.6rem; }
.step-head { display: flex; gap: 0.75rem; align-items: flex-start; }
.step-num { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 0.7rem; background: var(--brand-deep); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; margin-top: 0.15rem; }
.step.extra .step-num { background: var(--accent); }
.step h2 { margin: 0; font-size: clamp(1.4rem, 3.4vw, 1.95rem); letter-spacing: -0.02em; }
.where-tag { display: inline-flex; gap: 0.35rem; align-items: center; margin-top: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--brand-deep); background: var(--brand-soft); border-radius: 999px; padding: 0.1rem 0.6rem; }
.where-tag.phone { background: var(--accent-soft); color: var(--accent); }
.step-body { margin-top: 0.9rem; }
.step-body > p, .step-body > ul, .step-body > ol { max-width: 48rem; }
.step h3 { font-size: 1.1rem; margin: 1.5rem 0 0.4rem; }
.substeps { padding-left: 1.3rem; }
.substeps > li { margin-bottom: 0.75rem; }
.substeps > li::marker { font-weight: 700; color: var(--brand); }

/* ---- callouts --------------------------------------------------------------------------------- */
.callout { border-radius: var(--radius); padding: 0.8rem 0.95rem; margin: 1rem 0; border: 1px solid var(--line); background: var(--surface); max-width: 48rem; }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout .title { display: block; font-weight: 700; margin-bottom: 0.2rem; }
.callout.check { background: var(--success-bg); border-color: #b9dcc4; }
.callout.check .title { color: var(--success); }
.callout.warn { background: var(--warning-bg); border-color: #e9cf8a; }
.callout.warn .title { color: var(--warning); }
.callout.danger { background: var(--danger-bg); border-color: #efc1c8; }
.callout.danger .title { color: var(--danger); }
.callout.info { background: var(--brand-soft); border-color: #c5cff8; }
.callout.info .title { color: var(--brand-deep); }

/* ---- command blocks --------------------------------------------------------------------------- */
.cmd { margin: 0.8rem 0 1rem; border-radius: var(--radius); overflow: hidden; background: var(--code-bg); max-width: 48rem; box-shadow: 0 6px 18px rgba(16, 32, 42, 0.18); }
.cmd-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.35rem 0.4rem 0.35rem 0.85rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); color: var(--code-dim); font-size: 0.78rem; }
.cmd-head .label::before { content: "$ "; color: #8fdcff; font-family: ui-monospace, Menlo, monospace; }
.cmd.output .cmd-head .label::before { content: "↳ "; }
.cmd pre { margin: 0; padding: 0.8rem 0.95rem; overflow-x: auto; color: var(--code-ink); font-size: 0.86rem; line-height: 1.55; -webkit-overflow-scrolling: touch; }
.cmd pre code { white-space: pre; }
.cmd .ph { color: #8fdcff; background: rgba(0, 177, 255, 0.14); border-bottom: 1px dashed #8fdcff; border-radius: 0.15rem; }
.cmd .cm { color: var(--code-dim); }
.cmd.output { background: #1b1f45; }
.copy-btn { border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.06); color: #fff; border-radius: 0.45rem; padding: 0.3rem 0.75rem; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; min-height: 2.25rem; min-width: 5.2rem; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.14); }
.copy-btn.done { background: #1f7a4d; border-color: #1f7a4d; }
.copy-btn.fail { background: var(--danger); border-color: var(--danger); }

/* ---- tables ----------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0.8rem 0 1rem; max-width: 52rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
th { background: var(--paper-deep); color: var(--brand-deep); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td.msg code { white-space: normal; }

/* troubleshooting as accordions */
.faq { max-width: 52rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 0.5rem; }
.faq summary { cursor: pointer; padding: 0.75rem 0.9rem; font-weight: 600; list-style: none; display: flex; gap: 0.6rem; align-items: baseline; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; color: var(--accent); font-weight: 800; width: 0.9rem; flex: none; }
.faq details[open] summary::before { content: "−"; }
.faq summary code { font-weight: 500; }
.faq .answer { padding: 0 0.9rem 0.8rem 2.4rem; }
.faq .answer > :first-child { margin-top: 0; }

/* ---- phases list ------------------------------------------------------------------------------ */
.phases { list-style: none; padding: 0; margin: 0.6rem 0 1rem; max-width: 48rem; border-left: 2px solid var(--brand-soft); }
.phases li { padding: 0.3rem 0 0.3rem 0.9rem; position: relative; }
.phases li::before { content: ""; position: absolute; left: -0.36rem; top: 0.82rem; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--brand); }
.phases code { color: var(--brand-deep); }
.phases span { display: block; color: var(--muted); font-size: 0.9rem; }

/* ---- footer ----------------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-deep); color: var(--muted); font-size: 0.88rem; }
.site-footer .inner { max-width: var(--max); margin: 0 auto; padding: 1.25rem 1rem 2rem; display: grid; gap: 0.4rem; }
.site-footer p { margin: 0; }

/* ---- legal page ------------------------------------------------------------------------------- */
.legal { max-width: 48rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
.legal h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 0.3em 0 0.6em; }
.legal h2 { font-size: 1.2rem; margin: 1.8rem 0 0.4rem; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0.6rem 0; }
.legal dt { font-weight: 700; color: var(--brand-deep); }
.legal dd { margin: 0; }

/* ---- desktop ---------------------------------------------------------------------------------- */
@media (min-width: 64rem) {
  .layout { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .step-nav { position: sticky; top: 1rem; background: transparent; border: 0; backdrop-filter: none; margin-top: 1.5rem; }
  .nav-title { display: block; margin: 0 0 0.5rem 0.4rem; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--accent); }
  .step-nav ol { flex-direction: column; overflow: visible; padding: 0; gap: 0.15rem; }
  .step-nav a { width: 100%; white-space: normal; border-color: transparent; background: transparent; border-radius: 0.55rem; padding: 0.35rem 0.6rem 0.35rem 0.35rem; }
  .step-nav a:not([aria-current="step"]):hover { background: var(--surface); border-color: var(--line); }
  html { scroll-padding-top: 1.5rem; }
}

/* sample of the placeholder highlight used in command blocks, shown in running text */
.ph-sample { background: #ece3fd; border-bottom: 1px dashed #8730e8; border-radius: 0.15rem; padding: 0 0.25em; color: #3b1a73; }
.legal h3 { font-size: 1.02rem; margin: 1.3rem 0 0.3rem; color: var(--brand-deep); }
.legal section > ul { padding-left: 1.2rem; }
.legal section > ul li + li { margin-top: 0.35rem; }

/* ---- home DanAivatar --------------------------------------------------------------------------- */
.home-hero { max-width: var(--max); margin: 0 auto; padding: 2.2rem 1rem 2.6rem; display: grid; gap: 1.75rem; align-items: center; }
@media (min-width: 56rem) { .home-hero { grid-template-columns: 1.05fr 0.95fr; gap: 2.5rem; padding-block: 3.5rem; } }
.home-hero h1 { font-size: clamp(2rem, 5.6vw, 3.4rem); letter-spacing: -0.035em; margin: 0.35em 0 0.45em; max-width: 18ch; }
.home-hero-art { margin: 0; }
.home-hero-art img { display: block; width: 100%; height: auto; border-radius: 1.1rem; box-shadow: var(--shadow); background: #0e1233; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: 0.55rem 1.2rem; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid var(--brand-deep); }
.btn.primary { background: var(--brand-deep); color: #fff; }
.btn.primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; color: var(--brand-deep); }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand-deep); }
.band { padding: 2.75rem 0; }
.band.alt { background: var(--surface); border-block: 1px solid var(--line); }
.band-inner { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
.band h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin: 0 0 1.2rem; letter-spacing: -0.02em; }
/* motivo: la linea sfumata del logo DAI */
.band h2::before { content: ""; display: block; width: 2.6rem; height: 0.32rem; margin-bottom: 0.7rem; border-radius: 999px;
  background: var(--grad); }
.how, .principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 48rem) { .how { grid-template-columns: repeat(3, 1fr); } .principles { grid-template-columns: repeat(2, 1fr); } }
.how li, .principles li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; }
.principles li { background: var(--surface); border-left: 0.3rem solid var(--brand); }
.how h3, .principles h3 { margin: 0.45rem 0 0.35rem; font-size: 1.12rem; }
.principles h3 { margin-top: 0; }
.how p, .principles p { margin: 0; color: var(--muted); }
.how-n { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand-deep); color: #fff; font-weight: 800; }
.band-inner.prose > * { max-width: 46rem; }
.prose p { margin: 0 0 0.9rem; }
.prose p:last-child { margin-bottom: 0; }
.prose .aside { color: var(--muted); border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 1.2rem; }
.contact-mail { font-size: clamp(1.15rem, 3.2vw, 1.55rem); font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 23.5rem) { .header-links .hide-xs { display: none; } }
