:root {
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #0f172a;
    background: #ffffff;
    font-weight: 400;

    --color-ink: #0f172a;
    --color-muted: #64748b;
    --color-border: #e2e8f0;
    --color-accent: #c2410c;
    --page-width: 80rem;
    --content-width: 52rem;

    transition: background-color 280ms ease, color 280ms ease;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    transition: background-color 280ms ease, color 280ms ease;
}

.site-header {
    position: sticky;
    z-index: 10;
    top: 0;
    border-bottom: 1px solid var(--color-border);
    background: rgb(255 255 255 / 90%);
    backdrop-filter: blur(12px);
    transition: background-color 280ms ease, border-color 280ms ease;
}

.navbar {
    display: flex;
    width: 100%;
    max-width: var(--page-width);
    height: 4rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.625rem;
}

.theme-toggle {
    display: inline-flex;
    position: relative;
    width: 3.25rem;
    height: 1.875rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.125rem;
    background: #e2e8f0;
    color: #475569;
    cursor: pointer;
    transition: border-color 280ms ease, background-color 280ms ease, color 280ms ease;
}

.theme-toggle:hover {
    color: var(--color-ink);
}

.theme-toggle:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

.theme-toggle-thumb {
    display: grid;
    width: 1.375rem;
    height: 1.375rem;
    place-items: center;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgb(15 23 42 / 20%);
    transform: translateX(0);
    transition: background-color 280ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-toggle-thumb svg {
    width: 0.875rem;
    height: 0.875rem;
    grid-area: 1 / 1;
    transition: color 280ms ease, opacity 160ms ease, transform 280ms ease;
}

.theme-toggle-thumb .icon-moon {
    color: #475569;
    opacity: 0;
    transform: rotate(-35deg) scale(0.7);
}

.theme-toggle-thumb .icon-sun {
    color: #b45309;
    opacity: 1;
    transform: rotate(0) scale(1);
}

.brand,
.language-menu summary,
.language-options,
.language-options button,
.social-link,
.page-footer {
    transition: background-color 280ms ease, border-color 280ms ease, color 280ms ease;
}

.brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-ink);
    text-decoration: none;
}

.brand-name {
    flex: 0 0 auto;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    transition: color 150ms ease;
}

.brand:hover .brand-name {
    color: var(--color-accent);
}

.brand-description {
    overflow: hidden;
    padding-left: 0.75rem;
    border-left: 1px solid var(--color-border);
    color: #94a3b8;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.language-menu {
    position: relative;
    flex: 0 0 auto;
}

.language-menu summary {
    display: flex;
    min-height: 2.5rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.625rem;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    list-style: none;
    transition: border-color 280ms ease, background-color 280ms ease, color 280ms ease;
}

.language-menu summary::-webkit-details-marker {
    display: none;
}

.language-menu summary:hover {
    background: #f8fafc;
    color: var(--color-ink);
}

.language-menu summary:focus-visible,
.language-options button:focus-visible,
.brand:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

.language-menu summary > svg {
    width: 1.125rem;
    height: 1.125rem;
    flex: 0 0 auto;
}

.language-menu summary .language-chevron {
    width: 0.875rem;
    height: 0.875rem;
    margin-left: 0.125rem;
    transition: transform 150ms ease;
}

.language-menu[open] .language-chevron {
    transform: rotate(180deg);
}

.language-options {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 11;
    min-width: 11rem;
    padding: 0.25rem;
    border: 1px solid var(--color-border);
    border-radius: 0.625rem;
    background: #ffffff;
    box-shadow: 0 8px 20px rgb(15 23 42 / 8%);
}

.language-options button {
    display: block;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font: inherit;
    font-size: 0.8125rem;
    text-align: left;
}

.language-options button:hover,
.language-options button[aria-pressed="true"] {
    background: #f1f5f9;
    color: var(--color-ink);
}

.landing {
    display: grid;
    flex: 1;
    place-items: center;
    padding: 3rem 1.5rem;
}

.profile {
    width: 100%;
    max-width: var(--content-width);
}

.link-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 0.75rem;
}

.link-list {
    display: grid;
    grid-template-rows: repeat(5, minmax(3.5rem, auto));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.link-list li {
    min-width: 0;
}

.social-link {
    display: flex;
    min-height: 3.5rem;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 0.625rem;
    background: #ffffff;
    color: var(--color-ink);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    transition: border-color 280ms ease, background-color 280ms ease, color 280ms ease;
}

.social-link > svg {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
    color: var(--color-muted);
}

a.social-link:not(.social-link--featured):hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

a.social-link:focus-visible,
button.social-link:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

button.social-link--copy {
    width: 100%;
    cursor: pointer;
    text-align: left;
}

button.social-link--copy:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.copy-feedback {
    margin-left: auto;
    color: var(--color-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.social-link--featured {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    border-color: #ffffff40;
    background: #0f172a url("assets/portfolio/portfolio-preview.jpg") left center / cover no-repeat;
    color: #ffffff;
    transition: border-color 280ms ease, background-color 280ms ease, color 280ms ease;
}

.social-link--featured::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: rgb(0 0 0 / 42%);
    content: "";
    transition: background-color 150ms ease;
}

.social-link--featured > span {
    position: relative;
    z-index: 1;
    margin-top: auto;
    font-size: 1.625rem;
    font-weight: 600;
    letter-spacing: -0.035em;
}

a.social-link--featured:hover {
    border-color: #ffffff80;
    background: #0f172a url("assets/portfolio/portfolio-preview.jpg") left center / cover no-repeat;
}

a.social-link--featured:hover::before {
    background: rgb(0 0 0 / 32%);
}

.social-link--featured .link-arrow {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #ffffff;
}

@media (min-width: 561px) {
    .social-link--featured {
        padding: 1.5rem;
    }

    .social-link--featured .link-arrow {
        top: 1.5rem;
        right: 1.5rem;
    }
}

.social-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.link-arrow {
    width: 1rem !important;
    height: 1rem !important;
    margin-left: auto;
}

.social-link--unavailable {
    border-style: dashed;
    color: var(--color-muted);
}

.social-link--unavailable > svg {
    opacity: 0.75;
}

.link-status {
    margin-left: auto;
    color: var(--color-muted);
    font-size: 0.75rem;
    font-weight: 400;
    text-align: right;
}

.page-footer {
    padding: 1rem 1rem 1.5rem;
    color: #94a3b8;
    font-size: 0.75rem;
    text-align: center;
}

.page-footer p {
    margin: 0;
}

@media (max-width: 360px) {
    .navbar {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .social-link {
        gap: 0.625rem;
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .link-status {
        font-size: 0.6875rem;
    }
}

@media (max-width: 560px) {
    .brand-description {
        display: none;
    }

    .landing {
        padding: 2rem 1.25rem;
    }

    .link-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .social-link--featured {
        grid-column: 1;
        grid-row: auto;
        min-height: 3.5rem;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 0.875rem;
    }

    .social-link--featured > svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .social-link--featured .link-arrow {
        position: static;
        margin-left: auto;
    }

    .social-link--featured > span {
        margin-top: 0;
        font-size: 0.9375rem;
        font-weight: 500;
        letter-spacing: normal;
    }

    .link-list {
        grid-template-rows: repeat(5, minmax(3.5rem, auto));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 160ms !important;
    }
}
