:root {
  --ink: #1c1640;
  --ink-soft: #4a4470;
  --paper: #ffffff;
  --wash: #f4f1fb;
  --line: #ddd6ef;
  --violet: #5e35b1;
  --violet-deep: #4527a0;
  --on-violet: #ffffff;
  --stage: #1e88e5;
  --condition: #ef6c00;
  --ok: #2e7d32;
  --band: #1c1640;
  --on-band: #ece8fb;
  --on-band-soft: #b9b0dd;
  --rainbow: linear-gradient(90deg, #e53935, #fb8c00, #fdd835, #7cb342, #00acc1, #1e88e5, #5e35b1, #d81b60);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 62ch;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece8fb;
    --ink-soft: #b9b0dd;
    --paper: #120e26;
    --wash: #1a1536;
    --line: #322a5c;
    --violet: #a58ae6;
    --violet-deep: #bba5f0;
    --on-violet: #120e26;
    --stage: #64b5f6;
    --condition: #ffa040;
    --ok: #81c784;
    --band: #0b0818;
    --on-band: #ece8fb;
    --on-band-soft: #a79fcf;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--violet); text-underline-offset: 0.18em; }
a:hover { color: var(--violet-deep); }
:focus-visible { outline: 3px solid var(--stage); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(100% - 2rem, 1120px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--paper); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.012em; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.1rem); }
h2 { font-size: clamp(1.8rem, 3.3vw, 2.5rem); }
h3 { font-size: 1.3rem; letter-spacing: 0; }
p { margin: 0 0 1em; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; }
.measure { max-width: var(--measure); }

/* header: always visible while the page scrolls */
html { scroll-padding-top: 6.5rem; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper); border-bottom: 1px solid var(--line);
  border-top: 5px solid transparent; border-image: var(--rainbow) 1 0 0 0;
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand img { width: 52px; height: auto; }
.brand span { font-family: var(--serif); font-size: 1.7rem; font-weight: 400; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 0.4rem 1.4rem; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.98rem; }
.nav a:hover { text-decoration: underline; }
.nav a.btn, .nav a.btn:hover { color: var(--on-violet); text-decoration: none; }

.btn {
  display: inline-block; padding: 0.8rem 1.35rem; border-radius: 10px; border: 2px solid var(--violet);
  background: var(--violet); color: var(--on-violet); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--violet-deep); border-color: var(--violet-deep); color: var(--on-violet); }
.btn.ghost { background: transparent; color: var(--violet); }
.btn.ghost:hover { background: var(--wash); color: var(--violet-deep); }
.btn.small { padding: 0.5rem 1rem; }

.lang { display: inline-flex; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang button { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 0.25rem 0.6rem; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--violet); color: var(--on-violet); }
.lang button:not([aria-pressed="true"]):hover { background: var(--wash); color: var(--ink); }

/* hero */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 1.4rem; }
.actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.8rem; }
.flow { margin: 0; }
.flow svg { width: 100%; height: auto; display: block; }
.flow figcaption { font-size: 0.92rem; color: var(--ink-soft); margin-top: 0.7rem; max-width: 46ch; }
.node-box { fill: var(--paper); stroke: var(--stage); stroke-width: 2; }
.node-bar { fill: var(--stage); }
.node-cond { fill: var(--paper); stroke: var(--condition); stroke-width: 2.5; }
.node-end { fill: var(--paper); stroke: var(--ok); stroke-width: 2; }
.node-start { fill: var(--wash); stroke: var(--ok); stroke-width: 2; }
.edge { fill: none; stroke: var(--ink-soft); stroke-width: 2.4; }
.edge-yes { fill: none; stroke: var(--condition); stroke-width: 2.4; }
.t-main { font: 600 14px var(--sans); fill: var(--ink); }
.t-sub { font: 12.5px var(--sans); fill: var(--ink-soft); }
.t-tag { font: 600 12px var(--sans); fill: var(--condition); }
.token-ring { fill: var(--violet); opacity: 0.22; }
.token { fill: var(--violet); }

/* sections */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.band-wash { background: var(--wash); }
.row { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: clamp(1.5rem, 5vw, 4rem); }
.row > header p { color: var(--ink-soft); margin-top: 1rem; max-width: 34ch; }

/* sequence */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 2rem; }
.steps li { display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem; align-items: start; counter-increment: step; }
.steps li::before {
  content: counter(step); font-family: var(--serif); font-size: 2.6rem; line-height: 1; color: var(--violet);
}
.steps h3 { margin-bottom: 0.4rem; }
.steps p { margin: 0; color: var(--ink-soft); max-width: 54ch; }

/* feature lists */
.groups { display: grid; gap: 3rem; }
.group h3 { padding-bottom: 0.7rem; border-bottom: 2px solid var(--violet); margin-bottom: 0.4rem; }
.group dl { margin: 0; }
.group .item { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); gap: 0.4rem 2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.group dt { font-weight: 600; }
.group dd { margin: 0; color: var(--ink-soft); }

/* templates */
.models { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.models li { border: 1.5px solid var(--stage); border-radius: 999px; padding: 0.35rem 0.95rem; font-size: 0.98rem; }

/* worked example */
.example { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); margin-top: 2.2rem; }
.case { border-left: 6px solid var(--stage); padding: 0.2rem 0 0.2rem 1.2rem; }
.case + .case { border-left-color: var(--ok); }
.case h3 { margin-bottom: 0.7rem; }
.case ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); }
.case li { margin-bottom: 0.45rem; }
.joined { grid-column: 1 / -1; color: var(--ink-soft); max-width: var(--measure); }
.joined strong { color: var(--ink); }

/* security band */
.dark { background: var(--band); color: var(--on-band); }
.dark h2 { color: var(--on-band); }
.dark .row > header p { color: var(--on-band-soft); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 2.4rem; }
.facts li { padding-left: 1.1rem; border-left: 3px solid var(--violet); }
.dark .facts li { border-left-color: #a58ae6; }
.facts strong { display: block; margin-bottom: 0.2rem; font-weight: 600; }
.facts span { color: var(--on-band-soft); }

/* address */
.address { font-family: var(--serif); font-size: clamp(1.4rem, 3.4vw, 2.2rem); margin: 1.4rem 0; overflow-wrap: anywhere; }
.address b { color: var(--violet); font-weight: 600; }
.finder { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: stretch; max-width: 36rem; }
.finder label { flex-basis: 100%; font-weight: 600; }
.finder .field { display: flex; flex: 1 1 12rem; min-width: 0; flex-wrap: wrap; column-gap: 0.2rem; align-items: center; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0 0.8rem; }
.finder .field:focus-within { border-color: var(--violet); }
.finder input { border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; padding: 0.7rem 0; min-width: 6rem; flex: 1 1 6rem; text-align: right; }
.finder .suffix { color: var(--ink-soft); overflow-wrap: anywhere; }
.finder .hint { flex-basis: 100%; min-height: 1.5em; margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.finder .hint.err { color: #c62828; }
@media (prefers-color-scheme: dark) { .finder .hint.err { color: #ff8a80; } }

/* closing */
.closing .wrap { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.closing h2 { max-width: 20ch; }
footer { border-top: 1px solid var(--line); padding: 1.6rem 0 2.4rem; color: var(--ink-soft); font-size: 0.93rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 0.5rem 3rem; flex-wrap: wrap; }
footer p { margin: 0 0 0.35rem; max-width: 52ch; }
footer strong { color: var(--ink); }

@media (max-width: 960px) {
  html { scroll-padding-top: 5rem; }
  .nav a:not(.btn) { display: none; }
  .top { flex-wrap: nowrap; gap: 0.5rem; }
  .nav { gap: 0.4rem; flex-wrap: nowrap; flex: none; }
  .brand { gap: 0.4rem; min-width: 0; }
  .brand img { width: 36px; }
  .brand span { font-size: 1.25rem; }
  .btn.small { padding: 0.4rem 0.65rem; font-size: 0.86rem; white-space: nowrap; }
  .lang button { padding: 0.25rem 0.45rem; font-size: 0.8rem; }
}
@media (max-width: 400px) {
  .brand span { display: none; }
}
@media (max-width: 880px) {
  .hero .wrap, .row, .example { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .group .item { grid-template-columns: minmax(0, 1fr); }
  .flow { max-width: 30rem; }
}

/* Pricing: three cards; the recommended plan is raised and framed. */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1.25rem; margin-top: 2.5rem; align-items: stretch; }
.plan { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1.75rem 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.plan h3 { font-family: var(--serif); font-size: 1.25rem; margin: 0; color: var(--ink); letter-spacing: 0.02em; text-transform: uppercase; }
.plan-desc { margin: 0; color: var(--ink-soft); font-size: 0.95rem; min-height: 2.6em; }
.price { margin: 0.25rem 0 0; color: var(--ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; }
.price strong { font-size: 2rem; font-family: var(--serif); color: var(--violet-deep); line-height: 1.1; }
.price span { color: var(--ink-soft); font-size: 0.9rem; }
.yearly { margin: -0.4rem 0 0; color: var(--ink-soft); font-size: 0.88rem; }
.plan ul { list-style: none; margin: 0.5rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line); display: grid; gap: 0.55rem; flex: 1; }
.plan li { position: relative; padding-left: 1.4rem; color: var(--ink-soft); font-size: 0.95rem; }
.plan li::before { content: "\2713"; position: absolute; left: 0; color: var(--violet); font-weight: 700; }
.plan-cta { margin-top: 0.5rem; display: block; text-align: center; padding: 0.7rem 1rem; border: 1.5px solid var(--violet); color: var(--violet-deep); border-radius: 8px; text-decoration: none; font-weight: 600; }
.plan-cta:hover { background: var(--violet); color: var(--on-violet); }
.plan.featured { border: 2px solid var(--violet); box-shadow: 0 18px 40px -22px rgb(94 53 177 / 0.45); transform: translateY(-8px); }
.plan.featured .plan-cta { background: var(--violet); color: var(--on-violet); }
.plan.featured .plan-cta:hover { background: var(--violet-deep); }
.flag { position: absolute; top: -0.75rem; left: 50%; transform: translateX(-50%); background: var(--violet); color: var(--on-violet); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.25rem 0.75rem; border-radius: 999px; white-space: nowrap; }
@media (max-width: 900px) { .plan.featured { transform: none; } }
#prezzi .note { margin-top: 2rem; color: var(--ink-soft); max-width: none; }


/* Demo request form. */
.demo-form { display: grid; gap: 1rem; min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1.25rem, 3vw, 2rem); }
.demo-form label { display: grid; gap: 0.35rem; font-size: 0.9rem; color: var(--ink); font-weight: 600; min-width: 0; }
.demo-form .opt { font-weight: 400; color: var(--ink-soft); }
.demo-form input, .demo-form select, .demo-form textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 0.65rem 0.8rem; width: 100%; min-width: 0; }
.demo-form input:focus, .demo-form select:focus, .demo-form textarea:focus { outline: 2px solid var(--violet); outline-offset: 1px; }
.demo-form .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.demo-form .consent { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; color: var(--ink-soft); font-size: 0.88rem; }
.demo-form .consent input { width: auto; margin-top: 0.2rem; }
.demo-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.demo-form button[type=submit] { justify-self: start; }
.demo-form button:disabled { opacity: 0.6; cursor: wait; }
.demo-form .status { margin: 0; font-size: 0.92rem; color: var(--ink-soft); min-height: 1.2em; }
.demo-form .status.ok { color: var(--ok); font-weight: 600; }
.demo-form .status.err { color: #b3261e; font-weight: 600; }

.demo-form .placeholder { color: var(--violet-deep); text-decoration: underline dotted; }

/* Demo request dialog. */
.demo-dialog { border: 0; border-radius: 16px; padding: 0; width: min(100% - 2rem, 640px); max-height: calc(100vh - 2rem); overflow: auto; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.5); }
.demo-dialog::backdrop { background: rgb(12 9 30 / 0.6); }
.demo-dialog .dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.5rem 1.5rem 0; }
.demo-dialog .dialog-head h2 { margin: 0; font-family: var(--serif); font-size: 1.6rem; }
.demo-dialog > p { margin: 0.5rem 1.5rem 0; color: var(--ink-soft); }
.demo-dialog .demo-form { border: 0; border-radius: 0; }
.dialog-close { background: none; border: 0; font-size: 2rem; line-height: 1; color: var(--ink-soft); cursor: pointer; padding: 0 0.3rem; }
.dialog-close:focus-visible { outline: 2px solid var(--violet); border-radius: 4px; }
button.plan-cta { width: 100%; font: inherit; background: none; cursor: pointer; }
.plan.featured button.plan-cta { background: var(--violet); color: var(--on-violet); }

/* Dialog frame: no browser focus ring, rounded corners clip the content, plain close button. */
.demo-dialog:focus, .demo-dialog:focus-visible { outline: none; }
.demo-dialog { overflow: hidden; }
.demo-dialog > .dialog-head, .demo-dialog > p, .demo-dialog .demo-form { border-radius: 0; }
.dialog-close { -webkit-appearance: none; appearance: none; background: transparent; border: 0; box-shadow: none; color: var(--ink-soft); }
.dialog-close:hover { color: var(--ink); background: transparent; }

/* Close control: top right corner, with the Esc hint in brackets. */
.demo-dialog { position: relative; }
.demo-dialog .dialog-head { padding-right: 6.5rem; }
.dialog-close { position: absolute; top: 1.1rem; right: 1.2rem; display: inline-flex; align-items: center; gap: 0.35rem; font: inherit; font-size: 1rem; }
.dialog-close span { font-size: 1.9rem; line-height: 1; }
.dialog-close small { font-size: 0.8rem; color: var(--ink-soft); }

/* Dialog border: the stage blue of the workflow editor. */
.demo-dialog { border: 2px solid var(--stage); }
