:root {
    --ink: #25212a;
    --muted: #625b69;
    --purple: #6622bb;
    --purple-dark: #43157f;
    --purple-soft: #f4effa;
    --purple-wash: #fbf9fd;
    --comparison-surface: #faf5ff;
    --surface-light: #fafafa;
    --border: #b9aacd;
    --code: #f0f0f0;
    --white: #ffffff;
    --code-alpha: 1;
    --code-ink-rgb: 42 32 51;
    --syntax-string-rgb: 142 28 214;
    --syntax-keyword-rgb: 0 0 255;
    --syntax-comment-rgb: 31 122 31;
    --selection: #0067c0;
    --selection-ink: #ffffff;
    --max-width: 960px;
    --radius: 0;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--purple-wash);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
    line-height: 1.55;
}

a {
    color: var(--purple);
}

a:hover {
    color: var(--purple-dark);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--purple);
    outline-offset: 2px;
}

code,
pre {
    font-family: Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

code {
    font-size: 0.92em;
}

pre code {
    font-size: inherit;
}

.syntax-string {
    color: rgb(var(--syntax-string-rgb) / var(--code-alpha));
}

.syntax-keyword {
    color: rgb(var(--syntax-keyword-rgb) / var(--code-alpha));
}

.syntax-comment {
    color: rgb(var(--syntax-comment-rgb) / var(--code-alpha));
}

main {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto;
}

.hero {
    min-height: 560px;
    padding: 160px 0 82px;
}

.hero > h1 {
    max-width: none;
    margin-bottom: 0;
    text-wrap: balance;
}

.hero-title-break {
    display: none;
}

@supports (container-type: inline-size) {
    .hero {
        container-type: inline-size;
    }

    .hero > h1 {
        font-size: max(2rem, 13cqi);
    }

    .hero-title-break-three {
        display: block;
    }

    @container (min-width: 34rem) {
        .hero > h1 {
            font-size: 9.5cqi;
        }

        .hero-title-break-three {
            display: none;
        }

        .hero-title-break-two {
            display: block;
        }
    }

    @container (min-width: 56rem) {
        .hero > h1 {
            font-size: 4.9cqi;
            white-space: nowrap;
        }

        .hero-title-break-two {
            display: none;
        }
    }
}

.hero-copy {
    margin-top: 32px;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4 {
    line-height: 1.18;
}

h1 {
    max-width: 700px;
    margin-bottom: 22px;
    color: var(--purple-dark);
    font-size: clamp(2.8rem, 6vw, 5.3rem);
    font-weight: 700;
    letter-spacing: -0.055em;
}

h2 {
    margin-bottom: 15px;
    color: var(--purple-dark);
    font-size: clamp(2rem, 3.5vw, 3rem);
    letter-spacing: -0.035em;
}

h3 {
    margin-bottom: 7px;
    font-size: 1.25rem;
}

h4 {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-lede {
    max-width: 880px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 1.18rem;
}

.study-data-showcase {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    margin-top: 38px;
    border: 1px solid var(--border);
    background: var(--white);
    overflow: hidden;
}

.study-hierarchy {
    margin: 0;
    min-width: 0;
}

.study-hierarchy {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.study-outline-root {
    list-style-type: none;
}

.study-outline-wrap {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    background: var(--white);
}

.study-outline-intro {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.study-outline,
.study-outline ul {
    margin: 0;
    padding-left: 1.4rem;
}

.study-outline ul {
    margin: 3px 0 1px;
}

.study-outline li {
    margin: 3px 0;
    padding-left: 3px;
}

.study-path-explanation {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.study-path-explanation p {
    margin: 0;
}

.study-path-explanation p + p {
    margin-top: 4px;
}

.study-outline-label {
    font-family: Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: clamp(0.76rem, 1.25vw, 0.92rem);
}

.study-outline-branch,
.study-outline-leaf {
    position: relative;
    list-style: none;
}

.study-outline-branch::before,
.study-outline-leaf::before {
    position: absolute;
    top: 0.3rem;
    left: -1.25rem;
    width: 1rem;
    color: currentColor;
    line-height: inherit;
    text-align: center;
}

.study-outline-branch::before {
    content: "▼";
    font-size: 0.5em;
}

.study-outline-leaf::before {
    content: "■";
    font-size: 0.55em;
}

.matlab-css-panel {
    display: flex;
    align-items: center;
    margin: 0;
    min-width: 0;
    padding: 18px;
    background: var(--white);
}

.matlab-window {
    display: grid;
    width: 100%;
    grid-template-rows: 18px 18px 30px 18px auto 18px;
    border: 1px solid #242424;
    background: var(--white);
    color: #111111;
    overflow: hidden;
}

.matlab-titlebar {
    display: flex;
    min-height: 0;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid #242424;
    background: #9a3d09;
}

.matlab-titlebar-mark {
    width: 56px;
    border-top: 2px solid rgba(255, 255, 255, 0.9);
}

.matlab-appbar {
    --matlab-tab-width: clamp(34px, 12%, 50px);
    --matlab-three-tabs: clamp(102px, 36%, 150px);
    --matlab-six-tabs: clamp(204px, 72%, 300px);
    display: grid;
    min-height: 0;
    grid-template-columns: var(--matlab-tab-width) 1fr clamp(64px, 20%, 90px) auto;
    gap: 5px;
    align-items: center;
    padding: 0 6px 0 3px;
    background: linear-gradient(
        to right,
        #004073 0 var(--matlab-three-tabs),
        #1171be var(--matlab-three-tabs) var(--matlab-six-tabs),
        #004073 var(--matlab-six-tabs) 100%
    );
}

.matlab-app-tab {
    position: relative;
    height: 15px;
    align-self: end;
    border: 1px solid #242424;
    border-bottom: 0;
    background: #f5f5f5;
}

.matlab-app-tab::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    border-top: 2px solid #242424;
    content: "";
    transform: translate(-50%, -50%);
}

.matlab-search,
.matlab-control {
    height: 12px;
    border: 1px solid #242424;
    background: #ffffff;
}

.matlab-control {
    aspect-ratio: 1;
}

.matlab-toolbar {
    display: flex;
    min-height: 0;
    align-items: center;
    gap: 11px;
    padding: 0 10px;
    border-bottom: 1px solid #242424;
    background: #f5f5f5;
}

.matlab-toolbar span {
    width: 18px;
    height: 18px;
    aspect-ratio: 1;
    border: 1px solid #242424;
    background: #e6e6e6;
}

.matlab-pane-bar {
    display: flex;
    min-height: 0;
    align-items: center;
    border-bottom: 1px solid #242424;
    background: #004073;
}

.matlab-pane-bar::after {
    width: 90px;
    margin-left: 14px;
    border-top: 2px solid rgba(255, 255, 255, 0.9);
    content: "";
}

.matlab-command-output {
    min-height: 0;
    margin: 0;
    padding: 14px clamp(14px, 3.2vw, 26px);
    background: #ffffff;
    color: #111111;
    font-family: Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: clamp(0.68rem, 1.45vw, 0.95rem);
    line-height: 1.35;
    overflow: auto;
    white-space: pre-wrap;
}

.matlab-prompt {
    color: #555555;
}

.matlab-statusbar {
    display: flex;
    min-height: 0;
    align-items: center;
    gap: 3px;
    padding: 0 3px;
    border-top: 1px solid #242424;
    background: #e6e6e6;
}

.matlab-statusbar span {
    width: 12px;
    height: 12px;
    aspect-ratio: 1;
    border: 1px solid #777777;
    background: #ffffff;
}

.benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0;
    padding: 0;
    color: var(--muted);
    list-style: none;
}

.benefits li {
    margin: 0;
}

.benefits li:not(:last-child)::after {
    content: "\00b7";
    margin-left: 10px;
    color: inherit;
    font-weight: 700;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 11px 19px;
    border: 1px solid var(--purple);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}

.button-primary {
    background: var(--purple);
    color: var(--white);
}

.button-primary:hover {
    background: var(--purple-dark);
    color: var(--white);
}

.exclusive-switcher {
    border-top: 1px solid var(--border);
    background: var(--white);
}

.exclusive-switcher details {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.exclusive-switcher summary {
    padding: 12px 15px;
    background: var(--code);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
}

.exclusive-switcher summary:focus-visible {
    z-index: 1;
}

.exclusive-switcher details:not([open]) > summary:hover {
    background: var(--purple-soft);
    color: var(--purple-dark);
}

.exclusive-switcher details[open] > summary {
    border-bottom: 1px solid var(--border);
    background: var(--purple);
    color: var(--white);
}

.switcher-panel {
    background: var(--white);
}

.install-panel {
    min-height: 160px;
    padding: 19px;
}

.install-panel > p {
    color: var(--muted);
}

.install-panel > p:last-child {
    margin-bottom: 0;
}

.install-panel > .clone-command {
    margin: 0 0 14px;
    padding: 13px;
    font-size: 0.72rem;
}

.install-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.install-instruction {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.install-instruction p {
    flex: 1;
    margin-bottom: 7px;
    color: var(--muted);
}

.install-instruction .install-command {
    margin: 0;
    padding: 10px 12px;
    font-size: 0.78rem;
}

.installation-docs {
    max-width: 760px;
    margin: 20px 0 0;
    color: var(--muted);
}

.code-block {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    background: var(--code);
    color: rgb(var(--code-ink-rgb) / var(--code-alpha));
    font-size: 0.88rem;
    line-height: 1.65;
    white-space: pre-wrap;
}

.code-block ::selection {
    background: var(--selection);
    color: var(--selection-ink);
}

.comparison .code-panel:not(.code-panel-good) {
    --code-alpha: 0.85;
}

.installation,
.capabilities,
.examples {
    padding: 82px 0;
    border-top: 1px solid var(--border);
}

.compact-heading {
    max-width: 700px;
}

.api-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--border);
    background: var(--white);
}

.api-group {
    padding: 20px;
}

.api-group + .api-group {
    border-left: 1px solid var(--border);
}

.api-group h3 {
    margin-bottom: 10px;
    font-size: 1rem;
}

.api-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.api-list li {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
    gap: 14px;
    padding: 10px 0;
}

.api-list code {
    color: var(--purple-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.api-list span {
    color: var(--muted);
    font-size: 0.88rem;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 34px;
}

.section-heading > p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.example-context {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(300px, 1.22fr);
    gap: 24px;
    align-items: center;
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
}

.example-context p {
    margin-bottom: 0;
    color: var(--muted);
}

.example-outline {
    margin: 0;
    padding: 10px 14px;
    background: var(--code);
    color: var(--ink);
}

.example-outline ul {
    margin: 2px 0 0;
    padding-left: 1.25rem;
}

.example-outline li {
    margin: 1px 0;
    padding-left: 2px;
    line-height: 1.25;
}

.example-outline-label {
    font-family: Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
}

.example-card {
    background: var(--white);
    overflow: hidden;
}

.example-heading {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-light);
}

.example-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.example-heading h3 {
    margin-bottom: 4px;
    font-size: 1rem;
}

.comparison {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.code-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
}

.code-panel + .code-panel {
    border-left: 1px solid var(--border);
}

.code-panel h4 {
    margin: 0;
    padding: 13px 18px 11px;
    border-bottom: 1px solid var(--border);
    background: var(--code);
}

.code-panel-good h4 {
    color: var(--purple-dark);
    background: var(--comparison-surface);
}

.code-panel .code-block {
    min-height: 118px;
    padding: 18px;
    font-size: 0.8rem;
}

.code-panel-good .code-block {
    background: var(--comparison-surface);
}

.result {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 15px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface-light);
    color: var(--muted);
    font-size: 0.9rem;
}

.result span {
    color: var(--muted);
    font-weight: 700;
}

.result code {
    color: var(--ink);
}

.result-output {
    flex: 1 1 240px;
    margin: 0;
    overflow-x: auto;
    color: var(--ink);
    font-size: 0.8rem;
    line-height: 1.5;
}

.install-button {
    width: fit-content;
    max-width: 100%;
    margin-top: 16px;
    padding: 9px 12px;
    font-size: 0.78rem;
    text-align: center;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 20px;
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto;
    padding: 28px 0 44px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.site-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

@media (min-width: 681px) {
    .exclusive-switcher {
        position: relative;
        padding-top: 49px;
        border: 1px solid var(--border);
    }

    .exclusive-switcher details {
        border: 0;
    }

    .exclusive-switcher details:not([open]) {
        height: 0;
    }

    .exclusive-switcher summary {
        position: absolute;
        top: 0;
        display: flex;
        width: calc(100% / 3);
        min-height: 49px;
        align-items: center;
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .exclusive-switcher details:nth-of-type(1) > summary {
        left: 0;
    }

    .exclusive-switcher details:nth-of-type(2) > summary {
        left: calc(100% / 3);
    }

    .exclusive-switcher details:nth-of-type(3) > summary {
        left: calc(200% / 3);
        border-right: 0;
    }
}

@media (max-width: 720px) {
    .install-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    body {
        font-size: 16px;
    }

    main,
    .site-footer {
        width: min(calc(100% - 32px), var(--max-width));
    }

    .hero {
        min-height: auto;
        padding: 64px 0 62px;
    }

    .study-data-showcase {
        grid-template-columns: minmax(0, 1fr);
    }

    .study-hierarchy {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .study-outline-wrap {
        padding: 22px;
    }

    .study-outline-label {
        font-size: clamp(0.75rem, 3.2vw, 0.9rem);
    }

    h1 {
        font-size: clamp(2.45rem, 13vw, 4rem);
    }

    h2 {
        font-size: 2rem;
    }

    .installation,
    .capabilities,
    .examples {
        padding: 58px 0;
    }

    .example-context,
    .comparison {
        grid-template-columns: 1fr;
    }

    .exclusive-switcher summary .switcher-label {
        margin-left: 0.35rem;
    }

    .api-panel {
        grid-template-columns: 1fr;
    }

    .api-group + .api-group {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .code-panel + .code-panel {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .example-context {
        gap: 18px;
    }

    .button {
        width: 100%;
    }

    .site-footer {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
