@import url('https://fonts.googleapis.com/css2?family=Inter');
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined');

:root {
    --font-size: 16px;
    /* Changing this scales everyting. */
    --content-width: 45em;
    --font: Inter;
    --font-mono: 'Source Code Pro';
    --foreground: rgb(217, 224, 238);
    --foreground-alt: rgb(67, 61, 87);
    --background: #1e1e2e;
    --background-alt: rgb(159, 120, 149);
    --good: #a3be8c;
    --bad: hsl(354, 74%, 62%);
    --warn: #ebcb8b;
    --roundness: 0.2em;
    /* Brand/neon accent (defaults to secondary accent) */
    --logo-glow-color: var(--background-alt);
    /* Opacity used by the animated bottom gradient; updated by JS on scroll */
    --gradient-opacity: 0;
}

html,
body,
input,
select,
button,
textarea {
    margin: 0;
    padding: 0;
    color: var(--foreground);
    background-color: var(--background);
    font-family: var(--font), sans-serif;
    font-size: var(--font-size);
    line-height: 1.4em;
}

/* ---------------------------------------- Header, footer and navigation. -- */

div.framed {
    padding: 1em;
    border-radius: var(--roundness);
    background-color: color-mix(in srgb, var(--foreground-alt) 50%, transparent);
}

div.framed > p {
    margin-bottom: 0;
}

header {
    margin: 0 0 1em 0;
    padding: 0;
    position: sticky;
    top: 0;
    background-color: var(--foreground-alt);
    z-index: 100;
}

header>div {
    margin: 0;
    padding: 0.75em 1em;
    display: flex;
    margin: auto;
    max-width: var(--content-width);
    justify-content: center; /* center the brand */
    align-items: center;
    position: relative; /* allow absolute-positioned icon */
}

header>div>a {
    font-size: 1.25em;
    text-decoration: none;
    color: var(--foreground);
}

/* Larger centered logo */
header>div>a:first-child img {
    height: 56px;
}

header>div>a.icon {
    font-size: 2.2em;
    opacity: 0.7;
    color: var(--foreground);
    position: absolute;
    right: 1em;
    top: 50%;
    transform: translateY(-50%);
}

header>div>a.icon:hover {
    opacity: 1;
}

header>div>a.icon:hover {
    color: var(--foreground);
    text-decoration: none;
}

.section {
    border: 1px solid var(--foreground-alt);
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1em auto;
    padding-top: 1em;
    max-width: var(--content-width);
    color: var(--foreground);
    border-top: 1px solid var(--background-alt);
    text-transform: uppercase;
}

footer a {
    color: color-mix(in srgb, var(--foreground-alt) 100%, white 70%);
    text-decoration: none;
    font-size: 0.75em;
}

footer a:hover {
    color: var(--foreground);
    text-decoration: none;
}

/* ---------------------------------------- Table of contents -- */

nav {
    margin: 0;
    padding: 1em;
    max-width: var(--content-width);
    margin: auto;
}

nav>h1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5em 0 0 0;
    padding: 0.5em 0.2em 0.5em 0.2em;
    font-size: 1.2em;
    color: var(--foreground);
    border-bottom: 1px solid var(--background-alt);
    cursor: pointer;
}

nav a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0.5em 0.2em 0.5em 0.2em;
    font-size: 1.2em;
    max-width: var(--content-width);
    list-style-type: none;
    color: var(--foreground);
    border-bottom: 1px solid var(--background-alt);
    text-decoration: none;
}

nav a:hover,
nav h1:hover {
    color: var(--foreground);
    background-color: var(--background-alt);
}

nav button {
    position: absolute;
    top: 1em;
    right: 1em;
    text-decoration: none;
    font-size: 2em;
    color: var(--foreground);
    background: none;
    border: none;
}

/* ---------------------------------------- Main content --*/

main {
    margin: 0;
    padding: 1em 1em 0 1em;
    max-width: var(--content-width);
    margin: auto;
}

h1,
h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1em 0 1em 0;
    padding: 0 0 0.5em 0;
    font-size: 1.75em;
    border-bottom: 1px solid #3a3a52;
}

h2 {
    font-size: 1.5em;
}

h3 {
    font-size: 1.25em;
}

p {
    margin: 0 0 1em 0;
    padding: 0;
}

a {
    color: var(--foreground);
    text-decoration: underline dotted var(--foreground);
}

a:hover {
    color: #5e81ac;
    text-decoration: underline solid var(--foreground);
}

pre {
    margin: 0 0 1em 0;
    padding: 0.6em 1em;
    border-radius: var(--roundness);
    background-color: var(--foreground-alt);
    color: var(--background-alt);
    font-family: var(--font-mono);
    font-size: 0.85em;
}

code {
    padding: 0.1em 0.3em;
    border-radius: var(--roundness);
    background-color: var(--foreground-alt);
    color: var(--background-alt);
    font-family: var(--font-mono);
    font-size: 0.85em;
    white-space: nowrap;
}

img {
    max-width: 100%;
}

img.framed {
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.7em;
    border-radius: var(--roundness);
    background-color: var(--foreground-alt);
}

/* ---------------------------------------- Form -- */

button {
    margin: 0;
    padding: 0.6em 1.2em;
    border: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: var(--foreground-alt);
    color: var(--background);
    border-radius: var(--roundness);
    font-size: var(--font-size);
}

button.good {
    background-color: var(--good)
}

button.bad {
    background-color: var(--bad)
}

button:hover {
    filter: brightness(1.1);
    /* box-shadow       : 0 0.1em 0.2em 0 rgba(0, 0, 0, 0.2), 0 0.1em 0.2em 0 rgba(0, 0, 0, 0.2); */
}

button>span.icon {
    padding: 0 0.3em 0 0;
    font-size: 1.2em;
    line-height: 1em;
}

/* ---------------------------------------- Flex -- */

.flexed {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
}

.flexed.top {
    align-items: flex-start;
}

.flexed>* {
    flex-grow: 0;
}

/* Centered row utility for CTAs/chips */
.centered-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6em;
    flex-wrap: wrap;
}

/* Responsive features grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2em;
    align-items: stretch;
}

@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr); /* enforce 2x2 for four items */
    }
}

.feature-card {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.feature-card h3 {
    display: flex;
    align-items: center;
    gap: 0.4em;
    margin: 0.2em 0 0.2em 0;
}

.hero-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2em;
    align-items: stretch;
    margin-top: 2em;
    width: 67vw;
    margin-left: calc(50% - 33.5vw);
    margin-right: calc(50% - 33.5vw);
    box-sizing: border-box;
    padding-left: 1em;
    padding-right: 1em;
}

.hero-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.hero-carousel {
    padding-top: 0;
}

/* Make carousel fill its panel nicely */
.hero-carousel .carousel,
.hero-carousel .carousel-inner,
.hero-carousel .carousel-item {
    height: 100%;
}

.hero-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--roundness);
}

/* Stretch highlights to match carousel column height */
.hero-highlights .section {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0; /* remove extra spacing inside the grid cell */
}
.hero-highlights .features-grid {
    flex: 1;
}

/* Desktop-only sizing to keep both panels visually balanced */
@media (min-width: 900px) {
    .hero-panel {
        min-height: 420px;
        /* optional: cap the height if needed
        max-height: 560px;
        */
    }
}

/* Balance widths on larger screens */
@media (min-width: 900px) {
    .hero-split {
        grid-template-columns: 1.1fr 0.9fr; /* give a bit more space to the carousel */
    }
}

/* ---------------------------------------- Logo neon effect -- */
.logo-neon {
    /* size inherits from the <img>; only add glow */
    /* make the glow more transparent by mixing with transparent */
    color: color-mix(in srgb, var(--logo-glow-color) 30%, transparent);
    /* fewer, softer layers for a subtler effect */
    filter:
        drop-shadow(0 0 4px currentColor)
        drop-shadow(0 0 12px currentColor)
        drop-shadow(0 0 32px color-mix(in srgb, var(--logo-glow-color) 18%, transparent))
        drop-shadow(0 0 64px color-mix(in srgb, var(--logo-glow-color) 50%, transparent));
    /* slightly reduce overall opacity if needed */
    opacity: 0.95;
}

/* ---------------------------------------- Mobile tweaks -- */
@media (max-width: 480px) {
    h1 { font-size: 1.5em; }
    h2 { font-size: 1.3em; }
    h3 { font-size: 1.1em; }
    .centered-row { gap: 0.5em; }
    .centered-row button { width: 100%; }
}

/* ---------------------------------------- Icon -- */

.icon {
    margin: 0;
    padding: 0;
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
}

/* other */

hr {
    margin: 1em 0;
    padding: 0;
    border: none;
    border-top: 1px solid var(--background-alt);
}

/* Ensure page content layers above the animated bottom gradient (keep header's own z-index) */
main, footer {
    position: relative;
    z-index: 1;
}

/* Animations for details expansion */
details {
    transition: all 0.3s ease;
}

details[open] {
    transition: all 0.3s ease;
}

details>summary {
    cursor: pointer;
    list-style: none;
    padding: 0.5em 0.2em 0.5em 0.2em;
    font-size: 1.2em;
    color: var(--foreground);
    /* border-bottom: 1px solid var(--background-alt); */
}

details>summary:hover {
    color: var(--foreground);
    background-color: var(--background-alt);
}

details>summary::-webkit-details-marker {
    display: none;
}

details>summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5em;
    transition: transform 0.3s ease;
    font-size: 0.5em;
    vertical-align: top;
}

details[open]>summary::before {
    transform: rotate(90deg);
}

details>ul {
    margin-top: 1em;
}

.bad {
    color: var(--bad);
}

.section > h3 {
    margin-top: 0.1em;
}

.section > h2 {
    margin-top: 0.4em;
}

.section > h1 {
    margin-top: 0.5em;
}