/* Colors */

:root {
    color-scheme: light dark;
    --color-background-primary: rgb(250, 249, 245);
    --color-background-secondary: rgb(240, 238, 230);
    --color-text-contrast-high-primary: rgb(0, 0, 0);
    --color-text-contrast-high-secondary: rgba(0, 0, 0, 0.5);
    --color-text-contrast-low-primary: rgb(255, 255, 255);
    --color-text-contrast-low-secondary: rgba(255, 255, 255, 0.5);
    --color-element-contrast-high-primary: rgb(0, 0, 0);
    --color-element-contrast-high-secondary: rgba(0, 0, 0, 0.50);
    --color-element-contrast-high-tertiary: rgba(0, 0, 0, 0.25);
    --color-element-contrast-high-quaternary: rgb(227, 218, 204);
    --color-element-contrast-low-primary: rgb(255, 255, 255);
    --color-element-contrast-low-secondary: rgba(255, 255, 255, 0.50);
    --color-element-contrast-low-tertiary: rgba(255, 255, 255, 0.25);
    --color-element-contrast-low-quaternary: rgba(255, 255, 255, 0.10);
    --color-control-contrast-high: rgb(0, 0, 0);
    --color-control-contrast-low: rgb(255, 255, 255);
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-border-primary: rgba(0, 0, 0, 0.2);
    --color-border-secondary: rgba(0, 0, 0, 0.1);
    --color-hover-contrast-none: rgba(0, 0, 0, 0.025);
    --color-hover-contrast-high: rgba(0, 0, 0, 0.8);
    --color-hover-contrast-low: rgba(255, 255, 255, 0.5);
    --color-translucent-white: rgba(255, 255, 255, 0.5);
    --color-translucent-light-white: rgba(255, 255, 255, 0.25);
    --color-white: rgb(255, 255, 255);
    --color-black: rgb(0, 0, 0);
    --color-neon-green: rgb(51, 255, 170);
    --color-blue: rgb(0, 136, 255);
    --color-red: rgb(255, 56, 60);
    --color-green: rgb(52, 199, 89);
    --color-yellow: rgb(255, 204, 0);
    --color-orange: rgb(255, 141, 40);
    --color-indigo: rgb(97, 85, 245);
    --color-purple: rgb(203, 48, 224);
    --color-light-blue: rgba(0, 136, 255, 0.05);
    --color-light-red: rgba(255, 56, 60, 0.05);
    --color-light-green: rgba(52, 199, 89, 0.05);
    --color-light-yellow: rgba(255, 204, 0, 0.05);
    --color-light-orange: rgba(255, 141, 40, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-background-primary: rgb(20, 20, 19);
        --color-background-secondary: rgb(38, 38, 36);
        --color-text-contrast-high-primary: rgb(255, 255, 255);
        --color-text-contrast-high-secondary: rgba(255, 255, 255, 0.5);
        --color-text-contrast-low-primary: rgb(0, 0, 0);
        --color-text-contrast-low-secondary: rgba(0, 0, 0, 0.5);
        --color-element-contrast-high-primary: rgb(255, 255, 255);
        --color-element-contrast-high-secondary: rgba(255, 255, 255, 0.50);
        --color-element-contrast-high-tertiary: rgba(255, 255, 255, 0.25);
        --color-element-contrast-high-quaternary: rgba(255, 255, 255, 0.10);
        --color-element-contrast-low-primary: rgb(0, 0, 0);
        --color-element-contrast-low-secondary: rgba(0, 0, 0, 0.50);
        --color-element-contrast-low-tertiary: rgba(0, 0, 0, 0.25);
        --color-element-contrast-low-quaternary: rgba(0, 0, 0, 0.10);
        --color-control-contrast-high: rgb(255, 255, 255);
        --color-control-contrast-low: rgb(0, 0, 0);
        --color-shadow: rgba(255, 255, 255, 0.1);
        --color-border-primary: rgba(255, 255, 255, 0.2);
        --color-border-secondary: rgba(255, 255, 255, 0.1);
        --color-hover-contrast-none: rgba(255, 255, 255, 0.025);
        --color-hover-contrast-high: rgba(255, 255, 255, 0.5);
        --color-hover-contrast-low: rgba(0, 0, 0, 0.8);
    }
}

/* General */

html,
body,
div {
    margin: 0;
    padding: 0;
}

html {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--color-text-contrast-high-primary);
    background-color: var(--color-background-primary);
    height: 100%;
    scroll-behavior: smooth;
}

body {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

main {
    flex: 1;
    width: calc(100% - 2rem);
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 4rem;
}

main.wide {
    max-width: 64rem;
}

/* Headers */

h1 {
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.25rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

h4 {
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

@container (min-width: 40rem) {
    h1 {
        font-size: 3rem;
    }
}

@container (min-width: 64rem) {
    .display-heading {
        font-size: 5rem;
    }
}

/* Images */

img.screenshot {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border-primary);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

@media (prefers-color-scheme: dark) {
    img.color-inverting {
        filter: invert();
    }
}

/* Aside Containers */

.has-aside-container {
    container-type: inline-size;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

@container (min-width: 40rem) {
    .has-aside-container {
        margin-left: 15rem;
    }
}

/* Links */

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

a:hover {
    text-decoration: underline;
}

/* External Links */

.external-link::after {
    content: "↗";
    display: inline-block;
    font-size: 0.5rem;
    line-height: 1;
    margin-left: 0.2rem;
    transform: translateY(0.2rem);
    vertical-align: text-top;
}

/* Hash Links */

.hash-link {
    display: block;
    color: inherit;
    width: 100%;
}

.hash-link:hover {
    text-decoration: none;
    position: relative;
}

.hash-link:hover::after {
    content: "#";
    position: absolute;
    transform: scale(0.75);
    transform-origin: top right;
    color: var(--color-blue);
    font-weight: normal;
}

.hash-target {
    position: relative;
    scroll-margin-top: 5rem;
}

.hash-target:target:not(.hash-target-dismissed)::after {
    content: "";
    position: absolute;
    inset: -0.5rem;
    border: 2px solid var(--color-blue);
    border-radius: 0.5rem;
    pointer-events: none;
}

/* Rules */

hr {
    border: none;
    height: 1px;
    background-color: var(--color-border-primary);
    margin-top: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

/* Forms */

input[type=text],
input[type=email],
input[type=password],
textarea {
    outline-width: 0;
    min-width: 0;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border-primary);
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--color-control-contrast-low);
    padding: 1rem;
    box-sizing: border-box;
    margin-bottom: 1rem;
    width: 100%;
}

input[type=submit] {
    display: block;
    color: var(--color-text-contrast-low-primary);
    border: none;
    outline-width: 0;
    background-color: var(--color-control-contrast-high);
    border-radius: 0.5rem;
    font-size: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    cursor: pointer;
    width: 100%;
}

label {
    display: block;
    margin-bottom: 0.5rem;
}

label:has(> input[type=checkbox]) {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    cursor: pointer;
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

input[type=checkbox] {
    margin: 0;
    accent-color: var(--color-control-contrast-high);
    cursor: pointer;
}

label:has(+ input:required)::after,
label:has(+ textarea:required)::after,
label:has(> input[required])::after {
    content: " *";
    color: var(--color-red);
}

label:has(> input[required])::after {
    margin-left: -0.25rem;
}

textarea {
    resize: vertical;
}

.field-only-form {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.field-only-form input[type=text] {
    margin-bottom: 0;
}

@container (min-width: 40rem) {
    input[type=submit] {
        margin-left: auto;
        width: auto;
    }
}

/* Buttons */

button {
    color: var(--color-text-contrast-low-primary);
    border: none;
    outline-width: 0;
    background-color: var(--color-control-contrast-high);
    border-radius: 0.5rem;
    font-size: 1rem;
    text-align: center;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

button.secondary-button {
    background-color: var(--color-control-contrast-low);
    border: 1px solid var(--color-border-primary);
}

a.button,
a.secondary-button {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    text-decoration: none;
    text-align: center;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    white-space: nowrap;
    box-sizing: border-box;
}

a.button {
    background-color: var(--color-control-contrast-high);
    color: var(--color-text-contrast-low-primary);
}

a.secondary-button {
    color: var(--color-text-contrast-high-primary);
    background-color: var(--color-control-contrast-low);
    border: 1px solid var(--color-border-primary);
}

a.button > img,
a.secondary-button > img {
    height: 1rem;
}

.sign-up-button.button {
    background-color: var(--color-neon-green);
    color: var(--color-black);
}

button:hover,
a.button:hover {
    background-color: var(--color-hover-contrast-high);
}

.sign-up-button.button:hover {
    background-color: var(--color-neon-green);
}

button.secondary-button:hover,
a.secondary-button:hover {
    background-color: var(--color-hover-contrast-low);
}

/* Button Containers */

.buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.buttons-container > a,
.buttons-container > button {
    width: 100%;
}

@container (min-width: 40rem) {
    .buttons-container {
        flex-direction: row;
    }

    .buttons-container > a,
    .buttons-container > button {
        width: auto;
    }

    .sign-up-buttons-container {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        width: max-content;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Tables */

table {
    border-collapse: collapse;
    background-color: var(--color-control-contrast-low);
    width: 100%;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

table a {
    word-break: break-word;
}

th,
td {
    border: 1px solid var(--color-border-primary);
    padding: 0.5rem;
    text-align: left;
}

th {
    background-color: var(--color-background-secondary);
}

.key-value-table td:first-child {
    font-weight: bold;
}

@container (min-width: 40rem) {
    .key-value-table td:first-child {
        white-space: nowrap;
    }
}

/* Lists */

ul,
ol {
    line-height: 1.5rem;
}

/* Code */

code {
    font-size: 0.875rem;
    font-family: 'SF Mono', SFMono-Regular, monospace;
    background-color: var(--color-background-secondary);
    border-radius: 0.25rem;
    padding-top: 0.0625rem;
    padding-bottom: 0.0625rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Code Block Actions Container */

.code-block-actions-container {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Attributes */

.disabled {
    pointer-events: none;
    opacity: 0.2;
}

.destructive {
    color: var(--color-red);
}

.secondary-text {
    color: var(--color-text-contrast-high-secondary);
}

.caption {
    color: var(--color-text-contrast-high-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

.note {
    color: var(--color-text-contrast-high-secondary);
    margin-top: 1rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.agent-name {
    color: var(--color-text-contrast-high-primary);
    font-family: 'SF Mono', SFMono-Regular, monospace;
    font-weight: bold;
    word-break: break-word;
}

@container (min-width: 40rem) {
    .caption {
        padding-right: 10%;
        padding-left: 10%;
    }
}

/* Hover Content */

:has(> .hover-content) {
    position: relative;
    cursor: default;
}

.hover-content {
    display: none;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 1rem;
    left: -1rem;
    background-color: var(--color-control-contrast-low);
    z-index: 1;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border-primary);
    box-shadow: 0 0 0.5rem var(--color-shadow);
    padding: 1rem;
    font-size: 1rem;
    font-weight: normal;
    width: max-content;
    max-width: 16rem;
    white-space: normal;
    text-align: left;
    transition: opacity 100ms ease, display 100ms allow-discrete;
}

:has(> .hover-content):hover > .hover-content {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

@starting-style {
    :has(> .hover-content):hover > .hover-content {
        opacity: 0;
    }
}

/* Connection Options Container */

.connection-options-container > p {
    text-align: center;
}

/* Pulsing Dot */

.pulsing-dot {
    height: 1rem;
    width: 1rem;
    border-radius: 50%;
    background: #007aff;
}

.pulsing-dot::after {
    content: "";
    height: 100%;
    width: 100%;
    border-radius: 50%;
    background: #007aff;
    display: block;
    animation: pulse 2s ease 0s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    80% {
        opacity: 0;
        transform: scale(2.5);
    }
    100% {
        opacity: 0;
        transform: scale(3);
    }
}

/* Trailing Elements Container */

.trailing-elements-container > .right-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.trailing-elements-container > .right-container > * {
    flex-grow: 1;
}

.trailing-elements-container > .right-container > a {
    white-space: nowrap;
}

.trailing-elements-container > .right-container > .tag-cluster {
    margin-top: 0;
    margin-bottom: 0;
}

@container (min-width: 40rem) {
    .trailing-elements-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .trailing-elements-container > .right-container {
        margin-bottom: 0;
    }

    .trailing-elements-container:has(> .left-container > :where(h1)) {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }

    .trailing-elements-container:has(> .left-container > :where(h2)) {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .trailing-elements-container:has(> .left-container > :where(h3)) {
        margin-top: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .trailing-elements-container:has(> .left-container > :where(h4)),
    .trailing-elements-container:has(> .left-container > :where(p)) {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .trailing-elements-container > .left-container > :first-child {
        margin-top: 0;
    }

    .trailing-elements-container > .left-container > :last-child {
        margin-bottom: 0;
    }

    .trailing-elements-container > .right-container > * {
        flex-grow: 0;
    }
}

/* Multi-Column Containers */

@container (min-width: 64rem) {
    :is(
        .insights-row,
        .two-column-grid
    ):where(:has(> :nth-child(2))):where(:has(
        > * > h4:first-child,
        > * > .trailing-elements-container:first-child > .left-container > h4:first-child
    )) {
        margin-top: 1rem;
    }

    :is(
        .insights-row,
        .two-column-grid
    ):where(:has(> :nth-child(2))):where(:has(
        > * > h3:first-child,
        > * > .trailing-elements-container:first-child > .left-container > h3:first-child
    )) {
        margin-top: 1.25rem;
    }

    :is(
        .insights-row,
        .two-column-grid
    ):where(:has(> :nth-child(2))):where(:has(
        > * > h2:first-child,
        > * > .trailing-elements-container:first-child > .left-container > h2:first-child
    )) {
        margin-top: 1.5rem;
    }

    :is(
        .insights-row,
        .two-column-grid
    ):where(:has(> :nth-child(2))):where(:has(
        > * > h1:first-child,
        > * > .trailing-elements-container:first-child > .left-container > h1:first-child
    )) {
        margin-top: 2rem;
    }

    :is(
        .insights-row,
        .two-column-grid
    ):where(:has(> :nth-child(2))):where(:has(
        > * > :is(h1, h2, h3, h4):first-child,
        > * > .trailing-elements-container:first-child > .left-container > :is(h1, h2, h3, h4):first-child
    )) > * > :first-child {
        margin-top: 0;
    }

    :is(
        .insights-row,
        .two-column-grid
    ):where(:has(> :nth-child(2))):where(:has(
        > * > :is(h4, p):last-child,
        > * > .trailing-elements-container:last-child > .left-container > :is(h4, p):last-child
    )) {
        margin-bottom: 1rem;
    }

    :is(
        .insights-row,
        .two-column-grid
    ):where(:has(> :nth-child(2))):where(:has(
        > * > h3:last-child,
        > * > .trailing-elements-container:last-child > .left-container > h3:last-child
    )) {
        margin-bottom: 1.25rem;
    }

    :is(
        .insights-row,
        .two-column-grid
    ):where(:has(> :nth-child(2))):where(:has(
        > * > h2:last-child,
        > * > .trailing-elements-container:last-child > .left-container > h2:last-child
    )) {
        margin-bottom: 1.5rem;
    }

    :is(
        .insights-row,
        .two-column-grid
    ):where(:has(> :nth-child(2))):where(:has(
        > * > :is(h1, .caption, .note):last-child,
        > * > .trailing-elements-container:last-child > .left-container > :is(h1, .caption, .note):last-child
    )) {
        margin-bottom: 2rem;
    }

    :is(
        .insights-row,
        .two-column-grid
    ):where(:has(> :nth-child(2))):where(:has(
        > * > :is(h1, h2, h3, h4, p):last-child,
        > * > .trailing-elements-container:last-child > .left-container > :is(h1, h2, h3, h4, p):last-child
    )) > * > :last-child {
        margin-bottom: 0;
    }
}

/* Insight Rows */

@container (min-width: 64rem) {
    .insights-row:has(> :nth-child(2)) {
        display: flex;
        gap: 2rem;
    }

    .insights-row:has(> :nth-child(2)) > * {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
    }

    .insights-row:has(> :nth-child(2)) > * > :is(
        .metric-insight,
        .line-chart,
        .vertical-bar-chart,
        .timeline,
        .empty-state
    ) {
        flex: 1;
    }

    .insights-row:has(> :nth-child(2)) > * > .trailing-elements-container:has(+ .timeline) {
        margin-bottom: 0;
    }

    .insights-row:has(> :nth-child(2)) > * > .trailing-elements-container + :is(h1, h2, h3, h4) {
        margin-top: 0;
    }

    .insights-row:has(> :nth-child(2)) > * > :is(h1, h2, h3, h4) + .timeline {
        margin-top: 0;
    }

    .insights-row:has(> :nth-child(2)) > .primary-insight {
        flex: 2;
    }
}

/* Table Containers */

.scrollable-table-container {
    overflow-x: auto;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.scrollable-table-container > table {
    margin: 0;
}

@container (min-width: 64rem) {
    .scrollable-table-container {
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
    }
}

/* List */

.list {
    display: grid;
    gap: 1rem;
}

.list > * {
    border-bottom: 1px solid var(--color-border-primary);
    padding-bottom: 1rem;
}

.list > *:last-child {
    border-bottom: none;
}

/* List Containers */

.grouped-list {
    border: 1px solid var(--color-border-primary);
    border-radius: 0.5rem;
    background-color: var(--color-control-contrast-low);
}

.grouped-list > * {
    border-bottom: 1px solid var(--color-border-primary);
    padding: 1rem;
}

.grouped-list > *:last-child {
    border-bottom: none;
}

/* Two-Column Grid */

.two-column-grid > .chart-insight + .chart-insight {
    margin-top: 2rem;
}

@container (min-width: 64rem) {
    .two-column-grid:where(:has(> :nth-child(2))) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .two-column-grid:where(:has(> :nth-child(2))) > * {
        min-width: 0;
    }

    .two-column-grid:has(> :nth-child(2)) > .chart-insight + .chart-insight {
        margin-top: 0;
    }
}

/* Links Container */

.links-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.links-container > * {
    background-color: var(--color-control-contrast-low);
    border: 1px solid var(--color-border-primary);
    border-radius: 0.5rem;
    padding: 1rem;
}

/* External */

.grecaptcha-badge {
    visibility: hidden;
}
