@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&display=swap");

:root {
    --head: #0f172a;
    --txt: #1f2933;
    --txt2: #4b5563;
    --muted: #6b7280;
    --line: #94a3b8;
    --acc: #2563eb;
    --acc-hover: #3b82f6;
    --bg: #f0f2f5;
    --card: #fff;
    --tag-bg: #e5e7eb;
    --hover-bg: #f3f4f6;
    --active-bg: #d1d5db;
    --patent: #5b9608;
    --shadow: rgba(0, 0, 0, 0.1);
    --icon-sm: 14px;
    --icon-md: 18px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --theme-transition: 0.3s ease
}

:root.dark {
    --head: #d5d6d8;
    --txt: #c9cacd;
    --txt2: #a6a8ad;
    --muted: #808288;
    --line: #4c4e56;
    --acc: #60a5fa;
    --acc-hover: #93c5fd;
    --bg: #18191b;
    --card: #202124;
    --tag-bg: #2d2f32;
    --hover-bg: #2d2f32;
    --active-bg: #3e4043;
    --patent: #77bf0a;
    --shadow: rgba(0, 0, 8, 0.4)
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%
}

body {
    background: var(--bg);
    color: var(--txt);
    font: 400 13px/1.4 "IBM Plex Mono", monospace;
    -webkit-font-smoothing: antialiased;
    transition: background var(--theme-transition), color var(--theme-transition)
}

h1,
.pronoun,
.meta,
.muted,
.desc,
.acc,
.row strong,
.row>span:not(.meta),
.ranks,
.doi a,
.contacts a,
.gold,
.silver,
.bronze,
[data-lucide] {
    transition: color var(--theme-transition)
}

.container,
header,
.entry,
.float-btn {
    transition: background var(--theme-transition), box-shadow var(--theme-transition)
}

h2 {
    transition: color var(--theme-transition), border-color var(--theme-transition)
}

h3 {
    transition: color var(--theme-transition), background var(--theme-transition), border-color var(--theme-transition)
}

.tags span {
    transition: color var(--theme-transition), background var(--theme-transition)
}

.qr {
    transition: border-color var(--theme-transition)
}

@keyframes slideFromLeft {
    from {
        opacity: 0;
        transform: translateX(-48px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

@keyframes slideFromRight {
    from {
        opacity: 0;
        transform: translateX(48px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

@keyframes btnSlideIn {
    from {
        opacity: 0;
        transform: translateX(16px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@media (prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important
    }
}

[data-lucide] {
    display: inline-flex;
    vertical-align: middle;
    shape-rendering: geometricPrecision
}

.contacts [data-lucide],
.ranks [data-lucide],
.row strong [data-lucide] {
    width: var(--icon-sm);
    height: var(--icon-sm);
    flex-shrink: 0
}

.contacts [data-lucide],
.ranks [data-lucide] {
    margin: -2px 0
}

.contacts [data-lucide] {
    color: var(--muted)
}

.row strong [data-lucide] {
    position: relative;
    top: 0.18em
}

.gold {
    color: #f59e0b
}

.silver {
    color: #9ca3af
}

.bronze {
    color: #b45309
}

:root.dark .bronze {
    color: #d97706
}

.wrapper {
    padding: 15px 0;
    zoom: 1.1
}

.container {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 25px 35px;
    background: var(--card);
    box-shadow: 0 4px 15px var(--shadow);
    animation: slideFromLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    backface-visibility: hidden
}

.container:hover {
    box-shadow: 0 8px 25px var(--shadow)
}

header {
    position: relative;
    margin: -5px -5px 15px;
    padding: 5px 5px 12px;
    border-bottom: 2px solid var(--line);
    border-radius: var(--radius-sm);
    opacity: 0;
    animation: slideFromLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    transition: background var(--theme-transition), border-color var(--theme-transition)
}

header:hover {
    background: var(--hover-bg)
}

.name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap
}

h1 {
    position: relative;
    color: var(--head);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    padding-bottom: 6px
}

h1::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--acc-hover);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), background var(--theme-transition)
}

header:hover h1::after {
    transform: scaleX(1)
}

.pronoun {
    margin-left: 0.4em;
    color: var(--muted);
    font-size: 0.65em;
    font-weight: 400;
    opacity: 0.9;
    vertical-align: 0.15em
}

.qr {
    width: 55px;
    height: 55px;
    padding: 3px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    image-rendering: pixelated
}

.contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px 20px;
    margin-top: 6px
}

.contacts a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(50% - 10px);
    color: var(--muted);
    font-size: 14px;
    text-decoration: none
}

.contacts a:hover,
.contacts a:hover [data-lucide] {
    color: var(--acc-hover)
}

main {
    opacity: 0;
    animation: slideFromRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards
}

main section {
    opacity: 0
}

main section:nth-child(odd) {
    animation: slideFromLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards
}

main section:nth-child(even) {
    animation: slideFromRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards
}

main section:nth-child(1) {
    animation-delay: 0.4s
}

main section:nth-child(2) {
    animation-delay: 0.5s
}

main section:nth-child(3) {
    animation-delay: 0.6s
}

main section:nth-child(4) {
    animation-delay: 0.7s
}

h2 {
    margin: 15px 0 8px;
    padding-bottom: 2px;
    color: var(--head);
    font-size: 17px;
    font-weight: 700;
    border-bottom: 2px solid var(--line)
}

h3 {
    margin: 10px 0 6px;
    padding: 3px 8px;
    color: var(--txt2);
    font-size: 12px;
    font-weight: 600;
    background: var(--tag-bg);
    border-left: 3px solid var(--acc);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0
}

h3:first-of-type {
    margin-top: 6px
}

.entry {
    position: relative;
    margin: 0 -5px 10px;
    padding: 5px;
    border-radius: var(--radius-sm);
    font-size: 12px
}

.entry:hover {
    background: var(--hover-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08)
}

.entry:active {
    background: var(--active-bg)
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px
}

.row>span:not(.meta) {
    color: var(--txt2)
}

.entry>.row:first-child {
    position: relative;
    padding-bottom: 2px;
    margin-bottom: 2px;
    min-height: 18px
}

.entry>.row:first-child::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--acc-hover);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background var(--theme-transition)
}

.entry:hover>.row:first-child::after {
    transform: scaleX(1)
}

.row strong {
    flex: 1;
    color: var(--head);
    font-size: 14px;
    line-height: 1.15;
    display: inline-flex;
    align-items: baseline;
    gap: 6px
}

.row strong a {
    color: inherit;
    text-decoration: none
}

.meta {
    flex-shrink: 0;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap
}

.muted {
    margin-bottom: 5px;
    color: var(--muted);
    font-weight: bold
}

.desc {
    margin-bottom: 4px;
    color: var(--txt2)
}

.acc {
    color: var(--acc);
    font-weight: 600
}

.projects .entry strong {
    color: var(--acc)
}

.entry.patent strong {
    color: var(--patent)
}

.ranks {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding: 0 15%;
    color: var(--txt2)
}

.ranks span {
    display: inline-flex;
    align-items: center;
    gap: 4px
}

.doi {
    margin-top: 2px
}

.doi a {
    color: var(--acc);
    text-decoration: none
}

.doi a:hover {
    color: var(--acc-hover)
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px
}

.tags span {
    padding: 2px 8px;
    color: var(--txt);
    font-size: 11px;
    background: var(--tag-bg);
    border-radius: var(--radius-sm);
    cursor: default
}

.tags span:hover {
    color: #fff;
    background: #3b82f6
}

footer {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 25px;
    margin-top: 10px;
    opacity: 0;
    animation: slideFromLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards
}

footer>div {
    flex: 1;
    min-width: 120px
}

footer h2 {
    margin-top: 0
}

.float-btn {
    position: fixed;
    top: 16px;
    z-index: 100;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 5px var(--shadow);
    cursor: pointer;
    opacity: 0
}

.float-btn [data-lucide] {
    width: var(--icon-md);
    height: var(--icon-md);
    color: var(--muted);
    transition: transform var(--theme-transition), color var(--theme-transition)
}

.float-btn:hover {
    background: var(--hover-bg)
}

.float-btn:hover [data-lucide] {
    transform: rotate(15deg)
}

.float-btn:active {
    background: var(--active-bg)
}

.theme-btn .icon-sun,
:root.dark .theme-btn .icon-moon {
    display: none
}

.theme-btn .icon-moon,
:root.dark .theme-btn .icon-sun {
    display: block
}

.print-btn {
    left: calc(50% + 115mm + 15px);
    animation: btnSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards
}

.theme-btn {
    left: calc(50% + 115mm + 65px);
    animation: btnSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards
}

@media print {
    @page {
        size: A4;
        margin: 10mm 0
    }

    :root,
    :root.dark {
        --head: #0f172a;
        --txt: #1f2933;
        --txt2: #4b5563;
        --muted: #6b7280;
        --line: #94a3b8;
        --acc: #2563eb;
        --bg: #fff;
        --card: #fff;
        --tag-bg: #e5e7eb;
        --shadow: none;
        --hover-bg: transparent;
        --theme-transition: 0s
    }

    body {
        background: #fff
    }

    .wrapper {
        transform: none;
        padding: 0;
        zoom: 1
    }

    .container {
        width: 210mm;
        min-height: 297mm;
        padding: 0 35px;
        box-shadow: none;
        animation: none
    }

    .qr {
        width: 65px;
        height: 65px;
        padding: 4px
    }

    .entry {
        margin: 0 -5px 6px;
        padding: 4px 5px
    }

    header,
    main,
    main section,
    footer {
        opacity: 1 !important;
        animation: none !important
    }

    .float-btn {
        display: none
    }

    h1::after,
    .entry>.row:first-child::after {
        display: none !important
    }

    .tags span {
        color: #000 !important;
        background: #f5f5f5
    }

    .gold {
        color: #b45309 !important
    }

    .silver {
        color: #6b7280 !important
    }

    .bronze {
        color: #92400e !important
    }

    section,
    .entry,
    header,
    footer,
    footer>div {
        break-inside: avoid
    }

    h2,
    h3 {
        break-after: avoid
    }
}

@media screen and (max-width:900px) {
    .float-btn {
        top: auto;
        bottom: 16px;
        left: auto;
        animation: fadeIn 0.4s ease 0.6s forwards
    }

    .print-btn {
        right: 68px
    }

    .theme-btn {
        right: 16px
    }

    main {
        animation: fadeSlideUp 0.4s ease 0.2s both
    }

    main section:nth-child(odd),
    main section:nth-child(even) {
        animation: fadeSlideUp 0.4s ease both
    }

    main section:nth-child(1) {
        animation-delay: 0.25s
    }

    main section:nth-child(2) {
        animation-delay: 0.3s
    }

    main section:nth-child(3) {
        animation-delay: 0.35s
    }

    main section:nth-child(4) {
        animation-delay: 0.4s
    }
}

@media screen and (max-width:900px) and (min-width:601px) {
    .wrapper {
        zoom: 1;
        padding: 12px
    }

    .container {
        width: 100%;
        max-width: 100%;
        min-height: auto;
        padding: 20px 24px;
        border-radius: var(--radius-lg);
        animation: fadeSlideUp 0.5s ease forwards
    }

    header {
        animation: fadeSlideUp 0.4s ease 0.1s both
    }

    h1 {
        font-size: 24px
    }

    h2 {
        font-size: 16px
    }

    .qr {
        width: 53px;
        height: 53px
    }

    .contacts {
        gap: 10px 16px
    }

    .contacts a {
        font-size: 13px
    }

    .row strong {
        font-size: 13px
    }

    .ranks {
        padding: 0 10%
    }
}

@media screen and (max-width:600px) {
    .wrapper {
        zoom: 1;
        padding: 8px
    }

    .container {
        width: 100%;
        max-width: 100%;
        min-height: auto;
        padding: 16px 18px;
        border-radius: var(--radius-md);
        animation: fadeSlideUp 0.5s ease forwards
    }

    header {
        margin: -5px -5px 12px;
        padding: 5px 5px 10px;
        animation: fadeSlideUp 0.4s ease 0.1s both
    }

    .name-row {
        align-items: flex-start
    }

    h1 {
        font-size: 22px;
        line-height: 1.25;
        padding-bottom: 0
    }

    .pronoun {
        display: block;
        margin-left: 0;
        margin-top: 2px;
        font-size: 12px
    }

    .qr {
        width: 58px;
        height: 58px;
        padding: 4px
    }

    .contacts {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
        margin-top: 8px
    }

    .contacts a {
        max-width: 100%;
        font-size: 12px;
        gap: 5px
    }

    .contacts [data-lucide] {
        width: 13px;
        height: 13px
    }

    h2 {
        font-size: 15px;
        margin: 12px 0 6px
    }

    h3 {
        font-size: 11px;
        margin: 8px 0 6px
    }

    .entry {
        margin: 0 -5px 8px
    }

    .row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px
    }

    .row strong {
        font-size: 13px;
        line-height: 1.2
    }

    .row strong [data-lucide] {
        width: 13px;
        height: 13px
    }

    .meta {
        font-size: 11px;
        white-space: normal
    }

    .muted {
        font-size: 11px;
        margin-bottom: 4px
    }

    .desc {
        font-size: 12px;
        margin-bottom: 4px
    }

    .ranks {
        flex-wrap: wrap;
        gap: 6px 12px;
        padding: 0 5%
    }

    .ranks span {
        font-size: 11px
    }

    .ranks [data-lucide] {
        width: 13px;
        height: 13px
    }

    .doi a {
        font-size: 11px;
        word-break: break-all
    }

    .tags span {
        font-size: 11px
    }

    footer {
        flex-direction: column;
        gap: 12px;
        animation: fadeSlideUp 0.4s ease 0.5s both
    }

    footer>div {
        width: 100%;
        min-width: auto
    }

    .float-btn {
        bottom: 12px;
        width: 42px;
        height: 42px
    }

    .float-btn [data-lucide] {
        width: 20px;
        height: 20px
    }

    .print-btn {
        right: 62px
    }

    .theme-btn {
        right: 12px
    }
}

@media screen and (max-width:380px) {
    .wrapper {
        padding: 6px
    }

    .container {
        padding: 14px 16px
    }

    h1 {
        font-size: 20px
    }

    h2 {
        font-size: 15px
    }

    .qr {
        width: 52px;
        height: 52px
    }

    .contacts {
        gap: 6px 10px
    }

    .contacts a {
        font-size: 10px;
        gap: 4px
    }

    .contacts [data-lucide] {
        width: 11px;
        height: 11px
    }

    .row strong {
        font-size: 12px
    }

    .desc {
        font-size: 11px
    }

    .tags span {
        font-size: 10px;
        padding: 2px 6px
    }

    .float-btn {
        width: 40px;
        height: 40px
    }

    .float-btn [data-lucide] {
        width: 18px;
        height: 18px
    }

    .print-btn {
        right: 56px
    }

    .theme-btn {
        right: 10px
    }
}

@media (hover:none) and (pointer:coarse) {

    header:hover,
    .entry:hover {
        background: transparent;
        box-shadow: none
    }

    .float-btn:hover {
        background: var(--card)
    }

    .float-btn:hover [data-lucide] {
        transform: none
    }

    .tags span:hover {
        color: var(--txt);
        background: var(--tag-bg)
    }

    .contacts a:hover,
    .contacts a:hover [data-lucide] {
        color: var(--muted)
    }

    .doi a:hover {
        color: var(--acc)
    }

    h1::after,
    .entry>.row:first-child::after {
        display: none
    }

    .entry:active {
        background: var(--hover-bg)
    }

    .tags span:active {
        color: #fff;
        background: #3b82f6
    }

    .float-btn:active {
        background: var(--active-bg);
        transform: scale(0.95)
    }

    .contacts a:active,
    .contacts a:active [data-lucide],
    .doi a:active {
        color: var(--acc-hover)
    }
}