html, body { overscroll-behavior: none; }

/* Tilt, the scroll-driven flip, and the two faces each have their own layer. */
.content { inset: 0; width: 100%; max-width: none; padding: 24px 16px; }
.flip-shell { width: min(650px, 100%); perspective: 1400px; position: relative; }
.flip-rotor { display: grid; transform-style: preserve-3d; will-change: transform; }
.flip-shell .container {
    grid-area: 1 / 1; margin: 0; width: 100%; max-width: none;
    min-height: 15rem; height: auto; padding: 35px 15px;
    /* A visible glass surface even while the faces are composited in 3D. */
    background:
        linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.035) 38%, rgba(255,255,255,0.07)),
        rgba(20, 24, 32, 0.22);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 24px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.45),
        inset 1px 0 0 rgba(255,255,255,0.12),
        inset 0 -1px 0 rgba(255,255,255,0.08),
        0 24px 70px rgba(0,0,0,0.26),
        0 4px 14px rgba(0,0,0,0.12);
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    transition: opacity 0.8s ease;
}
.flip-shell .container::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(255,255,255,0.13), transparent 55%),
        linear-gradient(160deg, rgba(255,255,255,0.055), transparent 35%, transparent 75%, rgba(255,255,255,0.035));
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .flip-shell .container { background-color: rgba(38,43,52,0.78); }
}
.card-front { transform: rotateY(0deg); }
.flip-shell .card-back { transform: rotateY(180deg); justify-content: center; gap: 20px; text-align: left; }
.github-heading { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.22em; opacity: 0.7; }
.github-name { color: #fff; font-size: clamp(32px, 6vw, 46px); line-height: 1; text-shadow: 0 0 20px #ffffff80; }
.github-subtitle { color: #ffffff99; font-size: 14px; margin-top: -8px; text-align: center; }
.github-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.github-stats > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 8px; background: #ffffff0d; border: 1px solid #ffffff0d; border-radius: 16px; }
.github-stats strong { font-size: 28px; font-weight: 600; }
.github-stats span { color: #ffffff99; font-size: 12px; }
.github-projects-heading { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.github-projects-heading h3 { font-size: 13px; font-weight: 600; }
.github-projects-heading > span { color: #ffffff70; font-size: 11px; }
.github-projects { width: 100%; display: grid; gap: 8px; }
.github-project { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: white; text-decoration: none; padding: 12px 14px; border: 1px solid #ffffff0d; background: #ffffff08; border-radius: 12px; }
.github-project:hover, .github-project:focus-visible { background: #ffffff14; border-color: #ffffff40; }
.github-project-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.github-project-meta { color: #ffffff80; font-size: 11px; white-space: nowrap; }
.github-feedback { color: #ffffff80; font-size: 12px; text-align: center; }
.github-feedback:empty { display: none; }
.github-profile-link { display: inline-flex; align-items: center; gap: 8px; color: white; text-decoration: none; font-size: 13px; background: #ffffff12; border: 1px solid #ffffff18; border-radius: 24px; padding: 10px 18px; }
.github-profile-link:hover, .github-profile-link:focus-visible { background: #ffffff25; }
.flip-hint { position: absolute; top: calc(100% + 20px); width: 100%; display: flex; justify-content: center; gap: 8px; font-size: 12px; color: #ffffff99; letter-spacing: 0.02em; }
@media (max-height: 760px), (max-width: 480px) {
    .content { padding: 16px; }
    .flip-shell { width: min(560px, 100%); }
    .flip-shell .container { min-height: min(560px, calc(100dvh - 80px)); padding: 25px 10px; }
    .flip-shell .card-back { gap: 14px; }
    .flip-shell .container .avatar { width: 115px; height: 115px; margin-top: 20px; }
    .flip-shell .container .presenceContainer { margin-top: 20px; }
    .flip-shell .container .profileLayout { padding-top: 8px; }
    .flip-shell .container .profileUsername { margin-top: 0; font-size: 36px; }
    .flip-shell .container .profileUsername span { font-size: 30px; }
    .flip-shell .container .linkedAccounts { margin-top: 20px; }
    .github-stats > div { padding: 12px 6px; }
    .github-stats strong { font-size: 24px; }
    .github-stats span { font-size: 10px; }
    .flip-hint { top: calc(100% + 12px); }
}
