/* CaravaggioUI — marketing site */

:root {
  --primary: #662d8c;
  --primary-light: #b58ad6;
  --primary-dark: #3f145a;
  --secondary: #ed1e79;
  --secondary-light: #ff7bb5;
  --secondary-dark: #b3004c;

  --bg: #faf8fc;
  --bg-alt: #f3eef8;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #1a1224;
  --text-muted: #5c4d6b;
  --border: rgba(102, 45, 140, 0.12);
  --shadow: 0 8px 32px rgba(63, 20, 90, 0.08);
  --shadow-lg: 0 24px 64px rgba(63, 20, 90, 0.14);
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  --gradient-soft: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--secondary);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(102, 45, 140, 0.08);
  padding: 0.15em 0.45em;
  border-radius: 6px;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

/* Background orbs */

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.orb-1 {
  width: 520px;
  height: 520px;
  top: -120px;
  right: -80px;
  background: var(--primary-light);
}

.orb-2 {
  width: 420px;
  height: 420px;
  bottom: 10%;
  left: -120px;
  background: var(--secondary-light);
}

.orb-3 {
  width: 300px;
  height: 300px;
  top: 45%;
  right: 20%;
  background: var(--primary);
  opacity: 0.2;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(250, 248, 252, 0.82);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  flex-shrink: 0;
}

.nav-brand img {
  border-radius: 10px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(237, 30, 121, 0.28);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 8px 28px rgba(237, 30, 121, 0.36);
}

.btn-outline {
  background: var(--surface-solid);
  color: var(--primary-dark);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--primary);
  background: rgba(102, 45, 140, 0.06);
}

.btn-sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.9rem 1.6rem;
  font-size: 1rem;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 0 5rem;
}

.hero-badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(102, 45, 140, 0.1);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.5vw, 3.15rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--primary-dark);
}

.hero-lead {
  margin: 0 0 1.75rem;
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 34rem;
}

.install-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.65rem 0.65rem 1.1rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  max-width: 28rem;
}

.install-box code {
  flex: 1;
  background: none;
  padding: 0;
  font-size: 0.9rem;
  color: var(--primary-dark);
  overflow-x: auto;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(102, 45, 140, 0.08);
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: rgba(102, 45, 140, 0.14);
}

.copy-btn-dark {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.copy-btn-dark:hover {
  background: rgba(255, 255, 255, 0.14);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.hero-stats strong {
  display: block;
  color: var(--primary-dark);
  font-size: 1.05rem;
}

/* Phone preview mock */

.hero-preview {
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

.phone-frame {
  width: min(300px, 100%);
  padding: 12px;
  border-radius: 36px;
  background: linear-gradient(160deg, #2a1538, #1a1224);
  box-shadow: var(--shadow-lg);
  transform: rotateY(-8deg) rotateX(4deg);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: rotateY(-8deg) rotateX(4deg) translateY(0); }
  50% { transform: rotateY(-8deg) rotateX(4deg) translateY(-10px); }
}

.phone-notch {
  width: 90px;
  height: 22px;
  margin: 0 auto 8px;
  border-radius: 0 0 14px 14px;
  background: #1a1224;
}

.phone-screen {
  border-radius: 26px;
  overflow: hidden;
  background: var(--gradient-soft);
}

.preview-scaffold {
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.preview-appbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.5rem;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.preview-back {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.preview-body {
  padding: 0.75rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-carousel {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(63, 20, 90, 0.12);
}

.preview-carousel-header {
  height: 100px;
  background: var(--gradient);
  position: relative;
  padding: 0.65rem;
}

.preview-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
}

.preview-carousel-content {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.preview-carousel-content strong {
  font-size: 0.85rem;
  color: var(--primary-dark);
}

.preview-carousel-content span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.preview-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
}

.preview-tabs span {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0.25rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.preview-tabs span.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(63, 20, 90, 0.1);
}

.preview-tile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(63, 20, 90, 0.08);
}

.preview-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--gradient-soft);
  flex-shrink: 0;
}

.preview-tile-text {
  flex: 1;
  min-width: 0;
}

.preview-tile-text strong {
  display: block;
  font-size: 0.78rem;
  color: var(--primary-dark);
}

.preview-tile-text span {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.preview-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--primary-light);
  border-bottom: 2px solid var(--primary-light);
  transform: rotate(-45deg);
  flex-shrink: 0;
}

.preview-btn-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.preview-btn {
  flex: 1;
  text-align: center;
  padding: 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.preview-btn.gradient {
  background: var(--gradient);
  color: #fff;
}

.preview-btn.outline {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--border);
}

/* Sections */

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section-label {
  margin: 0 0 0.5rem;
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-header h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -0.02em;
  color: var(--primary-dark);
}

.section-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Features */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature-card {
  padding: 1.75rem;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--primary-dark);
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--primary-dark);
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.feature-card code {
  font-size: 0.82em;
}

/* Components */

.components-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.component-group {
  padding: 1.5rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.component-group h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--primary-dark);
}

.component-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.component-group li code {
  display: inline-block;
  font-size: 0.78rem;
}

.component-highlight {
  background: var(--gradient);
  border: none;
  color: #fff;
}

.component-highlight h3 {
  color: #fff;
}

.component-highlight p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  opacity: 0.92;
}

.component-highlight .btn-outline {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.component-highlight .btn-outline:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Code steps */

.code-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 760px;
  margin-inline: auto;
}

.code-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}

.step-num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.5rem;
}

.code-block {
  background: #1a1224;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
  font-weight: 500;
}

.code-block pre {
  margin: 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
}

.code-block code {
  background: none;
  padding: 0;
  color: #e8dff0;
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre;
}

/* CTA */

.cta-section {
  padding: 5rem 0;
  background: var(--gradient-soft);
  border-top: 1px solid var(--border);
}

.cta-inner {
  text-align: center;
}

.cta-logo {
  margin: 0 auto 1.25rem;
  border-radius: 18px;
}

.cta-inner h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3vw, 2.2rem);
  color: var(--primary-dark);
}

.cta-inner p {
  margin: 0 auto 1.75rem;
  max-width: 480px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.cta-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.45);
}

/* Footer */

.site-footer {
  padding: 2.5rem 0;
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.75);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 700;
}

.footer-brand img {
  border-radius: 8px;
}

.footer-copy {
  margin: 0;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--secondary-light);
}

/* Scroll reveal */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Responsive */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 2.5rem;
  }

  .hero-preview {
    order: -1;
  }

  .phone-frame {
    transform: none;
    animation: none;
    width: min(260px, 85%);
  }

  .features-grid,
  .components-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links,
  .nav-actions {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    padding: 1rem 1.5rem 1.25rem;
    background: rgba(250, 248, 252, 0.98);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    margin-left: 0;
  }

  .nav-actions.open {
    display: flex;
    position: absolute;
    top: calc(var(--header-h) + 180px);
    left: 1.5rem;
    right: 1.5rem;
  }

  .site-header .nav {
    position: relative;
    flex-wrap: wrap;
  }

  .features-grid,
  .components-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 3.5rem 0;
  }

  .code-step {
    grid-template-columns: 1fr;
  }

  .step-num {
    margin-top: 0;
  }
}

/* Live demo page */

.demo-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #1a1224;
}

.demo-header {
  flex-shrink: 0;
  background: rgba(250, 248, 252, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.demo-header-inner {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
  padding: 0.85rem 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.demo-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  justify-self: start;
}

.demo-back:hover {
  color: var(--primary);
}

.demo-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: var(--primary-dark);
  justify-self: center;
}

.demo-title img {
  border-radius: 8px;
}

.demo-subtitle {
  margin: 0;
  justify-self: end;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.demo-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.demo-frame {
  width: 100%;
  height: calc(100vh - 57px);
  height: calc(100dvh - 57px);
  border: none;
  background: #fff;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.demo-frame.ready {
  opacity: 1;
}

.demo-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: linear-gradient(160deg, #2a1538 0%, #1a1224 100%);
  color: rgba(255, 255, 255, 0.85);
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 1;
}

.demo-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.demo-loader p {
  margin: 0;
  font-size: 0.95rem;
}

.demo-loader-dots {
  display: flex;
  gap: 0.45rem;
}

.demo-loader-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient);
  animation: demo-bounce 1.2s ease-in-out infinite;
}

.demo-loader-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.demo-loader-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes demo-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  40% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .demo-header-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0.35rem;
  }

  .demo-back,
  .demo-title,
  .demo-subtitle {
    justify-self: center;
  }

  .demo-subtitle {
    font-size: 0.75rem;
  }
}
