@font-face {
  font-family: "Montserrat";
  src: url("/montserrat-latin.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Montserrat", Arial, sans-serif;
  background: #05080d;
  color: #f5f7fb;
  letter-spacing: 0;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #05080d; }

body {
  min-width: 280px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background-color: #05080d;
  background-image: url("/primex-theme-bg.png");
  background-blend-mode: multiply;
  background-position: center;
  background-size: cover;
}

button { font: inherit; letter-spacing: 0; }
button { -webkit-tap-highlight-color: transparent; }
body.install-help-open { overflow: hidden; }

.install-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.install-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  border: 1px solid #29415f;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(7, 15, 27, .96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .48);
}

.brand-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px;
  border-bottom: 1px solid #1e3048;
}

.wordmark { width: 148px; height: auto; display: block; }
.brand-link { display: inline-flex; align-items: center; flex: 0 0 auto; }
.home-nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 26px); }
.home-nav a { color: #b7c7dc; text-decoration: none; font-size: 12px; font-weight: 750; transition: color .18s ease, background-color .18s ease; }
.home-nav a:hover { color: #fff; }
.home-nav .nav-create { min-height: 36px; display: inline-flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid #ccaa35; border-radius: 8px; color: #f8d575; background: rgba(204,170,53,.08); }
.home-nav .nav-create:hover { background: rgba(204,170,53,.18); }
.home-nav a:focus-visible, .brand-link:focus-visible, .hero-actions a:focus-visible { outline: 2px solid #efc45c; outline-offset: 4px; }

.secure-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8fa7c8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.secure-label svg,
footer svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #63d8c4;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.install-content {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 460px;
  padding: clamp(38px, 6vw, 72px);
  background: #091423;
}
.install-content::before,
.install-content::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}
.install-content::before {
  inset: -5%;
  background:
    linear-gradient(90deg, rgba(5, 12, 23, .96) 0%, rgba(5, 12, 23, .85) 42%, rgba(5, 12, 23, .22) 100%),
    url("/primex-theme-bg.png") center 59% / cover no-repeat;
  animation: hero-drift 20s ease-in-out infinite alternate;
}
.install-content::after {
  inset: 0;
  background: radial-gradient(circle at 75% 58%, rgba(17, 104, 210, .28), transparent 36%);
  animation: hero-glow 8s ease-in-out infinite alternate;
}
.install-copy { position: relative; z-index: 1; width: min(600px, 66%); }
@keyframes hero-drift {
  from { transform: translate3d(-1%, 0, 0) scale(1.02); }
  to { transform: translate3d(1%, -1%, 0) scale(1.08); }
}
@keyframes hero-glow {
  from { opacity: .38; transform: translate3d(-1%, 0, 0); }
  to { opacity: .76; transform: translate3d(1%, -1%, 0); }
}

.eyebrow {
  margin: 0 0 10px;
  color: #e1b64f;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.eyebrow-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #e1b64f; box-shadow: 0 0 0 5px rgba(225,182,79,.12); vertical-align: middle; }

h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(36px, 4.8vw, 58px);
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1.09;
}
h1 em { color: #e7c776; font-style: normal; }

.intro {
  max-width: 560px;
  margin: 22px 0 26px;
  color: #a8b7cc;
  font-size: 16px;
  line-height: 1.7;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hero-actions a { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; padding: 0 20px; border-radius: 9px; text-decoration: none; font-size: 12px; font-weight: 850; }
.hero-primary { color: #09111d; background: linear-gradient(105deg, #d5aa43, #f1d779); box-shadow: 0 12px 30px rgba(219,163,42,.18); }
.hero-primary:hover { background: #f6dc8a; }
.hero-secondary { border: 1px solid #35506e; color: #e4edf8; background: rgba(11,27,48,.66); }
.hero-secondary:hover { border-color: #7899bc; }
.hero-note { margin: 15px 0 0; color: #8293aa; font-size: 11px; }

.platform-section { padding: 46px clamp(24px, 5vw, 60px) 54px; border-top: 1px solid #1e3048; background: #081321; scroll-margin-top: 20px; }
.section-heading { max-width: 580px; margin-bottom: 27px; }
.section-heading h2, .start-copy h2, .install-zone h2 { margin: 0; color: #f5f7fb; font-size: clamp(24px, 3vw, 32px); line-height: 1.2; letter-spacing: -.035em; }
.section-heading > p:last-child, .start-copy > p:last-child, .install-zone-copy > p:last-child { margin: 10px 0 0; color: #91a7c3; font-size: 13px; line-height: 1.65; }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.feature-card { position: relative; min-height: 222px; display: flex; flex-direction: column; padding: 19px; border: 1px solid #29415f; border-radius: 13px; background: linear-gradient(150deg, #10233a, #0b1829 70%); }
.feature-card-upcoming { border-color: rgba(225,182,79,.38); background: linear-gradient(150deg, #1b2535, #101927 74%); }
.feature-badge { position: absolute; top: 22px; right: 16px; padding: 5px 7px; border: 1px solid rgba(225,182,79,.35); border-radius: 999px; color: #e6c779; background: rgba(225,182,79,.08); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.feature-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(225,182,79,.35); border-radius: 12px; color: #efd078; background: rgba(225,182,79,.1); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.feature-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feature-icon-signal { border-color: rgba(91,169,240,.35); color: #82c0f7; background: rgba(55,126,202,.13); }
.feature-icon-trade { border-color: rgba(240,168,99,.35); color: #f0bb78; background: rgba(216,123,56,.12); }
.feature-icon-auto { border-color: rgba(103,204,180,.35); color: #82d9c0; background: rgba(58,167,143,.12); }
.feature-card h3 { margin: 22px 0 9px; color: #fff; font-size: 16px; letter-spacing: -.02em; }
.feature-card p { margin: 0; color: #9eb1ca; font-size: 11px; line-height: 1.62; }
.feature-category { margin-top: auto; padding-top: 21px; color: #e1b64f; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

.start-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: 40px; align-items: center; padding: 48px clamp(24px, 5vw, 60px); border-top: 1px solid #1e3048; }
.start-copy { max-width: 540px; }
.start-steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid #29415f; }
.start-steps li { display: flex; align-items: center; gap: 18px; min-height: 54px; border-bottom: 1px solid #29415f; color: #dce7f6; font-size: 12px; }
.start-steps li span { color: #e1b64f; font-size: 11px; font-weight: 900; }

.install-zone { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: 36px; padding: 42px clamp(24px, 5vw, 60px); border-top: 1px solid #1e3048; background: radial-gradient(circle at 8% 0%, rgba(21,75,140,.28), transparent 46%), #0b192b; }
.install-zone-action { min-width: 0; }
.install-zone .install-button { max-width: 480px; }
.install-zone .install-status { max-width: 480px; min-height: 20px; margin-bottom: 18px; }

.install-button {
  width: 100%;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid #f0bd4e;
  border-radius: 6px;
  background: #e8b43f;
  color: #09111d;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(219, 163, 42, .18);
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.install-button:hover { background: #f3c85f; box-shadow: 0 14px 34px rgba(219, 163, 42, .28); }
.install-button:active { transform: translateY(1px); }
.install-button:focus-visible { outline: 3px solid rgba(86, 161, 255, .62); outline-offset: 3px; }
.install-button:disabled { cursor: default; opacity: .72; }
.install-button.is-installed { border-color: #52c7ae; background: #52c7ae; }

.install-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.install-status {
  min-height: 34px;
  margin: 10px 0 20px;
  color: #7f96b7;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.install-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.install-steps li {
  min-width: 0;
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid #1d304a;
  background: #0b1727;
}

.install-steps > li > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #d7a83f;
  border-radius: 50%;
  color: #efc45c;
  font-size: 11px;
  font-weight: 800;
}

.install-steps p { min-width: 0; margin: 1px 0 0; }
.install-steps strong { display: block; font-size: 11px; line-height: 1.35; }
.install-steps small { display: block; margin-top: 4px; color: #8194ae; font-size: 9px; line-height: 1.45; }

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 28px;
  border-top: 1px solid #1e3048;
  background: #081321;
}

footer p { margin: 0; }
footer strong, footer small { display: block; }
footer strong { color: #d5e0ee; font-size: 11px; }
footer small { margin-top: 3px; color: #7187a5; font-size: 10px; }

.install-help[hidden] { display: none; }

.install-help {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 18px;
}

.install-help-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0, 4, 10, .78);
  cursor: default;
}

.install-help-sheet {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100dvh - 36px);
  margin-inline: auto;
  overflow-y: auto;
  border: 1px solid #31547d;
  border-radius: 8px;
  background: #081321;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .7);
  animation: install-sheet-in .22s ease-out both;
}

.install-help-sheet > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid #20354f;
}

.install-help-sheet header p,
.install-help-sheet header h2 { margin: 0; }
.install-help-sheet header p { color: #e1b64f; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.install-help-sheet header h2 { margin-top: 4px; font-size: 17px; line-height: 1.25; }

.install-help-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #31547d;
  border-radius: 6px;
  color: #6faeff;
  background: #0b1c31;
}

.install-help-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.install-help-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #29415f;
  border-radius: 50%;
  background: #0b1727;
  color: #a8b7cc;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.install-help-copy {
  margin: 0;
  padding: 16px 18px 4px;
  color: #a8b7cc;
  font-size: 12px;
  line-height: 1.6;
}

.install-help-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px 18px 18px;
  list-style: none;
}

.install-help-steps li {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #20354f;
  background: #0b1727;
}

.install-help-steps li > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #e1b64f;
  border-radius: 50%;
  color: #efc45c;
  font-size: 11px;
  font-weight: 800;
}

.install-help-steps p { min-width: 0; margin: 0; }
.install-help-steps strong,
.install-help-steps small { display: block; }
.install-help-steps strong { font-size: 12px; }
.install-help-steps small { margin-top: 4px; color: #8194ae; font-size: 10px; line-height: 1.45; }

.install-help-done {
  width: calc(100% - 36px);
  min-height: 48px;
  margin: 0 18px 18px;
  border: 1px solid #e8b43f;
  border-radius: 6px;
  background: #e8b43f;
  color: #09111d;
  font-weight: 900;
  cursor: pointer;
}

@keyframes install-sheet-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .install-shell { padding: 0; }
  .install-panel { min-height: 100vh; min-height: 100dvh; border: 0; border-radius: 0; }
  .brand-row { min-height: 68px; padding: 16px 20px; }
  .wordmark { width: 124px; }
  .home-nav { gap: 12px; }
  .home-nav .nav-explore { display: none; }
  .install-content { min-height: 400px; padding: 48px 24px 54px; }
  .install-content::before { background: linear-gradient(90deg, rgba(5, 12, 23, .88), rgba(5, 12, 23, .55)), url("/primex-theme-bg.png") 78% center / auto 120% no-repeat; }
  .install-copy { width: 100%; max-width: 580px; text-align: left; }
  .eyebrow { margin-bottom: 8px; }
  h1 { max-width: 480px; font-size: clamp(35px, 7vw, 46px); }
  .intro { max-width: 520px; margin: 16px 0 22px; font-size: 13px; line-height: 1.6; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-card { min-height: 195px; }
  .start-section, .install-zone { grid-template-columns: 1fr; gap: 26px; }
  .install-zone .install-status { text-align: left; }
  .install-button { min-height: 52px; }
  .install-status { margin-bottom: 14px; }
  .install-steps { text-align: left; }
  footer { justify-content: flex-start; padding: 20px 24px max(20px, env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .brand-row { gap: 10px; padding-inline: 18px; }
  .wordmark { width: 116px; }
  .home-nav > a:not(.nav-create) { display: none; }
  .home-nav .nav-create { padding-inline: 10px; font-size: 10px; }
  .install-content { min-height: 390px; padding: 42px 20px 48px; }
  h1 { font-size: clamp(32px, 9vw, 39px); }
  .hero-actions a { flex: 1 1 auto; }
  .platform-section, .start-section, .install-zone { padding: 34px 20px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 0; }
  .feature-card h3 { margin-top: 20px; }
  .feature-category { padding-top: 20px; }
  .install-steps { grid-template-columns: 1fr; }
  .install-steps li { min-height: 56px; align-items: center; }
  .install-steps small { font-size: 10px; }
  .install-help { padding: 10px; }
  .install-help-sheet { max-height: calc(100dvh - 20px); }
}

@media (max-height: 690px) and (max-width: 720px) {
  .install-content { padding-top: 30px; }
}

@media (min-width: 721px) and (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-card { min-height: 186px; }
  .install-zone { grid-template-columns: 1fr; }
}

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