:root {
  --app-header-height: 74px;
  --app-purple: #935bfc;
  --app-purple-dark: #7646df;
  --app-ink: #16161d;
  --app-muted: #676778;
}

[hidden] { display: none !important; }

.download-page {
  min-height: 100vh;
  padding-top: var(--app-header-height);
  background: #f5f3f8;
}

.download-page .app-site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
}

.download-page .word-logo {
  display: block;
  width: auto;
  height: 31px;
  object-fit: contain;
}

.download-page .brand-word { display: none; }

.download-page .nav { direction: ltr; }

.download-page .app-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.download-page .app-language-select {
  flex: 0 1 138px;
  width: 138px;
  height: 38px;
}

html[dir="rtl"] .download-page .app-language-select,
html[dir="rtl"] .download-page .back-link {
  direction: rtl;
}

.download-hero {
  min-height: calc(100vh - var(--app-header-height));
  padding: 74px 16px 96px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 8%, rgba(147, 91, 252, 0.17), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(8, 198, 204, 0.13), transparent 25%),
    linear-gradient(180deg, #fbfbff 0%, #f2eff7 100%);
}

.download-heading,
.ios-intro {
  width: min(760px, 100%);
  margin: 0 auto;
  text-align: center;
}

.download-heading .eyebrow,
.ios-intro .eyebrow { margin-bottom: 14px; color: var(--app-purple); }

.download-heading h1,
.ios-intro h1 {
  margin-bottom: 18px;
  color: var(--app-ink);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.download-heading > p:last-child,
.ios-intro > p:last-child {
  margin-bottom: 0;
  color: var(--app-muted);
  font-size: 17px;
  line-height: 1.7;
}

.platform-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 34px auto 0;
}

.platform-button {
  display: flex;
  align-items: center;
  width: min(228px, calc(50vw - 26px));
  min-height: 72px;
  padding: 10px 22px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  color: #fff;
  background: #16161d;
  box-shadow: 0 15px 34px rgba(22, 22, 29, 0.18);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.platform-button:hover { transform: translateY(-2px); background: #24242d; box-shadow: 0 19px 40px rgba(22, 22, 29, 0.22); }
.platform-button:active { transform: translateY(0) scale(.985); }
.platform-button.is-launching { opacity: .8; }
.platform-button:focus-visible,
.version-button:focus-visible,
.store-choice:focus-visible,
.text-button:focus-visible,
.back-link:focus-visible,
.app-language-select:focus-visible,
.testflight-guide a:focus-visible { outline: 3px solid rgba(147, 91, 252, .34); outline-offset: 4px; }

.platform-button img { flex: 0 0 auto; width: 48px; height: 48px; margin-right: 14px; object-fit: contain; }
.platform-button span { display: grid; gap: 2px; text-align: left; }
.platform-button small { color: rgba(255,255,255,.68); font-size: 11px; letter-spacing: .08em; }
.platform-button strong { font-size: 18px; letter-spacing: .01em; }

.android-panel {
  width: min(560px, 100%);
  margin: 24px auto 0;
  padding: 20px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 20px;
  background: rgba(255,255,255,.74);
  box-shadow: 0 18px 45px rgba(42,36,68,.09);
  backdrop-filter: blur(18px);
}

.device-info-card { color: #414150; font-size: 14px; font-weight: 700; }
.launch-status { min-height: 20px; margin: 8px 0 0; color: var(--app-muted); font-size: 13px; }
.text-button { padding: 8px 12px; color: var(--app-purple-dark); font: inherit; font-size: 14px; font-weight: 750; background: transparent; border: 0; cursor: pointer; }
.store-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.store-choice { display: grid; min-height: 46px; place-items: center; padding: 9px 12px; border: 1px solid rgba(22,22,29,.1); border-radius: 12px; color: #34343f; background: #fff; font-size: 14px; font-weight: 750; }
.fallback-panel { margin-top: 14px; padding: 13px 14px; border: 1px solid rgba(22,22,29,.1); border-radius: 12px; color: #555564; background: rgba(255,255,255,.78); font-size: 13px; line-height: 1.55; }
.fallback-panel.emphasized { border-color: rgba(147,91,252,.3); background: #faf7ff; }
.fallback-panel p { margin-bottom: 5px; }
.fallback-link { color: var(--app-purple-dark); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.browser-tip {
  position: fixed;
  z-index: 60;
  top: var(--app-header-height);
  left: 50%;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(680px, calc(100vw - 24px));
  padding: 15px 18px;
  color: #594b37;
  border: 1px solid rgba(255,145,77,.55);
  border-radius: 0 0 16px 16px;
  background: linear-gradient(135deg, #ffd29f, #fff0bb);
  box-shadow: 0 12px 32px rgba(82,55,22,.16);
  transform: translateX(-50%);
}

.browser-tip.show { display: flex; }
.browser-tip div { display: grid; gap: 3px; font-size: 14px; line-height: 1.45; }
.tip-arrow { font-size: 27px; }

.app-preview { display: grid; place-items: center; margin: 70px auto 0; }
.preview-kicker { margin-bottom: 24px; color: var(--app-muted); font-size: 13px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.download-page .app-preview .phone-shell { width: min(390px, calc(100vw - 44px)); box-shadow: 0 38px 92px rgba(42,39,62,.18); }
.download-page .app-preview .metric-card { pointer-events: none; }

.ios-main {
  min-height: calc(100vh - var(--app-header-height));
  padding: 70px 16px 92px;
  background:
    radial-gradient(circle at 18% 12%, rgba(147,91,252,.17), transparent 28%),
    radial-gradient(circle at 84% 15%, rgba(8,198,204,.13), transparent 26%),
    linear-gradient(180deg,#fbfbff 0%,#f2eff7 100%);
}

.back-link { color: #444450; font-size: 14px; font-weight: 720; }
.ios-intro { margin-bottom: 38px; }
.version-grid { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: 22px; width: min(1040px, 100%); margin: 0 auto; align-items: stretch; }

.version-card {
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 26px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 22px 60px rgba(42,36,68,.1);
  backdrop-filter: blur(20px);
}

.version-card-testflight { border-color: rgba(147,91,252,.22); background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(246,240,255,.86)); }
.version-icon { display: grid; width: 58px; height: 58px; margin-bottom: 22px; place-items: center; border-radius: 17px; background: var(--app-ink); }
.version-icon img { width: 42px; height: 42px; object-fit: contain; }
.version-label { margin-bottom: 8px; color: var(--app-purple); font-size: 12px; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.version-card h2 { margin-bottom: 14px; color: var(--app-ink); font-size: clamp(24px,3vw,32px); line-height: 1.18; }
.version-description { color: var(--app-muted); font-size: 15px; line-height: 1.75; }
.version-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.experience-badge { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; color: #fff; background: var(--app-purple); font-size: 12px; font-weight: 800; }
.feature-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 24px; padding: 0; list-style: none; }
.feature-list li { padding: 7px 11px; border: 1px solid rgba(147,91,252,.16); border-radius: 999px; color: #65449f; background: rgba(147,91,252,.07); font-size: 12px; font-weight: 740; }
.version-button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; margin-top: auto; padding: 0 20px; border-radius: 999px; color: #fff; background: var(--app-ink); font-size: 15px; font-weight: 800; }
.version-button-accent { background: linear-gradient(135deg,var(--app-purple),var(--app-purple-dark)); box-shadow: 0 12px 28px rgba(147,91,252,.25); }

.testflight-guide { margin-bottom: 24px; padding: 18px; border: 1px solid rgba(22,22,29,.08); border-radius: 18px; background: rgba(255,255,255,.72); }
.guide-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.guide-heading strong { font-size: 15px; }
.guide-heading span { color: var(--app-muted); font-size: 12px; }
.testflight-guide ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.testflight-guide li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 58px; padding: 9px 10px; border-radius: 13px; background: #fff; }
.step-number { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: var(--app-purple-dark); background: rgba(147,91,252,.1); font-size: 12px; font-weight: 850; }
.testflight-guide li div { display: grid; gap: 3px; }
.testflight-guide li strong { font-size: 14px; }
.testflight-guide li small { color: var(--app-muted); font-size: 11px; }
.testflight-guide li a { padding: 7px 10px; border-radius: 999px; color: var(--app-purple-dark); background: rgba(147,91,252,.1); font-size: 12px; font-weight: 800; }

@media (max-width: 760px) {
  .download-hero, .ios-main { padding-top: 52px; }
  .version-grid { grid-template-columns: 1fr; }
  .version-card { padding: 24px; }
  .download-page .app-preview .phone-dynamic {
    width: 114.3%;
    height: 114.3%;
    transform: scale(.875);
    transform-origin: top left;
  }
}

@media (max-width: 520px) {
  :root { --app-header-height: 64px; }
  .download-page .nav { width: calc(100vw - 28px); min-height: 64px; }
  .download-page .word-logo { height: 27px; }
  .download-heading h1, .ios-intro h1 { font-size: 34px; }
  .platform-actions { gap: 10px; }
  .platform-button { min-height: 64px; padding: 8px 12px; border-radius: 14px; }
  .platform-button img { width: 40px; height: 40px; margin-right: 8px; }
  .platform-button strong { font-size: 15px; }
  .store-choices { grid-template-columns: 1fr; }
  .app-preview { margin-top: 52px; }
  .back-link { font-size: 13px; }
  .download-page .app-header-actions { gap: 8px; }
  .download-page .app-language-select { flex: 0 0 clamp(112px, 34vw, 126px); width: clamp(112px, 34vw, 126px); max-width: 126px; }
  .version-card-heading { display: block; }
  .experience-badge { display: inline-flex; margin-bottom: 14px; }
  .guide-heading { align-items: flex-start; flex-direction: column; }
}

.download-page .phone-shell--download-preview {
  width: min(390px, calc(100vw - 44px));
  aspect-ratio: 512 / 1176;
}

.download-page .app-preview .phone-dynamic--download-preview {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  transform: none;
  padding: 5.3% 3.2% 4%;
}

.download-page .phone-dynamic--download-preview .metric-grid {
  min-height: 0;
  padding-bottom: 7.5%;
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.download-page .phone-dynamic--download-preview .metric-card {
  min-height: 0;
  height: 100%;
}

.download-page .phone-dynamic--download-preview .sound-card .metric-label {
  margin-top: 6px;
}

@media (max-width: 370px) {
  .platform-actions { flex-direction: column; align-items: center; }
  .platform-button { width: min(230px, 100%); }
  .testflight-guide li { grid-template-columns: auto 1fr; }
  .testflight-guide li a { grid-column: 2; justify-self: start; }
  .download-page .phone-dynamic--download-preview .metric-label { font-size: 14px; }
}

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