/* ============================================================
   Здоровье 5.0 — colour & type tokens (from design system)
   ============================================================ */
:root {
  /* Brand & accent */
  --z-teal: #13c2c2;
  --z-teal-hover: #10aeae;
  --z-teal-pressed: #0e9494;
  --z-teal-tint: #00c8b3;
  --z-teal-deep: #00474f;
  --z-teal-50: #e6fffb;
  --z-teal-100: #b5f5ec;
  --z-purple: #7b61ff;
  --z-coral: #ff6b6b;

  /* Surfaces */
  --z-bg-app: #f8f9fe;
  --z-surface: #ffffff;
  --z-surface-tint: #f3f4f8;

  /* Text */
  --z-text-primary: #0e0e0e;
  --z-text-body: #333333;
  --z-text-secondary: rgba(0, 0, 0, 0.45);
  --z-text-tertiary: #767c8c;

  /* Lines */
  --z-divider: #f0f0f0;

  /* Shadows (blue-tinted) */
  --z-shadow-card: 0 4px 14px rgba(0, 55, 94, 0.08);
  --z-shadow-card-lg: 0 8px 24px rgba(0, 55, 94, 0.16);
  --z-shadow-fab: 0 6px 20px rgba(19, 194, 194, 0.35);

  /* Type families */
  --z-font-sans:
    "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --z-font-ios:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;

  /* ── Responsive scale — defaults = xl (≥1440) ── */
  --nav-pad: 26px 48px;
  --nav-link-gap: 36px;
  --logo-size: 34px;
  --wordmark-fs: 21px;
  --hero-pad: 8px 48px 64px;
  --eyebrow-mb: 28px;
  --h1-fs: 76px;
  --sub-fs: 30px;
  --desc-fs: 17px;
  --phone-scale: 0.6;
  --footer-pad: 22px 48px 36px;
  --footer-gap: 28px;
}

/* ============================================================
   Base
   ============================================================ */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--z-font-sans);
  background: var(--z-bg-app);
  color: var(--z-text-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: inherit;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--nav-pad);
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand__mark {
  width: var(--logo-size);
  height: var(--logo-size);
  display: block;
}
.brand__word {
  font-size: var(--wordmark-fs);
  font-weight: 700;
  color: var(--z-teal);
  letter-spacing: 0;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--nav-link-gap);
}
.nav__link {
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: var(--z-text-secondary);
  transition: color 140ms ease;
}
.nav__link--active {
  color: var(--z-teal-deep);
}

/* ============================================================
   Hero
   ============================================================ */
.hero-wrap {
  display: grid;
  flex: 1;
}
.hero {
  width: 100%;
  height: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--hero-pad);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 32px;
}

.hero__copy {
  position: relative;
  max-width: 560px;
}

.eyebrow {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--z-teal-50);
  color: var(--z-teal-deep);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--eyebrow-mb);
}
.eyebrow__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}

.hero__title {
  font-size: var(--h1-fs);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--z-text-primary);
  margin: 0 0 8px;
}
.hero__title .accent {
  color: var(--z-teal);
}

.hero__subtitle {
  font-size: var(--sub-fs);
  font-weight: 600;
  color: var(--z-teal-deep);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.hero__desc {
  font-size: var(--desc-fs);
  line-height: 1.6;
  color: var(--z-text-secondary);
  margin: 0 0 36px;
  max-width: 460px;
  text-wrap: pretty;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-start;
}
.store-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 56px;
  padding: 0 22px 0 18px;
  border-radius: 14px;
  background: #0e0e0e;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--z-shadow-card-lg);
  flex: 0 0 auto;
  transition:
    transform 140ms ease,
    background 140ms ease;
}
.store-btn:hover {
  background: #1c1c1c;
  transform: translateY(-2px);
}
.store-btn__glyph {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}
.store-btn__txt {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.store-btn__kicker {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.7;
  letter-spacing: 0.01em;
}
.store-btn__name {
  font-size: 17px;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Sparkle decorations ── */
.sparkle {
  display: block;
}
.sparkle--eyebrow {
  position: absolute;
  top: -34px;
  left: 2px;
  opacity: 0.55;
}

/* ============================================================
   Phone stage (right column)
   ============================================================ */
.hero__stage-col {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.stage {
  position: relative;
  width: calc(402px * var(--phone-scale));
  height: calc(874px * var(--phone-scale));
}
.stage__backdrop {
  position: absolute;
  width: calc(402px * var(--phone-scale) + 56px);
  height: calc(874px * var(--phone-scale) - 40px);
  border-radius: 48px;
  background: linear-gradient(160deg, var(--z-teal-50), #fff);
  transform: translate(28px, 18px);
  box-shadow: 0 30px 70px rgba(0, 55, 94, 0.1);
  z-index: 0;
}
.sparkle--tr {
  position: absolute;
  top: 8px;
  right: -68px;
  opacity: 0.7;
  z-index: 5;
}
.sparkle--bl {
  position: absolute;
  bottom: 60px;
  left: -16px;
  opacity: 0.5;
  z-index: 5;
}

/* scaled phone wrapper */
.phone-mock {
  position: relative;
  z-index: 2;
  width: calc(402px * var(--phone-scale));
  height: calc(874px * var(--phone-scale));
}
.phone-mock__scaler {
  transform: scale(var(--phone-scale));
  transform-origin: top left;
  width: 402px;
  height: 874px;
}

/* ── iOS device frame ── */
.ios-device {
  width: 402px;
  height: 874px;
  border-radius: 48px;
  overflow: hidden;
  position: relative;
  background: #f2f2f7;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.12);
  font-family: var(--z-font-ios);
  -webkit-font-smoothing: antialiased;
}
.ios-device__island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  border-radius: 24px;
  background: #000;
  z-index: 50;
}
.ios-device__teal-band {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: var(--z-teal);
  z-index: 5;
}
.ios-device__home {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 34px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 8px;
  pointer-events: none;
}
.ios-device__home span {
  width: 139px;
  height: 5px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.25);
}

/* ── iOS status bar (white glyphs on teal band) ── */
.ios-status {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  gap: 154px;
  align-items: center;
  justify-content: center;
  padding: 21px 24px 19px;
  width: 100%;
  color: #000;
  background-color: #fff;
}
.ios-status__time {
  flex: 1;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1.5px;
  font-family: -apple-system, "SF Pro", system-ui, var(--z-font-sans);
  font-weight: 600;
  font-size: 17px;
  line-height: 22px;
}
.ios-status__icons {
  flex: 1;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-top: 1px;
  padding-right: 1px;
}

/* ── Today screen content ── */
.today {
  position: absolute;
  inset: 0;
  padding-top: 54px;
  padding-bottom: 110px;
  overflow: hidden;
}
.app-header {
  background: var(--z-surface);
  border-radius: 0 0 30px 30px;
  padding: 14px 20px 18px;
  box-shadow: 0 4px 14px rgba(0, 55, 94, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.app-header__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--z-text-primary);
  line-height: 1.2;
}
.app-header__subtitle {
  font-size: 13px;
  color: var(--z-text-secondary);
  display: block;
  margin-top: 2px;
}
.app-header__actions {
  display: flex;
  gap: 8px;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--z-surface-tint);
  border: 0;
  color: var(--z-text-primary);
  display: grid;
  place-items: center;
}

.today__body {
  padding: 20px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.metric-card {
  background: var(--z-surface);
  border-radius: 16px;
  padding: 14px 16px 16px;
  box-shadow: var(--z-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 130px;
}
.metric-card__chip {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
}
.metric-card__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--z-text-primary);
  line-height: 1.2;
}
.metric-card__value {
  font-size: 14px;
  color: var(--z-text-primary);
  margin-top: 2px;
}
.metric-card__value--empty {
  color: var(--z-text-tertiary);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #333;
  letter-spacing: -0.23px;
}

.analyses {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.analysis-item {
  background: var(--z-surface);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--z-shadow-card);
  display: flex;
  gap: 14px;
  align-items: center;
}
.analysis-item__chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.analysis-item__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.analysis-item__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--z-text-primary);
}
.analysis-item__delta {
  font-size: 13px;
  color: #333;
}
.analysis-item__stamp {
  font-size: 12px;
  color: var(--z-text-tertiary);
}

.fab {
  position: absolute;
  right: 20px;
  bottom: 34px;
  z-index: 4;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--z-teal);
  color: #fff;
  border: 0;
  display: grid;
  place-items: center;
  box-shadow: var(--z-shadow-fab);
}

/* ── floating stat badges ── */
.float-badge {
  position: absolute;
  background: #fff;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--z-shadow-card-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 6;
}
.float-badge--health {
  top: 48px;
  left: -176px;
}
.float-badge--pulse {
  bottom: 128px;
  right: -176px;
}
.float-badge__meta {
  line-height: 1.25;
  text-align: left;
}
.float-badge__label {
  font-size: 12px;
  color: var(--z-text-tertiary);
}
.float-badge__value {
  font-size: 16px;
  font-weight: 700;
  color: var(--z-teal-deep);
}
.pulse-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--z-coral);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--footer-pad);
  border-top: 1px solid var(--z-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  width: 100%;
}
.footer__copy {
  font-size: 13px;
  color: var(--z-text-tertiary);
}
.footer__developer {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.footer__links {
  display: flex;
  align-items: center;
  gap: var(--footer-gap);
  flex-wrap: wrap;
}
.footer__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--z-text-secondary);
  text-decoration: none;
}
.footer__link:hover {
  color: var(--z-text-body);
}
.footer__link--brand {
  color: var(--z-teal-deep);
  font-weight: 600;
}

/* ============================================================
   Responsive — xl 1440+ · lg 1024+ · md 768+ · sm 360+
   ============================================================ */

/* xxl: 2000+ */
@media (min-width: 2000px) {
  :root {
    --nav-pad: 40px 60px;
    --nav-link-gap: 40px;
    --hero-pad: 16px 56px 80px;
    --eyebrow-mb: 40px;
    --h1-fs: 80px;
    --sub-fs: 40px;
    --desc-fs: 24px;
    --phone-scale: 0.9;
    --footer-pad: 40px 56px 52px;
  }
  .nav,
  .hero,
  .footer {
    max-width: 1600px;
  }
  .hero__copy {
    max-width: 720px;
  }
  .footer__link,
  .footer__copy,
  .nav__link,
  .eyebrow {
    font-size: 18px;
  }
  .store-btn__kicker {
    font-size: 15px;
  }
  .store-btn__glyph {
    width: 32px;
    height: 32px;
  }
  .store-btn__name {
    font-size: 20px;
  }
  .float-badge--health {
    top: 90px;
  }
  .float-badge--pulse {
    right: -120px;
  }
}

/* lg: 1024–1439 */
@media (max-width: 1439px) {
  :root {
    --nav-pad: 26px 40px;
    --nav-link-gap: 28px;
    --hero-pad: 8px 40px 60px;
    --eyebrow-mb: 24px;
    --h1-fs: 62px;
    --sub-fs: 26px;
    --desc-fs: 17px;
    --phone-scale: 0.58;
    --footer-pad: 22px 40px 36px;
  }
  .float-badge--health {
    top: 90px;
  }
  .float-badge--pulse {
    right: -120px;
  }
}

/* md: 768–1023 — single column, nav links & decoration hidden */
@media (max-width: 1023px) {
  :root {
    --nav-pad: 22px 32px;
    --hero-pad: 8px 32px 56px;
    --eyebrow-mb: 24px;
    --h1-fs: 54px;
    --sub-fs: 24px;
    --desc-fs: 16px;
    --phone-scale: 0.6;
    --footer-pad: 22px 32px 32px;
    --footer-gap: 24px;
  }
  .nav__links {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 56px;
    min-height: auto;
  }
  .hero__copy {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
  }
  .hero__desc {
    margin-left: auto;
    margin-right: auto;
  }
  .stores {
    justify-content: center;
  }
  .brand {
    margin: 0 auto;
  }
  .float-badge--pulse {
    right: -180px;
  }
}

/* sm: <768 (down to 360) — compact, full-width store buttons */
@media (max-width: 767px) {
  :root {
    --nav-pad: 18px 20px;
    --logo-size: 30px;
    --wordmark-fs: 19px;
    --hero-pad: 4px 20px 44px;
    --eyebrow-mb: 20px;
    --h1-fs: 38px;
    --sub-fs: 20px;
    --desc-fs: 15px;
    --phone-scale: 0.52;
    --footer-pad: 20px 20px 28px;
    --footer-gap: 20px;
  }
  .store-btn {
    flex: 1 1 100%;
    justify-content: center;
  }
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .hero__stage-col {
    display: none;
  }
}
