/* ==========================================================================
    Font face
   ========================================================================== */

@font-face {
    font-family: 'MD IO';
    src: url(/Resources/Fonts/mdio/MDIO-Regular.ttf) format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'MD IO';
    src: url(/Resources/Fonts/mdio/MDIO-Bold.ttf) format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


@font-face {
    font-family: 'MD IO';
    src: url(/Resources/Fonts/mdio/MDIO-Black.ttf) format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SST";
    src: url(/Resources/Fonts/stack/StackSansText.ttf) format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
    Root
   ========================================================================== */
:root {
    /* opacity of the hero section */
    --hero-opacity: 0.2;
    /* light mode */
    --glass-bg: rgba(250, 114, 41, 0.08);
    /* #F0681F */
    --glass-border: rgba(240, 104, 31, 0.15);
    /* select text color */
    --text-color-select: #F0681F;
    /* Foreground color for error block */
    --error-foreground: hsl(1, 81%, 50%);
    /* Background color for error block */
    --error-background: hsla(1, 81%, 50%, 0.1);
    /* Background color for note block */
    --note-background: rgb(234, 237, 241);
    /* Foreground color for note block */
    --note-foreground: hsl(0 0 0);
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

body {
    margin: 0;
    font-family: 'SST', system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: hsl(221, 39%, 11%);
    background-color: hsl(0, 0%, 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 0.5em;
    font-weight: 600;
    line-height: 1.25;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.6rem;
}

h3 {
    font-size: 1.3rem;
}

p {
    margin: 0 0 1em;
    opacity: 0.9;

    font-size: 0.99rem;
    font-weight: 400;
    line-height: 1.65;
}

small {
    font-size: 0.875rem;
    color: #6b7280;
}

code,
pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
        Consolas, "Liberation Mono", monospace;
}

pre {
    padding: 1rem;
    overflow-x: auto;
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 8px;
}

/* ==========================================================================
   Links
   ========================================================================== */

a {
    color: #F0681F;
    text-decoration: none;
    cursor: pointer;
}

a:hover,
a:focus {
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ==========================================================================
   Layout
   ========================================================================== */

header,
main,
footer {
    padding: 2rem 0;
}

/* ==========================================================================
   Lists
   ========================================================================== */

ul,
ol {
    padding-left: 1.8rem;
    margin: 0 0 1rem;
}

li {
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

/* ==========================================================================
   Media
   ========================================================================== */

img {
    max-width: 100%;
    height: auto;
    display: block;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

button {
    font: inherit;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    background-color: #2563eb;
    color: #ffffff;
    cursor: pointer;
}

button:hover {
    background-color: #1d4ed8;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 2rem;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6b7280;
}

.navigation {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: 'MD IO';
    font-size: 0.8rem;
    font-weight: 500;
    background: transparent;
    transition: background-color 0.35s ease, backdrop-filter 0.35s ease;
}

.navigation.scrolled {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);

    /* fade blur vertically */
    -webkit-mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 0.9) 40%,
            rgba(0, 0, 0, 0.4) 70%,
            rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 0.9) 40%,
            rgba(0, 0, 0, 0.4) 70%,
            rgba(0, 0, 0, 0) 100%);
}

.navigation .menu-left {
    display: flex;
}

.navigation .menu-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.main-centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;

    min-height: 90vh;
}

.hero {
    display: block;
    max-width: 100%;
    height: 70vh;
    background-image: url(../Resources/Swift.png);
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: auto;
    opacity: var(--hero-opacity);
}

.before-scroll {
    margin: 0;
    padding-top: 80px;
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 0px;
    border-bottom: 0.02rem solid #4D4D4E;
    font-size: 1.15rem;
}

.inline-image {
    display: inline-flex;
    transform: translateY(2.5px);
}

/* Chevron animation */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    50% {
        transform: translateY(6px);
        opacity: 1;
    }
}

/* ==========================================================================
   Liquid Glass Search box
   ========================================================================== */
.glass-search {
    width: 240px;
    padding: 4px 10px;
    border-radius: 999px;

    background: var(--glass-bg);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);

    border: 1px solid var(--glass-border);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.2);
}

.glass-search input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;

    color: var(--text-color-select);
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: inherit;
}

.glass-search input::placeholder {
    color: var(--text-color-select);
}

.glass-search:focus {
    background: rgba(255, 255, 255, 0.2);
}

.glass-search:focus-visible {
    background: rgba(255, 255, 255, 0.2);
}

.glass-search:hover {
    background: rgba(255, 255, 255, 0.2);
}

.glass-search:focus-within {
    border-color: rgba(255, 255, 255, 0.45);
}

.two-col-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 2rem 0;
    font-size: 0.85rem;
}

.note {
    display: block;

    padding: 0.8rem;

    border: 0;
    border-radius: 1rem;

    background-color: var(--note-background);
    color: var(--note-foreground);

    font-size: 0.8rem;
    font-weight: 400;
}

.error {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;

    padding: 1rem 1.4rem;
    border-radius: 12px;

    background: var(--error-background);
    color: var(--error-foreground);
    font-weight: 300;

    &::before {
        content: "";
        flex: 0 0 1.25rem;

        width: 1.25rem;
        height: 1.25rem;
        margin-top: 0.2rem;

        background: var(--error-foreground);
        mask: url("/Resources/svg/exclamationmark.circle.fill.svg") no-repeat center / contain;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

:focus:not(:focus-visible) {
    outline: none;
}

/* ==========================================================================
   Dark Mode (system-based)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        /* opacity of the hero section */
        --hero-opacity: 1;
        --glass-bg: rgba(203, 109, 58, 0.18);
        /* #CB6D3A */
        --glass-border: rgba(203, 109, 58, 0.35);
        /* select text color */
        --text-color-select: #CB6D3A;
        /* Foreground color for error block */
        --error-foreground: hsl(1, 100%, 57%);
        /* Background color for error block */
        --error-background: hsl(1, 68%, 53%, 0.25);
        /* Background color for note block */
        --note-background: rgb(40, 41, 43);
        /* Foreground color for note block */
        --note-foreground: hsl(0, 0%, 100%);
    }

    body {
        background-color: #09090a;
        color: #ffffff;
    }

    a {
        color: #CB6D3A;
    }

    pre {
        background: #020617;
    }
}

@media (width < 640px) {
    .hero {
        height: 60vh;
        background-image: url(../Resources/Swift-small.png);
    }

    .two-col-grid {
        padding: 0;
        gap: 1rem 1rem;
    }

    .glass-search {
        width: 89px;
    }
}