/* SOL Hub — Get Key page. Colors from the "Mono" preset in part1.lua */
:root {
  --bg:        rgb(16, 16, 17);
  --surface:   rgb(20, 20, 21);
  --surface-2: rgb(25, 25, 26);
  --stroke:    rgb(40, 40, 42);
  --stroke-2:  rgb(38, 38, 40);
  --muted-2:   rgb(84, 84, 88);
  --accent:    rgb(236, 236, 240);
  --on-accent: rgb(20, 20, 22);
  --text:      rgb(234, 234, 236);
  --muted:     rgb(128, 128, 134);
  --success:   rgb(110, 220, 150);
  --radius-card: 28px;
  --radius-btn: 16px;
  /* shared top bar height (includes the notch / safe area) */
  --topbar-h: env(safe-area-inset-top, 0px);
  /* Montserrat (Google Fonts) first, then a solid system stack so the page looks right offline */
  --font: "Montserrat", "Gotham", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

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

html {
  overflow-x: hidden; /* propagates to the viewport; keeps the sticky top bar working */
  scroll-behavior: smooth;
  background: #20262e;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Soft blurred backdrop, like the hub preview (bluish top-left, greenish bottom-right) */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 12% 10%, rgba(92, 110, 135, 0.55), transparent 70%),
    radial-gradient(55% 50% at 92% 95%, rgba(78, 96, 72, 0.45), transparent 70%),
    linear-gradient(160deg, #2a323d 0%, #1f252e 50%, #232a26 100%);
}

/* Frosted glass card */
.card {
  position: relative;
  width: 100%;
  margin: 0 auto;
  max-width: 440px;
  padding: 44px 36px 22px;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(34, 34, 36, 0.92) 0%, rgba(16, 16, 17, 0.94) 55%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  overflow: hidden;
  animation: card-in 0.5s cubic-bezier(.2, .8, .2, 1) both;
}

/* Logo tile with subtle concentric rings */
.logo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
}
.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.ring-1 { width: 168px; height: 168px; }
.ring-2 { width: 260px; height: 260px; border-color: rgba(255, 255, 255, 0.035); }
.ring-3 { width: 360px; height: 360px; border-color: rgba(255, 255, 255, 0.022); }
/* very faint halo behind the tile (kept subtle on purpose) */
.logo-wrap::before {
  content: "";
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 236, 240, 0.07) 0%, transparent 65%);
  pointer-events: none;
}
.logo {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  color: var(--on-accent);
  background: linear-gradient(180deg, #f2f2f5 0%, #bdbdc2 100%);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  user-select: none;
}

.title {
  position: relative;
  margin: 0;
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}
.subtitle {
  position: relative;
  margin: 8px 0 30px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

/* Primary button — same look as "Verify key" in the hub */
.btn-primary {
  position: relative;
  width: 100%;
  min-height: 60px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-btn);
  background: linear-gradient(180deg, #f0f0f3 0%, #c4c4c9 100%);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
  touch-action: manipulation;
}
.btn-primary:hover { filter: brightness(1.04); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), inset 0 1px 0 #fff; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn-icon { display: inline-flex; }

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(20, 20, 22, 0.2);
  border-top-color: var(--on-accent);
  animation: spin .7s linear infinite;
}
.btn-primary.is-loading { cursor: progress; filter: brightness(0.94); }
.btn-primary.is-loading .btn-icon { display: none; }
.btn-primary.is-loading .spinner { display: inline-block; }

.status {
  min-height: 20px;
  margin: 12px 0 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.status.is-error { color: rgb(240, 110, 110); }

.divider {
  height: 1px;
  margin: 10px 0 16px;
  background: linear-gradient(90deg, transparent, var(--stroke), transparent);
}
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(110, 220, 150, 0.14);
  flex: none;
}

.footer.is-offline { color: rgb(240, 110, 110); }
.footer.is-offline .dot {
  background: rgb(240, 110, 110);
  box-shadow: 0 0 0 3px rgba(240, 110, 110, 0.14);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Page layout ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  border-radius: 12px;
}
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: var(--on-accent);
  background: linear-gradient(180deg, #f2f2f5 0%, #bdbdc2 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 3px 10px rgba(0, 0, 0, 0.35);
}
.badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--topbar-h) max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
}
.hero {
  min-height: calc(100vh - var(--topbar-h));
  min-height: calc(100dvh - var(--topbar-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
  scroll-margin-top: var(--topbar-h);
}
.hero:focus { outline: none;
}

.section { padding: 28px 0; }
.section-title {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* shared glass surface for small cards */
.glass {
  background: linear-gradient(180deg, rgba(30, 30, 32, 0.9), rgba(18, 18, 19, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.steps, .features, .chips {
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps, .features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.step { padding: 20px; min-width: 0; }
.step-icon, .feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.step-num {
  display: block;
  margin: 14px 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.step-title, .feature-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.step-text, .feature-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  min-width: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.chips-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.chips-label-muted { margin-top: 18px; color: var(--muted-2); }
/* Untested executors: visually toned down */
.chip-untested {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.07);
}
.chip-untested .chip-dot { background: var(--muted-2); opacity: 1; }
.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.85;
}

.faq { display: grid; gap: 10px; }
.faq-item { border-radius: 16px; overflow: hidden; }
.faq-item summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 14px 52px 14px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  border-radius: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-item summary:hover { background: rgba(255, 255, 255, 0.025); }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq-item p {
  margin: 0;
  padding: 0 18px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.faq-item strong { color: var(--text); }

.site-footer {
  padding: 24px 16px max(28px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
  color: var(--muted-2);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.site-footer p { margin: 0; }

/* Scroll reveal: only hidden when JS is on (html.js), so content is visible without JS */
/* Fallback: if the observer never runs, sections still appear after 2 s.
   Once the observer is active (html.io), the fallback is turned off so normal scroll reveal works. */
.reveal { opacity: 1; }
.io .reveal.will-reveal { opacity: 0; transform: translateY(14px); }
.io .reveal.will-reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
}

@media (max-width: 760px) {
  .steps, .features { grid-template-columns: minmax(0, 1fr); }
}

/* Mobile */
@media (max-width: 480px) {
  .card { padding: 36px 22px 18px; border-radius: 24px; }
  .logo-wrap, .logo { width: 84px; height: 84px; }
  .logo { font-size: 40px; border-radius: 21px; }
  .subtitle { font-size: 14px; margin-bottom: 26px; }
  .btn-primary { min-height: 56px; font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* keep a visible (static) loading indicator */
  .spinner { animation: none !important; border-color: rgba(20, 20, 22, 0.5); }
}
