:root,
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1013;
    --surface: #15181e;
    --surface-2: #1e2229;
    --border: #2a2e37;
    --text: #eef1f5;
    --muted: #9ba3b0;
    --accent: #5b8bd6;
    --on-accent: #0b1220;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 48px -24px rgba(0, 0, 0, 0.7);
    --waves: url("waves.svg");
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-2: #f0f3f7;
    --border: #dfe4eb;
    --text: #141820;
    --muted: #586172;
    --accent: #1f4e8c;
    --on-accent: #ffffff;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 24px 48px -24px rgba(15, 23, 42, 0.18);
    --waves: url("waves-light.svg");
}

:root {
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background-color: var(--bg);
    background-image: var(--waves);
    background-position: center;
    background-size: cover;
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

.card {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: clamp(200px, 32vw, 300px) 1fr;
    grid-template-areas:
        "photo content"
        "links links";
    gap: 32px 40px;
    padding: 40px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.photo {
    grid-area: photo;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 30% 60%;
    border-radius: 18px;
}

.content {
    grid-area: content;
    align-self: center;
    min-width: 0;
}

.name {
    margin: 0;
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1;
}

.facts {
    display: grid;
    gap: 11px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    font-size: 1.0625rem;
    font-weight: 500;
}

.facts li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bio {
    max-width: 50ch;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
    text-wrap: pretty;
}

.links {
    grid-area: links;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.links a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 0.975rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.links a:active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

@media (hover: hover) {
    .links a:hover {
        background-color: var(--accent);
        border-color: var(--accent);
        color: var(--on-accent);
        transform: translateY(-2px);
    }
}

.links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.facts .icon {
    color: var(--accent);
}

.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: color-mix(in srgb, var(--surface-2) 85%, transparent);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@media (hover: hover) {
    .theme-toggle:hover {
        border-color: var(--accent);
        color: var(--accent);
    }
}

.theme-toggle .moon,
:root[data-theme="light"] .theme-toggle .sun {
    display: none;
}

:root[data-theme="light"] .theme-toggle .moon {
    display: block;
}

.facts a {
    color: inherit;
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.2s;
}

.facts a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@media (hover: hover) {
    .facts a:hover {
        color: var(--accent);
    }
}

@media (max-width: 720px) and (orientation: portrait) {
    body {
        display: block;
        padding: 0;
        background: var(--bg);
    }

    .card {
        display: flex;
        flex-direction: column;
        gap: 0;
        min-height: 100vh;
        min-height: 100dvh;
        max-width: none;
        padding: 0 0 24px;
        background-color: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        animation-name: fade;
    }

    .photo {
        flex: 1 1 0;
        min-height: 120px;
        aspect-ratio: auto;
        border-radius: 0;
        object-position: 30% 35%;
        -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
        mask-image: linear-gradient(to bottom, #000 70%, transparent);
    }

    .content {
        position: relative;
        flex-shrink: 0;
        margin-top: -16px;
        padding: 0 24px;
    }

    .name {
        font-size: 2.25rem;
    }

    .facts {
        gap: 9px;
        margin-top: 14px;
        font-size: 1rem;
    }

    .bio {
        margin-top: 14px;
        font-size: 0.9375rem;
        line-height: 1.55;
    }

    .links {
        flex-shrink: 0;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 24px;
        padding: 0 24px;
    }

    .links a {
        padding: 12px;
    }
}

@media (max-width: 720px) and (orientation: portrait) and (max-height: 560px) {
    .card {
        padding-bottom: 16px;
    }

    .photo {
        min-height: 96px;
    }

    .content {
        padding: 0 20px;
    }

    .name {
        font-size: 2rem;
    }

    .links {
        margin-top: 16px;
        padding: 0 20px;
    }

    .links a {
        padding: 10px;
    }
}

@media (max-height: 620px) and (orientation: landscape) {
    body {
        padding: 12px;
    }

    .card {
        grid-template-columns: clamp(140px, 24vw, 240px) 1fr;
        gap: 16px 28px;
        padding: 20px;
        border-radius: 22px;
    }

    .photo {
        aspect-ratio: auto;
        height: 100%;
        contain: size;
    }

    .name {
        font-size: clamp(2rem, 5vw, 2.75rem);
    }

    .facts {
        gap: 6px;
        margin-top: 12px;
        font-size: 0.9375rem;
    }

    .bio {
        margin-top: 12px;
        font-size: 0.9375rem;
        line-height: 1.5;
    }

    .links a {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

@keyframes fade {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .card {
        animation: none;
    }

    .links a {
        transition: none;
    }

    .links a:hover {
        transform: none;
    }
}
