/**! ==================== IMPORT ==================== **/

@import url("./default.css");
@import url("./global.css");
/* @import url("./breakpoints.css"); */

/**! ==================== HEADER ==================== **/

.header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-surface);
}

.header::after {
    position: absolute;
    bottom: 0;
    left: 50%;
    height: 1px;
    width: min(100% - 30px, calc(var(--container-max) / 1.18));
    background: linear-gradient(to right, transparent, var(--border-header), transparent);
    transform: translateX(-50%);
    content: "";
}

.header__container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 12px 15px;
}

/** ===== BRAND ===== */

.header__brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 10px;
}

.header__brand:focus-visible {
    border-radius: var(--radius-pill);
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.header__brand-logo {
    display: block;
    flex: 0 0 auto;
    height: 32px;
    width: 32px;
    background: url("../images/logo/logo.svg") center / contain no-repeat;
}

:root[data-theme="light"] .header__brand-logo {
    background-image: url("../images/logo/logo-light.svg");
}

.header__brand-name {
    font-weight: var(--fw-bold);
    font-size: var(--fs-sm);
    letter-spacing: var(--ls-heading);
    color: var(--txt-primary);
}

/** ===== NAVIGATION ===== */

.header__nav {
    display: inline-flex;
    justify-self: center;
}

.header__nav-list {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header__nav-link {
    display: inline-flex;
    align-items: center;
    font-weight: var(--fw-medium);
    font-size: var(--fs-xs);
    letter-spacing: var(--ls-base);
    color: var(--txt-muted);
}

/** ===== ACTIONS ===== */

.header__actions {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 10px;
}

.header__external-link,
.header__theme-toggle {
    font-weight: var(--fw-medium);
    font-size: var(--fs-xs);
    letter-spacing: var(--ls-base);
    color: var(--txt-muted);
}

/**! ==================== MAIN ==================== **/

.main {
    flex-grow: 1;
}

.main__container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas:
        "welcome stack"
        "news    stack"
        "projects projects"
        "blog    blog";
    align-items: start;
    gap: 30px;
    margin: 50px auto;
}

/** ==================== SECTION WELCOME ==================== **/

.welcome {
    grid-area: welcome;
    padding: 0 10px 10px;
}

.welcome__title {
    font-size: var(--fs-xl);
    color: var(--txt-primary);
}

.welcome__title>span {
    color: var(--accent-primary);
}

.welcome__text {
    margin-top: 10px;
    font-weight: var(--fw-medium);
    font-style: italic;
    color: var(--txt-secondary);
}

.welcome__text-typed::after {
    margin-left: 1px;
    font-style: normal;
    color: var(--accent-primary);
    opacity: 0;
    content: "|";
}

.welcome__text.is-typing .welcome__text-typed::after {
    animation: caret-blink 1s steps(1, end) infinite;
}

/** ==================== SECTION STACK ==================== **/

.stack {
    grid-area: stack;
    padding: 0 10px 10px;
}

/** ==================== SECTION NEWS ==================== **/

.news {
    grid-area: news;
    padding: 0 10px 10px;
}

.news__title {
    padding: 0 0 10px;
    font-style: italic;
    text-align: right;
    color: var(--txt-primary);
}

.news__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.news__card {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 14px;
    transition: border-color var(--dur-fast) ease;
}

.news__card:hover,
.news__card:focus-within {
    border-color: var(--border-hover);
}

.news__date {
    font-size: var(--fs-2xs);
    color: var(--txt-muted);
}

.news__card-title {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    margin: 6px 0;
    font-size: var(--fs-xs);
    line-height: var(--lh-snug);
    color: var(--txt-primary);
    overflow: hidden;
}

.news__text {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    margin-bottom: 14px;
    font-size: var(--fs-2xs);
    line-height: var(--lh-snug);
    color: var(--txt-muted);
    overflow: hidden;
}

.news__button {
    align-self: flex-start;
    margin: auto 0 0;
    font-weight: var(--fw-medium);
    font-size: var(--fs-2xs);
    color: var(--txt-muted);
}

/** ==================== SECTION PROJECTS ==================== **/

.projects {
    grid-area: projects;
    padding: 0 10px 10px;
}

.projects__layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    margin-top: 25px;
}

/** ===== PROJECTS PANEL ===== */

.projects-panel {
    display: flex;
    flex-direction: column;
}

.projects-panel__nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

.projects-panel__item {
    display: grid;
    align-items: center;
    height: 50px;
    background-color: var(--bg-elevated);
    padding: 5px 10px;
    color: var(--txt-primary);
    transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.projects-panel__item:hover,
.projects-panel__item:focus-visible {
    background-color: var(--bg-card-hover);
    transform: translateX(5px);
}

.projects-panel__item.is-active {
    background-color: var(--bg-card-active);
}

.projects-panel__name {
    font-weight: var(--fw-bold);
    color: var(--txt-primary);
}

/** ===== PROJECTS GALLERY ===== */

.projects-gallery__viewport {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.projects-gallery__slide {
    position: absolute;
    inset: 0;
    margin: 0;
}

.projects-gallery__slide[hidden] {
    display: none;
}

.projects-gallery__placeholder {
    height: 100%;
    width: 100%;
    background: repeating-linear-gradient(45deg,
            var(--bg-card-hover),
            var(--bg-card-hover) 12px,
            var(--bg-elevated) 12px,
            var(--bg-elevated) 24px);
}

/** ===== ARROWS ===== */

.projects-gallery__arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    height: 42px;
    width: 42px;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-default);
    border-radius: 50%;
    transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, opacity var(--dur-fast) ease;
    transform: translateY(-50%);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.projects-gallery__arrow::before {
    display: block;
    height: 16px;
    width: 16px;
    background-color: var(--txt-primary);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    transition: background-color var(--dur-fast) ease;
    content: "";
}

.projects-gallery__arrow--prev {
    left: 10px;
}

.projects-gallery__arrow--prev::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
}

.projects-gallery__arrow--next {
    right: 10px;
}

.projects-gallery__arrow--next::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
}

.projects-gallery__arrow:hover,
.projects-gallery__arrow:focus-visible {
    background-color: var(--bg-card-hover);
    border-color: var(--border-hover);
    outline: none;
}

.projects-gallery__arrow:disabled {
    pointer-events: none;
    opacity: 0;
}

/** ===== INFO CARD ===== */

.projects-gallery__card {
    position: absolute;
    bottom: 15px;
    left: 50%;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    align-items: start;
    gap: 20px;
    width: min(80%, 560px);
    background-color: var(--bg-glass);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xs);
    padding: 12px;
    transition: opacity var(--dur-base) ease, transform var(--dur-base) ease, border-color var(--dur-base) ease;
    transform: translate(-50%, 10px);
    backdrop-filter: blur(16px);
    pointer-events: none;
    opacity: 0;
}

.projects-gallery__viewport:hover .projects-gallery__card,
.projects-gallery__viewport:focus-within .projects-gallery__card {
    border-color: var(--border-hover);
    transform: translate(-50%, 0);
    pointer-events: auto;
    opacity: 1;
}

.projects-gallery__project-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.projects-gallery__project-desc {
    max-width: 100%;
    margin: 0 0 12px;
    font-weight: var(--fw-medium);
    font-size: var(--fs-2xs);
    line-height: var(--lh-snug);
    color: var(--txt-muted);
}

.projects-gallery__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
}

.projects-gallery__button {
    height: 30px;
    width: 100%;
    background-color: var(--bg-tint);
    padding: 6px 12px;
    font-weight: var(--fw-medium);
    font-size: var(--fs-2xs);
    color: var(--txt-secondary);
}

/** ===== FOOTER / DOTS ===== */

.projects-gallery__footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0 0;
}

.projects-gallery__dots {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.projects-gallery__dot {
    height: 8px;
    width: 8px;
    background-color: var(--dot-idle);
    border-radius: 50%;
    transition: background var(--dur-slow) ease, width var(--dur-slow) ease, border-radius var(--dur-slow) ease;
    cursor: pointer;
}

.projects-gallery__dot:hover,
.projects-gallery__dot:focus-visible {
    background-color: var(--txt-secondary);
}

.projects-gallery__dot.is-active {
    width: 30px;
    background-color: var(--dot-active);
    border-radius: var(--radius-pill);
}

/** ==================== SECTION BLOG ==================== **/

.blog {
    grid-area: blog;
    padding: 0 10px 10px;
}

/** ===== TAGS ===== */

.blog__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.blog__tag {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-pill);
    padding: 5px 14px;
    font-weight: var(--fw-medium);
    font-size: var(--fs-2xs);
    letter-spacing: var(--ls-base);
    color: var(--txt-muted);
    transition:
        background var(--dur-fast) ease,
        border-color var(--dur-fast) ease,
        color var(--dur-fast) ease,
        transform var(--dur-fast) ease;
    user-select: none;
}

.blog__tag:hover,
.blog__tag:focus-visible {
    border-color: var(--border-hover);
    color: var(--txt-primary);
}

.blog__tag:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.blog__tag:active {
    transform: scale(.95);
}

.blog__tag.is-active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--txt-primary);
}

.blog__tag-badge {
    flex: 0 0 auto;
    background-color: var(--accent-ghost);
    border-radius: var(--radius-pill);
    padding: 3px 8px;
    font-size: var(--fs-2xs);
    line-height: var(--lh-tight);
    color: var(--accent-primary);
}

/** ===== LAYOUT ===== */

.blog__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    align-items: start;
    gap: 30px;
    margin-top: 25px;
}

/** ===== FEATURED POST ===== */

.blog-featured {
    display: flex;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    transition: border-color var(--dur-base) ease, transform var(--dur-base) ease;
    overflow: hidden;
}

.blog-featured:hover,
.blog-featured:focus-within {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.blog-featured__link {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.blog-featured__link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
}

.blog-featured__cover {
    aspect-ratio: 16 / 9;
    background: repeating-linear-gradient(45deg,
            var(--bg-card-hover),
            var(--bg-card-hover) 12px,
            var(--bg-elevated) 12px,
            var(--bg-elevated) 24px);
}

.blog-featured__body {
    padding: 20px;
}

.blog-featured__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.blog-featured__label {
    font-size: var(--fs-2xs);
    letter-spacing: var(--ls-base);
    color: var(--accent-primary);
}

.blog-featured__date {
    font-size: var(--fs-2xs);
    color: var(--txt-muted);
}

.blog-featured__post-title {
    margin: 12px 0 8px;
    font-weight: var(--fw-bold);
    font-size: var(--fs-md);
    line-height: var(--lh-tight);
    color: var(--txt-primary);
}

.blog-featured__excerpt {
    font-size: var(--fs-xs);
    line-height: var(--lh-snug);
    color: var(--txt-secondary);
}

/** ===== TIMELINE ===== */

.blog-timeline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-left: 2px solid var(--border-default);
}

.blog-timeline__item {
    position: relative;
    padding: 0 0 25px 25px;
}

.blog-timeline__item::before {
    position: absolute;
    top: 4px;
    left: -7px;
    height: 12px;
    width: 12px;
    background-color: var(--bg-base);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    content: "";
}

.blog-timeline__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.blog-timeline__date {
    font-size: var(--fs-2xs);
    color: var(--txt-muted);
}

.blog-timeline__post-title {
    margin-bottom: 5px;
    font-weight: var(--fw-bold);
    font-size: var(--fs-sm);
    line-height: var(--lh-tight);
    color: var(--txt-primary);
}

.blog-timeline__link {
    color: inherit;
    transition: color var(--dur-fast) ease;
}

.blog-timeline__link:hover,
.blog-timeline__link:focus-visible {
    color: var(--accent-primary);
}

.blog-timeline__link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.blog-timeline__excerpt {
    font-size: var(--fs-xs);
    line-height: var(--lh-snug);
    color: var(--txt-secondary);
}

.blog-timeline__more {
    margin-left: 25px;
    font-weight: var(--fw-medium);
    font-size: var(--fs-xs);
    letter-spacing: var(--ls-base);
    color: var(--txt-muted);
}

/**! ==================== FOOTER ==================== **/

.footer {
    position: relative;
    background-color: var(--bg-surface);
}

.footer::before {
    position: absolute;
    top: 0;
    left: 50%;
    height: 1px;
    width: min(100% - 30px, calc(var(--container-max) / 1.18));
    background: linear-gradient(to right, transparent, var(--border-header), transparent);
    transform: translateX(-50%);
    content: "";
}

.footer__container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px 20px;
    padding: 20px 15px;
}

.footer__copyright {
    font-size: var(--fs-xs);
    color: var(--txt-muted);
}

.footer__brand {
    font-weight: var(--fw-bold);
    color: var(--txt-secondary);
    transition: color var(--dur-fast) ease;
}

.footer__brand:hover,
.footer__brand:focus-visible {
    color: var(--accent-primary);
}

.footer__link {
    flex: 0 0 auto;
    font-size: var(--fs-xs);
    letter-spacing: var(--ls-base);
    color: var(--txt-muted);
}

/**! ==================== ERROR ==================== **/

.error__container {
    place-items: center;
    display: grid;
    min-height: 100%;
    margin: 90px auto;
}

.error {
    max-width: 620px;
    padding: 0 10px 10px;
    text-align: center;
}

.error__code {
    font-weight: var(--fw-bold);
    font-size: clamp(5rem, 3rem + 9vw, 9rem);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-heading);
    color: var(--accent-primary);
}

.error__title {
    margin-top: 10px;
    color: var(--txt-primary);
}

.error__text {
    margin-top: 14px;
    font-style: italic;
    font-size: var(--fs-xs);
    color: var(--txt-secondary);
}

.error__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.error__button {
    font-weight: var(--fw-medium);
    font-size: var(--fs-xs);
    letter-spacing: var(--ls-base);
    color: var(--txt-muted);
}

/**! ==================== ANIMATIONS ==================== **/

@keyframes caret-blink {
    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}
