:root {
  /* Tuned to branding/logo-master.png (neon circuit blues) */
  --blue-900: #002080;
  --blue-700: #0060f0;
  --blue-500: #0090f0;
  --blue-neon: #00b0f0;
  --blue-100: #dff4ff;
  --white: #ffffff;
  --text: #001858;
  --muted: #3d5f99;
  --border: #a8cef5;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(0, 48, 192, 0.14);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--blue-100) 0%, var(--white) 240px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--blue-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--blue-900);
  text-decoration: none;
}

.logo-img {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 1rem;
  flex: 1;
}

.nav a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.nav a.active,
.nav a:hover {
  color: var(--blue-700);
}

.auth-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-email {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--white);
}

.hero {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 42%, var(--blue-neon) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  opacity: 0.85;
  margin: 0 0 0.5rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
}

.hero .lead {
  font-size: 1.1rem;
  max-width: 42rem;
  opacity: 0.95;
  margin: 0 0 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section {
  margin-bottom: 2.5rem;
}

.section-title {
  margin-bottom: 1rem;
}

.page-head h1 {
  margin: 0 0 0.5rem;
}

.lead.narrow {
  max-width: 42rem;
  color: var(--muted);
}

.cards-three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.about-block h2 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  color: var(--blue-900);
}

.about-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.about-links {
  text-align: center;
  color: var(--muted);
  margin: 0;
}

.about-sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 64, 208, 0.08);
}

.card h3 {
  margin-top: 0;
  color: var(--blue-900);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn-lg {
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
}

.btn-primary {
  background: var(--blue-700);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--blue-900);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.65);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--blue-700);
  border: none;
}

.inline-form {
  display: inline;
  margin: 0;
}

.app-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.app-tile {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.app-icon {
  display: block;
  margin-bottom: 0.75rem;
  width: auto;
  max-width: 100%;
  height: 64px;
  object-fit: contain;
}

.app-tile-wide .app-icon {
  max-width: 140px;
}


.app-blurb {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
}

.stack .steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--muted);
}

.auth-panel {
  display: flex;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.stack-form label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.stack-form input[type="email"],
.stack-form input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.auth-alt {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fde8e8;
  color: #8b1a1a;
  border: 1px solid #f5b8b8;
}

.alert-success {
  background: #e6f6ed;
  color: #0d5730;
  border: 1px solid #9eddb8;
}

.purchase-form fieldset {
  border: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.purchase-form legend {
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: 0.75rem;
}

.plan-grid {
  display: grid;
  gap: 0.75rem;
}

.plan-option input {
  position: absolute;
  opacity: 0;
}

.plan-option {
  position: relative;
  cursor: pointer;
}

.plan-card {
  display: block;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: border-color 0.15s;
}

.plan-option input:checked + .plan-card {
  border-color: var(--blue-500);
  background: var(--blue-100);
}

.plan-price {
  display: block;
  font-size: 1.25rem;
  color: var(--blue-700);
  margin: 0.25rem 0;
}

.plan-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.app-select {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.app-option img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.app-option input:checked + img + span,
.app-option:has(input:checked) {
  border-color: var(--blue-500);
  background: var(--blue-100);
}

@media (max-width: 640px) {
  .nav {
    width: 100%;
    order: 3;
  }
  .auth-links {
    margin-left: auto;
  }
}