:root,
html[data-theme="light"] {
    color-scheme: light;
    --background: #fdfdfd;
    --foreground: #282728;
    --accent: #006cac;
    --muted: #e6e6e6;
    --border: #ece9e9;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --background: #212737;
    --foreground: #eaedf3;
    --accent: #ff6b01;
    --muted: #343f60;
    --border: #ab4b08;
}

* {
    box-sizing: border-box;
    border-color: var(--border);
    scrollbar-color: var(--muted) transparent;
}

::selection {
    background: color-mix(in srgb, var(--accent) 75%, transparent);
    color: var(--background);
}

html {
    min-width: 20rem;
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    min-height: 100svh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--foreground);
    font-family:
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 1rem;
    line-height: 1.65;
}

h1,
h2,
h3,
.site-header,
.site-footer,
.breadcrumb,
.format-kicker,
.button,
.card-action,
.updated,
.build-details summary {
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

a,
button {
    color: inherit;
    font: inherit;
    outline-color: var(--accent);
    outline-offset: 0.25rem;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    text-decoration: none;
    outline: 2px dashed var(--accent);
}

button:not(:disabled),
summary {
    cursor: pointer;
}

svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

hr {
    width: 100%;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.site-shell,
.app-shell {
    width: 100%;
    margin-inline: auto;
    padding-inline: 1rem;
}

.site-shell {
    max-width: 72rem;
}

.app-shell {
    max-width: 48rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none;
}

#skip-to-content {
    position: absolute;
    top: -100%;
    left: 4rem;
    z-index: 100;
    padding: 0.5rem 0.75rem;
    background: var(--background);
    color: var(--accent);
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    transition: top 150ms ease;
}

#skip-to-content:focus {
    top: 1rem;
}

.site-header {
    width: 100%;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-nav-wrap {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding-block: 1rem;
    background: var(--background);
}

.brand {
    padding-block: 0.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 2rem;
    text-decoration: none;
    white-space: nowrap;
}

#nav-menu {
    margin-left: 0.5rem;
}

#menu-btn,
#theme-btn,
.icon-link {
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
}

#menu-btn {
    width: 3rem;
    height: 3rem;
    padding: 0.75rem;
}

#menu-btn svg,
#theme-btn svg,
.icon-link svg {
    width: 1.5rem;
    height: 1.5rem;
}

#menu-items {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 50;
    display: none;
    width: 15rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem;
    margin: 0.25rem 0 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background);
    box-shadow: 0 1rem 2rem
        color-mix(in srgb, var(--foreground) 14%, transparent);
    list-style: none;
}

#menu-items.is-open {
    display: grid;
}

#menu-items li:not(.utility-item) {
    grid-column: span 2;
}

#menu-items li > a:not(.icon-link) {
    display: block;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
}

#menu-items li > a:hover,
#menu-items li > a:focus-visible {
    background: color-mix(in srgb, var(--muted) 40%, transparent);
    color: var(--accent);
}

.utility-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-link,
#theme-btn {
    width: 3rem;
    height: 3rem;
    padding: 0.75rem;
}

.icon-link:hover,
#theme-btn:hover,
.brand:hover {
    color: var(--accent);
}

.active-nav {
    text-decoration-line: underline !important;
    text-decoration-style: wavy !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 0.25rem;
}

html[data-theme="light"] .sun-icon,
html[data-theme="dark"] .moon-icon {
    display: none;
}

.breadcrumb {
    margin-top: 2rem;
    margin-bottom: 0.25rem;
    font-weight: 300;
}

.breadcrumb ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumb li {
    display: inline;
}

.breadcrumb a,
.breadcrumb span {
    opacity: 0.8;
}

.breadcrumb a {
    text-decoration: none;
}

.breadcrumb a:hover {
    opacity: 1;
}

#main-content {
    flex: 1;
    padding-bottom: 4rem;
}

.page-heading {
    margin-bottom: 2rem;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(1.5rem, 5vw, 1.875rem);
    line-height: 1.25;
    font-weight: 600;
}

.page-heading > p:first-of-type {
    max-width: 42rem;
    margin: 0.5rem 0 0;
    color: color-mix(in srgb, var(--foreground) 70%, transparent);
    line-height: 1.75;
}

.updated {
    margin: 0.65rem 0 0;
    color: color-mix(in srgb, var(--foreground) 70%, transparent);
    font-size: 0.8125rem;
}

.primary-format {
    display: grid;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--muted) 25%, transparent);
}

.format-kicker {
    margin: 0 0 0.5rem;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.primary-format h2,
.section-heading h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.primary-format p:not(.format-kicker),
.section-heading p,
.format-card > p:not(.format-kicker),
.build-details > p {
    color: color-mix(in srgb, var(--foreground) 75%, transparent);
}

.primary-format p:not(.format-kicker) {
    max-width: 34rem;
    margin: 0.75rem 0 0;
}

.primary-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.button {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: color-mix(in srgb, var(--foreground) 70%, transparent);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition:
        border-color 150ms ease,
        color 150ms ease,
        background-color 150ms ease;
}

.button svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.button-primary {
    border-color: var(--accent);
    color: var(--accent);
}

.button-primary:hover {
    background: var(--accent);
    color: var(--background);
}

.other-formats {
    margin-top: 3.5rem;
    padding-top: 3.5rem;
    border-top: 1px dashed var(--border);
}

.section-heading {
    margin-bottom: 1.5rem;
}

.section-heading p {
    margin: 0.75rem 0 0;
}

.format-grid {
    display: grid;
    gap: 1rem;
}

.format-card {
    display: flex;
    min-height: 16rem;
    flex-direction: column;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--background);
    transition: border-color 150ms ease;
}

.format-card:hover,
.format-card:focus-within {
    border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
}

.format-card h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.4;
    font-weight: 600;
}

.format-card h3 a {
    text-decoration: none;
    text-underline-offset: 0.25rem;
}

.format-card:hover h3 a {
    color: var(--accent);
}

.format-card h3 a:hover {
    text-decoration: underline dashed;
}

.format-card > p:not(.format-kicker) {
    margin: 0.75rem 0 0;
    font-size: 0.9375rem;
    line-height: 1.65;
}

.card-action {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.25rem;
    margin-top: auto;
    padding-top: 1.5rem;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    text-underline-offset: 0.25rem;
}

.card-action:hover {
    text-decoration: underline dashed;
}

.card-action svg {
    width: 1rem;
    height: 1rem;
}

.build-details {
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.build-details summary {
    width: fit-content;
    color: color-mix(in srgb, var(--foreground) 70%, transparent);
    font-size: 0.875rem;
    font-weight: 600;
}

.build-details summary:hover {
    color: var(--accent);
}

.build-details > p {
    max-width: 38rem;
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
}

.detail-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 0.875rem;
}

.detail-links a {
    color: var(--accent);
    text-decoration: underline dashed;
    text-underline-offset: 0.25rem;
}

.detail-links a:hover {
    text-decoration-style: solid;
}

.site-footer {
    width: 100%;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    padding-block: 1.75rem;
    font-size: 0.875rem;
}

.footer-primary,
.footer-secondary,
.footer-social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.footer-primary {
    gap: 0.5rem 1.25rem;
}

.footer-secondary {
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.footer-primary a,
.footer-secondary a {
    text-decoration: none;
}

.footer-primary a:hover,
.footer-secondary a:hover {
    color: var(--accent);
}

.footer-social {
    width: fit-content;
    gap: 0.25rem;
    margin-top: 1rem;
}

.footer-social a {
    display: grid;
    place-items: center;
    padding: 0.5rem;
    transition: transform 150ms ease;
}

.footer-social a:hover {
    color: var(--accent);
    transform: rotate(6deg);
}

.footer-social svg {
    width: 1.5rem;
    height: 1.5rem;
}

.copyright {
    margin: 2rem 0 0;
    color: color-mix(in srgb, var(--foreground) 70%, transparent);
    font-size: 0.75rem;
    line-height: 1.25rem;
}

@media (min-width: 40rem) {
    .top-nav-wrap {
        padding-block: 1.5rem;
    }

    .brand {
        font-size: 1.5rem;
        line-height: 1;
    }

    #menu-btn {
        display: none;
    }

    #menu-items,
    #menu-items.is-open {
        position: static;
        display: flex;
        width: auto;
        align-items: center;
        gap: 0.75rem;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    #menu-items li:not(.utility-item) {
        grid-column: auto;
    }

    #menu-items li > a:not(.icon-link) {
        padding: 0.25rem 0.5rem;
        border-radius: 0;
        text-align: left;
    }

    #menu-items li > a:hover,
    #menu-items li > a:focus-visible {
        background: transparent;
    }

    .icon-link,
    #theme-btn {
        width: 2rem;
        height: 2rem;
        padding: 0.25rem;
    }

    .icon-link svg,
    #theme-btn svg {
        width: 1.5rem;
        height: 1.5rem;
    }

    .primary-format {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .format-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        column-gap: 2rem;
        padding-block: 1.5rem;
    }

    .footer-primary {
        grid-column: 1;
        grid-row: 1;
    }

    .footer-social {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        margin-top: 0;
    }

    .footer-secondary {
        grid-column: 1;
        grid-row: 2;
    }

    .copyright {
        grid-column: 1 / -1;
        grid-row: 3;
    }
}

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .site-header,
    .site-footer,
    .breadcrumb,
    .other-formats,
    .build-details,
    .primary-actions {
        display: none;
    }

    #main-content {
        max-width: none;
        padding: 0;
    }

    .primary-format {
        border: 0;
        background: transparent;
    }
}

.company-section {
    margin-top: 2.5rem;
}

.letter-downloads .button {
    text-decoration: none;
}

.letter-grid {
    display: grid;
    gap: 1rem;
}

.letter-grid .format-card {
    min-height: 13rem;
}

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