:root {
    --obsidian: #050506;
    --midnight: #0b0d14;
    --charcoal: #14161e;
    --ember: #d4a04e;
    --ember-soft: rgba(212, 160, 78, 0.25);
    --cloud: #f1efe7;
    --muted: #9a9587;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(227, 181, 119, 0.15), transparent 45%),
        linear-gradient(180deg, rgba(5, 5, 6, 0) 0%, rgba(212, 160, 78, 0.12) 65%, rgba(5, 5, 6, 0.98) 100%),
        var(--obsidian);
    color: var(--cloud);
    padding: 3rem 1.5rem 4rem;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(212, 160, 78, 0.2), transparent 60%);
    opacity: 0.65;
    pointer-events: none;
    z-index: -2;
}

.noise-overlay {
    position: fixed;
    inset: 0;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160"%3E%3Cfilter id="n" x="0" y="0" width="1" height="1"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="160" height="160" filter="url(%23n)" opacity="0.12"/%3E%3C/svg%3E');
    opacity: 0.4;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: -1;
}

.candle-glow-layer {
    position: fixed;
    inset: auto 0 0 0;
    height: 55vh;
    background: radial-gradient(circle at 50% 100%, rgba(255, 201, 132, 0.22), rgba(5, 5, 6, 0) 55%),
        radial-gradient(circle at 30% 100%, rgba(212, 160, 78, 0.18), transparent 60%),
        radial-gradient(circle at 70% 100%, rgba(212, 160, 78, 0.18), transparent 60%);
    filter: blur(4px);
    opacity: 0.8;
    pointer-events: none;
    z-index: -2;
}

.candle-row {
    position: fixed;
    inset: auto 0 0 0;
    height: 220px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: clamp(1rem, 4vw, 3rem);
    padding: 0 7vw 1rem;
    pointer-events: none;
    z-index: -1;
    mix-blend-mode: screen;
}

.candle {
    position: relative;
    width: clamp(12px, 2vw, 24px);
    height: 140px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(212, 160, 78, 0.95));
    border-radius: 999px 999px 8px 8px;
    box-shadow: 0 0 45px rgba(255, 208, 136, 0.7), 0 25px 60px rgba(0, 0, 0, 0.7);
    opacity: 0.9;
    transform-origin: bottom center;
    animation: candle-sway 6s ease-in-out infinite;
}

.candle::before,
.candle::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.candle::before {
    top: -36px;
    width: 18px;
    height: 36px;
    border-radius: 50% 50% 50% 50%;
    background: radial-gradient(circle at 50% 20%, #fff, #ffd789 60%, rgba(255, 178, 71, 0.4) 100%);
    box-shadow: 0 0 60px rgba(255, 201, 132, 0.95);
    animation: candle-flicker 1.8s ease-in-out infinite;
}

.candle::after {
    bottom: -20px;
    width: 120px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 208, 136, 0.25), transparent 70%);
    filter: blur(8px);
}

.mobile-candle {
    display: none;
    pointer-events: none;
}

.candle:nth-child(2) {
    height: 160px;
    animation-delay: 0.6s;
}

.candle:nth-child(3) {
    height: 120px;
    animation-delay: 1s;
}

.candle:nth-child(4) {
    height: 170px;
    animation-delay: 0.2s;
}

.candle:nth-child(5) {
    height: 135px;
    animation-delay: 1.4s;
}

.candle:nth-child(6) {
    height: 155px;
    animation-delay: 0.9s;
}

.candle:nth-child(7) {
    height: 125px;
    animation-delay: 0.3s;
}

@keyframes candle-sway {
    0% {
        transform: translateY(0) rotate(-0.8deg);
    }
    50% {
        transform: translateY(-6px) rotate(0.8deg);
    }
    100% {
        transform: translateY(0) rotate(-0.6deg);
    }
}

@keyframes candle-flicker {
    0% {
        opacity: 0.75;
        transform: translate(-50%, -2px) scale(0.95);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1.05);
    }
    100% {
        opacity: 0.8;
        transform: translate(-50%, -1px) scale(0.98);
    }
}

.hero {
    max-width: 720px;
    margin: 0 auto 3rem;
    text-align: center;
}

.hero .eyebrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.75rem;
    color: var(--cloud);
    font-weight: 700;
    margin-bottom: 0.75rem;
    isolation: isolate;
}

.hero .eyebrow::before {
    content: '';
    position: absolute;
    inset: 0.15rem;
    background: linear-gradient(90deg, #007a3d 0%, #007a3d 33%, #ce1126 33%, #ce1126 66%, #fcd116 66%, #fcd116 100%);
    border-radius: 999px;
    box-shadow: 0 10px 25px rgba(6, 18, 8, 0.65);
    z-index: -1;
}

.hero h1 {
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-size: clamp(2.5rem, 4vw, 3.8rem);
    margin-bottom: 1rem;
    color: var(--cloud);
    text-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
}

.hero .lede {
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--muted);
}

.martyrs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 0 auto;
    max-width: 1200px;
}

.martyr-card {
    background: linear-gradient(145deg, var(--midnight), var(--charcoal));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1.2rem;
    position: relative;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    transition: transform 240ms ease, box-shadow 240ms ease;
    content-visibility: auto;
    contain-intrinsic-size: 320px 520px;
}

.martyr-card::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.martyr-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.6);
}

.martyr-photo {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(160deg, rgba(212, 160, 78, 0.25), rgba(5, 5, 6, 0.9));
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), 0 10px 25px rgba(0, 0, 0, 0.55);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.martyr-photo picture {
    width: 100%;
    height: 100%;
    display: block;
}

.martyr-photo::before {
    content: '';
    position: absolute;
    inset: 45% -20% -20% -20%;
    background: radial-gradient(circle at 50% 100%, rgba(255, 214, 137, 0.55), transparent 70%);
    filter: blur(20px);
    opacity: 0.7;
    z-index: 0;
    pointer-events: none;
}

.martyr-photo::after {
    content: attr(data-initials);
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.1em;
    text-shadow: 0 6px 15px rgba(0, 0, 0, 0.8);
}

.martyr-photo[data-has-image="true"]::after {
    content: '';
}

.martyr-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.6rem;
    filter: grayscale(0.15) contrast(1.15) saturate(0.85);
    mix-blend-mode: lighten;
    box-shadow: 0 20px 60px rgba(212, 160, 78, 0.25);
    position: relative;
    z-index: 1;
}

.martyr-body h3 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.02em;
}

.martyr-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.martyr-links a,
.martyr-links .no-link {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.martyr-links a {
    color: var(--ember);
    text-decoration: none;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid transparent;
    transition: color 200ms ease, border-color 200ms ease;
}

.martyr-links a:hover,
.martyr-links a:focus-visible {
    color: #ffd789;
    border-color: rgba(255, 215, 137, 0.6);
}

.no-link {
    color: var(--muted);
}

.site-footer {
    text-align: center;
    margin-top: 3rem;
    color: rgba(241, 239, 231, 0.7);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

@media (max-width: 900px) {
    .noise-overlay,
    .candle-row {
        display: none;
    }

    .candle-glow-layer {
        display: block;
        height: 35vh;
        background: radial-gradient(circle at 50% 90%, rgba(255, 196, 134, 0.18), transparent 60%),
            radial-gradient(circle at 30% 85%, rgba(212, 160, 78, 0.12), transparent 50%),
            radial-gradient(circle at 70% 85%, rgba(212, 160, 78, 0.12), transparent 50%);
        filter: blur(10px);
        opacity: 0.6;
        animation: glow-pulse 8s ease-in-out infinite;
    }

    .mobile-candle {
        display: block;
        position: sticky;
        top: 45vh;
        width: 18px;
        height: 78px;
        margin: 0 auto 2.5rem;
        border-radius: 999px 999px 6px 6px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(212, 160, 78, 0.95));
        box-shadow: 0 0 35px rgba(255, 220, 150, 0.4), 0 14px 25px rgba(0, 0, 0, 0.55);
        animation: candle-sway-mobile 6s ease-in-out infinite;
        mix-blend-mode: screen;
        z-index: 5;
    }

    .mobile-candle::before {
        content: '';
        position: absolute;
        top: -28px;
        left: 50%;
        transform: translateX(-50%);
        width: 16px;
        height: 28px;
        border-radius: 50% 50% 45% 45%;
        background: radial-gradient(circle at 50% 25%, #fff, rgba(255, 214, 137, 0.9));
        box-shadow: 0 0 30px rgba(255, 214, 137, 0.8);
        animation: candle-flicker-mobile 1.8s ease-in-out infinite;
    }

    .mobile-candle::after {
        content: '';
        position: absolute;
        bottom: -18px;
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
        height: 40px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 214, 137, 0.3), transparent 65%);
        filter: blur(6px);
    }

    body::before {
        display: none;
    }

    body {
        padding: 2.5rem 1rem 3rem;
        background: radial-gradient(circle at top, rgba(227, 181, 119, 0.08), transparent 35%),
            linear-gradient(180deg, rgba(5, 5, 6, 0) 0%, rgba(212, 160, 78, 0.08) 50%, rgba(5, 5, 6, 0.95) 100%),
            var(--obsidian);
    }

    .martyr-card {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    }

    .martyr-photo {
        box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.55), 0 6px 16px rgba(0, 0, 0, 0.4);
    }

    .martyr-photo img {
        filter: grayscale(0.05) contrast(1.05);
        mix-blend-mode: normal;
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
    }
}

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

    .candle-row,
    .noise-overlay,
    .candle-glow-layer,
    .mobile-candle {
        display: none;
    }

    .mobile-candle::before {
        animation: none;
    }
}

@media (max-width: 600px) {
    body {
        padding: 2.5rem 1rem 3rem;
    }

    body::before {
        display: none;
    }

    .martyrs-grid {
        gap: 1.25rem;
    }

    .martyr-card {
        padding: 1rem;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
        border: 1px solid rgba(255, 255, 255, 0.04);
    }

    .martyr-photo {
        box-shadow: none;
        border-color: rgba(255, 255, 255, 0.05);
    }

    .martyr-photo::before {
        display: none;
    }

    .martyr-photo img {
        filter: none;
        box-shadow: none;
    }

    .mobile-candle {
        top: 42vh;
        height: 66px;
        margin-bottom: 2rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .martyr-card {
        transition: none;
    }

    .martyr-card::before {
        border-color: rgba(255, 255, 255, 0.05);
    }

    .martyr-card:hover {
        transform: none;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    }

}

@keyframes glow-pulse {
    0% {
        opacity: 0.35;
        transform: scale(0.98);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.4;
        transform: scale(1);
    }
}

@keyframes candle-sway-mobile {
    0% {
        transform: translateX(-50%) translateY(0) rotate(-1deg);
    }
    50% {
        transform: translateX(-50%) translateY(-4px) rotate(1deg);
    }
    100% {
        transform: translateX(-50%) translateY(0) rotate(-0.8deg);
    }
}

@keyframes candle-flicker-mobile {
    0% {
        opacity: 0.75;
        transform: translateX(-50%) scale(0.95);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
    100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(0.98);
    }
}
