:root {
  color-scheme: light;
  font-family: system-ui, "Segoe UI", sans-serif;
  --ink: #17231c;
  --muted: #46574d;
  --accent: #285c35;
  --lime: #a8ef70;
  --paper: #f3f5f3;
  --surface: #e9eeea;
  --rule: #cbd4cd;
  --bar-height: 64px;
}

* { box-sizing: border-box; }
body.n8n-demo {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 1rem system-ui, "Segoe UI", sans-serif;
  letter-spacing: normal;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
h1:focus { outline: none; }
html { scroll-padding-top: calc(var(--bar-height) + 12px); }

.demo-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: var(--bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px max(16px, calc((100% - 1100px) / 2));
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  font-size: .875rem;
}
.demo-back {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}
.demo-back:hover { border-color: var(--accent); background: var(--surface); }
.demo-back span { color: var(--accent); font-size: 1.2em; }
@media (max-width: 420px) {
  .demo-header { padding-inline: 12px; }
  .demo-back, .demo-header .skip { padding-inline: 8px; font-size: .82rem; }
}
.stage {
  min-height: calc(100svh - 134px);
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  background: transparent;
  padding: clamp(48px, 9vh, 106px) 20px clamp(42px, 7vh, 74px);
}

.demo-maker {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: .875rem;
}
.demo-maker a {
  color: var(--accent);
  font-weight: 650;
  text-underline-offset: .2em;
}

.brand { background: transparent; position: relative; margin-bottom: clamp(29px, 5vh, 55px); }
.asset-brand { width: min(82vw, 640px); aspect-ratio: 3 / 1; }
.asset-brand img { position: absolute; inset: 0; width: 100%; height: 100%; }
.asset-arrows {
  opacity: 0;
  /* Reveal the emblem while leaving out the laptop in its center. */
  clip-path: polygon(evenodd, 0 0, 29% 0, 29% 100%, 0 100%, 0 0,
    10.4% 41.5%, 10.4% 67%, 22.3% 67%, 22.3% 41.5%, 10.4% 41.5%, 0 0);
}

.copy { max-width: 790px; }
body.n8n-demo h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(2.08rem, 6.2vw, 4.15rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -.058em;
  text-wrap: balance;
}
.copy p {
  max-width: 52ch;
  margin: 21px auto 30px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.65;
  text-wrap: pretty;
}
.primary, .demo-login {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 650;
  text-decoration: none;
}
.primary { background: var(--lime); color: var(--ink); }
.primary:hover { border-color: var(--accent); background: #bcf495; }
.demo-login { border-color: var(--rule); background: #fff; color: var(--ink); }
.demo-login:hover { border-color: var(--accent); background: var(--surface); }

.skip {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--ink);
  background: var(--paper);
}

footer {
  display: grid;
  place-items: center;
  min-height: 70px;
  border-top: 1px solid var(--rule);
}
.replay {
  padding: 10px 13px;
  border: 0;
  color: var(--muted);
  background: none;
  text-underline-offset: 4px;
  text-decoration: underline;
}

.playing .brand { animation: settle 2s both; }
.playing .copy { animation: show-copy 2s both; }
.playing .asset-arrows {
  opacity: 1;
  mask-image: conic-gradient(from -80deg at 16% 52%, #000 var(--asset-turn), transparent 0);
  animation: asset-arrows .76s linear both;
}
.playing .asset-logo { animation: car-color .48s .76s both; }

@property --asset-turn {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes asset-arrows {
  from { --asset-turn: 0deg; }
  to { --asset-turn: 360deg; }
}

@keyframes settle {
  0%, 62% { transform: translateY(24px) scale(1.02); }
  94%, 100% { transform: translateY(0) scale(1); }
}
@keyframes show-copy {
  0%, 74% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes car-color { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .playing *, .playing *::before, .playing *::after { animation: none !important; }
}

.stage { min-height: calc(100svh - 150px); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.stage .actions + .secondary { margin-top: 10px; }
@media (max-width: 420px) {
  .primary, .demo-login { padding-inline: 11px; font-size: .875rem; }
}
@media (max-width: 360px) {
  .stage { padding-inline: 12px; }
  .actions { gap: 6px; }
  .primary, .demo-login { padding-inline: 7px; }
}
.secondary { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 650; text-underline-offset: .25em; }
.wrap { max-width: 1100px; width: calc(100% - 48px); margin-inline: auto; }
.workflow { padding: clamp(56px, 9vw, 108px) 0; background: #fff; }
.section-lead { max-width: 650px; margin-bottom: clamp(32px, 6vw, 64px); }
.kicker { margin: 0 0 12px; color: var(--accent); font-weight: 700; font-size: .875rem; }
body.n8n-demo h2 { margin: 0; font-family: inherit; font-weight: 700; font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.05; letter-spacing: -.045em; text-wrap: balance; }
body.n8n-demo h3 { margin: 0; font-family: inherit; font-weight: 700; font-size: clamp(1.25rem, 2.4vw, 1.75rem); line-height: 1.15; letter-spacing: -.025em; }
.section-lead > p:last-child, .step p, .feature p, .demo-end p { color: var(--muted); line-height: 1.65; }
.section-lead > p:last-child { margin: 16px 0 0; font-size: 1.08rem; }
.timeline { margin: 0; padding: 0; list-style: none; }
.step { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 16px; padding: 30px 0; border-top: 1px solid var(--rule); }
.step:last-child { border-bottom: 1px solid var(--rule); }
.step-number { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: var(--accent); background: var(--surface); font-size: .875rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.step-body { min-width: 0; padding-top: 7px; }
.step-body p { max-width: 54ch; margin: 9px 0 0; }
.step-with-image .step-body { display: grid; grid-template-columns: minmax(230px, .75fr) minmax(0, 1.25fr); gap: 24px; align-items: start; }
.program-view { margin: 0; min-width: 0; }
.program-view a { display: block; border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; background: var(--paper); }
.program-view img { display: block; width: 100%; height: auto; }
.program-view a { text-decoration: none; }
.program-view .enlarge-label { display: block; padding: 7px 10px; border-top: 1px solid var(--rule); color: var(--accent); font-size: .85rem; font-weight: 650; text-align: center; text-decoration: underline; text-underline-offset: .18em; }
.program-view figcaption { margin-top: 9px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.features { padding: clamp(56px, 9vw, 108px) 0; }
.features .section-lead { margin-bottom: 30px; }
.feature-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.feature { border-top: 2px solid #9eb5a2; padding-top: 16px; }
body.n8n-demo .feature h3 { font-size: 1.24rem; }
.feature p { margin: 9px 0 0; }
.module-list { margin-top: 38px; }
.module-list > p { color: var(--muted); line-height: 1.55; }
.module-list details { border-top: 1px solid var(--rule); }
.module-list details:last-child { border-bottom: 1px solid var(--rule); }
.module-list summary { min-height: 48px; padding: 14px 8px; cursor: pointer; color: var(--accent); font-weight: 700; }
.module-list .program-view { width: min(100%, 620px); margin: 12px 8px 16px; }
.module-list details p { margin: 0 8px; color: var(--muted); }
.module-list ul { margin: 0 8px 16px; padding-left: 20px; columns: 2; column-gap: 30px; }
.module-list li { break-inside: avoid; padding: 4px 0; line-height: 1.5; }
.demo-end { padding: clamp(45px, 7vw, 82px) 0; background: #17231c; color: #fff; }
.demo-end .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 32px; }
body.n8n-demo .demo-end h2 { font-size: clamp(1.8rem, 4vw, 2.65rem); }
.demo-end p { color: #dce7dc; margin: 12px 0 0; }
.demo-end .actions { justify-content: flex-start; }
.demo-end a:focus-visible { outline-color: var(--lime); }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: .2em; }
.footer-label { color: var(--muted); font-size: .84rem; }
@media (max-width: 760px) {
  .step-with-image .step-body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .feature-list { grid-template-columns: 1fr; }
  .module-list ul { columns: 1; }
}
@media (max-width: 420px) {
  .wrap { width: calc(100% - 36px); }
  .step { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding-block: 24px; }
  .step-number { width: 32px; height: 32px; }
  .step-body { padding-top: 4px; }
}

.image-viewer { padding: 0; border: 1px solid var(--rule); border-radius: 10px; width: min(1080px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); color: var(--ink); background: #fff; }
.image-viewer::backdrop { background: rgb(23 35 28 / 78%); }
.image-toolbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; background: #fff; border-bottom: 1px solid var(--rule); }
body.n8n-demo .image-toolbar h2 { font-size: 1rem; letter-spacing: normal; }
.close-viewer { padding: 8px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); }
.enlarged { display: block; max-width: 100%; height: auto; margin-inline: auto; }

html:has(body.admin-bar.n8n-demo) { scroll-padding-top: calc(var(--bar-height) + 44px); }
.admin-bar .demo-header { top: 32px; }
@media (min-width: 601px) and (max-width: 782px) {
  html:has(body.admin-bar.n8n-demo) { scroll-padding-top: calc(var(--bar-height) + 58px); }
  .admin-bar .demo-header { top: 46px; }
}
@media (max-width: 600px) {
  html:has(body.admin-bar.n8n-demo) { scroll-padding-top: calc(var(--bar-height) + 12px); }
  .admin-bar .demo-header { top: 0; }
}
