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

:root {
  /* Sampled from the polymita logo: purple ring for background/surface,
     orange for buttons/CTAs. Matches the app's Bootstrap palette
     (apps/frontend/src/styles.scss) and the wiki theme. */
  --bg: #1f1b34;
  --bg-card: #343147;
  --border: #2e2847;
  --text: #f3f0f7;
  --muted: #a79fc2;
  --primary: #ff6435;
  --primary-hover: #e5551f;
  --primary-ink: #1f1b34;
  --gold: #eeb627;
  --success: #3ecf8e;
  --error: #f87171;
  --radius: 10px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Plain text links default to gold — same role as --bs-link-color in the
   app and --vp-c-brand-1 in the wiki. Logo/buttons/nav links below all use
   class selectors, which win regardless of source order, so they're
   unaffected by this. */
a {
  color: var(--gold);
}

.text-gold {
  color: var(--gold);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-wide {
  max-width: 1200px;
}

/* Header */
.header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.header .btn-primary {
  margin-left: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo-mark {
  height: 1.75rem;
  width: auto;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
  margin-right: auto;
}

.header-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s;
}

.header-nav a:hover {
  color: var(--gold);
}

@media (max-width: 640px) {
  .header-nav {
    display: none;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
}

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

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
  text-align: center;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Section heading */
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.section-head p {
  color: var(--muted);
  font-size: 1rem;
}

/* Hero */
.hero {
  padding: 4rem 0 3rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.hero-copy {
  flex: 1 1 380px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 0 2rem;
}

@media (max-width: 900px) {
  .hero {
    padding: 3.5rem 0 4rem;
    text-align: center;
  }

  .hero-inner {
    flex-direction: column;
  }

  .hero-sub {
    margin: 0 auto 2rem;
  }
}

/* Device mockup */
.mockup {
  flex: 1 1 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;

  /* Preview-theme colors — scoped to this component only, never the real page. */
  --mockup-bg: #1f1b34;
  --mockup-surface: #343147;
  --mockup-accent: #ff6435;
  /* Device bezel stays fixed regardless of preview theme — only the screen
     fill changes. Deliberately darker than any --bg option so the frame
     reads as a distinct object against the page, not just a slightly
     different shade of it. */
  --device-bezel: #0a0814;
}

.mockup[data-theme="ocean"] {
  --mockup-bg: #0a1628;
  --mockup-surface: #102340;
  --mockup-accent: #22d3ee;
}

.mockup[data-theme="emerald"] {
  --mockup-bg: #0a1410;
  --mockup-surface: #12211b;
  --mockup-accent: #34d399;
}

.mockup-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  width: 100%;
}

.device {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.45));
}

.mockup[data-device="desktop"] .device-desktop,
.mockup[data-device="tablet"] .device-tablet,
.mockup[data-device="phone"] .device-phone {
  display: block;
  animation: deviceIn 0.35s ease;
}

@keyframes deviceIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.device-screen {
  background: var(--mockup-bg);
  overflow: hidden;
  transition: background 0.25s ease;
}

.device-screen-bar {
  display: flex;
  align-items: center;
  padding: 0 0.6rem;
  background: var(--mockup-surface);
  transition: background 0.25s ease;
}

.device-screen-dot {
  display: block;
  border-radius: 50%;
  background: var(--mockup-accent);
  transition: background 0.25s ease;
}

.device-desktop {
  width: 320px;
  padding: 10px 10px 0;
  background: var(--device-bezel);
  border-radius: 10px 10px 0 0;
}

.device-desktop .device-screen {
  aspect-ratio: 16 / 10;
  border-radius: 3px;
}

.device-desktop .device-screen-bar {
  height: 18px;
}

.device-desktop .device-screen-dot {
  width: 8px;
  height: 8px;
}

.device-desktop::after {
  content: '';
  display: block;
  width: 90px;
  height: 16px;
  margin: 0 auto;
  background: var(--device-bezel);
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
}

.device-tablet {
  width: 220px;
  padding: 16px 14px;
  background: var(--device-bezel);
  border-radius: 12px;
}

.device-tablet .device-screen {
  aspect-ratio: 3 / 4;
  border-radius: 4px;
}

.device-tablet .device-screen-bar {
  height: 16px;
}

.device-tablet .device-screen-dot {
  width: 7px;
  height: 7px;
}

.device-phone {
  position: relative;
  width: 150px;
  padding: 16px 8px 8px;
  background: var(--device-bezel);
  border-radius: 18px;
}

.device-phone .device-screen {
  aspect-ratio: 9 / 19.5;
  border-radius: 4px;
}

.device-phone .device-screen-bar {
  height: 14px;
}

.device-phone .device-screen-dot {
  width: 6px;
  height: 6px;
}

.device-notch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 6px;
  border-radius: 4px;
  background: var(--device-bezel);
  z-index: 1;
}

.device-notch::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 30px;
  height: 3px;
  border-radius: 3px;
  background: #17171f;
}

.mockup-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.mockup-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem;
}

.mockup-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mockup-tab:hover {
  color: var(--text);
}

.mockup-tab.active {
  background: var(--primary);
  color: var(--primary-ink);
}

.mockup-swatches {
  display: flex;
  gap: 0.6rem;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color 0.15s;
}

.swatch.active {
  outline-color: #fff;
}

.swatch-polymitas {
  background: linear-gradient(135deg, #ff6435 50%, #1f1b34 50%);
}

.swatch-ocean {
  background: linear-gradient(135deg, #22d3ee 50%, #0a1628 50%);
}

.swatch-emerald {
  background: linear-gradient(135deg, #34d399 50%, #0a1410 50%);
}

@media (max-width: 480px) {
  .mockup-controls {
    flex-direction: column;
    gap: 0.85rem;
  }
}

/* Features */
.features {
  padding: 3rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.feature-icon {
  color: var(--primary);
  margin-bottom: 0.9rem;
}

.feature-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.feature h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.feature p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* How it works */
.how-it-works {
  padding: 3rem 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.step {
  text-align: center;
}

.step-number {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--primary);
  font-weight: 700;
}

.step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step p {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 280px;
  margin: 0 auto;
}

/* Pricing (placeholder — commented out in index.html until plans are public) */
.pricing {
  padding: 3rem 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.pricing-card {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pricing-card-line {
  height: 0.65rem;
  border-radius: 4px;
  background: var(--bg-card);
}

.pricing-card-title {
  width: 55%;
  height: 0.9rem;
}

.pricing-card-price {
  width: 40%;
  height: 1.4rem;
  margin-bottom: 0.5rem;
}

/* Trusted by (placeholder — commented out in index.html until there are real customers) */
.trusted-by {
  padding: 3rem 0;
}

.trusted-by-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.logo-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.logo-slot {
  width: 120px;
  height: 48px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* Docs teaser */
.docs-teaser {
  padding: 3rem 1.5rem;
}

.docs-teaser-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.docs-teaser-inner h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.docs-teaser-inner p {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Request form (standalone pages: /demo, /support) */
.request {
  padding: 6rem 0;
  min-height: calc(100vh - 4.25rem);
  display: flex;
  align-items: center;
}

.request-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 560px;
  margin: 0 auto;
}

.request-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.request-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--primary);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--border);
}

#submit-btn {
  margin-top: 0.5rem;
}

.form-status {
  font-size: 0.875rem;
  margin-top: 0.75rem;
  min-height: 1.25rem;
}

.form-status.success {
  color: var(--success);
}

.form-status.error {
  color: var(--error);
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}