:root {
  --brand-primary: #173B66;
  --brand-primary-light: #3F6E9D;
  --brand-secondary: #C9366B;
  --ink: #172033;
  --muted: #687386;
  --line: #d9dee7;
  --surface: #ffffff;
  --canvas: #f2f4f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  opacity: 0;
}

body.is-ready {
  opacity: 1;
  transition: opacity 180ms ease;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand-copy small {
  color: var(--brand-secondary);
  font-size: 12px;
  font-weight: 700;
}

.viewer-controls,
.mode-switch {
  display: flex;
  align-items: center;
}

.viewer-controls {
  gap: 12px;
}

.surface-status {
  min-width: 136px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.surface-status.is-switching {
  color: var(--brand-secondary);
}

.surface-status.is-error {
  color: #b42318;
}

.mode-switch {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f5;
}

.mode-switch button,
.fullscreen-button {
  min-height: 38px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.mode-switch button {
  padding: 0 16px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.mode-switch button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--brand-primary);
  box-shadow: 0 3px 10px rgba(23, 59, 102, 0.2);
}

.mode-switch button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.fullscreen-button {
  padding: 0 16px;
  border: 1px solid var(--brand-primary);
  border-radius: 8px;
  color: var(--brand-primary);
  background: var(--surface);
}

.fullscreen-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.mode-switch button:hover,
.fullscreen-button:hover {
  filter: brightness(0.96);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(201, 54, 107, 0.28);
  outline-offset: 3px;
}

.showcase {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: calc(100dvh - 72px);
  padding: 18px clamp(20px, 4vw, 64px) 12px;
}

.intro {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto 10px;
  text-align: center;
}

body[data-view-mode="phone"] .intro[data-intro="desktop"],
body[data-view-mode="desktop"] .intro[data-intro="phone"] {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand-secondary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  color: var(--brand-primary);
  font-size: clamp(24px, 3.1vh, 34px);
  line-height: 1.18;
  letter-spacing: 0;
}

.intro-copy {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.mobile-admin-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 7px;
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 750;
}

.mobile-admin-note::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-secondary);
  content: "";
}

.benefits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  color: #3b4658;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.benefits li::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--brand-secondary);
  content: "";
}

.device-stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: hidden;
}

.device-stage::before {
  position: absolute;
  width: min(680px, 66vw);
  height: 1px;
  background: var(--line);
  content: "";
}

.device-sizer {
  position: relative;
  z-index: 1;
}

.device-frame {
  position: relative;
  overflow: hidden;
  background: #121722;
  box-shadow:
    0 28px 56px rgba(20, 31, 49, 0.18),
    0 8px 20px rgba(20, 31, 49, 0.14);
}

.device-frame.is-phone {
  width: 416px;
  height: 870px;
  padding: 12px;
  border: 1px solid #2f3745;
  border-radius: 56px;
}

.device-frame.is-phone::after {
  position: absolute;
  inset: 5px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 51px;
  pointer-events: none;
  content: "";
}

.phone-speaker {
  position: absolute;
  top: 20px;
  left: 50%;
  z-index: 4;
  width: 112px;
  height: 30px;
  border-radius: 18px;
  background: #07090e;
  transform: translateX(-50%);
  pointer-events: none;
}

.device-frame iframe {
  display: block;
  border: 0;
  background: #ffffff;
}

.app-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--brand-primary);
  background: #f8f9fc;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.app-loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loading-overlay img {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.app-loading-overlay strong {
  font-size: 17px;
}

.app-loading-overlay small {
  color: var(--muted);
  font-size: 12px;
}

.loading-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(23, 59, 102, 0.16);
  border-top-color: var(--brand-secondary);
  border-radius: 50%;
  animation: loading-spin 720ms linear infinite;
}

.device-frame.is-phone .app-loading-overlay {
  inset: 12px;
  border-radius: 38px;
}

.device-frame.is-desktop .app-loading-overlay {
  inset: 44px 10px 10px;
  border-radius: 4px;
}

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

.device-frame.is-phone iframe {
  width: 390px;
  height: 844px;
  border-radius: 38px;
}

.desktop-toolbar {
  display: none;
}

.device-frame.is-desktop {
  width: 1200px;
  height: 812px;
  padding: 44px 10px 10px;
  border: 1px solid #bec6d2;
  border-radius: 12px;
  background: #e9edf2;
}

.device-frame.is-desktop iframe {
  width: 1180px;
  height: 758px;
  border-radius: 4px;
}

.device-frame.is-desktop .phone-speaker {
  display: none;
}

.device-frame.is-desktop .desktop-toolbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  color: #445064;
  font-size: 13px;
}

.window-dots {
  position: absolute;
  left: 16px;
  display: flex;
  gap: 7px;
}

.window-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c5ccd6;
}

.window-dots i:first-child {
  background: var(--brand-secondary);
}

.window-dots i:nth-child(2) {
  background: #e4a94c;
}

.window-dots i:last-child {
  background: #47a97c;
}

.demo-note {
  margin: 7px 0 0;
  color: #7a8495;
  font-size: 11px;
  text-align: center;
}

body[data-view-mode="phone"] .topbar {
  min-height: 64px;
  padding-block: 8px;
}

body[data-view-mode="phone"] .showcase {
  height: calc(100dvh - 64px);
  padding-top: 10px;
  padding-bottom: 8px;
}

body[data-view-mode="phone"] .intro {
  margin-bottom: 4px;
}

body[data-view-mode="phone"] .intro h1 {
  font-size: clamp(22px, 2.7vh, 28px);
}

body[data-view-mode="phone"] .intro-copy,
body[data-view-mode="phone"] .benefits,
body[data-view-mode="phone"] .demo-note {
  display: none;
}

.noscript {
  max-width: 620px;
  margin: 80px auto;
  padding: 24px;
  text-align: center;
}

@media (max-height: 780px) {
  .showcase {
    padding-top: 10px;
  }

  .intro-copy,
  .benefits {
    display: none;
  }

  .intro {
    margin-bottom: 4px;
  }

  .demo-note {
    display: none;
  }
}

@media (max-width: 920px) {
  .topbar {
    padding-inline: 16px;
  }

  .fullscreen-button {
    display: none;
  }

  .showcase {
    padding-inline: 16px;
  }

  .surface-status {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
