:root {
  --bg: #f3f6fa;
  --surface: rgba(255, 255, 255, 0.9);
  --text: #172033;
  --muted: #687386;
  --subtle: #8c96a7;
  --border: #dce3ed;
  --cobalt: #5366f2;
  --violet: #8b7cf6;
  --cyan: #3dbfd9;
  --green: #179b78;
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --shadow: 0 24px 70px rgba(51, 64, 92, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { min-width: 320px; scroll-padding-top: 6rem; background: var(--bg); }

body {
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--sans);
  color: var(--text);
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 86% 2%, rgba(83, 102, 242, 0.08), transparent 28rem),
    radial-gradient(circle at 4% 48%, rgba(61, 191, 217, 0.06), transparent 24rem),
    linear-gradient(160deg, #f8fafc 0%, var(--bg) 42%, #eef3f8 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  opacity: 0.58;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(94, 111, 144, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 111, 144, 0.035) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 72%);
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

body::after {
  position: fixed;
  top: 7rem;
  right: -18rem;
  z-index: -1;
  width: min(58rem, 76vw);
  aspect-ratio: 1;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(83, 102, 242, 0.08);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 8rem rgba(61, 191, 217, 0.018),
    inset 0 0 0 18rem rgba(83, 102, 242, 0.018);
}

a { color: inherit; text-decoration: none; }
button, a { touch-action: manipulation; }
::selection { color: #fff; background: rgba(83, 102, 242, 0.72); }
:focus-visible { outline: 3px solid rgba(83, 102, 242, 0.72); outline-offset: 3px; }

.display { font-family: var(--display); font-weight: 600; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cobalt);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.landing { min-height: 100dvh; }

.landing-top {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(220, 227, 237, 0.9);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.header-inner {
  display: flex;
  width: 100%;
  max-width: 90rem;
  height: 4.5rem;
  margin: 0 auto;
  padding: 0 2.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 0.9rem;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255,255,255,.26), transparent 45%),
    linear-gradient(135deg, var(--cobalt), var(--violet) 58%, var(--cyan));
  box-shadow: 0 10px 25px rgba(83, 102, 242, 0.24);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  width: 0.88rem;
  height: 0.88rem;
  content: "";
  border: 2px solid currentColor;
  border-radius: 0.28rem;
}

.brand-mark::before {
  top: 0.55rem;
  left: 0.55rem;
}

.brand-mark::after {
  right: 0.5rem;
  bottom: 0.5rem;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.landing-user { display: flex; align-items: center; gap: 0.75rem; }

.system-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid #d8eee7;
  border-radius: 999px;
  color: #147a60;
  background: #f3fbf8;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.system-pill::before { content: "✓"; font-weight: 900; }

.header-rule { width: 1px; height: 1.25rem; background: var(--border); }

.user-label {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #3f4a5e;
  font-size: 0.875rem;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  padding: 0 1rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
}

.btn-primary {
  border-color: var(--cobalt);
  color: #fff;
  background: var(--cobalt);
  width: 100%;
}

.btn-ghost {
  color: #586579;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 3px 12px rgba(23, 32, 51, 0.04);
}

.landing-main {
  width: 100%;
  max-width: 90rem;
  min-height: calc(100dvh - 4.5rem);
  margin: 0 auto;
  padding: 2rem 2.5rem 5rem;
}

.landing-main:has(.landing-anon) {
  display: grid;
  place-items: center;
}

.landing-anon {
  width: min(26rem, 100%);
  padding: 1.75rem;
  border: 1px solid rgba(210, 219, 232, 0.92);
  border-radius: 1.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.sub {
  color: var(--muted);
  margin-bottom: 1rem;
  text-align: center;
}

/* Launcher (authenticated) — Concept 2 composition */
.launcher-page {
  display: flex;
  max-width: 84rem;
  flex-direction: column;
  padding-top: 2.25rem;
  padding-bottom: 1.5rem;
}

.launcher-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(24rem, 0.95fr);
  align-items: center;
  gap: 2rem;
}

.launcher-copy h1 {
  max-width: 45rem;
  margin: 0;
  font-size: clamp(3rem, 5vw, 4.15rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.launcher-copy > p {
  max-width: 40rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.available {
  display: flex;
  margin-top: 1.5rem;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.available span {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--cobalt);
}

.signal {
  position: relative;
  min-height: 15.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 1.75rem;
  background-image:
    linear-gradient(rgba(83, 102, 242, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 102, 242, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(245, 246, 255, 0.58));
  background-size: 36px 36px, 36px 36px, auto;
  box-shadow: 0 24px 70px rgba(72, 88, 120, 0.09);
}

.signal-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4.25rem;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 1.35rem;
  background: linear-gradient(145deg, var(--cobalt), var(--violet));
  box-shadow:
    0 18px 35px rgba(83, 102, 242, 0.2),
    0 0 0 12px rgba(83, 102, 242, 0.06);
}

.signal-core::after {
  position: absolute;
  inset: 50%;
  width: 0.75rem;
  aspect-ratio: 1;
  content: "";
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(83, 102, 242, 0.14);
  border-radius: 50%;
  animation: breathe 7s ease-in-out infinite alternate;
}

.ring.one { width: 32%; }
.ring.two { width: 58%; border-color: rgba(61, 191, 217, 0.14); animation-delay: -2s; }
.ring.three { width: 82%; animation-delay: -4s; }

.node {
  position: absolute;
  width: 0.55rem;
  aspect-ratio: 1;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--cobalt);
  box-shadow: 0 4px 12px rgba(83, 102, 242, 0.2);
}

.node.one { top: 29%; left: 31%; }
.node.two { top: 41%; right: 18%; background: var(--cyan); }
.node.three { bottom: 20%; left: 44%; background: var(--violet); }

.signal-label {
  position: absolute;
  bottom: 1.25rem;
  left: 1.5rem;
  margin: 0;
  color: var(--subtle);
  font: 500 0.58rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.module-grid {
  display: grid;
  margin-top: 2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.module-card {
  position: relative;
  display: flex;
  min-height: 17rem;
  padding: 1.5rem;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(210, 219, 232, 0.95);
  border-radius: 1.75rem;
  text-align: left;
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(242, 244, 255, 0.96));
  box-shadow: var(--shadow);
  transition: transform 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
}

a.module-card:hover {
  transform: translateY(-4px);
  border-color: #c1cbfc;
  box-shadow: 0 28px 70px rgba(58, 73, 108, 0.15);
}

.module-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.module-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid #d9dffe;
  border-radius: 1rem;
  color: var(--cobalt);
  background: #eef0ff;
  font-size: 1.35rem;
  font-weight: 800;
}

.module-icon.geo {
  border-color: #d8edf2;
  color: #399eb3;
  background: #f0fafc;
}

.module-state {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0.42rem 0.75rem;
  border: 1px solid #d9dffe;
  border-radius: 999px;
  color: var(--cobalt);
  background: #eef0ff;
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.module-body {
  display: flex;
  margin-top: 1.8rem;
  flex: 1;
  flex-direction: column;
}

.module-title {
  margin: 0;
  font-size: 2.75rem;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.module-secondary .module-title { font-size: 2.35rem; }

.module-card.module-span {
  grid-column: 1 / -1;
  min-height: 12.5rem;
}

.module-span .module-body { margin-top: 1.15rem; }

.module-span .module-title { font-size: clamp(2rem, 3vw, 2.35rem); }

.module-span .module-desc { max-width: 44rem; }

.module-icon.news {
  border-color: #efe0cc;
  color: #a86b2d;
  background: #fbf6ef;
}

.module-desc {
  max-width: 33rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.module-action {
  display: inline-flex;
  margin-top: auto;
  padding-top: 1.25rem;
  align-items: center;
  gap: 0.5rem;
  color: var(--cobalt);
  font-size: 0.875rem;
  font-weight: 750;
}

.launcher-footer {
  display: flex;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--subtle);
  font-size: 0.75rem;
}

.launcher-footer .mono {
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@keyframes breathe {
  from { transform: translate(-50%, -50%) scale(0.98); opacity: 0.65; }
  to { transform: translate(-50%, -50%) scale(1.03); opacity: 1; }
}

@media (max-width: 900px) {
  .header-inner { padding: 0 2rem; }
  .landing-main { padding-right: 2rem; padding-left: 2rem; }
  .launcher-hero { grid-template-columns: 1fr; }
  .signal { min-height: 11rem; }
}

@media (max-width: 700px) {
  body::before { background-size: 52px 52px; }
  .header-inner { padding: 0 1.25rem; }
  .system-pill,
  .header-rule { display: none; }
  .landing-main { padding: 1.5rem 1.25rem 3.5rem; }
  .launcher-page { padding-top: 1.75rem; }
  .launcher-copy h1 { font-size: clamp(2.65rem, 12vw, 3.45rem); }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 16rem; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
