:root {
    color-scheme: dark;
    --mem-ink: #f5f2eb;
    --mem-muted: rgba(255, 255, 255, 0.62);
    --mem-paper: transparent;
    --mem-card: rgba(8, 8, 8, 0.76);
    --mem-green: #c2a46b;
    --mem-green-soft: #d4bb86;
    --mem-gold: #c2a46b;
    --mem-line: rgba(255, 255, 255, 0.17);
    --mem-radius-lg: 30px;
    --mem-radius-md: 20px;
    --mem-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

html {
    background: #1b211f;
}

body {
    overflow: hidden;
    color: var(--mem-ink);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
a {
    font: inherit;
}

.page-background {
    position: fixed;
    inset: -20px;
    z-index: -2;
    background:
        radial-gradient(circle at 50% 20%, rgba(98, 115, 107, 0.48), transparent 45%),
        #1d2421;
    background-position: center;
    background-size: cover;
    filter: blur(4px) saturate(0.72) brightness(0.68);
    transform: scale(1.045);
}

.page-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(7, 8, 8, 0.2), rgba(7, 8, 8, 0.42)),
        radial-gradient(circle at center, transparent 24%, rgba(0, 0, 0, 0.28));
}

.page-background.has-background {
    filter: blur(4px) saturate(0.72) brightness(0.68);
}

.scroll-container {
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.page {
    width: min(calc(100% - 40px), 1080px);
    margin-inline: auto;
}

.hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 100px 20px 110px;
}

.memorial-brand {
    position: absolute;
    top: 28px;
    left: max(24px, calc((100% - 1080px) / 2));
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.82);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
    text-decoration: none;
}

.memorial-brand img {
    width: 34px;
    height: 34px;
    display: block;
    border-radius: 10px;
    object-fit: cover;
    opacity: 0.92;
}

.memorial-brand-logo {
    width: 34px;
    height: 34px;
    display: block;
    flex: 0 0 34px;
}

.hero-inner {
    position: relative;
    z-index: 2;
}

.top-row {
    display: grid;
    grid-template-columns: minmax(290px, 0.76fr) minmax(0, 1.24fr);
    min-height: 570px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: var(--mem-radius-lg);
    background: rgba(248, 247, 242, 0.92);
    box-shadow: var(--mem-shadow);
    backdrop-filter: blur(18px);
}

.main-photo {
    position: relative;
    min-height: 570px;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(49, 91, 80, 0.16), rgba(184, 151, 95, 0.16)),
        #d9dcd7;
}

.main-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset -1px 0 rgba(255, 255, 255, 0.35);
}

.main-photo.is-clickable {
    cursor: pointer;
}

.main-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
    transition: none;
}

.name-block {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    padding: clamp(42px, 7vw, 86px);
}

.full-name {
    color: var(--mem-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(48px, 5.7vw, 75px);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.dates {
    padding: 9px 14px;
    border: 1px solid var(--mem-line);
    border-radius: 999px;
    color: var(--mem-muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.biography {
    width: 100%;
    max-width: 540px;
    max-height: 156px;
    overflow: hidden;
    color: var(--mem-muted);
    font-size: 15px;
    line-height: 1.75;
    white-space: pre-line;
    transition: max-height 300ms ease;
}

.biography.expanded {
    max-height: none;
}

.biography-toggle {
    display: none;
    align-self: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--mem-line);
    color: var(--mem-green-soft);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.divider-wrapper {
    position: relative;
    z-index: 3;
    margin-top: 30px;
    margin-bottom: 0;
}

.divider-row {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.divider-row.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.divider-row.one-column {
    grid-template-columns: 1fr;
}

.divider-half {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 18px;
    background: rgba(251, 250, 246, 0.92);
    color: var(--mem-ink);
    box-shadow: 0 18px 50px rgba(18, 27, 24, 0.14);
    backdrop-filter: blur(14px);
}

.divider-half strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 400;
}

.contacts-trigger,
.location-button,
.share-button {
    cursor: pointer;
}

.social-links {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.social-link {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--mem-line);
    border-radius: 50%;
    background: #fff;
}

.social-link img {
    width: 19px;
    height: 19px;
    display: block;
    filter: grayscale(1) brightness(0.35);
}

.content {
    margin-top: 28px;
    padding: 0 0 76px;
    background: transparent;
}

.content-inner {
    padding: 56px 34px 48px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: var(--mem-radius-lg);
    background: rgba(243, 241, 235, 0.94);
    box-shadow: 0 24px 70px rgba(17, 26, 23, 0.12);
    backdrop-filter: blur(14px);
}

.section-title {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin: 0 0 30px;
    color: var(--mem-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(42px, 5.4vw, 62px);
    font-weight: 400;
    line-height: 1;
    text-align: center;
    letter-spacing: -0.035em;
}

.section-divider {
    width: 100%;
    height: 1px;
    margin: 72px 0;
    background: var(--mem-line);
}

.slider {
    position: relative;
    overflow: hidden;
    padding: 0 4px;
    touch-action: pan-y;
}

.track {
    display: flex;
    transition: transform 350ms ease;
}

.item {
    padding: 8px;
}

.photo-slide {
    flex: 0 0 33.333%;
}

.video-slide {
    flex: 0 0 50%;
}

.inner {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(32, 39, 36, 0.11);
    border-radius: var(--mem-radius-md);
    background: #d9ddd8;
    box-shadow: 0 14px 38px rgba(23, 35, 31, 0.08);
    cursor: pointer;
}

.inner img,
.inner video,
.inner iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    object-fit: cover;
}

.inner iframe {
    pointer-events: none;
}

.video-preview {
    position: relative;
    width: 100%;
    height: 100%;
    background: #17201d;
    color: #fff;
    cursor: pointer;
}

.video-item,
.video-item video,
.video-item .video-preview-placeholder,
.video-item .video-play-badge {
    cursor: pointer;
}

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.video-preview-placeholder {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 30% 25%, rgba(184, 151, 95, 0.24), transparent 34%),
        linear-gradient(145deg, #2b423b, #121916);
}

.video-play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(8px);
    transform: translate(-50%, -50%);
}

.video-play-badge::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #fff;
}

.nav-btn {
    position: absolute;
    top: 50%;
    z-index: 10;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background: rgba(31, 44, 40, 0.84);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(8px);
    transform: translateY(-50%);
}

.nav-btn.left {
    left: 14px;
}

.nav-btn.right {
    right: 14px;
}

.nav-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.memory-candle {
    margin-top: 28px;
}

.memory-candle-card {
    position: relative;
    overflow: hidden;
    min-height: 460px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 13px;
    padding: 48px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--mem-radius-lg);
    background:
        radial-gradient(circle at 50% 35%, rgba(184, 151, 95, 0.2), transparent 31%),
        linear-gradient(145deg, #253b35, #15221e);
    color: #fff;
    text-align: center;
    box-shadow: 0 26px 70px rgba(22, 42, 35, 0.16);
}

.memory-candle-title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(36px, 5vw, 50px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.035em;
}

.memory-candle-counter {
    margin: 3px 0 0;
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
}

.memory-candle-counter strong {
    color: #fff;
}

.candle-visual {
    position: relative;
    width: 110px;
    height: 145px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 4px 0;
}

.candle-glow {
    position: absolute;
    bottom: 50px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(253, 214, 127, 0.38), rgba(253, 214, 127, 0));
    opacity: 0;
}

.candle-body {
    width: 46px;
    height: 84px;
    border-radius: 9px 9px 6px 6px;
    background: linear-gradient(90deg, #d5c4a2, #f4ead2 45%, #d6c39d);
    box-shadow: inset 0 -12px 18px rgba(74, 48, 20, 0.14);
}

.candle-wick {
    position: absolute;
    bottom: 80px;
    width: 2px;
    height: 15px;
    background: #302a22;
}

.candle-flame {
    position: absolute;
    bottom: 91px;
    width: 18px;
    height: 29px;
    border-radius: 80% 70% 65% 65%;
    background: linear-gradient(180deg, #fff4b0, #f5a524 62%, #d95d22);
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.64));
    opacity: 0;
    transform-origin: 50% 100%;
}

.candle-visual.is-lit .candle-glow {
    opacity: 1;
    animation: glowPulse 3.2s ease-in-out infinite;
}

.candle-visual.is-lit .candle-flame {
    opacity: 1;
    animation: flameFlicker 1.6s ease-in-out infinite;
}

.memory-candle-form {
    width: 100%;
    display: flex;
    justify-content: center;
}

.memory-submit {
    min-width: 230px;
    min-height: 48px;
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--mem-green);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background-color 180ms ease,
        transform 180ms ease;
}

.memory-submit:hover {
    background: #fff;
    transform: translateY(-1px);
}

.memory-submit:disabled {
    opacity: 0.56;
    cursor: default;
    transform: none;
}

@keyframes flameFlicker {
    0%,
    100% {
        transform: translateX(0) scale(1) rotate(-1deg);
    }
    35% {
        transform: translateX(1px) scale(0.94, 1.04) rotate(2deg);
    }
    65% {
        transform: translateX(-1px) scale(1.04, 0.96) rotate(-3deg);
    }
}

@keyframes glowPulse {
    0%,
    100% {
        opacity: 0.72;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

.footer {
    width: min(calc(100% - 40px), 1080px);
    margin: 0 auto 22px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 18px;
    background: rgba(19, 30, 27, 0.88);
    backdrop-filter: blur(14px);
}

.footer-sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.footer-section {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 13px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
    transition:
        background-color 180ms ease,
        color 180ms ease;
}

.footer-section:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.footer-section.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: none;
    flex-direction: column;
    background: rgba(3, 3, 3, 0.78);
    backdrop-filter: blur(8px);
}

.lightbox.active {
    display: flex;
}

.lightbox-header {
    min-height: 46px;
    padding: 18px 70px 8px;
    color: rgba(255, 255, 255, 0.84);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
    text-align: center;
}

.lightbox-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox img,
.lightbox video {
    max-width: 90vw;
    max-height: 82vh;
    border-radius: 12px;
    object-fit: contain;
}

.lightbox iframe {
    width: min(90vw, 1200px);
    height: min(78vh, 800px);
    border: 0;
    border-radius: 12px;
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 25px;
    cursor: pointer;
    transform: translateY(-50%);
}

.lightbox-btn.left {
    left: 22px;
}

.lightbox-btn.right {
    right: 22px;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 22px;
    z-index: 2;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
}

.contacts-overlay,
.coords-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 18, 16, 0.78);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(12px);
    transition:
        opacity 180ms ease,
        visibility 180ms ease;
}

.contacts-overlay.active,
.coords-overlay.active {
    opacity: 1;
    visibility: visible;
}

.contacts-modal,
.coords-modal {
    width: min(100%, 640px);
    max-height: min(86vh, 800px);
    overflow-y: auto;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 26px;
    background: var(--mem-paper);
    color: var(--mem-ink);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.28);
}

.contacts-modal h2 {
    margin: 0 0 26px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 400;
    text-align: center;
    letter-spacing: -0.035em;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.contact-item {
    min-height: 112px;
    padding: 15px;
    border: 1px solid var(--mem-line);
    border-radius: 17px;
    background: var(--mem-card);
}

.contact-item.is-phone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.contact-item.is-memorial {
    display: flex;
    align-items: center;
    gap: 13px;
}

.contact-item-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.contact-photo-block {
    width: 66px;
    height: 66px;
    flex: 0 0 66px;
    overflow: hidden;
    border-radius: 50%;
    background: #d9ddd8;
}

.contact-avatar {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(1);
}

.contact-avatar.is-color {
    filter: none;
}

.contact-body {
    min-width: 0;
}

.contact-fullname,
.contact-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    line-height: 1.15;
}

.contact-relation-pill {
    display: inline-flex;
    margin-top: 7px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e8ece6;
    color: var(--mem-green-soft);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.contact-dates {
    margin-top: 7px;
    color: var(--mem-muted);
    font-size: 11px;
}

.contact-phone {
    display: inline-block;
    margin-top: 7px;
    color: var(--mem-green-soft);
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.contacts-close,
.coords-modal button {
    min-width: 130px;
    min-height: 42px;
    display: block;
    margin: 24px auto 0;
    padding: 10px 17px;
    border: 0;
    border-radius: 999px;
    background: var(--mem-green);
    color: #fff;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.services-text {
    color: var(--mem-muted);
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-line;
    text-align: left;
}

.services-text.is-centered {
    text-align: center;
}

.services-call {
    display: block;
    width: fit-content;
    margin: 22px auto 0;
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--mem-card);
}

.services-call.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.coords-overlay {
    display: none;
    opacity: 1;
    visibility: visible;
}

.coords-overlay.active {
    display: flex;
}

.coords-modal {
    max-width: 420px;
    text-align: center;
}

.coords-modal p {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
}

@media (max-width: 900px) {
    .top-row {
        grid-template-columns: minmax(270px, 0.85fr) minmax(0, 1.15fr);
        min-height: 520px;
    }

    .main-photo {
        min-height: 520px;
    }

    .name-block {
        padding: 42px;
    }

    .full-name {
        font-size: clamp(42px, 6vw, 58px);
    }
}

@media (max-width: 700px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .scroll-container {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .page {
        width: min(calc(100% - 24px), 1080px);
    }

    .hero {
        min-height: 100svh;
        display: block;
        padding: 76px 0 92px;
        box-sizing: border-box;
    }

    .memorial-brand {
        top: 20px;
        left: 18px;
    }

    .memorial-brand img {
        width: 30px;
        height: 30px;
        border-radius: 9px;
    }

    .memorial-brand-logo {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .memorial-brand span {
        font-size: 16px;
    }

    .top-row {
        display: flex;
        flex-direction: column;
        min-height: 0;
        border-radius: 24px;
    }

    .main-photo {
        width: 100%;
        min-height: 0;
        aspect-ratio: 4 / 5;
    }

    .main-photo::after {
        box-shadow: inset 0 -1px rgba(255, 255, 255, 0.35);
    }

    .name-block {
        align-items: center;
        gap: 15px;
        padding: 28px 20px 31px;
        text-align: center;
    }

    .full-name {
        font-size: clamp(38px, 12vw, 52px);
        line-height: 0.99;
    }

    .dates {
        font-size: 15px;
    }

    .biography {
        max-height: 84px;
        font-size: 13px;
        line-height: 1.65;
        text-align: center;
    }

    .divider-wrapper {
        margin-top: 18px;
    }

    .divider-row.two-columns,
    .divider-row.one-column {
        grid-template-columns: 1fr;
    }

    .divider-half {
        min-height: 62px;
        justify-content: center;
        padding: 11px 14px;
        border-radius: 15px;
        text-align: center;
    }

    .divider-half:has(.social-links) {
        justify-content: center;
    }

    .divider-half strong {
        font-size: 16px;
    }

    .content {
        margin-top: 18px;
        padding: 0 0 42px;
        background: transparent;
    }

    .content-inner {
        padding: 38px 16px 30px;
        border-radius: 24px;
    }

    .section-title {
        margin-bottom: 20px;
        font-size: 40px;
    }

    .section-divider {
        margin: 48px 0;
    }

    .slider {
        margin-inline: 0;
        padding-inline: 0;
    }

    .photo-slide,
    .video-slide {
        flex: 0 0 88%;
    }

    .item {
        padding: 5px;
    }

    .inner {
        border-radius: 17px;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    .nav-btn.left {
        left: 15px;
    }

    .nav-btn.right {
        right: 15px;
    }

    .memory-candle {
        margin-top: 18px;
    }

    .memory-candle-card {
        min-height: 420px;
        padding: 40px 15px;
        border-radius: 24px;
    }

    .memory-candle-title {
        font-size: 38px;
    }

    .footer {
        width: calc(100% - 24px);
        margin-bottom: 12px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .footer-sections {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .footer-section {
        min-height: 52px;
        padding: 12px 16px;
        border: 1px solid rgba(255, 255, 255, 0.24);
        border-radius: 15px;
        background: rgba(5, 5, 5, 0.68);
        font-size: 16px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
        backdrop-filter: blur(14px);
    }

    .contacts-modal,
    .coords-modal {
        padding: 25px 18px;
        border-radius: 22px;
    }

    .contacts-modal h2 {
        font-size: 29px;
    }

    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .contact-item {
        min-height: 92px;
    }

    .lightbox-btn {
        width: 40px;
        height: 40px;
    }

    .lightbox-btn.left {
        left: 8px;
    }

    .lightbox-btn.right {
        right: 8px;
    }
}

@media (max-width: 380px) {
    .full-name {
        font-size: 36px;
    }

    .photo-slide,
    .video-slide {
        flex-basis: 94%;
    }
}

@media (max-width: 700px) and (max-height: 760px) and (orientation: portrait) {
    .hero {
        min-height: 100svh;
        padding: 64px 0 12px;
    }

    .memorial-brand {
        top: 16px;
    }

    .top-row {
        height: calc(100svh - 76px);
        min-height: 0;
    }

    .main-photo {
        height: auto;
        min-height: 0;
        flex: 0 0 58%;
        aspect-ratio: auto;
    }

    .name-block {
        min-height: 0;
        flex: 1 1 auto;
        justify-content: center;
        gap: 8px;
        padding: 13px 14px 15px;
    }

    .full-name {
        font-size: clamp(29px, 9.2vw, 35px);
        line-height: 0.96;
    }

    .dates {
        padding: 7px 11px;
        font-size: 13px;
    }

    .biography {
        max-height: 40px;
        font-size: 11px;
        line-height: 1.45;
    }

    .biography-toggle {
        padding: 2px 0;
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.top-row {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(5, 5, 5, 0.68);
    color: #fff;
    box-shadow: var(--mem-shadow);
    backdrop-filter: blur(16px);
}

.main-photo {
    background: rgba(12, 12, 12, 0.78);
}

.full-name {
    color: #fff;
}

.dates {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.68);
}

.biography {
    color: rgba(255, 255, 255, 0.68);
}

.biography-toggle {
    border-bottom-color: rgba(255, 255, 255, 0.24);
    color: var(--mem-gold);
}

.divider-half {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(5, 5, 5, 0.68);
    color: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
}

.social-link {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

.social-link img {
    filter: grayscale(1) saturate(0) brightness(0) invert(1);
}

.content-inner {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(5, 5, 5, 0.68);
    color: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(14px);
}

.section-title {
    color: #fff;
}

.section-divider {
    background: rgba(255, 255, 255, 0.18);
}

.inner {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(12, 12, 12, 0.8);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
}

.nav-btn {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(4, 4, 4, 0.72);
}

.memory-candle-card {
    border-color: rgba(255, 255, 255, 0.24);
    background:
        radial-gradient(circle at 50% 34%, rgba(194, 164, 107, 0.16), transparent 32%),
        rgba(5, 5, 5, 0.68);
    color: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(14px);
}

.memory-candle-counter {
    color: rgba(255, 255, 255, 0.58);
}

.memory-submit {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.memory-submit:hover {
    background: rgba(255, 255, 255, 0.17);
}

.footer {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(5, 5, 5, 0.68);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.footer-section {
    color: rgba(255, 255, 255, 0.74);
}

.contacts-modal,
.coords-modal {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(7, 7, 7, 0.94);
    color: #fff;
}

.contact-item {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.055);
}

.contact-photo-block {
    background: rgba(255, 255, 255, 0.08);
}

.contact-relation-pill {
    background: rgba(194, 164, 107, 0.14);
    color: #dec58f;
}

.contact-dates,
.services-text {
    color: rgba(255, 255, 255, 0.58);
}

.contact-phone {
    color: #dec58f;
}

.contacts-close,
.coords-modal button {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.services-call {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

@media (max-width: 700px) {
    .footer {
        border: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }
}
