/* The landing page: always dark, full width, the docs chrome kept quiet. */
.cm-home {
  --night: #0b0b0c;
  --night-2: #131315;
  --line: rgba(242, 242, 242, 0.08);
  --text: #f2f2f2;
  --muted: rgba(242, 242, 242, 0.66);
  --accent: #8db4ea;
  --highlight: #c9d7ea;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  background: var(--night);
  color: var(--text);
  font-family: "Geist", var(--md-text-font-family);
  -webkit-font-smoothing: antialiased;
}

body:has(.cm-home) {
  background: #0b0b0c;
}

body:has(.cm-home) .md-main {
  display: none;
}

body:has(.cm-home) .md-header,
body:has(.cm-home) .md-header + .md-container .md-tabs {
  background: rgba(11, 11, 12, 0.72);
  backdrop-filter: blur(12px);
  color: #f2f2f2;
  border-bottom: 1px solid rgba(242, 242, 242, 0.08);
}

body:has(.cm-home) .md-logo img.cm-logo--ink {
  display: none;
}

body:has(.cm-home) .md-logo img.cm-logo--paper {
  display: block;
}

body:has(.cm-home) .md-search__form {
  background: rgba(242, 242, 242, 0.06);
  border-color: rgba(242, 242, 242, 0.1);
}

body:has(.cm-home) .md-search__input,
body:has(.cm-home) .md-search__input::placeholder,
body:has(.cm-home) .md-search__icon[for="__search"] {
  color: rgba(242, 242, 242, 0.7);
}

body:has(.cm-home) .md-footer {
  background: #070708;
  border-top: 1px solid rgba(242, 242, 242, 0.08);
}

.cm-wrap {
  position: relative;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.2rem;
}

.cm-label {
  margin: 0 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.cm-label--accent {
  color: var(--accent);
}

.cm-home h1,
.cm-home h2 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.cm-home h1 {
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  line-height: 1.04;
}

.cm-home h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.08;
}

.cm-home code {
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  background: rgba(242, 242, 242, 0.07);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85em;
}

.cm-lede,
.cm-sub {
  max-width: 34rem;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Hero: the graph behind, the claim in front. */
.cm-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: max(34rem, calc(100vh - 4.8rem));
  overflow: hidden;
  text-align: center;
}

.cm-graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cm-hero__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 42% 40% at 50% 48%, rgba(11, 11, 12, 0.92), rgba(11, 11, 12, 0.6) 60%, transparent 100%),
    linear-gradient(to bottom, transparent 70%, var(--night));
  pointer-events: none;
}

.cm-hero__text {
  width: 100%;
  pointer-events: none;
}

.cm-hero__text a,
.cm-hero__text button {
  pointer-events: auto;
}

.cm-hero .cm-lede {
  margin-left: auto;
  margin-right: auto;
}

.cm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.6rem;
}

.cm-hero .cm-actions,
.cm-actions--center {
  justify-content: center;
}

.cm-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border: 1px solid rgba(242, 242, 242, 0.22);
  border-radius: 0.45rem;
  color: var(--text) !important;
  font-size: 0.75rem;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}

.cm-btn:hover {
  border-color: rgba(242, 242, 242, 0.5);
}

.cm-btn--solid {
  background: var(--text);
  border-color: var(--text);
  color: var(--night) !important;
}

.cm-btn--solid:hover {
  background: var(--highlight);
  border-color: var(--highlight);
}

.cm-install {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.4rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: rgba(11, 11, 12, 0.6);
  color: var(--muted);
  max-width: 100%;
  font: 0.68rem var(--mono);
  white-space: nowrap;
  cursor: pointer;
}

.cm-install:hover {
  color: var(--text);
  border-color: rgba(242, 242, 242, 0.2);
}

.cm-install__prompt {
  color: var(--accent);
}

.cm-install__hint {
  padding-left: 0.5rem;
  border-left: 1px solid var(--line);
  color: rgba(242, 242, 242, 0.4);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Sections. */
.cm-section {
  padding: 6rem 0 0;
}

.cm-panel {
  position: relative;
  margin: 2.6rem 0 0;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(242, 242, 242, 0.05), rgba(242, 242, 242, 0.01));
}

.cm-panel::before {
  content: "";
  position: absolute;
  inset: 10% 5% -6%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(141, 180, 234, 0.22), rgba(201, 215, 234, 0.08) 60%, transparent);
  filter: blur(40px);
}

.cm-panel img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.6rem;
}

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

.cm-facts p:not(.cm-label) {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.cm-facts > div {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.cm-split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 3.5rem;
  align-items: center;
}

.cm-split--flip > :first-child {
  order: 2;
}

.cm-split .cm-panel {
  margin: 0;
}

.cm-panel--tilt {
  transform: perspective(1600px) rotateY(-9deg) rotateX(3deg);
}

.cm-panel--tilt-left {
  transform: perspective(1600px) rotateY(9deg) rotateX(3deg);
}

.cm-list {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  color: var(--muted);
}

.cm-list li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

.cm-list code {
  margin-right: 0.4rem;
  color: var(--highlight);
}

/* Code cards. */
.cm-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.4rem;
}

.cm-code {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--night-2);
  overflow: hidden;
}

.cm-code__bar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

.cm-code__bar span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: rgba(242, 242, 242, 0.16);
}

.cm-code__bar em {
  margin-left: 0.6rem;
  color: rgba(242, 242, 242, 0.45);
  font: normal 0.6rem var(--mono);
}

.cm-code pre {
  margin: 0;
  padding: 1rem 1.1rem 1.2rem;
  overflow-x: auto;
}

.cm-code pre code {
  padding: 0;
  background: none;
  color: rgba(242, 242, 242, 0.85);
  font-size: 0.68rem;
  line-height: 1.75;
}

.cm-code .c,
.cm-code .m {
  color: rgba(242, 242, 242, 0.38);
}

.cm-code .k {
  color: var(--accent);
}

.cm-code .s {
  color: #93c5fd;
}

.cm-code .v {
  color: var(--highlight);
}

.cm-caret {
  display: inline-block;
  width: 0.5em;
  height: 1.1em;
  margin-left: 0.15em;
  vertical-align: -0.2em;
  background: var(--highlight);
  animation: cm-blink 1.1s steps(1) infinite;
}

@keyframes cm-blink {
  50% { opacity: 0; }
}

.cm-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 2.4rem;
  border-top: 1px solid var(--line);
}

.cm-stats > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 0;
}

.cm-stats strong {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.cm-stats span {
  color: var(--muted);
  font: 0.6rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* FAQ. */
.cm-faq {
  max-width: 40rem;
}

.cm-faq h2 {
  margin-bottom: 1.6rem;
  text-align: center;
}

.cm-faq details {
  border-top: 1px solid var(--line);
}

.cm-faq details:last-of-type {
  border-bottom: 1px solid var(--line);
}

.cm-faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.cm-faq summary::-webkit-details-marker {
  display: none;
}

.cm-faq summary::after {
  content: "+";
  color: var(--muted);
  font-family: var(--mono);
  transition: transform 0.2s;
}

.cm-faq details[open] summary::after {
  transform: rotate(45deg);
}

.cm-faq details p {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.cm-more {
  margin-top: 1.2rem;
  font-size: 0.75rem;
}

.cm-more a {
  color: var(--accent);
}

/* Closing call to action. */
.cm-cta {
  position: relative;
  margin-top: 6rem;
  padding: 6rem 0 5rem;
  overflow: hidden;
  text-align: center;
}

.cm-cta__glow {
  position: absolute;
  inset: 20% -10% -40%;
  background:
    radial-gradient(ellipse 35% 50% at 30% 70%, rgba(141, 180, 234, 0.2), transparent),
    radial-gradient(ellipse 35% 50% at 70% 70%, rgba(201, 215, 234, 0.14), transparent);
  filter: blur(30px);
}

.cm-ticker {
  margin: 1.4rem auto 0;
  max-width: 34rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
}

.cm-ticker div {
  display: inline-block;
  white-space: nowrap;
  color: var(--muted);
  font: 500 0.68rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: cm-ticker 40s linear infinite;
}

@keyframes cm-ticker {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .cm-ticker div,
  .cm-caret {
    animation: none;
  }
}

@media screen and (max-width: 60em) {
  .cm-split,
  .cm-code-grid,
  .cm-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
  }

  .cm-split--flip > :first-child {
    order: 0;
  }

  .cm-panel--tilt,
  .cm-panel--tilt-left {
    transform: none;
  }

  .cm-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cm-install {
    font-size: 0.6rem;
  }

  .cm-install__hint {
    display: none;
  }

  .cm-section {
    padding-top: 4rem;
  }
}
