*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary, #0f172a);
    background: #f8fafc;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--brand-primary) 18%, transparent), transparent 42%),
        radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--brand-secondary) 12%, transparent), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
}

.page-shell {
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 2.5rem 1.25rem 5rem;
}

.page-profile .page-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 4rem);
    min-height: calc(100dvh - 4rem);
}

.profile-card,
.error-card {
    width: min(100%, 420px);
    margin: 0 auto;
    padding: 2rem 1.5rem 1.75rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 12px 40px rgba(15, 23, 42, 0.08);
}

.profile-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.logo-frame {
    width: min(100%, 200px);
    margin: 0 auto 1.25rem;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 4px 20px color-mix(in srgb, var(--brand-primary) 28%, transparent),
        0 1px 3px rgba(15, 23, 42, 0.08);
}

.brand-logo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

.avatar-ring {
    width: 112px;
    height: 112px;
    margin: 0 auto 1.25rem;
    padding: 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    box-shadow: 0 10px 30px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}

.avatar-logo,
.avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    background: #fff;
    display: grid;
    place-items: center;
}

.avatar-fallback {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.profile-name {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 4vw, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.profile-tagline {
    margin: 0;
    color: var(--text-muted, #64748b);
    font-size: 0.95rem;
}

.link-stack {
    display: grid;
    gap: 0.75rem;
}

.link-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.link-button.primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--brand-primary) 32%, transparent);
}

.link-button.primary.btn-light-text {
    color: #0f172a;
}

.link-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--brand-primary) 38%, transparent);
}

.link-button:active {
    transform: translateY(0);
}

.link-icon {
    display: inline-flex;
    opacity: 0.95;
}

.link-arrow {
    margin-left: auto;
    opacity: 0.85;
    transition: transform 0.18s ease;
}

.link-button:hover .link-arrow {
    transform: translateX(3px);
}

.profile-note {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

.home-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.eyebrow {
    display: inline-block;
    margin: 0 0 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--brand-surface, #eff6ff);
    color: var(--brand-primary, #2563eb);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-title {
    margin: 0 0 0.5rem;
    font-size: clamp(2rem, 5vw, 2.75rem);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.home-subtitle {
    margin: 0 auto;
    max-width: 34rem;
    color: var(--text-muted, #64748b);
}

.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.site-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.site-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--card-accent) 35%, transparent);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--card-accent) 18%, transparent);
}

.site-card-logo {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--card-surface, #f8fafc);
    display: grid;
    place-items: center;
}

.site-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.site-card-fallback {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--card-accent);
}

.site-card-body h2 {
    margin: 0 0 0.15rem;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.site-card-link {
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

.error-card {
    text-align: center;
}

.error-card h1 {
    margin: 0 0 0.5rem;
    font-size: 3rem;
    letter-spacing: -0.05em;
}

.ghost-link {
    display: inline-flex;
    margin-top: 1rem;
    color: var(--brand-primary, #2563eb);
    font-weight: 600;
    text-decoration: none;
}

.ghost-link:hover {
    text-decoration: underline;
}

.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    pointer-events: none;
}

@media (max-width: 480px) {
    .page-shell {
        padding-top: 1.75rem;
        padding-bottom: 4.5rem;
    }

    .profile-card {
        padding: 1.5rem 1.15rem 1.35rem;
        border-radius: 20px;
    }

    .logo-frame {
        width: min(100%, 176px);
    }

    .avatar-ring {
        width: 96px;
        height: 96px;
    }

    .site-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
