:root {
  --bg: #f7f3ff;
  --bg-2: #eee7fb;
  --surface: #fffbff;
  --surface-container: #f1ebf8;
  --surface-high: #e9e1f2;
  --ink: #17131f;
  --text: #352f40;
  --muted: #6f667d;
  --outline: #d4c6df;
  --primary: #5d2fba;
  --primary-dark: #381278;
  --primary-container: #e9ddff;
  --on-primary-container: #21005d;
  --cyan: #00ccd2;
  --mint: #168a4a;
  --yellow: #b86b00;
  --danger: #c7362f;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 28px 90px rgba(50, 31, 94, 0.18);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0;
}

main,
.hero,
.hero-grid,
.product-shell,
.workspace,
.section {
  min-width: 0;
}

.hero-grid > *,
.app-layout > *,
.workspace > *,
.mode-body > *,
.diagnostic-grid > * {
  min-width: 0;
}

a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }

.topbar {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 50;
  width: min(1180px, calc(100% - 32px));
  min-height: 64px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 12px 10px 18px;
  background: rgba(255, 251, 255, 0.78);
  border: 1px solid rgba(212, 198, 223, 0.84);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(39, 28, 64, 0.12);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 184px;
}

.brand img {
  width: 136px;
  height: auto;
  display: block;
  padding: 8px 10px;
  background: #15111f;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(21, 17, 31, 0.2);
}

.brand span {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  padding: 5px 9px;
  background: var(--primary-container);
  border-radius: 999px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(233, 225, 242, 0.58);
  border-radius: 999px;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
  padding: 10px 13px;
  border-radius: 999px;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}

.nav-links a:hover {
  color: var(--on-primary-container);
  background: rgba(255, 255, 255, 0.82);
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.button,
.icon-button {
  border: 0;
  cursor: pointer;
  transition: transform 90ms var(--ease), background 150ms var(--ease), box-shadow 150ms var(--ease);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 820;
  font-size: 14px;
  white-space: nowrap;
}

.button:active,
.icon-button:active { transform: scale(0.98); }

.button.large {
  min-height: 52px;
  padding: 0 24px;
  font-size: 15px;
}

.button.filled {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(93, 47, 186, 0.28);
}

.button.filled:hover { background: var(--primary-dark); }

.button.tonal {
  color: var(--on-primary-container);
  background: var(--primary-container);
}

.button.outlined {
  color: var(--primary-dark);
  background: transparent;
  border: 1px solid var(--outline);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--primary-dark);
  background: var(--surface-container);
  border-radius: 999px;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.hero {
  position: relative;
  min-height: 88svh;
  padding: 120px 48px 54px;
  overflow: hidden;
  display: grid;
  align-items: center;
}

.hero-video,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-video {
  object-fit: cover;
  opacity: 0.34;
  filter: saturate(1.1) contrast(1.08);
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(247, 243, 255, 0.96) 0%, rgba(247, 243, 255, 0.82) 45%, rgba(247, 243, 255, 0.58) 100%),
    radial-gradient(circle at 72% 34%, rgba(0, 204, 210, 0.18), transparent 36%),
    radial-gradient(circle at 24% 70%, rgba(93, 47, 186, 0.18), transparent 34%);
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(520px, 0.86fr);
  gap: 48px;
  align-items: center;
  width: min(1340px, 100%);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 820px;
  margin-bottom: 24px;
  color: var(--ink);
  font-size: 68px;
  line-height: 72px;
  letter-spacing: 0;
}

.lead {
  max-width: 700px;
  margin-bottom: 32px;
  color: #302a3a;
  font-size: 20px;
  line-height: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 780px;
  margin-top: 34px;
}

.hero-proof span,
.feature-card,
.diagnostic-card,
.diagnostic-result,
.case-card,
.mode-panel,
.final-card {
  background: rgba(255, 251, 255, 0.82);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
}

.hero-proof span {
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.hero-proof b {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 30px;
}

.product-shell {
  overflow: hidden;
  background: rgba(255, 251, 255, 0.9);
  border: 1px solid var(--outline);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.app-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--outline);
}

.traffic { display: flex; gap: 7px; }
.traffic i { width: 8px; height: 8px; border-radius: 50%; background: #ee6a5f; }
.traffic i:nth-child(2) { background: #d7a64a; }
.traffic i:nth-child(3) { background: #168a4a; }

.app-bar strong { color: var(--ink); font-size: 13px; }
.app-bar em { justify-self: end; color: var(--mint); font-style: normal; font-size: 13px; font-weight: 900; }

.app-layout {
  display: grid;
  grid-template-columns: 92px 1fr;
  min-height: 520px;
}

.rail {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 12px;
  background: var(--surface-container);
  border-right: 1px solid var(--outline);
}

.rail button {
  min-height: 52px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 18px;
  font-weight: 900;
  cursor: pointer;
}

.rail button.selected {
  color: var(--on-primary-container);
  background: var(--primary-container);
}

.workspace {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
}

.workspace-head,
.review-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.workspace small,
.metric-grid small,
.review-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workspace strong { color: var(--ink); }

.status-pill {
  color: var(--mint);
  background: #dbf5e8;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-grid article,
.review-card,
.task-list {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
}

.metric-grid strong {
  display: block;
  color: var(--ink);
  font-size: 34px;
  line-height: 40px;
}

.metric-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.review-card strong { display: block; margin-top: 6px; }

.chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 10px;
  height: 132px;
  padding: 16px;
  background: #15111f;
  border-radius: var(--radius);
}

.chart i {
  display: block;
  min-height: 28px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #d7c4ff, #6735c9);
}

.chart i:nth-child(1) { height: 34%; }
.chart i:nth-child(2) { height: 58%; }
.chart i:nth-child(3) { height: 46%; }
.chart i:nth-child(4) { height: 76%; }
.chart i:nth-child(5) { height: 54%; }
.chart i:nth-child(6) { height: 88%; }

.task-list { display: grid; gap: 12px; }
.task-list span { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 14px; font-weight: 760; }
.task-list i { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); }

.marquee {
  overflow: hidden;
  padding: 13px 0;
  background: var(--primary-dark);
  color: #fff;
}

.marquee div {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.marquee span {
  padding: 0 28px;
  color: rgba(255, 255, 255, 0.72);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

@keyframes marquee { to { transform: translateX(-50%); } }

.section {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 96px 48px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 48px;
  align-items: start;
  margin-bottom: 32px;
}

.section-head h2,
.builder-copy h2,
.method-copy h2,
.final-card h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 42px;
  line-height: 50px;
}

.section-head p:last-child,
.builder-copy p,
.method-copy p {
  color: var(--muted);
  font-size: 16px;
  line-height: 26px;
}

.feature-grid,
.case-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.feature-card,
.case-card {
  padding: 24px;
  min-height: 256px;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms var(--ease);
}

.feature-card:hover,
.case-card:hover {
  transform: translateY(-4px);
  border-color: #c1ace2;
  box-shadow: 0 18px 45px rgba(50, 31, 94, 0.12);
}

.material-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--on-primary-container);
  background: var(--primary-container);
  border-radius: 16px;
  font-weight: 900;
}

.feature-card h3,
.case-card strong {
  display: block;
  margin: 42px 0 12px;
  color: var(--ink);
  font-size: 22px;
  line-height: 30px;
}

.feature-card p,
.case-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 24px;
}

.builder {
  display: grid;
  grid-template-columns: 0.76fr 1fr;
  gap: 48px;
  align-items: center;
}

.mode-panel {
  padding: 12px;
  box-shadow: var(--shadow);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  background: var(--surface-container);
  border-radius: 18px;
}

.tabs button,
.case-filters button {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.tabs button.active,
.case-filters button.active {
  color: #fff;
  background: var(--primary);
}

.mode-body {
  display: grid;
  grid-template-columns: 1fr 0.62fr;
  gap: 24px;
  padding: 28px;
}

.mode-body small {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mode-body h3 {
  color: var(--ink);
  font-size: 32px;
  line-height: 40px;
}

.mode-body p,
.mode-body li {
  color: var(--muted);
  line-height: 25px;
}

.mode-body ul {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.mode-body li {
  padding: 12px;
  background: var(--surface-container);
  border-radius: var(--radius);
  font-weight: 760;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: 18px;
}

.diagnostic-card,
.diagnostic-result {
  padding: 24px;
}

.diagnostic-card {
  display: grid;
  gap: 22px;
}

label {
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

select,
input[type="search"] {
  width: 100%;
  min-height: 52px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 0 14px;
}

input[type="range"] { accent-color: var(--primary); }
output { color: var(--primary-dark); font-weight: 900; }

.diagnostic-result {
  display: grid;
  align-content: center;
  gap: 16px;
  background: #15111f;
  color: #fff;
  border-color: rgba(255,255,255,0.12);
}

.diagnostic-result small { color: #cdbdff; font-weight: 900; text-transform: uppercase; }
.diagnostic-result h3 { margin: 0; font-size: 32px; line-height: 40px; }
.diagnostic-result p { margin: 0; color: rgba(255,255,255,0.7); line-height: 26px; }

.result-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.result-metrics span {
  padding: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.72);
  font-size: 13px;
}

.result-metrics b {
  display: block;
  color: #fff;
  font-size: 28px;
}

.case-filters {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  margin-bottom: 18px;
  background: var(--surface-container);
  border-radius: 999px;
}

.case-filters button { padding: 0 16px; }
.case-card[hidden] { display: none; }
.case-card span { color: var(--primary-dark); font-size: 12px; font-weight: 900; text-transform: uppercase; }

.method {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 56px;
  align-items: center;
}

.method-media {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.method-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 52% center;
  display: block;
}

.method-copy ol {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 28px 0 0;
  list-style: none;
}

.method-copy li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--surface-container);
  border-radius: var(--radius);
}

.method-copy b { color: var(--primary); }
.method-copy span { color: var(--text); font-weight: 740; }

.final-cta {
  padding: 40px 48px 104px;
}

.final-card {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 56px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(21, 17, 31, 0.98), rgba(55, 18, 120, 0.94)),
    url("/assets/gui-cavallini.png") right center / auto 110% no-repeat;
  border-color: rgba(255,255,255,0.12);
  box-shadow: var(--shadow);
}

.final-card .eyebrow { color: #cdbdff; }
.final-card h2 { max-width: 760px; color: #fff; margin-bottom: 28px; }

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 28px 48px;
  color: var(--muted);
  border-top: 1px solid var(--outline);
}

footer img { width: 130px; height: auto; }
footer a:hover { color: var(--primary-dark); }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(9, 13, 19, 0.56);
}

.scrim.open { display: block; }

.command-dialog {
  position: fixed;
  top: 96px;
  z-index: 90;
  width: min(620px, calc(100% - 32px));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.command-dialog::backdrop { background: transparent; }

.command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--outline);
}

.command-head strong { color: var(--ink); font-size: 18px; }
.command-dialog input { margin: 16px; width: calc(100% - 32px); }

.command-list {
  display: grid;
  gap: 6px;
  padding: 0 16px 16px;
}

.command-list a {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius);
}

.command-list a:hover { background: var(--surface-container); }
.command-list b { color: var(--ink); }
.command-list span { color: var(--muted); font-size: 13px; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .hero-grid,
  .builder,
  .method,
  .diagnostic-grid,
  .section-head {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 54px; line-height: 60px; }
  .feature-grid,
  .case-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .topbar {
    top: 0;
    width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .brand { min-width: 0; }
  .brand img { width: 118px; }
  .brand span { display: none; }
  .nav-links { display: none; }
  .top-actions .button { display: none; }

  .hero {
    min-height: auto;
    padding: 112px 16px 48px;
  }

  .hero-grid {
    width: 100%;
    max-width: 358px;
    margin: 0;
    gap: 30px;
  }

  .hero-copy,
  .lead,
  .hero-proof,
  .product-shell,
  .app-layout,
  .workspace,
  .section {
    width: 100%;
    max-width: 100%;
  }

  h1 { font-size: 38px; line-height: 44px; }
  h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .lead { font-size: 17px; line-height: 28px; }
  .hero-actions { align-items: stretch; }
  .button.large { width: 100%; }
  .hero-proof,
  .metric-grid,
  .feature-grid,
  .case-grid,
  .result-metrics,
  .mode-body {
    grid-template-columns: 1fr;
  }

  .product-shell { border-radius: 18px; }
  .app-layout { grid-template-columns: 1fr; min-height: auto; }
  .rail {
    grid-template-columns: repeat(4, 1fr);
    border-right: 0;
    border-bottom: 1px solid var(--outline);
  }
  .rail button { min-height: 44px; }

  .section { padding: 64px 16px; }
  .section-head h2,
  .builder-copy h2,
  .method-copy h2,
  .final-card h2 {
    font-size: 31px;
    line-height: 39px;
  }

  .tabs { grid-template-columns: repeat(2, 1fr); }
  .case-filters { width: 100%; overflow: auto; }
  .case-filters button { white-space: nowrap; }
  .final-cta { padding: 24px 16px 72px; }
  .final-card {
    padding: 32px 22px;
    background: linear-gradient(135deg, rgba(21,17,31,0.98), rgba(55,18,120,0.96));
  }
  footer { flex-direction: column; align-items: flex-start; padding: 24px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
