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

:root {
  --bg: #03030b;
  --bg-elevated: rgba(8, 8, 26, 0.96);
  --bg-chip: rgba(255, 255, 255, 0.04);
  --border-subtle: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(0, 245, 255, 0.6);
  --text-main: #f6f6ff;
  --text-soft: #a7a7d2;
  --text-faded: #6b6a8e;
  --accent: #00f5ff;
  --accent-soft: rgba(0, 245, 255, 0.16);
  --danger-soft: rgba(255, 99, 132, 0.16);
  --danger: #ff5c7a;
  --radius-lg: 1.2rem;
  --radius-md: 0.9rem;
  --radius-pill: 999px;
  --shadow-soft: 0 20px 48px rgba(0, 0, 0, 0.9);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --max-width-wide: 1400px;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 0% 0%, #10234a 0, rgba(0, 0, 0, 0) 40%),
    radial-gradient(circle at 100% 0%, #3b1638 0, rgba(0, 0, 0, 0) 40%),
    radial-gradient(circle at 50% 120%, #102e35 0, rgba(0, 0, 0, 0) 45%),
    linear-gradient(to bottom, #02020a, #020208 55%, #000 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(to right, rgba(2, 2, 10, 0.96), rgba(2, 2, 6, 0.9));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0.6rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffb6c1 0, #ff4f7b 35%, #5420ff 70%, #05030a 100%);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-title {
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-subtitle {
  font-size: 0.76rem;
  color: var(--text-faded);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nav-link {
  border-radius: var(--radius-pill);
  padding: 0.28rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-decoration: none;
  transition:
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.nav-link:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.nav-link[data-current="true"] {
  background: radial-gradient(circle at top left, var(--accent-soft), rgba(0, 0, 0, 0.9));
  color: var(--text-main);
  border-color: var(--border-strong);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 1.4rem 1.6rem 1.8rem;
}

/* HERO generic */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.5fr);
  gap: 2.3rem;
  align-items: flex-start;
  margin-bottom: 1.8rem;
}

.hero-main {
  position: relative;
  padding: 1.5rem 1.7rem 1.6rem;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.18), rgba(8, 8, 26, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.hero-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.16), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(0, 245, 255, 0.16), transparent 60%);
  mix-blend-mode: soft-light;
  opacity: 0.9;
  pointer-events: none;
}

.hero-main-inner {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-faded);
  margin-bottom: 0.2rem;
}

.hero-title {
  font-size: clamp(1.8rem, 3.1vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.hero-title span {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-soft);
  max-width: 34rem;
}

.hero-meta {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.78rem;
}

.hero-pill {
  padding: 0.18rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
  color: var(--text-soft);
}

.hero-side {
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius-lg);
  background: rgba(6, 6, 20, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-soft);
}

.hero-side-title {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.4rem;
  color: var(--text-soft);
}

.hero-side p {
  font-size: 0.84rem;
  color: var(--text-soft);
  margin-bottom: 0.7rem;
}

.hero-side-list {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.hero-side-list li::before {
  content: "•";
  margin-right: 0.45rem;
  color: var(--accent);
}

/* INDEX PAGE CARDS */

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

.portal-card {
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
  overflow: hidden;
  transition:
    transform 150ms ease-out,
    box-shadow 150ms ease-out,
    border-color 150ms ease-out,
    background 150ms ease-out;
}

.portal-card::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 245, 255, 0.18), transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(255, 99, 132, 0.16), transparent 55%);
  opacity: 0;
  transition: opacity 150ms ease-out;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.portal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.95);
  border-color: var(--border-strong);
  background: radial-gradient(circle at top left, var(--accent-soft), rgba(8, 8, 26, 0.98));
}

.portal-card:hover::before {
  opacity: 1;
}

.portal-card-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-faded);
}

.portal-card-title {
  font-size: 1.02rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portal-card-body {
  font-size: 0.86rem;
  color: var(--text-soft);
}

.portal-card-meta {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: var(--text-faded);
}

.portal-pill {
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.6);
}

/* CONTRACTS PAGE */

.filters {
  margin-bottom: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

.filter-search {
  flex: 1 1 260px;
  min-width: 0;
}

.filter-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-faded);
  margin-bottom: 0.25rem;
}

.filter-input {
  width: 100%;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-main);
  font-size: 0.86rem;
  outline: none;
}

.filter-input::placeholder {
  color: var(--text-faded);
}

.filter-input:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(0, 245, 255, 0.5);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.chip {
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg-chip);
  color: var(--text-soft);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.chip[data-active="true"] {
  background: radial-gradient(circle at top left, var(--accent-soft), rgba(0, 0, 0, 0.92));
  color: var(--text-main);
  border-color: rgba(0, 245, 255, 0.7);
  transform: translateY(-1px);
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.persona-select {
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-soft);
  font-size: 0.8rem;
  outline: none;
  min-width: 160px;
}

.persona-select:focus {
  border-color: rgba(0, 245, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(0, 245, 255, 0.4);
}

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

.module-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.95rem 1.05rem 1.05rem;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition:
    transform 160ms ease-out,
    box-shadow 160ms ease-out,
    border-color 160ms ease-out,
    background 160ms ease-out,
    opacity 160ms ease-out;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 245, 255, 0.14), transparent 60%),
    radial-gradient(circle at 100% 0%, rgba(255, 99, 132, 0.15), transparent 55%);
  opacity: 0;
  transition: opacity 180ms ease-out;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 245, 255, 0.7);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.95);
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.12), rgba(6, 6, 20, 0.98));
}

.module-card:hover::before {
  opacity: 1;
}

.module-card[hidden] {
  display: none;
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.module-title {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.15rem;
}

.module-subtitle {
  font-size: 0.78rem;
  color: var(--text-faded);
}

.module-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.12rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-soft);
  background: rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.module-tagline {
  font-size: 0.84rem;
  color: var(--text-soft);
  margin-bottom: 0.45rem;
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.tag {
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.55);
  font-size: 0.72rem;
  color: var(--text-faded);
}

.tag--role {
  border-color: rgba(0, 245, 255, 0.7);
  color: var(--accent);
}

.tag--persona {
  border-color: rgba(255, 255, 255, 0.25);
}

.tag--import {
  border-style: dashed;
  font-style: italic;
}

.module-summary {
  font-size: 0.8rem;
  color: var(--text-soft);
  list-style: none;
  margin-bottom: 0.45rem;
  padding-left: 0.9rem;
}

.module-summary li::before {
  content: "▹";
  margin-left: -0.9rem;
  margin-right: 0.4rem;
  color: var(--accent);
}

.module-risk {
  font-size: 0.78rem;
  color: var(--danger);
  list-style: none;
  margin-bottom: 0.4rem;
  padding-left: 0.9rem;
  background: var(--danger-soft);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.5rem 0.35rem 1.05rem;
}

.module-risk li::before {
  content: "!";
  font-weight: 700;
  margin-left: -0.85rem;
  margin-right: 0.45rem;
  color: var(--danger);
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-faded);
  margin-bottom: 0.4rem;
}

.module-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.13rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.6);
}

.module-meta strong {
  font-weight: 500;
  color: var(--text-soft);
}

details.module-details {
  margin-top: 0.35rem;
  border-radius: var(--radius-md);
  background: rgba(2, 2, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.78rem;
  overflow: hidden;
}

details.module-details > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--text-soft);
}

details.module-details > summary::-webkit-details-marker {
  display: none;
}

.summary-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.summary-hint {
  font-size: 0.72rem;
  color: var(--text-faded);
}

.details-body {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.55rem 0.6rem 0.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr);
  gap: 0.6rem;
}

.details-column h4 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.3rem;
  color: var(--text-soft);
}

.details-list {
  list-style: none;
  padding-left: 0.85rem;
  color: var(--text-soft);
}

.details-list li::before {
  content: "›";
  margin-left: -0.75rem;
  margin-right: 0.35rem;
  color: var(--accent);
}

pre.code-block {
  max-height: 420px;
  overflow: auto;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-md);
  background: #050514;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  color: #f3f3ff;
}

.code-block code {
  white-space: pre;
}

/* GRAPH PAGE */

.graph-shell {
  position: relative;
  height: calc(100vh - 64px);
  margin-top: 1.1rem;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.18), rgba(0, 0, 0, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.graph-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.graph-legend {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  color: var(--text-soft);
  max-width: 320px;
}

.graph-legend h3 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.25rem;
}

.graph-legend ul {
  list-style: none;
  display: grid;
  gap: 0.2rem;
}

.graph-legend li::before {
  content: "•";
  margin-right: 0.45rem;
  color: var(--accent);
}

.graph-tooltip {
  position: absolute;
  pointer-events: none;
  padding: 0.35rem 0.55rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.74rem;
  color: var(--text-soft);
  max-width: 260px;
  display: none;
}

.graph-tooltip strong {
  color: var(--text-main);
}

.graph-node-label {
  font-size: 10px;
  fill: #f6f6ff;
  pointer-events: none;
}

/* DOCS PAGE */

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

.docs-card {
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-soft);
}

.docs-card h3 {
  font-size: 0.96rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.35rem;
}

.docs-card p {
  font-size: 0.86rem;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.docs-links {
  list-style: none;
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
}

.docs-links a {
  color: var(--accent);
  text-decoration: none;
}

.docs-links a:hover {
  text-decoration: underline;
}

/* FOOTER NOTE */

.footer-note {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-faded);
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .nav-inner {
    padding-inline: 1rem;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .main-inner {
    padding-inline: 1rem;
  }
  .graph-shell {
    height: calc(100vh - 80px);
  }
}

@media (max-width: 640px) {
  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .nav-links {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .hero-main {
    padding-inline: 1.2rem;
  }
}
