/* =========================================================
   NYARLHTP — responsive stylesheet
   Palette: cosmic minimalism / dark academia
   ========================================================= */

:root {
    color-scheme: dark;
    --bg: #080910;
    --panel: #11111b;
    --text: #f0eee9;
    --muted: #a6a4b5;
    --line: #292839;
    --accent: #c7a5ff;
    --shell-width: 1180px;
    --radius: 16px;
    --motion: 180ms ease;
}

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

html {
    min-width: 320px;
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    background:
        radial-gradient(ellipse at 50% 0%, #29203d55, transparent 48%),
        var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

a:hover {
    color: var(--accent);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

button {
    font: inherit;
}

.site-shell {
    display: flex;
    flex-direction: column;
    width: min(var(--shell-width), calc(100% - 64px));
    min-height: 100vh;
    min-height: 100svh;
    margin-inline: auto;
}

/* Header and desktop navigation */
.site-header {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(16px, 3vw, 40px);
    min-height: 84px;
}

.logo {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    min-width: 0;
}

.logo img {
    width: auto;
    max-width: min(180px, 38vw);
    max-height: 48px;
    object-fit: contain;
    filter: grayscale(100%);
    transform-origin: center;
    animation: logo-rotate 12s linear infinite;
    transition: filter 350ms ease;
}

.logo:hover img,
.logo:focus-visible img {
    filter: grayscale(0%);
}

.logo:hover img {
    animation-duration: 3s;
}

@keyframes logo-rotate {
    to {
        transform: rotate(360deg);
    }
}

.menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: clamp(12px, 2vw, 28px);
}

.menu a {
    padding-block: 8px;
    border-bottom: 1px solid transparent;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color var(--motion), border-color var(--motion);
}

.menu a:hover,
.menu a.current,
.menu a[aria-current="page"] {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.nav-toggle {
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
}

.nav-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.nav-toggle i {
    font-size: 1.1rem;
}

/* Main frame */
main {
    flex: 1 0 auto;
    min-width: 0;
    padding: clamp(12px, 2vw, 24px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

#identity {
    padding: clamp(36px, 7vw, 82px) 12px 0;
    text-align: center;
}

.description {
    margin: 0 0 clamp(20px, 4vw, 42px);
    color: var(--accent);
    font-size: clamp(0.68rem, 1.5vw, 0.82rem);
    font-weight: 750;
    letter-spacing: 0.18em;
    line-height: 1.5;
    text-transform: uppercase;
}

.avatar {
    width: clamp(124px, 18vw, 164px);
    aspect-ratio: 1;
    margin: 0 auto 24px;
    padding: 5px;
    overflow: hidden;
    border: 1px solid #c7a5ff80;
    border-radius: 50%;
    background: #c7a5ff0b;
    box-shadow: 0 0 42px #c7a5ff16;
}

.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.name {
    margin: 0;
    color: var(--text);
    font-size: clamp(2.25rem, 7.4vw, 5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
}

.username {
    margin: 12px 0;
    color: var(--accent);
    font-size: clamp(15px, 2.2vw, 19px);
    font-weight: 650;
    letter-spacing: 0.04em;
}

.username img {
    width: auto;
    max-width: 100%;
    height: 20px;
    margin-inline: auto;
    object-fit: contain;
}

.profession {
    margin: 0;
    padding: 8px 0;
    color: var(--muted);
    font-size: clamp(0.8rem, 1.8vw, 0.94rem);
    font-weight: 700;
    text-transform: uppercase;
}

.identity-summary {
    max-width: 620px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: clamp(0.82rem, 1.7vw, 0.94rem);
    line-height: 1.75;
    text-wrap: pretty;
}

/* Social and publication icon links */
.social-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1.2vw, 12px);
    width: min(100%, 660px);
    margin-inline: auto;
    padding-inline: 12px;
}

.publication-links {
    margin-top: 30px;
    margin-bottom: 30px;
}

.profile-links {
    margin-top: 28px;
    margin-bottom: 24px;
}

.contact-links {
    margin-top: 26px;
    margin-bottom: 10px;
}

.social-section a {
    display: grid;
    flex: 0 0 46px;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff04;
    color: var(--muted);
    font-size: 20px;
    transition:
        color var(--motion),
        border-color var(--motion),
        background var(--motion),
        transform var(--motion);
}

.social-section a:hover,
.social-section a:focus-visible {
    transform: translateY(-3px);
    border-color: var(--accent);
    background: #c7a5ff12;
    color: var(--accent);
}

.social-section a:active {
    transform: translateY(0);
}

/* Practice topics */
#practice {
    padding-top: 4px;
}

.services {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 10px;
    max-width: 760px;
    margin: 24px auto;
    padding-inline: 8px;
    color: var(--text);
    font-size: clamp(0.75rem, 1.6vw, 0.88rem);
    font-weight: 600;
    line-height: 1.8;
    text-align: center;
}

.services a {
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    transition: color var(--motion), text-decoration-color var(--motion);
}

.services a:hover,
.services a:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: currentColor;
}

.service-separator {
    color: var(--accent);
}

/* Footer */
.site-footer {
    flex: 0 0 auto;
    padding: 18px 12px max(18px, env(safe-area-inset-bottom));
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.6;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

/* Tablet and mobile navigation */
@media (max-width: 900px) {
    .site-shell {
        width: min(700px, calc(100% - 40px));
    }

    .site-header {
        min-height: 72px;
        gap: 16px;
    }

    .nav-toggle {
        display: grid;
    }

    .menu {
        position: absolute;
        top: calc(100% - 2px);
        right: 0;
        display: none;
        align-items: stretch;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 2px;
        width: min(300px, calc(100vw - 32px));
        max-height: min(70vh, 480px);
        overflow-y: auto;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--panel);
        box-shadow: 0 18px 50px #0008;
    }

    .menu.is-open {
        display: flex;
    }

    .menu a {
        padding: 12px;
        border: 0;
        border-radius: 8px;
        font-size: 0.82rem;
        white-space: normal;
    }

    .menu a:hover,
    .menu a:focus-visible,
    .menu a.current,
    .menu a[aria-current="page"] {
        border: 0;
        background: #c7a5ff12;
    }

    main {
        padding: clamp(10px, 3vw, 20px);
    }
}

@media (max-width: 480px) {
    .site-shell {
        width: calc(100% - 24px);
    }

    .site-header {
        min-height: 64px;
    }

    .logo img {
        max-width: min(156px, 48vw);
        max-height: 42px;
    }

    #identity {
        padding: 40px 4px 0;
    }

    .description {
        letter-spacing: 0.14em;
    }

    .avatar {
        margin-bottom: 22px;
    }

    .name {
        letter-spacing: -0.04em;
    }

    .services {
        max-width: 340px;
        column-gap: 7px;
        row-gap: 2px;
    }

    .social-section {
        gap: 8px;
        padding-inline: 0;
    }

    .social-section a {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        border-radius: 11px;
        font-size: 18px;
    }
}

/* Honor reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
