:root {
  color-scheme: light;
  --bg: #edf5ff;
  --bg-strong: #dff3ff;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #ffffff;
  --surface-soft: #f7fbff;
  --ink: #102033;
  --muted: #60708a;
  --line: rgba(124, 151, 184, 0.32);
  --primary: #1f61e8;
  --primary-strong: #1547b8;
  --cyan: #0cb9d4;
  --accent: #12a383;
  --warning: #f4b942;
  --shadow: 0 22px 64px rgba(22, 45, 84, 0.14);
  --phone-shadow: 0 34px 80px rgba(5, 16, 38, 0.34), 0 10px 24px rgba(31, 97, 232, 0.14);
  --radius: 8px;
  --radius-lg: 18px;
}

body.is-dark {
  color-scheme: dark;
  --bg: #08111e;
  --bg-strong: #0b2537;
  --surface: rgba(13, 27, 45, 0.86);
  --surface-solid: #101c2c;
  --surface-soft: #132338;
  --ink: #eef6ff;
  --muted: #9db0c9;
  --line: rgba(142, 169, 202, 0.24);
  --primary: #62a5ff;
  --primary-strong: #2f75df;
  --cyan: #29d3ef;
  --accent: #38d5b1;
  --warning: #ffca68;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.34);
  --phone-shadow: 0 38px 92px rgba(0, 0, 0, 0.58), 0 10px 34px rgba(41, 211, 239, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(12, 185, 212, 0.22), transparent 26rem),
    radial-gradient(circle at 86% 4%, rgba(31, 97, 232, 0.24), transparent 24rem),
    radial-gradient(circle at 52% 24%, rgba(124, 58, 237, 0.1), transparent 26rem),
    linear-gradient(135deg, var(--bg), var(--bg-strong) 48%, var(--bg));
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
iframe {
  font: inherit;
}

.preview-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand img {
  width: 38px;
  height: 38px;
}

.topnav,
.hero-actions,
.cta-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topnav a,
.theme-toggle,
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 780;
  box-shadow: 0 10px 26px rgba(16, 32, 51, 0.06);
  cursor: pointer;
}

.button-compact {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.topnav a:hover,
.theme-toggle:hover,
.button:hover {
  transform: translateY(-1px);
}

.theme-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0 28%, var(--primary) 30% 100%);
  box-shadow: inset -3px -3px 0 rgba(16, 32, 51, 0.24);
}

.buy-link,
.button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(31, 97, 232, 0.28);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(370px, 468px);
  align-items: center;
  gap: clamp(34px, 5vw, 68px);
  min-height: calc(100vh - 88px);
  padding: 18px 0 58px;
}

.hero-copy {
  min-width: 0;
}

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

body.is-dark .eyebrow {
  color: var(--cyan);
}

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

h1 {
  max-width: 680px;
  margin-bottom: 10px;
  font-size: clamp(44px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

.subtitle {
  margin-bottom: 12px;
  color: var(--primary-strong);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 850;
}

.intro {
  max-width: 680px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 18px;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 24px;
}

.badge-list span,
.live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(12, 185, 212, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

body.is-dark .badge-list span,
body.is-dark .live-pill {
  background: rgba(255, 255, 255, 0.07);
}

.hero-actions {
  margin-bottom: 24px;
}

.selector-panel,
.screen-selector-card,
.notice-section,
.cta-section,
.feature-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, #ffffff), color-mix(in srgb, var(--surface-soft) 70%, var(--surface))),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.selector-panel {
  max-width: 760px;
  padding: 20px;
}

.panel-heading,
.screen-selector-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.screen-selector-card h2 {
  margin: 0;
  font-size: 22px;
}

.app-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.auth-flow-note {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(31, 97, 232, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.auth-flow-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

body.is-dark .auth-flow-note {
  background: rgba(255, 255, 255, 0.07);
}

.preview-demo-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.preview-demo-actions .button.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #ffffff;
}

.app-button {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.app-button:hover,
.app-button.is-active {
  border-color: rgba(31, 97, 232, 0.58);
  background:
    linear-gradient(135deg, rgba(31, 97, 232, 0.13), rgba(12, 185, 212, 0.12)),
    var(--surface-solid);
  box-shadow: 0 12px 28px rgba(31, 97, 232, 0.12);
}

.app-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.preview-svg-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-button strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.app-button span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.preview-column {
  min-width: 0;
}

.screen-selector-card {
  display: block;
  margin-bottom: 18px;
  padding: 20px;
}

.screen-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.screen-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--muted);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.screen-button:hover,
.screen-button.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #ffffff;
}

.phone-wrap {
  display: flex;
  justify-content: center;
  padding: 6px 0 0;
}

.phone-device {
  width: min(390px, 100%);
  aspect-ratio: 390 / 812;
  position: relative;
  border: 10px solid #070b12;
  border-radius: 46px;
  background:
    linear-gradient(145deg, #1d2533, #05070c 42%, #111827);
  box-shadow: var(--phone-shadow);
  overflow: hidden;
}

.phone-device::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 36px;
  pointer-events: none;
}

.phone-device::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 6px;
  z-index: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  pointer-events: none;
}

.phone-top {
  height: 28px;
  position: absolute;
  top: 4px;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 138px;
  padding: 0 16px;
  transform: translateX(-50%);
  border-radius: 0 0 20px 20px;
  background: #05070c;
}

.camera {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1e2a3d;
  box-shadow: inset 0 0 0 2px #111827;
}

.speaker {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: #202b3b;
}

.phone-screen {
  position: absolute;
  inset: 6px;
  z-index: 1;
  overflow: hidden;
  border-radius: 34px;
  background:
    radial-gradient(circle at 80% 0%, rgba(12, 185, 212, 0.12), transparent 8rem),
    #f8fbff;
}

.phone-screen iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #ffffff;
}

.loading-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 10px;
  background: rgba(248, 251, 255, 0.88);
  color: #102033;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.loading-state.is-visible {
  opacity: 1;
  visibility: visible;
}

.loader {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border: 3px solid rgba(31, 97, 232, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.notice-section {
  display: grid;
  gap: 8px;
  margin: 10px 0 54px;
  padding: 20px;
  border-left: 4px solid var(--warning);
}

.notice-section p {
  margin: 0;
}

.frontend-note {
  color: var(--muted);
  font-size: 14px;
}

.feature-section {
  padding: 20px 0 56px;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 18px;
}

.section-heading h2,
.cta-section h2 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

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

.feature-grid article {
  min-height: 178px;
  padding: 18px;
}

.feature-grid span {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.feature-grid h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.feature-grid p,
.cta-section p {
  margin-bottom: 0;
  color: var(--muted);
}

.cta-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
  padding: 24px;
}

.cta-actions {
  justify-content: flex-end;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0 34px;
  color: var(--muted);
  font-size: 14px;
}

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

@media (max-width: 1040px) {
  .hero-section {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .preview-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    align-items: start;
    gap: 22px;
  }

  .screen-selector-card {
    margin-bottom: 0;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .preview-shell {
    width: min(100% - 22px, 1220px);
  }

  .topbar,
  .cta-section {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .topnav,
  .cta-actions {
    width: 100%;
  }

  .topnav a,
  .theme-toggle,
  .cta-actions .button {
    flex: 1 1 auto;
  }

  .hero-section {
    gap: 30px;
    padding-top: 8px;
  }

  .selector-panel,
  .screen-selector-card,
  .notice-section,
  .cta-section {
    border-radius: 14px;
  }

  .app-selector,
  .preview-column,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .phone-device {
    width: min(390px, calc(100vw - 34px));
  }
}

@media (max-width: 430px) {
  .topnav a,
  .theme-toggle,
  .button {
    width: 100%;
  }

  .panel-heading {
    display: block;
  }

  .auth-flow-note {
    grid-template-columns: 1fr;
  }

  .preview-demo-actions {
    justify-content: stretch;
  }

  .preview-demo-actions .button {
    width: 100%;
  }

  h1 {
    font-size: 42px;
  }
}
