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

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.5 var(--font-text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.screen__title:focus { outline: none; }

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--page-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: clip; /* наклон карточек не сдвигает страницу вбок */
  padding: calc(12px + var(--safe-top)) var(--gutter) calc(var(--nav-height) + var(--safe-bottom) + 20px);
}

/* Шапка */
.header { display: flex; align-items: center; gap: 10px; }
.logo { flex: none; width: 36px; height: 36px; }
.brand { flex: 1; min-width: 0; }
.brand__name { font: 600 15px/1.25 var(--font-display); white-space: nowrap; }
.brand__sub { color: var(--text-2); font-size: 12px; line-height: 1.35; white-space: nowrap; }

.trial {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
}
.trial__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2s ease-out infinite;
}

.demo {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .08em;
}

/* Экраны */
.screens { flex: 1; padding-top: 16px; perspective: 1000px; }
.screen { animation: screen-in .8s var(--ease-screen) backwards; }
.screen__title { font: 600 24px/1.25 var(--font-display); }

.card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--card), var(--card-2));
}
.screen .card { margin-top: 16px; color: var(--text-2); }

.disclaimer {
  margin-top: 24px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

/* Нижнее меню */
.nav {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 4px var(--safe-bottom);
  border-top: 1px solid var(--nav-border);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(var(--nav-blur));
  backdrop-filter: blur(var(--nav-blur));
}
.nav__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  height: var(--nav-height);
}
.nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: var(--tap);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.nav__item:focus-visible { outline-offset: -4px; }
.nav__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 30px;
  border-radius: var(--radius-nav);
}
.nav__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav__item[aria-current="page"] { color: var(--gold); }
.nav__item[aria-current="page"] .nav__icon { background: var(--burgundy-soft); }

/* Нажатие: вдавливается и пружинит */
button, .trial, .nav__icon { transition: transform .35s var(--ease-spring); }
button:active, .trial:active { transform: scale(.95); }
.nav__item:active .nav__icon { transform: scale(.88); }

@keyframes screen-in {
  from { opacity: 0; transform: translateZ(-160px) rotateX(10deg); }
  to { opacity: 1; transform: translateZ(0) rotateX(0); }
}
@keyframes pulse {
  from { box-shadow: 0 0 0 0 var(--gold-pulse); }
  70%, to { box-shadow: 0 0 0 7px var(--gold-pulse-end); }
}

/* Узкие телефоны: текст кнопки в две строки, чтобы шапка помещалась */
@media (max-width: 419px) {
  .trial__text > span { display: block; }
  .trial__text > .trial__sep { display: none; }
}

@media (max-width: 350px) {
  .app { padding-right: 12px; padding-left: 12px; }
  .header { gap: 8px; }
  .trial { gap: 6px; padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  button:active, .trial:active, .nav__item:active .nav__icon { transform: none; }
}
