* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: rgba(15, 23, 42, 0.78);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --line: rgba(148, 163, 184, 0.32);
  --line-strong: rgba(248, 250, 252, 0.22);
  --accent: #f8fafc;
  --button: #e5e7eb;
  --button-text: #0f172a;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.24), transparent 32rem),
    radial-gradient(circle at 85% 80%, rgba(245, 158, 11, 0.16), transparent 28rem),
    var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.app {
  height: 100dvh;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 16px;
  gap: 12px;
  overflow: hidden;
}

.app-header,
.app-footer,
.card-frame {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.app-header,
.app-footer {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.20);
}

.app-header {
  min-height: 58px;
  border-radius: 22px;
  padding: 10px 12px 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand,
.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  min-width: 0;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(248, 250, 252, 0.08);
  flex: 0 0 auto;
}

.header-badges {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  background: rgba(248, 250, 252, 0.08);
  white-space: nowrap;
}

.badge.muted {
  color: var(--muted);
}

.version-badge {
  font-weight: 760;
  letter-spacing: 0.04em;
}

.card-frame {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.page {
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.card-layout,
.feature-layout {
  height: 100%;
  min-height: 0;
  padding: clamp(18px, 3.6vw, 48px);
}

.card-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(20px, 3.6vw, 48px);
  align-items: stretch;
}

.feature-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.98fr) minmax(0, 1.02fr);
  gap: clamp(20px, 3.6vw, 48px);
  align-items: stretch;
}

.feature-layout.reverse {
  grid-template-columns: minmax(0, 1.02fr) minmax(280px, 0.98fr);
}

.card-media,
.feature-media {
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-image,
.feature-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 26px;
  border: 1px solid var(--line-strong);
  background: rgba(248, 250, 252, 0.06);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.card-copy,
.feature-copy {
  min-height: 0;
  height: 100%;
  display: grid;
  gap: 16px;
  align-content: center;
}

.card-copy {
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
}

.feature-copy {
  grid-template-rows: auto auto auto;
}

.text-scroll {
  min-height: 0;
  overflow: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.text-block {
  display: grid;
  gap: 1em;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(34px, 6vw, 72px);
}

h2 {
  font-size: clamp(32px, 4.8vw, 64px);
}

p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.5;
}

.app-footer {
  min-height: 64px;
  border-radius: 24px;
  padding: 10px;
  display: grid;
  grid-template-columns: 124px minmax(110px, 1fr) 124px;
  align-items: center;
  gap: 12px;
}

.app-footer button {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
}

.primary {
  background: var(--button);
  color: var(--button-text);
  font-weight: 760;
}

.secondary {
  background: rgba(15, 23, 42, 0.94);
  color: var(--text);
}

.secondary:disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

.progress-wrap {
  height: 6px;
  background: rgba(248, 250, 252, 0.14);
  border-radius: 999px;
  overflow: hidden;
}

.progress {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 220ms ease;
}

@media (max-width: 820px) {
  .app {
    padding: 10px;
    gap: 10px;
  }

  .app-header {
    align-items: flex-start;
    border-radius: 18px;
    padding: 10px;
  }

  .brand {
    padding-top: 6px;
  }

  .header-badges {
    max-width: 58%;
  }

  .badge {
    min-height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .page {
    border-radius: 24px;
  }

  .card-layout,
  .feature-layout {
    padding: 16px;
    gap: 16px;
  }

  .card-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 40%) minmax(0, 60%);
  }

  .feature-layout,
  .feature-layout.reverse {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 42%) minmax(0, 58%);
  }

  .feature-layout.reverse .feature-copy {
    order: 0;
  }

  .feature-layout.reverse .feature-media {
    order: 1;
  }

  .card-copy,
  .feature-copy {
    min-height: 0;
  }

  .card-copy {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .feature-copy {
    align-content: center;
  }

  h1 {
    font-size: clamp(30px, 9vw, 52px);
  }

  h2 {
    font-size: clamp(28px, 8vw, 46px);
  }

  p {
    font-size: clamp(16px, 4.2vw, 19px);
  }

  .app-footer {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    min-height: 74px;
    border-radius: 20px;
  }

  .progress-wrap {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .secondary {
    grid-column: 1;
  }

  .primary {
    grid-column: 2;
  }
}
