@font-face {
    font-family: "e-Ukraine";
    src: url("fonts/e-Ukraine-Thin.woff2") format("woff2");
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "e-Ukraine";
    src: url("fonts/e-Ukraine-UltraLight.woff2") format("woff2");
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "e-Ukraine";
    src: url("fonts/e-Ukraine-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "e-Ukraine";
    src: url("fonts/e-Ukraine-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "e-Ukraine";
    src: url("fonts/e-Ukraine-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "e-Ukraine";
    src: url("fonts/e-Ukraine-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --text: #050505;
    --card: rgba(248, 250, 255, 0.66);
    --glass: rgba(255, 255, 255, 0.76);
    --nav-h: 88px;
    --document-footer-h: clamp(90px, 13.5dvh, 135px);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #dfe8ff;
    color: var(--text);
    font-family: "e-Ukraine", Arial, Helvetica, sans-serif;
}

body {
    overflow: hidden;
    background: #202321;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

.app-shell {
    position: relative;
    width: min(100%, 430px);
    margin: 0 auto;
    height: 100dvh;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 0% 91%, #fff9b5 0%, transparent 48%),
        radial-gradient(ellipse at 100% 100%, #8dd9e6 0%, transparent 46%),
        linear-gradient(155deg, #c9bbdf 0%, #c7bce0 30%, #d9def0 66%, #d1e6e5 100%);
}

.document-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    padding: calc(var(--safe-top) + 20.8dvh) 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.document-card {
    position: relative;
    width: 100%;
    max-width: none;
    flex: 0 0 100%;
    height: min(calc(54dvh + 32px), 572px);
    min-height: 332px;
    container-type: inline-size;
    flex-shrink: 0;
    border: 0;
    border-radius: 24px;
    overflow: hidden;
    background: var(--card);
    backdrop-filter: blur(24px) saturate(120%);
    -webkit-backdrop-filter: blur(24px) saturate(120%);
    box-shadow: none;
    transform: scaleY(var(--card-scale, 0.9));
    transform-origin: center;
    will-change: transform;
}

.document-card__body {
    height: calc(100% - var(--document-footer-h));
    padding: 22px 18px 50px;
    display: flex;
    flex-direction: column;
}

.document-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.document-title {
    margin: 0;
    font-size: 6.8cqw;
    font-weight: 400;
    letter-spacing: -0.04em;
}

.document-main {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.96fr);
    gap: 26px;
    align-items: start;
}

.portrait-wrap {
    height: min(57cqw, 100%);
    max-height: 220px;
    min-height: 0;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 26%;
    display: block;
}

.document-meta {
    padding-top: 0;
    font-size: 3.9cqw;
    line-height: 1.4;
}

.document-meta p {
    margin: 0;
}

.meta-label {
    font-weight: 400;
}

.meta-value {
    margin-top: 3px !important;
}

.meta-label--spaced {
    margin-top: 14px !important;
}

.ticker {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--document-footer-h);
    height: 26px;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, #a7f77c 0%, #79e2d1 100%);
    white-space: nowrap;
    font-size: 12px;
    line-height: 1;
}

.ticker__track {
    display: flex;
    min-width: max-content;
    animation: marquee 18s linear infinite;
}

.ticker__track span {
    padding-right: 56px;
}

.ticker__track--updated span {
    padding-right: 1ch;
}

@keyframes marquee {
    to {
        transform: translateX(-50%);
    }
}

.document-card__footer {
    position: relative;
    height: var(--document-footer-h);
    padding: 30px 18px 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.person-name {
    font-size: 6.6cqw;
    line-height: 1.1;
    letter-spacing: -0.035em;
    font-weight: 400;
    text-transform: uppercase;
    padding-bottom: 0;
}

.dots-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    display: grid;
    grid-auto-flow: column;
    place-content: center;
    gap: 4px;
    background: #000;
    flex: 0 0 auto;
    margin-bottom: 2px;
    cursor: pointer;
}

.dots-button span {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #fff;
}

.document-carousel {
    display: flex;
    width: 100%;
    gap: 4%;
    padding-inline: 7.5%;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    cursor: grab;
    user-select: none;
}
.document-carousel::-webkit-scrollbar { display: none; }
.document-carousel.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.document-carousel .document-card { scroll-snap-align: center; scroll-snap-stop: always; }
.document-carousel img { -webkit-user-drag: none; }
.document-card--actions {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    overflow: visible;
}
.document-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    border: 0;
    border-radius: 20px;
    background: var(--card);
    font-size: 5.3cqw;
    line-height: 1.4;
    cursor: pointer;
}
.document-tile svg { width: 36px; height: 36px; }
.document-card--tax .document-heading { margin-bottom: 18px; }
.tax-subtitle { margin: 0; font-size: 4.8cqw; }
.tax-name { margin: 24px 0 18px; font-size: 4.4cqw; line-height: 1.12; text-transform: uppercase; }
.tax-number { font-size: 7cqw; letter-spacing: -0.04em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 24px;
}

.pager-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    background: rgba(255, 255, 255, 0.32);
    transition: background 0.2s, transform 0.2s;
}

.pager-dot::before { content: ""; position: absolute; inset: -9px -4px; }

.pager-dot.is-active {
    transform: scale(1.15);
    background: #fff;
}

.bottom-nav {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
    min-height: calc(var(--nav-h) + var(--safe-bottom));
    padding: 13px 12px calc(10px + var(--safe-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: start;
    background: #000;
    color: #fff;
    gap: 4px;
}

.nav-item {
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    font-size: 10px;
    cursor: pointer;
    color: #fff;
    opacity: 1;
    gap: 7px;
    padding: 4px 0;
}

.nav-icon {
    width: 30px;
    height: 30px;
    display: block;
    object-fit: contain;
}

.overlay {
    position: fixed;
    z-index: 50;
    inset: 0;
    background: rgba(24, 22, 32, 0.66);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.overlay.is-visible { opacity: 1; }

.bottom-sheet {
    position: fixed;
    z-index: 60;
    left: 50%;
    width: min(calc(100% - 32px), 398px);
    bottom: calc(24px + var(--safe-bottom));
    transform: translate(-50%, calc(100% + 30px));
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

.bottom-sheet.is-open {
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.sheet-panel,
.sheet-close {
    border-radius: 26px;
    background: #fff;
}

.sheet-panel {
    padding: 10px 18px;
}

.sheet-row {
    width: 100%;
    min-height: 60px;
    border: 0;
    background: transparent;
    display: grid;
    grid-template-columns: 46px 1fr;
    align-items: center;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
}

.sheet-icon {
    width: 22px;
    height: 22px;
    justify-self: center;
}

.sheet-divider {
    height: 1px;
    background: #e7e7e7;
    margin: 0 2px;
}

.sheet-close {
    width: 100%;
    height: 54px;
    border: 0;
    margin-top: 8px;
    font-size: 20px;
    cursor: pointer;
}

.full-info {
    position: fixed;
    z-index: 70;
    left: 50%;
    width: min(100%, 430px);
    bottom: 0;
    height: 93dvh;
    display: flex;
    flex-direction: column;
    border-radius: 28px 28px 0 0;
    background: #eef5f4;
    transform: translate(-50%, 102%);
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
    pointer-events: none;
}

.full-info.is-open {
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.full-info__grabber {
    display: block;
    flex-shrink: 0;
    width: 42px;
    height: 5px;
    padding: 0;
    border: 0;
    cursor: pointer;
    touch-action: none;
    border-radius: 10px;
    background: #aeb5b6;
    margin: 10px auto 8px;
}

.full-info__header {
    padding: 4px 24px 24px;
    font-size: 27px;
    font-weight: 400;
    touch-action: pan-x;
    letter-spacing: -0.04em;
}

.ticker--full {
    position: relative;
    bottom: auto;
    height: 25px;
    flex-shrink: 0;
}

.full-info__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 25px 24px calc(30px + var(--safe-bottom));
}

.info-card {
    border-radius: 18px;
    background: #fff;
    padding: 18px;
    margin-bottom: 16px;
}

.info-card--hero h2 {
    margin: 0 0 18px;
    font-size: 24px;
    line-height: 1.06;
    font-weight: 400;
    letter-spacing: -0.03em;
}

.latin-name {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 400;
}

.info-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    gap: 24px;
    align-items: start;
}

.info-photo {
    width: 100%;
    aspect-ratio: 0.77;
    object-fit: cover;
    object-position: 50% 26%;
    border-radius: 16px;
    border: 1px solid #e5e5e5;
}

.info-label,
.info-value {
    margin: 0;
    font-size: 14px;
}

.info-label span {
    color: #8f8f8f;
}

.info-value {
    margin-top: 5px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.info-row + .info-row {
    margin-top: 20px;
}

.info-row strong {
    font-weight: 400;
}

.info-row--stack {
    display: grid;
    gap: 6px;
}

#info-document-source { white-space: pre-line; }
.info-row--sex { display: grid; grid-template-columns: 1fr 1fr; }
.info-translation { color: #858585; }
.info-row--tax { display: grid; grid-template-columns: 1.2fr 1fr 24px; align-items: center; gap: 8px; }
.copy-button { width: 28px; height: 30px; border: 0; padding: 3px; background: transparent; cursor: pointer; }
.copy-button svg { width: 100%; height: 100%; }

[hidden] { display: none !important; }

button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid #3769cf; outline-offset: 4px; }
button:active { transform: scale(0.97); }
.nav-item.is-active { opacity: 1; }
.secondary-view { position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; padding: 30px 24px; }
.secondary-view h1 { font-size: 32px; font-weight: 400; letter-spacing: -1.3px; margin: 8px 0 28px; }
.eyebrow { font-size: 10px; color: #535e5c; letter-spacing: 0.04em; }
.content-card { background: #ffffffa8; border: 1px solid #ffffff70; padding: 22px; border-radius: 22px; margin-bottom: 14px; }
.content-card h2, .action-panel h2 { font-size: 23px; font-weight: 400; letter-spacing: -0.7px; margin: 0 0 14px; }
.content-card p, .action-panel p, .action-panel details { font-size: 13px; line-height: 1.7; }
.content-card p { color: #485352; }
.text-button { border: 0; background: #000; color: #fff; border-radius: 30px; padding: 14px 22px; cursor: pointer; font-size: 13px; margin-top: 8px; }
.action-panel { padding: 28px 24px; max-height: 65dvh; overflow-y: auto; }
.action-panel h2 { margin-top: 12px; }
.action-panel details { padding: 14px 0; border-bottom: 1px solid #e5e7e6; }
.action-panel summary { cursor: pointer; }
.rating { display: flex; justify-content: space-between; margin: 20px 0; gap: 4px; }
.rating button { border: 1px solid #ddd; border-radius: 50%; background: #f3f5f3; width: 46px; height: 46px; cursor: pointer; }
.rating button[aria-pressed="true"] { background: #000; color: #fff; }
.rating-result { min-height: 44px; }
.demo-code { text-align: center; border: 1px dashed #b4c2bd; border-radius: 18px; background: #edf5ef; padding: 28px 16px; margin: 20px 0; }
.demo-code strong { display: block; font-size: 30px; letter-spacing: 6px; margin-bottom: 8px; }
.demo-code span { font-size: 10px; }
@media (max-width: 360px) {
    .document-card__body { padding: 18px 16px 46px; }
    .document-heading { margin-bottom: 20px; }
    .document-main { gap: 20px; }
    .document-card__footer { padding: 26px 16px 18px; }
    .nav-item { font-size: 9px; }
}
@media (max-height: 650px) {
    .document-stage { padding-top: calc(var(--safe-top) + 16dvh); }
    .document-heading { margin-bottom: 18px; }
    .document-card__footer { padding-bottom: 16px; }
    .pager { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .document-card { transform: none; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
