:root {
  color-scheme: light;
  --navy: #2f3b4a;
  --ink: #112743;
  --muted: #5c6e84;
  --blue: #2797e6;
  --blue-dark: #187fc5;
  --surface: #ffffff;
  --canvas: #f3f7fb;
  --line: #dce6f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 4%, rgba(39, 151, 230, .12), transparent 28rem),
    var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.install-shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: var(--navy);
  box-shadow: 0 9px 22px rgba(32, 58, 86, .18);
}

.brand-mark img { width: 30px; height: 33px; object-fit: contain; }
.brand-header strong { display: block; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; }
.brand-header small { display: block; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.trial-badge {
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid #bee1f7;
  border-radius: 999px;
  background: #edf8ff;
  color: #0875ba;
  font-size: 12px;
  font-weight: 750;
}

.hero {
  padding: clamp(46px, 9vw, 84px) 0 32px;
  text-align: center;
}

.eyebrow, .platform {
  margin: 0 0 8px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0 auto;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.04;
  letter-spacing: -.04em;
}

.intro {
  max-width: 620px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: clamp(16px, 2.5vw, 19px);
  line-height: 1.65;
}

.data-flow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 9px;
  margin: 28px auto 0;
  color: #344a65;
  font-size: 13px;
  font-weight: 750;
}

.server-pill {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.flow-arrow { color: var(--blue); font-size: 20px; }

.install-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.install-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  gap: 17px;
  padding: clamp(22px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 48px rgba(26, 55, 86, .08);
}

.install-card.is-recommended {
  border-color: #78c4f1;
  box-shadow: 0 20px 52px rgba(28, 133, 204, .16);
}

.install-card.is-recommended::before {
  align-self: flex-start;
  margin-bottom: -5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e9f7ff;
  color: #0875ba;
  content: "Recommended for this device";
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.platform-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: #eaf6fe;
  color: var(--blue-dark);
  font-size: 19px;
  font-weight: 850;
}

.install-card h2 { margin: 0; font-size: 23px; letter-spacing: -.02em; }
.install-card p:not(.platform) { margin: 9px 0 0; color: var(--muted); line-height: 1.55; }

.card-actions {
  display: grid;
  gap: 9px;
  margin-top: auto;
}

.card-actions .primary-button,
.card-actions .secondary-button {
  margin-top: 0;
}

.primary-button, .secondary-button {
  display: flex;
  min-height: 54px;
  margin-top: auto;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font-weight: 780;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.primary-button {
  flex-direction: column;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--blue), #218bd6);
  color: #fff;
  box-shadow: 0 10px 24px rgba(39, 151, 230, .24);
}

.primary-button small { margin-top: 2px; color: rgba(255,255,255,.78); font-size: 11px; font-weight: 600; }
.secondary-button { border: 1px solid #b9dbf1; background: #f2faff; color: var(--blue-dark); }
.single-line { flex-direction: row; }
.primary-button[disabled] { cursor: wait; opacity: .72; }
.primary-button:focus-visible, .secondary-button:focus-visible { outline: 3px solid rgba(39,151,230,.24); outline-offset: 3px; }

.browser-warning {
  padding: 10px 12px;
  border: 1px solid #f0c36e;
  border-radius: 10px;
  background: #fff8e7;
  color: #7b4f00 !important;
  font-weight: 700;
}

.installed-state {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid #a7ddc7;
  border-radius: 18px;
  background: #f0fbf6;
}

.installed-state[hidden] { display: none; }
.installed-state img { width: 56px; height: 56px; border-radius: 15px; }
.installed-state div { flex: 1; }
.installed-state strong, .installed-state span { display: block; }
.installed-state span { margin-top: 4px; color: var(--muted); }
.installed-state .secondary-button { min-width: 120px; margin-top: 0; }

.notice {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid #cfe5f4;
  border-left: 4px solid var(--blue);
  border-radius: 14px;
  background: #f7fcff;
}

.notice p { margin: 5px 0 0; color: var(--muted); line-height: 1.5; }

.instruction-overlay {
  position: fixed;
  z-index: 11000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(18, 32, 50, .62);
  backdrop-filter: blur(7px);
}

.instruction-overlay[hidden] { display: none; }
.instruction-open { overflow: hidden; }

.instruction-dialog {
  position: relative;
  width: min(520px, 100%);
  padding: clamp(24px, 6vw, 38px);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(13, 29, 48, .34);
}

.instruction-dialog > img { width: 72px; height: 72px; margin-bottom: 18px; border-radius: 18px; }
.instruction-dialog h2 { margin: 0; font-size: clamp(24px, 6vw, 32px); letter-spacing: -.025em; }
.instruction-dialog ol { margin: 22px 0; padding-left: 24px; color: #344a65; }
.instruction-dialog li { margin: 11px 0; padding-left: 5px; line-height: 1.45; }
.instruction-note { color: var(--muted); line-height: 1.55; }
.instruction-dialog .secondary-button { width: 100%; margin-top: 18px; }

.instruction-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #edf4fa;
  color: #36506d;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

@media (max-width: 880px) {
  .install-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .browser-card { grid-column: 1 / -1; min-height: 0; }
}

@media (max-width: 680px) {
  .install-shell { width: min(100% - 24px, 520px); padding-top: 18px; }
  .hero { padding-top: 42px; }
  .install-grid { grid-template-columns: 1fr; }
  .install-card { min-height: 0; }
  .browser-card { grid-column: auto; }
  .installed-state { align-items: flex-start; flex-wrap: wrap; }
  .installed-state .secondary-button { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .install-card { transition: transform .2s ease, box-shadow .2s ease; }
  .install-card:hover { transform: translateY(-2px); box-shadow: 0 22px 54px rgba(26, 55, 86, .12); }
}
