/* Official faces: DM Serif Display for headers, Lexend for body, Cascadia Code NF for code. */

@font-face
{
    font-family: 'DM Serif Display';
    src: url('/DMSerif/DM_Serif_Display/DMSerifDisplay-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face
{
    font-family: 'DM Serif Display';
    src: url('/DMSerif/DM_Serif_Display/DMSerifDisplay-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face
{
    font-family: 'Lexend';
    src: url('/Lexend/Lexend-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face
{
    font-family: 'Cascadia Code NF';
    src: url('/CascadiaCode/woff2/CascadiaCodeNF.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face
{
    font-family: 'Cascadia Code NF';
    src: url('/CascadiaCode/woff2/CascadiaCodeNFItalic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root
{
    --font-family: 'Lexend', 'Noto Sans', 'Open Sans', Helvetica, Arial, sans-serif;
    --font-heading: 'DM Serif Display', 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-mono: 'Cascadia Code NF', 'Cascadia Code', Consolas, 'Liberation Mono', monospace;
    --root-bg: #faf8f5;
    --root-text: #1f3d2b;
    --header-bg: #1f3d2b;
    --header-text: #faf8f5;
    --menubar-bg: #529282;
    --menubar-text: #faf8f5;
    --menubar-active: #1f3d2b;
    --menubar-active-text: #faf8f5;
    --menubar-inactive-tab: #a8c8c0;
    --menubar-inactive-tab-text: #faf8f5;
    --primary-base: #529282;
    --primary-hover: #3e7466;
    --primary-active: #1f3d2b;
    --primary-focus: #1f3d2b;
    --primary-text: #ffffff;
    --secondary-base: #3b82f6;
    --secondary-hover: #2563eb;
    --secondary-active: #1d4ed8;
    --secondary-focus: #1e40af;
    --secondary-text-hover: #faf8f5;
    --btn-secondary-base: #5f6f7a;
    --btn-secondary-hover: #4a5960;
    --btn-secondary-active: #3a464d;
    --btn-secondary-focus: #2e383e;
    --btn-secondary-text-hover: #faf8f5;
    --gray-base: #f6f1e8;
    --gray-hover: #e8e0d3;
    --gray-active: #dbd2c4;
    --gray-focus: #cec4b5;
    --gray-text: #1f3d2b;
    --icon-tint: #1f3d2b;
    --icon-wrapper: #c2a24f;
    --icon-wrapper-tint-hover: #a88b3e;
    --icon-wrapper-tint-active: #937a36;
    --icon-wrapper-tint-focus: #7e692e;
    --icon-wrapper-tint: #faf8f5;
    --table-row-even: #f6f1e8;
    --table-row-odd: #faf8f5;
    --table-row-selected: #529282;
    --table-row-hover: #c2a24f;
    --table-row-text: #1f3d2b;
    --table-row-text-selected: #faf8f5;
    --table-row-text-hovered: #1f3d2b;
    --alert-success: #529282;
    --alert-danger: #c70000;
    --alert-warning: #ff751f;
    --alert-info: #8b5cf6;
    --box-bg: #ffffff;
    --editor-bg: #ffffff;
    --editor-text: #1f3d2b;
    --editor-selection: #529282;
    --editor-line-number: #a8c8c0;
    --editor-cursor: #1f3d2b;
    --editor-whitespace: #dbd2c4;
    --editor-bracket-match: #529282;
}

*, *::before, *::after
{
    box-sizing: border-box;
}

html
{
    scroll-behavior: smooth;
}

html, body
{
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-family);
    background-color: var(--root-bg);
    color: var(--root-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4
{
    font-family: var(--font-heading);
    font-weight: 400;
}

code, kbd, samp, pre, .x-mono
{
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ---------- shell ---------- */

.x-site
{
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1.5rem;
}

.x-header
{
    width: 100%;
    max-width: 68rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.25rem;
}

.x-mark
{
    height: 2rem;
    width: auto;
    display: block;
}

/* ---------- buttons and links ---------- */

.x-btn
{
    display: inline-block;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    border-radius: 8px;
    padding: 0.8125rem 1.75rem;
    cursor: pointer;
    background-color: var(--primary-base);
    color: var(--primary-text);
    transition: background-color 0.15s ease, transform 0.05s ease;

    &:hover
    {
        color: var(--primary-text);
        background-color: var(--primary-hover);
    }

    &:active
    {
        background-color: var(--primary-active);
        transform: translateY(1px);
    }

    &:focus-visible
    {
        outline: 2px solid var(--primary-focus);
        outline-offset: 2px;
    }
}

.x-btn-quiet
{
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: transparent;
    color: var(--primary-base);
    border: 1px solid var(--menubar-inactive-tab);

    &:hover
    {
        background-color: var(--gray-hover);
        color: var(--primary-active);
    }
}

.x-link
{
    color: var(--primary-base);
    text-decoration: underline;
    text-underline-offset: 3px;

    &:hover
    {
        color: var(--primary-hover);
    }

    &:focus-visible
    {
        outline: 2px solid var(--primary-focus);
        outline-offset: 2px;
    }
}

/* ---------- hero ---------- */

.x-hero
{
    max-width: 46rem;
    text-align: center;
    padding: clamp(3rem, 11vh, 6rem) 0 clamp(2.5rem, 8vh, 4.5rem);
}

.x-eyebrow
{
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-base);
    margin: 0 0 1rem;
}

.x-headline
{
    font-size: clamp(2.75rem, 7.5vw, 4.5rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin: 0;
}

.x-lede
{
    font-size: clamp(1.0625rem, 2.2vw, 1.3125rem);
    line-height: 1.6;
    max-width: 38rem;
    margin: 1.25rem auto 0;
}

.x-emoji
{
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0;
}

.x-cta-row
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem 1.5rem;
    margin-top: 2rem;
}

/* ---------- sections ---------- */

.x-section
{
    width: 100%;
    max-width: 68rem;
    padding: clamp(3rem, 7vh, 4.5rem) 0;
    border-top: 1px solid var(--gray-active);
    scroll-margin-top: 4.5rem;
}

.x-section-alt
{
    border-radius: 16px;
    padding-left: clamp(1rem, 3vw, 2rem);
    padding-right: clamp(1rem, 3vw, 2rem);
    background-color: var(--gray-base);
    border: 1px solid var(--gray-active);
}

.x-h2
{
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    letter-spacing: -0.01em;
    margin: 0;
}

.x-section-intro
{
    font-size: 1.0625rem;
    opacity: 0.75;
    margin: 0.5rem 0 2rem;
}

/* ---------- themes ---------- */

.x-theme-grid
{
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.x-theme-card
{
    background-color: var(--box-bg);
    border: 1px solid var(--gray-active);
    border-top: 3px solid var(--icon-wrapper);
    border-radius: 12px;
    padding: 1.5rem 1.5rem 1.75rem;
}

.x-theme-title
{
    font-size: 1.375rem;
    margin: 0;
}

.x-theme-sub
{
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-base);
    margin: 0.25rem 0 0.875rem;
}

.x-theme-body
{
    font-size: 0.9375rem;
    line-height: 1.65;
    margin: 0;
}

.x-bridge
{
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    line-height: 1.6;
    max-width: 46rem;
    margin: 2rem 0 0;
}

/* ---------- scenarios ---------- */

.x-scenario-grid
{
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 1.25rem;
}

.x-scenario
{
    background-color: var(--box-bg);
    border: 1px solid var(--gray-active);
    border-radius: 10px;
    padding: 1.125rem 1.25rem;

    h3
    {
        font-size: 1.125rem;
        margin: 0 0 0.375rem;
    }

    p
    {
        font-size: 0.875rem;
        line-height: 1.6;
        opacity: 0.85;
        margin: 0;
    }
}

/* ---------- connect ---------- */

.x-connect-grid
{
    display: grid;
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

.x-steps
{
    list-style: none;
    counter-reset: x-step;
    margin: 0;
    padding: 0;
}

.x-step
{
    position: relative;
    counter-increment: x-step;
    padding: 0 0 1.25rem 2.75rem;

    &::before
    {
        content: counter(x-step);
        position: absolute;
        left: 0;
        top: -0.125rem;
        width: 1.875rem;
        height: 1.875rem;
        border-radius: 50%;
        background-color: var(--primary-base);
        color: var(--primary-text);
        font-size: 0.8125rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    h3
    {
        font-size: 1.0625rem;
        margin: 0 0 0.25rem;
    }

    p
    {
        font-size: 0.9375rem;
        line-height: 1.6;
        opacity: 0.85;
        margin: 0;
    }
}

.x-banner
{
    font-size: 0.9375rem;
    border-radius: 10px;
    padding: 0.875rem 1.125rem;
    margin: 0 0 1.75rem;
    background-color: var(--gray-base);
}

.x-banner-ok
{
    border-left: 4px solid var(--alert-success);
}

.x-banner-warn
{
    border-left: 4px solid var(--alert-warning);
}

/* ---------- form ---------- */

.x-form
{
    display: grid;
    gap: 1rem;
    background-color: var(--box-bg);
    border: 1px solid var(--gray-active);
    border-radius: 12px;
    padding: 1.5rem;
}

.x-field
{
    display: grid;
    gap: 0.375rem;

    label
    {
        font-size: 0.875rem;
        font-weight: 600;
    }
}

.x-optional
{
    font-size: 0.8125rem;
    font-weight: 400;
    opacity: 0.6;
}

.x-field input,
.x-field textarea
{
    width: 100%;
    font: inherit;
    color: var(--editor-text);
    background-color: var(--editor-bg);
    border: 1px solid var(--gray-active);
    border-radius: 8px;
    padding: 0.625rem 0.75rem;

    &:focus-visible
    {
        outline: 2px solid var(--primary-focus);
        outline-offset: 1px;
        border-color: var(--primary-base);
    }

    &::placeholder
    {
        color: var(--editor-line-number);
    }
}

.x-field textarea
{
    min-height: 7rem;
    resize: vertical;
}

.x-note
{
    font-size: 0.8125rem;
    opacity: 0.7;
    margin: 0;
}

/* Honeypot: reachable to a bot, out of the way for a person. */
.x-trap
{
    position: absolute;
    left: -99999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- footer ---------- */

.x-footer
{
    width: 100%;
    max-width: 68rem;
    border-top: 1px solid var(--gray-active);
    padding: 1.5rem 0 2.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem 1.5rem;
    font-size: 0.8125rem;
}

.x-copy
{
    opacity: 0.6;
}

/* ---------- responsive ---------- */

@media (min-width: 40rem)
{
    .x-theme-grid,
    .x-scenario-grid
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 64rem)
{
    .x-scenario-grid
    {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 56rem)
{
    .x-connect-grid
    {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 40rem)
{
    .x-site
    {
        padding: 0 1rem;
    }

    .x-header
    {
        align-items: flex-end;
    }
}

@media (prefers-reduced-motion: reduce)
{
    html
    {
        scroll-behavior: auto;
    }

    .x-btn
    {
        transition: none;
    }
}
