/* Profile details and the learning overview. */
.profile-page {
    --profile-muted: #a3b1c5;
    --profile-line: rgba(159, 179, 205, 0.15);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    max-width: 1100px;
    margin-inline: auto;
    padding: 28px 30px;
    border: 1px solid var(--profile-line);
    border-top: 2px solid #72cfba;
    border-radius: 20px;
    background:
        radial-gradient(ellipse at top right, rgba(83, 113, 204, 0.13), transparent 55%),
        linear-gradient(115deg, #162633, #121c2a 65%);
}

.profile-sql-art {
    position: absolute;
    z-index: -1;
    top: -46px;
    right: 105px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(151, 173, 217, 0.12);
    border-radius: 50%;
    color: rgba(151, 173, 217, 0.12);
    transform: rotate(-14deg);
    pointer-events: none;
    user-select: none;
}
.profile-sql-art::after {
    content: "";
    position: absolute;
    inset: 26px;
    border: inherit;
    border-radius: inherit;
}
.profile-sql-art i { font-size: 90px; line-height: 1; }
.profile-sql-art span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.profile-page [hidden] { display: none !important; }
.profile-page a { text-decoration: none; }
.profile-page a:focus-visible {
    outline: 2px solid #72e3c0;
    outline-offset: 5px;
}
.profile-page h1,
.profile-page p,
.profile-page dd { margin: 0; }

.profile-page .profile-eyebrow {
    color: var(--profile-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 25px;
}
.profile-identity {
    display: flex;
    align-items: center;
    gap: 23px;
    min-width: 0;
}
.profile-portrait {
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    padding: 4px;
    border: 1px solid rgba(150, 223, 206, 0.36);
    border-radius: 27px;
    background: rgba(134, 186, 179, 0.07);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}
.profile-initials,
.profile-photo {
    width: 100%;
    height: 100%;
    border-radius: 22px;
}
.profile-initials {
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 80% 15%, rgba(170, 249, 216, 0.6), transparent 55%),
        linear-gradient(140deg, #658dba, #275d69);
    color: #e8fff7;
    font-size: 43px;
    font-weight: 600;
}
.profile-photo { display: block; object-fit: cover; }
.profile-identity-copy { min-width: 0; }
.profile-page h1 {
    color: #f6f8fc;
    font-size: clamp(24px, 2.3vw, 34px);
    font-weight: 650;
    letter-spacing: -0.04em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.profile-page .profile-username {
    margin-top: 9px;
    color: #86cbbc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    overflow-wrap: anywhere;
}
.profile-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-shrink: 0;
    padding: 11px 16px;
    border-radius: 9px;
    background: #e4edea;
    color: #182c2b;
    font-size: 13px;
    font-weight: 600;
    transition: background 180ms ease, transform 180ms ease;
}
.profile-edit:hover {
    background: #f4fff9;
    color: #13241f;
    transform: translateY(-2px);
}
.profile-details {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 28px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--profile-line);
}
.profile-detail { min-width: 0; }
.profile-detail dt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    color: var(--profile-muted);
    font-size: 12px;
    font-weight: 400;
}
.profile-detail dd {
    color: #dce6f3;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.profile-detail a { color: inherit; }
.profile-detail a[href]:hover { color: #a6f0d8; }
.profile-page .profile-status {
    margin-top: 20px;
    color: var(--profile-muted);
    font-size: 13px;
    line-height: 1.6;
}

.profile-learning {
    max-width: 1100px;
    margin: 28px auto 0;
}
.profile-learning-heading {
    margin-bottom: 15px;
}
.profile-learning-heading h2 {
    margin: 0;
    color: #e5edf8;
    font-size: 16px;
    font-weight: 600;
}
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}
.profile-stat {
    min-width: 0;
    padding: 23px;
    border: 1px solid rgba(159, 179, 205, 0.15);
    border-radius: 16px;
    background: linear-gradient(135deg, #182535, #141e2c);
    box-shadow: inset 0 2px var(--stat-accent);
    transition: border-color 180ms ease, transform 180ms ease;
}
.profile-stat-points { --stat-accent: #e8be7a; }
.profile-stat-solved { --stat-accent: #79d5b9; }
.profile-stat-rank { --stat-accent: #aaa1f0; }
.profile-stat-completion { --stat-accent: #7ebbe9; }
.profile-stat:hover {
    border-color: var(--stat-accent);
    transform: translateY(-3px);
}
.profile-stat dt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #b3c0d2;
    font-size: 12px;
    font-weight: 400;
}
.profile-stat dt i { color: var(--stat-accent); font-size: 19px; }
.profile-stat dd {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 17px 0 0;
    color: #f5f8fc;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
}
.profile-stat dd i { color: var(--stat-accent); }

@media (max-width: 1199.98px) {
    .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .profile-page { padding: 23px; }
    .profile-sql-art { top: -30px; right: -60px; }
    .profile-header { flex-wrap: wrap; gap: 22px; }
    .profile-edit { width: 100%; }
    .profile-details { grid-template-columns: minmax(0, 1fr); gap: 21px; }
}
@media (max-width: 479.98px) {
    .main-header .header-greeting p { display: none; }
    .profile-page { padding: 21px; }
    .profile-identity { gap: 17px; }
    .profile-portrait { width: 80px; height: 80px; flex-basis: 80px; border-radius: 21px; }
    .profile-initials, .profile-photo { border-radius: 16px; }
    .profile-initials { font-size: 34px; }
    .profile-page .profile-username { font-size: 11px; }
    .profile-stats { gap: 12px; }
    .profile-stat { padding: 18px 15px; }
    .profile-stat dt { align-items: flex-start; min-height: 36px; gap: 8px; }
    .profile-stat dt span { max-width: 72px; }
}
@media (max-width: 359.98px) {
    .profile-identity { flex-direction: column; align-items: flex-start; }
    .profile-stats { grid-template-columns: minmax(0, 1fr); }
    .profile-stat dt span { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    .profile-edit, .profile-stat { transition: none; }
    .profile-edit:hover, .profile-stat:hover { transform: none; }
}
