:root {
  color-scheme: dark;
  --bg: #08090c;
  --panel: rgba(24, 27, 35, 0.75);
  --panel-strong: rgba(36, 40, 52, 0.95);
  --fg: #e8ebf4;
  --muted: #a2a8bf;
  --accent: #7aa2f7;
  --accent-soft: rgba(122, 162, 247, 0.1);
  --border: rgba(122, 162, 247, 0.15);
  --ok: #3dd68c;
  --error: #ff6b7a;
  --code-bg: rgba(15, 18, 26, 0.85);
  --ghost: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 40px rgba(4, 6, 12, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont;
  background: radial-gradient(circle at 0 0, rgba(83, 101, 198, 0.25), rgba(8, 9, 12, 0.95));
  color: var(--fg);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  border: none;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #05070c;
  font-weight: 600;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(122, 162, 247, 0.35);
}

.button--outline {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}

.button--outline:hover {
  background: var(--accent-soft);
}

.button--ghost {
  background: rgba(122, 162, 247, 0.12);
  border-color: rgba(122, 162, 247, 0.35);
  color: var(--fg);
}

.button--ghost:hover {
  background: rgba(122, 162, 247, 0.22);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2rem;
  padding: 4rem clamp(2rem, 5vw, 6rem) 2rem;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(122, 162, 247, 0.18), transparent 45%);
  pointer-events: none;
  opacity: 0.7;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 4vw, 3.6rem);
  margin: 0;
}

.hero p {
  color: var(--muted);
  max-width: 700px;
  line-height: 1.6;
}

.hero__stats {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 1.5rem;
}

.hero__stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.3rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero__stat-label {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__stat-description {
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.55;
}

.hero__cta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.hero__card {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.6rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 320px;
}

.hero__card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.hero__card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.hero__response {
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: rgba(8, 9, 12, 0.65);
  padding: 0.9rem;
  min-height: 3rem;
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  overflow-x: auto;
  font-size: 0.85rem;
  color: var(--accent);
}

.page {
  padding: 1rem clamp(2rem, 5vw, 6rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.highlights {
  display: grid;
  gap: 2.5rem;
}

.section-heading {
  display: grid;
  gap: 0.6rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.2rem);
}

.section-heading p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  line-height: 1.6;
}

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

.highlight-card {
  background: var(--panel);
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  padding: 1.8rem 1.6rem;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  box-shadow: var(--shadow);
}

.highlight-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.highlight-card__copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.highlight-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: #c4c9da;
  font-size: 0.95rem;
}

.highlight-card__cta {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.highlight-card__cta::after {
  content: "→";
  font-size: 1rem;
  transition: transform 120ms ease;
}

.highlight-card__cta:hover::after {
  transform: translateX(4px);
}

.showcase {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.showcase__nav {
  background: var(--panel);
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  padding: 1.5rem;
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - 4rem);
  overflow: auto;
}

.showcase__nav h2 {
  margin: 0;
  font-size: 1.2rem;
}

.showcase__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.showcase__nav-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid transparent;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  transition: border 120ms ease, background 120ms ease, color 120ms ease;
}

.showcase__nav-item small {
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.showcase__nav-item:hover {
  color: var(--fg);
  border-color: var(--border);
  background: rgba(122, 162, 247, 0.1);
}

.showcase__nav-item--active {
  border-color: rgba(122, 162, 247, 0.4);
  background: rgba(122, 162, 247, 0.16);
  color: var(--fg);
}

.showcase__card {
  background: var(--panel-strong);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.demo-card {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2.4rem;
}

.demo-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.demo-card__header h2 {
  margin: 0;
  font-size: 1.8rem;
}

.demo-card__header p {
  margin: 0;
  color: var(--muted);
}

.demo-card__overview {
  display: grid;
  gap: 1.8rem;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: start;
}

.demo-card__meta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.demo-card__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.demo-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(122, 162, 247, 0.2);
  color: var(--fg);
  font-size: 0.8rem;
  border: 1px solid rgba(122, 162, 247, 0.35);
}

.pill--muted {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.pill--ghost {
  background: var(--ghost);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--fg);
}

.demo-card__summary h3,
.demo-card__code h3,
.demo-card__result h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.demo-card__summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: #c5cae4;
  line-height: 1.5;
}

.demo-card__panel {
  background: rgba(8, 9, 12, 0.45);
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.demo-card__panel > summary {
  margin: 0;
  list-style: none;
  cursor: pointer;
  padding: 1.2rem 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.demo-card__panel[open] > summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

pre {
  margin: 0;
  padding: 1rem 1.2rem;
  background: linear-gradient(145deg, #0d0f17 0%, #161822 100%);
  border-radius: 1rem;
  overflow-x: auto;
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  border: 1px solid rgba(122, 162, 247, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.code-block {
  position: relative;
  padding: 0;
  border-radius: 1.15rem;
  background: linear-gradient(145deg, #0d0f17 0%, #13151f 50%, #0d0f17 100%);
  border: 1px solid rgba(122, 162, 247, 0.25);
  box-shadow: 0 20px 40px rgba(2, 4, 9, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.code-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(122, 162, 247, 0.22), transparent 45%);
  opacity: 0.8;
  pointer-events: none;
}

.code-block::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(90deg, rgba(122, 162, 247, 0.18), rgba(36, 173, 255, 0.18));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.code-block code {
  position: relative;
  display: block;
  padding: 2.6rem 1.8rem 1.6rem;
  background: transparent;
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.92rem;
  color: #e4e9ff;
  line-height: 1.75;
  tab-size: 2;
  white-space: pre;
  font-weight: 400;
}

.code-block code::before {
  content: "typelang.ts";
  position: absolute;
  top: 8px;
  left: 18px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(230, 235, 255, 0.6);
}

.code-block code::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 18px;
  width: 42px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: -18px 0 0 rgba(255, 255, 255, 0.12), -36px 0 0 rgba(255, 255, 255, 0.16);
}

/* Enhanced syntax highlighting - High contrast, vibrant colors */

.token.keyword {
  color: #d78fd8;
  font-weight: 600;
}

.token.function {
  color: #7dcfff;
  font-weight: 500;
}

.token.effect {
  color: #ff7a93;
  font-weight: 500;
}

.token.identifier {
  color: #7ce6e6;
}

.token.number {
  color: #ff9e64;
  font-weight: 500;
}

.token.literal {
  color: #ffd966;
  font-weight: 500;
}

.token.operator {
  color: #89ddff;
  font-weight: 500;
}

.token.string {
  color: #9ece6a;
}

.token.callable {
  color: #7dcfff;
  font-weight: 500;
}

.token.comment {
  color: #565f89;
  font-style: italic;
  opacity: 0.9;
}

.token.interpolation {
  color: #ff9e64;
  font-weight: 600;
  background: rgba(255, 158, 100, 0.1);
  padding: 0 0.2em;
  border-radius: 0.2em;
}

.token.type {
  color: #2ac3de;
  font-weight: 500;
}

.token.property {
  color: #73daca;
}

.token.punctuation {
  color: #a9b1d6;
}

.token.constant {
  color: #ff9e64;
  font-weight: 600;
}

.demo-card__result {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.demo-run {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(8, 9, 12, 0.55);
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.8rem;
}

.demo-run--pending {
  justify-content: center;
  background: rgba(8, 9, 12, 0.45);
  border-style: dashed;
  border-color: rgba(122, 162, 247, 0.25);
}

.demo-run__pending {
  display: grid;
  gap: 0.75rem;
}

.demo-run__pending h4 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-run__pending p {
  margin: 0;
  color: #c5cae4;
  line-height: 1.5;
  font-size: 0.95rem;
}

.demo-run__pending-handlers {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-run__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-run__status--ok {
  border-color: rgba(61, 214, 140, 0.55);
  background: rgba(61, 214, 140, 0.08);
  color: var(--fg);
}

.demo-run__status--error {
  border-color: rgba(255, 107, 122, 0.6);
  background: rgba(255, 107, 122, 0.1);
}

.demo-run__status strong {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.demo-run__elapsed {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
}

.demo-run__glance {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  align-items: start;
}

.demo-run__glance ul {
  margin: 0;
  padding: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: #c5cae4;
}

.demo-run__artifacts {
  display: grid;
  gap: 0.75rem;
}

.artifact {
  display: grid;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.9rem 1rem;
}

.artifact__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.artifact__value {
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.85rem;
}

.demo-run__details {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.demo-run__details > summary {
  margin: 0;
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
}

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

.demo-run__details[open] > summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.demo-run__details-grid {
  display: grid;
  gap: 1.1rem;
  padding: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.demo-run__panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem 1.1rem;
}

.demo-run__panel h5 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-run__panel-body {
  display: grid;
  gap: 0.6rem;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.timeline-list li {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.75rem 0.9rem;
  display: grid;
  gap: 0.25rem;
}

.timeline__label {
  font-size: 0.85rem;
  font-weight: 600;
}

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

.timeline__empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.demo-run__console-empty,
.demo-run__state-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.demo-run__log strong,
.demo-run__warn strong,
.demo-run__error strong {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.demo-run__warn ul {
  color: #f7d07a;
}

.demo-run__error ul {
  color: var(--error);
}

.demo-card__empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.echo-block,
.time-block {
  background: rgba(8, 9, 12, 0.7);
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem;
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.9rem;
}

.footer {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

code {
  font-family:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

@media (max-width: 968px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero__cta {
    justify-content: flex-start;
  }
  .demo-card__overview {
    grid-template-columns: 1fr;
  }
  .showcase {
    grid-template-columns: 1fr;
  }
  .showcase__nav {
    position: static;
    max-height: none;
  }
  .demo-run__glance {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 3rem 1.5rem 1.5rem;
  }
  .page {
    padding: 1.5rem;
  }
  .demo-card {
    padding: 1.6rem;
  }
  .hero__stats {
    grid-template-columns: 1fr;
  }
}
