/* ── VARIABLES ──────────────────────────────────────────────────────────── */
:root {
    --bg-color: #0b1414;
    --card-bg: #094f4f;
    --text-white: #ffffff;
    --accent-bright: #00bbc9;
    --radius: 28px;
    --text-bio: #bdd6d7;
    --text-body: #f0feff;
}

/* ── BASE ────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'JetBrains Mono', monospace;
    background-color: var(--bg-color);
    padding: 60px 20px;
    color: var(--text-body);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(9,134,143,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(9,134,143,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none; z-index: 0;
}

.container { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }

/* ── PROFILE HEADER ──────────────────────────────────────────────────────── */
.profile-header { text-align: center; margin-bottom: 60px; }

.profile-pic {
    width: 280px; height: 280px; border-radius: 50%;
    object-fit: cover; margin-bottom: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.header-label {
    display: block; font-size: 0.75rem; letter-spacing: 0.25em;
    color: var(--accent-bright); text-transform: uppercase;
    margin-bottom: 10px; opacity: 0.75;
}

.profile-header h1 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem); font-weight: 800;
    color: #fff; line-height: 1.1; margin-bottom: 14px;
}
.profile-header h1 span { color: var(--accent-bright); }

.bio { font-size: 0.9rem; color: var(--text-bio); max-width: 640px; margin: 0 auto; line-height: 1.7; opacity: 0.85; }
.cta { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; margin-top: 18px; color: var(--accent-bright); }

/* ── GRID ────────────────────────────────────────────────────────────────── */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    gap: 20px;
}
.small { grid-column: span 1; grid-row: span 1; }
.wide  { grid-column: span 2; grid-row: span 1; }
.tall  { grid-column: span 1; grid-row: span 2; }
.large { grid-column: span 2; grid-row: span 2; }

/* ── CARD BASE ───────────────────────────────────────────────────────────── */
.card {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    display: flex;
    border: 1px solid rgba(9,134,143,0.2);
    transition: transform 0.35s cubic-bezier(0.175,0.885,0.32,1.275),
                box-shadow 0.35s ease, border-color 0.35s ease, filter 0.35s ease;
    animation: fadeUp 0.5s ease both;
}

.card:nth-child(1)  { animation-delay: 0.05s; }
.card:nth-child(2)  { animation-delay: 0.10s; }
.card:nth-child(3)  { animation-delay: 0.15s; }
.card:nth-child(4)  { animation-delay: 0.20s; }
.card:nth-child(5)  { animation-delay: 0.25s; }
.card:nth-child(6)  { animation-delay: 0.30s; }
.card:nth-child(7)  { animation-delay: 0.35s; }
.card:nth-child(8)  { animation-delay: 0.40s; }
.card:nth-child(9)  { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.50s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.60s; }
.card:nth-child(13) { animation-delay: 0.65s; }
.card:nth-child(14) { animation-delay: 0.70s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card:hover {
    transform: translateY(-5px) scale(1.025);
    border-color: rgba(0,187,201,0.4);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 18px rgba(9,134,143,0.18);
    filter: brightness(1.07);
}

/* Shimmer — non-transparent cards only */
.card:not(.transparent)::after {
    content: '';
    position: absolute; inset: 0; border-radius: var(--radius);
    background: linear-gradient(115deg,
        transparent 0%, rgba(255,255,255,0.04) 40%,
        rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 60%, transparent 100%);
    opacity: 0; transform: translateX(-100%);
    pointer-events: none; z-index: 20;
}
.card:not(.transparent):hover::after { animation: shimmer 0.65s ease forwards; }
@keyframes shimmer {
    0%  { opacity: 0; transform: translateX(-100%); }
    20% { opacity: 1; }
    100%{ opacity: 0; transform: translateX(100%); }
}

/* ── INSTAGRAM GRID ──────────────────────────────────────────────────────── */
.ig-grid-container {
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
    width: 100%; height: 100%; z-index: 1;
}
.ig-photo { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .ig-photo { transform: scale(1.05); }

/* ── OVERLAY (image / ig) ────────────────────────────────────────────────── */
.overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    padding: 22px 24px; z-index: 2;
}
.card:has(.card-image-bg) .overlay,
.card:has(.ig-grid-container) .overlay {
    justify-content: flex-end; align-items: flex-start;
    background: linear-gradient(to top, rgba(0,8,8,0.78) 0%, transparent 62%);
}

/* ── SOLID CARD ──────────────────────────────────────────────────────────── */
.solid-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; text-align: center;
    padding: 24px; gap: 12px; z-index: 2;
}
/* Wide → horizontal */
.card.wide .solid-overlay {
    flex-direction: row; justify-content: flex-start;
    text-align: left; gap: 22px; padding: 28px 32px;
}

.solid-icon-wrap {
    flex-shrink: 0;
    width: 64px; height: 64px; border-radius: 18px;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
}
.solid-icon-wrap i   { font-size: 1.8rem; line-height: 1; }
.solid-icon-wrap svg,
.solid-icon-wrap img { display: block; }

.card:hover .solid-icon-wrap { transform: scale(1.1); background: rgba(255,255,255,0.2); }

/* Small cards */
.card.small .solid-icon-wrap { width: 52px; height: 52px; border-radius: 14px; }
.card.small .solid-icon-wrap i   { font-size: 1.45rem; }
.card.small .solid-icon-wrap img { width: 26px; height: 26px; }
.card.small .solid-overlay       { gap: 9px; }
.card.small h3                   { font-size: 0.9rem; }

.card-text-group { display: flex; flex-direction: column; gap: 4px; }

/* ── TEXT ────────────────────────────────────────────────────────────────── */
.card h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.08rem; font-weight: 700; color: #fff; line-height: 1.2;
}
.card p, .solid-desc {
    font-size: 0.74rem; color: rgba(255,255,255,0.65); line-height: 1.45;
}
.card:has(.ig-grid-container) h3,
.card:has(.ig-grid-container) p {
    text-shadow: 0 1px 8px rgba(0,0,0,0.85);
}

/* ── CORNER ICON ─────────────────────────────────────────────────────────── */
.card-corner-icon {
    position: absolute; top: 16px; right: 16px; z-index: 10;
    color: rgba(255,255,255,0.5); font-size: 1rem;
    pointer-events: none; text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    transition: color 0.3s ease;
}
.card:hover .card-corner-icon { color: rgba(255,255,255,0.9); }

/* ── SLUG ────────────────────────────────────────────────────────────────── */
.card-slug {
    position: absolute; bottom: 13px; right: 16px;
    font-size: 0.57rem; letter-spacing: 0.1em;
    color: rgba(255,255,255,0.28);
    font-family: 'JetBrains Mono', monospace;
    z-index: 5; pointer-events: none; transition: color 0.3s ease;
}
.card:hover .card-slug { color: rgba(255,255,255,0.58); }

/* ── GITHUB CUSTOM CARD ──────────────────────────────────────────────────── */
.gh-loading, .gh-error {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    width: 100%; height: 100%; gap: 12px;
    color: rgba(255,255,255,0.35); font-size: 0.8rem;
}
.gh-spinner { font-size: 2.5rem; animation: ghSpin 1.5s linear infinite; }
@keyframes ghSpin { to { transform: rotate(360deg); } }

.gh-card {
    display: flex; flex-direction: column;
    width: 100%; height: 100%; padding: 24px 26px; gap: 16px;
}

.gh-header { display: flex; gap: 16px; align-items: center; }

.gh-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    border: 2px solid rgba(48,130,198,0.5);
    flex-shrink: 0;
}

.gh-user-info { display: flex; flex-direction: column; gap: 3px; }
.gh-name   { font-family: 'Syne', sans-serif; font-size: 1.05rem; font-weight: 700; color: #fff; }
.gh-handle { font-size: 0.72rem; color: rgba(48,130,198,0.9); }
.gh-location { font-size: 0.68rem; color: rgba(255,255,255,0.4); margin-top: 2px; }
.gh-location i { margin-right: 4px; }

.gh-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.gh-stat {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(255,255,255,0.05); border-radius: 12px;
    padding: 8px 4px; border: 1px solid rgba(255,255,255,0.07);
}
.gh-stat-val { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; color: #5af; }
.gh-stat-lbl { font-size: 0.58rem; color: rgba(255,255,255,0.4); margin-top: 2px; text-align: center; }

.gh-graph { display: flex; flex-direction: column; flex: 1; gap: 6px; }
.gh-bars {
    display: flex; align-items: flex-end; gap: 3px;
    height: 56px; flex: 1;
}
.gh-bar {
    flex: 1; min-width: 4px;
    background: rgba(48,130,198,0.55);
    border-radius: 3px 3px 0 0;
    transition: background 0.2s ease;
}
.gh-bar:hover { background: rgba(90,170,255,0.85); }
.gh-graph-label { font-size: 0.58rem; color: rgba(255,255,255,0.25); text-align: right; }
.gh-no-data { font-size: 0.68rem; color: rgba(255,255,255,0.25); align-self: center; }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */

/* ── TABLET ≤900px ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
    }
    .profile-pic { width: 200px; height: 200px; }
    .profile-header h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
}

/* ── MOBILE ≤600px ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    body { padding: 16px; }

    /* Profile */
    .profile-header { margin-bottom: 36px; }
    .profile-pic { width: 130px; height: 130px; margin-bottom: 14px; }
    .profile-header h1 { font-size: clamp(1.6rem, 8vw, 2.2rem); margin-bottom: 10px; }
    .bio  { font-size: 0.8rem; line-height: 1.6; }
    .cta  { font-size: 0.9rem; margin-top: 12px; }

    /* Grid: single column, auto height */
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 12px;
    }
    /* Size hierarchy: small ≈ 1 unit, wide ≈ 2 units tall */
    .small { min-height: 90px;  max-height: 110px; }
    .wide  { min-height: 160px; }
    .tall,
    .large { min-height: 280px; }
    /* Wide cards: keep horizontal layout (icon + text side by side) */
    .card.wide .solid-overlay {
        flex-direction: row;
        text-align: left;
        justify-content: flex-start;
        gap: 16px;
        padding: 20px 20px;
    }
    /* GitHub card: 2:1 ratio (full width, half as tall) */
    .card-github { min-height: 200px; max-height: 240px; }
    /* Instagram cards: square-ish for the 2×2 photo grid */
    .card:has(.ig-grid-container) { min-height: 280px; max-height: 320px; }

    /* Small card: compact — just icon + label */
    .card.small { min-height: 90px; max-height: 110px; }
    .card.small .solid-overlay { gap: 6px; padding: 14px 16px; flex-direction: row; text-align: left; justify-content: flex-start; }
    .card.small .solid-icon-wrap { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; }
    .card.small .solid-icon-wrap img { width: 20px; height: 20px; }

    /* GitHub card internals — compact for 2:1 box */
    .card-github .gh-card  { padding: 14px 16px; gap: 8px; }
    .card-github .gh-header { gap: 12px; }
    .card-github .gh-avatar { width: 40px; height: 40px; }
    .card-github .gh-name   { font-size: 0.88rem; }
    .card-github .gh-handle { font-size: 0.65rem; }
    .card-github .gh-location { display: none; }
    .card-github .gh-stats  { grid-template-columns: repeat(4, 1fr); gap: 5px; }
    .card-github .gh-stat   { padding: 5px 2px; }
    .card-github .gh-stat-val { font-size: 0.82rem; }
    .card-github .gh-stat-lbl { font-size: 0.52rem; }
    .card-github .gh-bars   { height: 32px; }
    .card-github .gh-graph-label { font-size: 0.52rem; }

    /* Footer */
    .site-footer { margin-top: 40px; }
}

/* ── SMALL MOBILE ≤400px ─────────────────────────────────────────────────── */
@media (max-width: 400px) {
    body { padding: 12px; }
    .bento-grid { gap: 10px; }
    .profile-pic { width: 110px; height: 110px; }
    .card.wide .solid-overlay { gap: 12px; padding: 16px; }
}

/* ── SITE FOOTER ─────────────────────────────────────────────────────────── */
.site-footer {
    margin-top: 64px;
    padding: 40px 0 32px;
    border-top: 1px solid rgba(9,134,143,0.18);
    text-align: center;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.footer-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    opacity: 0.8;
    filter: drop-shadow(0 2px 8px rgba(0,187,201,0.15));
    transition: opacity 0.3s ease, filter 0.3s ease;
}
.footer-logo:hover {
    opacity: 1;
    filter: drop-shadow(0 2px 16px rgba(0,187,201,0.35));
}

.footer-name {
    font-family: 'Syne', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.02em;
}

.footer-copy {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.25);
    line-height: 1.7;
    max-width: 520px;
}

.footer-copy a {
    color: rgba(0,187,201,0.6);
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-copy a:hover { color: var(--accent-bright); }

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 0.67rem;
    color: rgba(0,187,201,0.55);
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}
.footer-links a:hover { color: var(--accent-bright); }

.footer-sep {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.15);
}
