/* ═══════════════════════════════════════════════════
   Design System — 1:1 iucc.me Clone
   ═══════════════════════════════════════════════════ */

@import url('https://api.fontshare.com/v2/css?f[]=alpino@400,500,700&display=swap');

/* ── Root ── */
:root {
    color: #fff;
    background: #000;
    font-family: "Alpino", monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100vh;
    margin: 0;
    background: #000;
    color: #fff;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

/* ── Links ── */
a {
    color: #fff;
    text-decoration: none;
    width: fit-content;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    padding-bottom: 0.15rem;
    transition: border-color 0.12s ease, opacity 0.12s ease;
}

a:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.55);
    outline-offset: 0.35rem;
}

a:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.85);
}

/* ── Nav link ── */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    transition: color 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.nav-link svg,
.nav-link i {
    width: 1rem;
    height: 1rem;
    transition: color 0.14s ease, filter 0.14s ease;
    font-size: 1rem;
}

.nav-link:hover {
    color: var(--hover-color, #ffffff);
    border-color: var(--hover-color, rgba(255, 255, 255, 0.85));
}

.nav-link:hover svg,
.nav-link:hover i {
    color: var(--hover-color, #ffffff);
    filter: drop-shadow(0 0 0.35rem color-mix(in srgb, var(--hover-color, #ffffff) 45%, transparent));
}

/* ── Page shell ── */
.page-shell {
    min-height: 100vh;
    display: block;
    padding: 4.5rem 2rem 3rem;
}

/* ── Hero ── */
.hero {
    position: relative;
    width: min(100%, 36rem);
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    margin: 0 0 2rem;
    font-size: clamp(1.35rem, 3vw, 2.1rem);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── Scroll hint ── */
.scroll-hint {
    display: inline-grid;
    place-items: center;
    margin: 0 0 2.25rem;
    color: rgba(255, 255, 255, 0.34);
    border: none;
}

.scroll-hint i {
    font-size: 1rem;
    animation: scroll-float 2.8s ease-in-out infinite;
}

/* ── Link groups ── */
.link-groups {
    display: grid;
    gap: 2rem;
    justify-items: center;
    margin-bottom: 3rem;
}

.link-group {
    position: relative;
    display: grid;
    gap: 0.85rem;
    justify-items: center;
}

.link-group h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ── Project preview (hover card) ── */
.project-preview {
    position: relative;
    display: grid;
    justify-items: center;
    z-index: 20;
}

.project-link {
    position: relative;
    z-index: 2;
}

.preview-card {
    position: absolute;
    z-index: 30;
    top: -0.35rem;
    left: calc(100% + 2rem);
    width: min(42vw, 30rem);
    min-width: 22rem;
    max-width: 30rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.35rem;
    background: radial-gradient(
        circle at top,
        color-mix(in srgb, var(--hover-color, #ffffff) 20%, transparent),
        transparent 48%
    ), #0a0a0cf0;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    opacity: 0;
    pointer-events: none;
    transform: translate(-0.6rem) scale(0.98);
    transform-origin: left top;
    transition: opacity 0.22s ease, transform 0.24s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.project-preview:hover .preview-card,
.project-preview:focus-within .preview-card {
    opacity: 1;
    transform: translate(0) scale(1);
    border-color: color-mix(in srgb, var(--hover-color, #ffffff) 28%, rgba(255, 255, 255, 0.12));
    box-shadow: 0 1.8rem 4.5rem rgba(0, 0, 0, 0.58),
                0 0 1.4rem color-mix(in srgb, var(--hover-color, #ffffff) 18%, transparent);
}

.preview-image-wrap {
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.preview-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1400 / 891;
    object-fit: contain;
    filter: saturate(0.95) contrast(1.02);
    transform: scale(1.02);
    transition: transform 0.28s ease, filter 0.22s ease;
}

.project-preview:hover .preview-image,
.project-preview:focus-within .preview-image {
    transform: scale(1.05);
    filter: saturate(1.02) contrast(1.06);
}

.preview-copy {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1rem 1.1rem;
    text-align: left;
}

.preview-title,
.preview-description {
    margin: 0;
}

.preview-title {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--hover-color, #ffffff) 72%, #ffffff);
}

.preview-description {
    font-size: 0.96rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
}

/* ── Stack sections (tech grid) ── */
.stack-sections {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 1.75rem;
    width: min(100%, 36rem);
    margin: 0 auto;
    content-visibility: auto;
    contain-intrinsic-size: 1200px;
}

.stack-section {
    display: grid;
    gap: 0.65rem;
}

.stack-section h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0;
    animation: fade-in-up 0.56s ease forwards;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.tech-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.03);
    opacity: 0;
    animation: fade-in-up 0.56s ease forwards;
    transition: color 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
}

.tech-item:hover {
    color: var(--hover-color, #ffffff);
    border-color: color-mix(in srgb, var(--hover-color, #ffffff) 55%, rgba(255, 255, 255, 0.16));
    background: color-mix(in srgb, var(--hover-color, #ffffff) 10%, rgba(255, 255, 255, 0.03));
}

.tech-icon {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    transition: color 0.14s ease, border-color 0.14s ease, background-color 0.14s ease, filter 0.14s ease;
}

.tech-item:hover .tech-icon {
    color: var(--hover-color, #ffffff);
    border-color: color-mix(in srgb, var(--hover-color, #ffffff) 45%, rgba(255, 255, 255, 0.22));
    background: color-mix(in srgb, var(--hover-color, #ffffff) 14%, rgba(255, 255, 255, 0.06));
    filter: drop-shadow(0 0 0.4rem color-mix(in srgb, var(--hover-color, #ffffff) 32%, transparent));
}

.tech-icon svg,
.tech-icon i {
    width: 1.05rem;
    height: 1.05rem;
    font-size: 1.05rem;
}

/* ── Staggered animation delays ── */
.stack-section:nth-of-type(1) h2 { animation-delay: 0.2s; }
.stack-section:nth-of-type(2) h2 { animation-delay: 0.28s; }
.stack-section:nth-of-type(3) h2 { animation-delay: 0.36s; }
.stack-section:nth-of-type(4) h2 { animation-delay: 0.44s; }
.stack-section:nth-of-type(5) h2 { animation-delay: 0.52s; }

.stack-section:nth-of-type(1) .tech-item { animation-delay: 0.14s; }
.stack-section:nth-of-type(2) .tech-item { animation-delay: 0.22s; }
.stack-section:nth-of-type(3) .tech-item { animation-delay: 0.3s; }
.stack-section:nth-of-type(4) .tech-item { animation-delay: 0.38s; }
.stack-section:nth-of-type(5) .tech-item { animation-delay: 0.46s; }

/* ── Keyframes ── */
@keyframes fade-in-up {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes scroll-float {
    0%, 100% { transform: translateY(0); opacity: 0.45; }
    50%      { transform: translateY(0.38rem); opacity: 0.8; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .hero h1,
    .scroll-hint,
    .link-group h2,
    .stack-section h2,
    .nav-link,
    .tech-item {
        opacity: 1;
        animation: none;
        transition: color 0.14s ease, border-color 0.14s ease, background-color 0.14s ease, opacity 0.14s ease;
    }
    .preview-card,
    .preview-image {
        transition: none;
    }
    .scroll-hint i {
        animation: none;
    }
}

/* ── Responsive ── */
@media (max-width: 980px) {
    .preview-card {
        top: calc(100% + 1rem);
        left: 50%;
        width: min(78vw, 28rem);
        min-width: 0;
        transform: translate(-50%) translateY(-0.35rem) scale(0.98);
        transform-origin: top center;
    }
    .project-preview:hover .preview-card,
    .project-preview:focus-within .preview-card {
        transform: translate(-50%) translateY(0) scale(1);
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 3rem 1rem;
    }
    .hero {
        width: min(100%, 34rem);
    }
    .preview-card {
        width: min(88vw, 26rem);
    }
}

/* ═══════════════════════════════════════════════════
   GitHub Contribution Graph
   ═══════════════════════════════════════════════════ */

.contrib-section {
    width: min(100%, 36rem);
    margin: 2.5rem auto 0;
    opacity: 0;
    animation: fade-in-up 0.56s ease forwards;
    animation-delay: 0.6s;
}

.contrib-section h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.contrib-wrapper {
    position: relative;
    display: grid;
    gap: 0.65rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}



/* ── Month labels ── */
.contrib-months {
    position: relative;
    height: 1rem;
    margin: 0 auto 0.2rem auto;
}

.contrib-month-label {
    position: absolute;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.04em;
    white-space: nowrap;
    line-height: 1;
}

/* ── Grid ── */
.contrib-grid {
    display: flex;
    width: max-content;
    margin: 0 auto;
}

.contrib-col {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
}

/* ── Cell ── */
.contrib-cell {
    display: block;
    padding: 0;
    border: none;
    cursor: default;
    outline: none;
    opacity: 0;
    transform: scale(0.35) translateY(4px);
    animation: contrib-cascade 0.32s ease forwards;
    transition: filter 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.contrib-cell:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 1px;
}

/* Cascade entrance */
@keyframes contrib-cascade {
    0%   { opacity: 0; transform: scale(0.35) translateY(4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Twinkle ambient effect for active cells */
.contrib-cell--active {
    animation:
        contrib-cascade 0.32s ease forwards,
        contrib-twinkle var(--twinkle-duration, 2.5s) ease-in-out var(--twinkle-delay, 0s) infinite;
}

@keyframes contrib-twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.66; transform: scale(0.92); }
}

/* ── Tooltip ── */
.contrib-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    white-space: nowrap;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    background: #fff;
    color: #0d1117;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 9999;
    will-change: transform, opacity;

    opacity: 0;
    transform: translate3d(var(--tx, -500px), var(--ty, -500px), 0) translateX(-50%) translateY(-100%) scale(0.92);
    transition: opacity 0.1s ease;
}

.contrib-tooltip.visible {
    opacity: 1;
    transform: translate3d(var(--tx, -500px), var(--ty, -500px), 0) translateX(-50%) translateY(-100%) scale(1);
}

/* ── Legend ── */
.contrib-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 0.25rem;
}

.contrib-legend-swatch {
    display: block;
}

.contrib-loading,
.contrib-error {
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 1rem 0;
}

/* ═══════════════════════════════════════════════════
   Sub-page styles (About, Projects, Socials, Countdown)
   ═══════════════════════════════════════════════════ */

/* ── Back link (floating pill) ── */
.back-link {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    text-align: center;
}

.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.3rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    font-size: 0.85rem;
}

.back-link a:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

/* ── Profile pic ── */
.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 2rem auto;
    display: block;
    border: 2px solid rgba(255, 255, 255, 0.12);
    filter: grayscale(0.1);
}

/* ── About / Skills ── */
.about-me, .skills {
    margin-bottom: 3rem;
    margin-top: 3rem;
}

.about-me h2, .skills h2 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fff;
    margin-bottom: 1.5rem;
}

.about-me p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.96rem;
    line-height: 1.55;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
}

.skill-list i {
    font-size: 2.4rem;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.14s ease;
}

.skill-item:hover i {
    color: #fff;
}

.skill-name {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    margin-top: 0.2rem;
    text-align: center;
}

.proficiency-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    margin-top: 0.5rem;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.proficiency-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: calc(var(--level, 0) * 1%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── Sub-page body padding ── */
body:not(.home-body) {
    padding-bottom: 100px;
}

/* ── Container (sub-pages) ── */
.container {
    max-width: 36rem;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ── Selection ── */
::selection {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ── Countdown CTA link on homepage ── */
.countdown-link {
    margin-top: 0.5rem;
}