/* Home page */

.site-main:has(.home-about) {
    padding-block: 0;
}

/* About */
.home-about {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    padding-block: clamp(3rem, 8vh, 6rem);
}

.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.about-inner {
    animation: home-fade-up 0.7s ease both;
}

.about-visual {
    animation: home-fade-up 0.7s ease 0.12s both;
}

.code-panel {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--color-surface) 88%, transparent);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.code-panel::before {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, var(--color-accent-soft), transparent 70%);
    pointer-events: none;
}

.code-panel-bar {
    display: flex;
    gap: 0.4rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.code-panel-bar span {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--color-border);
}

.code-panel-bar span:nth-child(1) { background: #e07a5f; }
.code-panel-bar span:nth-child(2) { background: #e9c46a; }
.code-panel-bar span:nth-child(3) { background: #2a9d8f; }

.code-panel-body {
    margin: 0;
    padding: 1.25rem 1.35rem 1.5rem;
    font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
    font-size: clamp(0.78rem, 1.5vw, 0.9rem);
    line-height: 1.75;
    direction: ltr;
    text-align: left;
    overflow-x: auto;
    color: var(--color-muted);
    position: relative;
}

.code-kw { color: var(--color-accent); font-weight: 600; }
.code-fn { color: var(--color-ink); font-weight: 600; }
.code-str { color: #3dba91; }

[data-theme="light"] .code-str {
    color: #0f6e56;
}

.about-eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-accent);
    letter-spacing: 0.04em;
}

.about-brand {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.about-titles {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    color: var(--color-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.about-titles li {
    position: relative;
}

.about-titles li:not(:last-child)::after {
    content: "";
    position: absolute;
    inset-inline-end: -0.7rem;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-muted);
    opacity: 0.45;
    transform: translateY(-50%);
}

.about-text {
    margin: 1.5rem 0 0;
    color: var(--color-muted);
    font-size: 1.05rem;
    max-width: 34rem;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
    animation: home-fade-up 0.7s ease 0.15s both;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.35rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-ghost {
    background: transparent;
    color: var(--color-ink);
    border-color: var(--color-border);
}

.btn-ghost:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-accent-soft);
}

/* Sections */
.home-section {
    padding-block: clamp(3.5rem, 8vh, 5.5rem);
}

.home-section-alt {
    background: color-mix(in srgb, var(--color-bg-soft) 55%, transparent);
}

.section-head {
    margin-bottom: 2.5rem;
    max-width: 32rem;
    animation: home-fade-up 0.6s ease both;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-head p {
    margin: 0.6rem 0 0;
    color: var(--color-muted);
}

.section-empty {
    color: var(--color-muted);
    margin: 0;
}

.section-more {
    margin-top: 1.75rem;
    display: flex;
    justify-content: center;
}

.item-meta {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-accent);
}

/* Portfolio / Blog: centered heading + cards */
#portfolio .section-head,
#blog .section-head {
    text-align: center;
    margin-inline: auto;
}

#portfolio .post-list,
#blog .post-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.75rem;
}

#portfolio .post-item,
#blog .post-item {
    flex: 0 1 calc((100% - 3.5rem) / 3);
    min-width: min(100%, 16rem);
    text-align: center;
}

#portfolio .section-empty,
#blog .section-empty {
    text-align: center;
}

/* Posts / Projects cards */
.post-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}

.post-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: inherit;
    padding: 0.85rem;
    border: 1px solid color-mix(in srgb, var(--color-border) 45%, transparent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--color-surface) 55%, transparent);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

a.post-item {
    cursor: pointer;
}

.post-item:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--color-accent) 28%, transparent);
}

.post-item:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: var(--radius);
}

.post-media {
    overflow: hidden;
    border-radius: var(--radius);
    aspect-ratio: 16 / 10;
    background: var(--color-bg-soft);
}

.post-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.post-item:hover .post-media img {
    transform: scale(1.04);
}

.post-body h3 {
    margin: 0.35rem 0 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.post-body p {
    margin: 0.75rem 0 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.post-body time {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* Contact */
.home-contact {
    padding-block: clamp(3.5rem, 8vh, 5rem);
}

.contact-inner {
    text-align: center;
    max-width: 28rem;
    margin-inline: auto;
}

.contact-inner h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2rem);
}

.contact-inner p {
    margin: 0.75rem 0 1.5rem;
    color: var(--color-muted);
}

@keyframes home-fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 860px) {
    .about-layout {
        grid-template-columns: 1fr;
    }

    .about-visual {
        order: -1;
        max-width: 28rem;
        margin-inline: auto;
        width: 100%;
    }

    .post-list {
        grid-template-columns: 1fr;
    }

    #portfolio .post-item,
    #blog .post-item {
        flex: 1 1 100%;
    }

    .about-titles li:not(:last-child)::after {
        display: none;
    }
}

@media (min-width: 861px) and (max-width: 980px) {
    .post-list {
        grid-template-columns: repeat(2, 1fr);
    }

    #portfolio .post-item,
    #blog .post-item {
        flex: 0 1 calc((100% - 1.75rem) / 2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .about-inner,
    .about-actions,
    .section-head,
    .post-item,
    .post-media img,
    .btn {
        animation: none;
        transition: none;
    }
}
