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

html {
    overflow-x: hidden;
}

:root {
    --top-header-height: 100px;
    --flip-scale: 1.3;
    --flip-tz: 300px;
    --card-width: 450px;
    --card-height: 623px;
    --card-front-border-width: 5px;
    --back-content-width: 650px;
    --back-content-height: 450px;
    --back-content-padding: 2rem;
    --postmark-width: 110px;
    --postmark-height: 140px;
    --postmark-font-size: 0.7rem;
    --postmark-city-size: 0.85rem;
    --postmark-cancel-width: 105px;
    --postmark-cancel-height: 105px;
    --postmark-cancel-top: -18px;
    --postmark-cancel-left: -22px;
    --flip-icon-size: 70px;
    --flip-icon-offset: 25px;
    --flip-icon-svg-size: 50px;
    --coverflow-nav-size: 60px;
    --coverflow-nav-font-size: 1.5rem;
    --coverflow-nav-prev-left: 30px;
    --coverflow-nav-next-right: 30px;
    --card-close-size: 27px;
    --card-close-font-size: 1.1rem;
    --card-close-bottom: -14px;
    --card-close-left: -14px;
    --focused-label-size: 1.2rem;
    --coverflow-header-cost: 200px; /* matches the constant in .coverflow-container height calc */
    /* Dynamic: positions label/hint just below the focused card's bottom edge.
       space_below_card = (100vh - header_cost - top_header - card_height) / 2
       focused-label.bottom = space_below_card - ~42px (label_height + card_margin).
       flip-hint is CHAINED to the label's actual resolved value (not an independent formula),
       so when space is tight and the label clamps, the hint always stays below it.
       Label minimum is 50px, guaranteeing the hint (needing 50px clearance) fits at bottom:0. */
    --focused-label-bottom: max(50px, calc((100vh - var(--coverflow-header-cost) - var(--top-header-height) - var(--card-height)) / 2 - 42px));
    --flip-hint-bottom: max(0px, calc(var(--focused-label-bottom) - 50px));
}

body {
    font-family: 'Inter', sans-serif;
    background: url('aula_wideshot.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.nav-hamburger {
    top: 26px;
}

.top-header {
    width: 100%;
    height: var(--top-header-height);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 2rem 0 3px;
}

.top-header .logo {
    max-width: 290px;
    width: 100%;
    height: auto;
    display: block;
}

header {
    text-align: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent);
    backdrop-filter: blur(10px);
    -webkit-mask-image: linear-gradient(to bottom, black 63%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 63%, transparent 100%);
}

header p {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    opacity: 0.8;
    margin-top: 3rem;
}

.swipe-hint {
    margin-top: 1.8rem;
    line-height: 1.3rem;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#mainTitle {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.header-ready .swipe-hint,
.header-ready #mainTitle {
    opacity: 1;
}

.mobile-br {
    display: none;
}

.nav-link {
    display: inline-block;
    margin-top: 1rem;
    color: #f8b500;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #ff6b6b;
}

/* Coverflow Container */
.coverflow-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 200px - var(--top-header-height));
    min-height: 500px;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.coverflow-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    pointer-events: none;
}

/* Postcard styling */
.postcard {
    position: absolute;
    width: var(--card-width);
    height: var(--card-height);
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                left 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.4s ease,
                z-index 0s;
    left: 50%;
    top: 50%;
    margin-left: calc(var(--card-width) / -2);
    margin-top: calc(var(--card-height) / -2);
    pointer-events: auto;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.25));
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Initial fade-in on page load */
.postcard.fade-in-init {
    opacity: 0 !important;
    transform: translateY(30px) scale(0.95) !important;
}
.postcard.fade-in-ready {
    transition: opacity 0.8s ease-out, transform 0.8s ease-out !important;
}

/* Faster transitions during rapid keyboard navigation */
.coverflow-wrapper.rapid-nav .postcard,
.coverflow-wrapper.rapid-nav .postcard.focused {
    transition: transform 0.15s ease-out, 
                opacity 0.1s ease-out,
                z-index 0s !important;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2)) !important;
}
/* Disable hover effects during rapid scroll to prevent extra repaints */
.coverflow-wrapper.rapid-nav .postcard:not(.focused):hover {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2)) !important;
    transform: none;
}

.postcard.focused {
    z-index: 100;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.35));
}

.postcard.focused.flipped {
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.3));
    transform: translateX(0) translateZ(var(--flip-tz, 300px)) rotateY(0) scale(1) !important;
}

.postcard:not(.focused):hover {
    filter: brightness(1.25) drop-shadow(0 0 20px rgba(248, 181, 0, 0.5));
    opacity: 1 !important;
    transform: translateX(var(--tx)) translateZ(calc(var(--tz) + 50px)) rotateY(calc(var(--ry) * 0.7)) scale(calc(var(--scale) + 0.08)) !important;
    z-index: 99 !important;
}

.postcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.postcard.flipped .postcard-inner {
    transform: rotateY(180deg) rotateZ(90deg) scale(var(--flip-scale));
}

/* Flip hint icon */
.flip-icon {
    position: absolute;
    bottom: var(--flip-icon-offset);
    right: var(--flip-icon-offset);
    width: var(--flip-icon-size);
    height: var(--flip-icon-size);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 20;
    pointer-events: none;
}

.flip-icon svg {
    width: var(--flip-icon-svg-size);
    height: var(--flip-icon-svg-size);
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    animation: flipIconPulse 2s ease-in-out infinite;
}

@keyframes flipIconPulse {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(180deg);
    }
}

.flip-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

.postcard.focused:not(.flipped) .flip-icon {
    opacity: 1;
    transform: scale(1);
}

.postcard.flipped .flip-icon {
    opacity: 0;
    transform: scale(0.8);
}

.postcard-front,
.postcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
    pointer-events: none;
    background: #f5f0e1;
    transform: translateZ(1px);
}

.postcard.flipped .postcard-back {
    overflow: visible;
    pointer-events: auto;
}

/* Postcard Front */
.postcard-front {
    border: var(--card-front-border-width) solid #f5f0e1;
}

.postcard-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.postcard-front-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
}

.postcard-year {
    font-size: 1.2rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.postcard-title-front {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    text-shadow: 0 3px 6px rgba(0,0,0,0.5);
}

/* Season/Year label below focused card */
.focused-label {
    position: absolute;
    bottom: var(--focused-label-bottom);
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: var(--focused-label-size);
    text-align: center;
    z-index: 110;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.focused-label.hidden {
    opacity: 0;
}

/* When flip-scale is minimum (0.9), move label to bottom */
.focused-label.at-bottom {
    bottom: 0px;
}

.flip-hint.scale-min {
    display: none;
}

/* Postcard Back */
.postcard-back {
    transform: rotateY(180deg) translateZ(1px);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-family: 'Poppins', sans-serif;
}

.postcard-back-content {
    /* Swap dimensions: content is landscape inside portrait container */
    /* After card rotates 90deg, the visible area is 650×450 (height×width of front) */
    position: absolute;
    width: var(--back-content-width);
    height: var(--back-content-height);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    display: flex;
    flex-direction: row;
    padding: var(--back-content-padding);
    box-sizing: border-box;
}

.postcard-back-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #ccc;
}

.postcard-back-left {
    width: 48%;
    height: 100%;
    overflow: hidden;
    padding-right: 1.5rem;
    font-size: 0.78rem;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.postcard-back-left .text-repertoire-spacer {
    flex-shrink: 0;
    height: 0.6rem;
}

.postcard-back-text {
    font-size: 0.75rem;
    color: #444;
    line-height: 1.55;
    flex: 0 1 auto;
    max-height: 35%;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* Equal heights: when text has enough content, both sections share space equally */
.postcard-back-left.equal-heights .postcard-back-text {
    flex: 1 1 0;
    max-height: none;
}

.postcard-back-left.equal-heights .postcard-back-repertoire {
    flex: 1 1 0;
}

.postcard-back-text p {
    margin-bottom: 0.15rem;
}

.postcard-back-repertoire {
    font-size: 0.71rem;
    color: #555;
    line-height: 1.5;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.postcard-back-repertoire p,
.postcard-back-repertoire li {
    margin-bottom: 0.15rem;
}

.postcard-back-repertoire ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.postcard-back-repertoire-label,
.postcard-back-text-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.83rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.1rem;
    flex-shrink: 0;
}

h3.postcard-back-repertoire-label,
h3.postcard-back-text-label {
    margin: 0;
}

.postcard-back-bottom-row {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    padding-top: 0.35rem;
    margin-top: auto;
}

.postcard-back-director,
.postcard-back-coorporation {
    flex: 1;
    font-size: 0.68rem;
    color: #444;
    line-height: 1.5;
    overflow: hidden;
    position: relative;
    max-height: 50px;
}

.postcard-back-director .bottom-label,
.postcard-back-coorporation .bottom-label {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.1rem;
}

.postcard-back-bottom-row dl {
    margin: 0;
}

.postcard-back-bottom-row dt {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.1rem;
}

.postcard-back-bottom-row dd {
    margin: 0;
}

.postcard-back-right {
    width: 48%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-left: 1.5rem;
}

.postcard-back-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.7rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
    text-align: right;
}

.postcard-back-date {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-style: italic;
    text-align: right;
}

/* Wrapper keeps stamp + cancel together as one flex item */
.postmark-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
    align-self: flex-end;
}

.postmark {
    width: var(--postmark-width);
    height: var(--postmark-height);
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #7a2000;
    font-size: var(--postmark-font-size);
    text-align: center;
    transform: rotate(3deg);
    opacity: 0.9;
    margin-bottom: 0;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    /* Stamp paper */
    background: #f2e8d0;
    /* 'Glued at an angle' shadow */
    filter: drop-shadow(1px 3px 4px rgba(0,0,0,0.32));
    /* Perforated stamp edges */
    --perf-r: 3.5px;
    --perf-s: 8px;
    --perf-strip: 5px;
    -webkit-mask:
        linear-gradient(#000 0 0) var(--perf-strip) var(--perf-strip) /
            calc(100% - 2*var(--perf-strip)) calc(100% - 2*var(--perf-strip)) no-repeat,
        radial-gradient(circle, transparent calc(var(--perf-r) - .5px), #000 var(--perf-r))
            calc(var(--perf-s)/2) calc(var(--perf-s)/2) / var(--perf-s) var(--perf-s);
    -webkit-mask-composite: source-over;
    mask:
        linear-gradient(#000 0 0) var(--perf-strip) var(--perf-strip) /
            calc(100% - 2*var(--perf-strip)) calc(100% - 2*var(--perf-strip)) no-repeat,
        radial-gradient(circle, transparent calc(var(--perf-r) - .5px), #000 var(--perf-r))
            calc(var(--perf-s)/2) calc(var(--perf-s)/2) / var(--perf-s) var(--perf-s);
    mask-composite: add;
}

/* Postal ink cancellation mark — sits on top of and slightly offset from the decorative stamp */
.postmark-cancel {
    position: absolute;
    /* bleed over the top-left of the stamp */
    top: var(--postmark-cancel-top);
    left: var(--postmark-cancel-left);
    width: var(--postmark-cancel-width);
    height: var(--postmark-cancel-height);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='105' height='105' viewBox='0 0 105 105'%3E%3Ccircle cx='52.5' cy='52.5' r='49' fill='none' stroke='%23192060' stroke-width='2.2' stroke-dasharray='9 2 15 1 8 3 20 2 10 1 6 2' stroke-opacity='0.7'/%3E%3Ccircle cx='52.5' cy='52.5' r='38' fill='none' stroke='%23192060' stroke-width='1.1' stroke-dasharray='5 1 11 2 7 1 14 3 5 1' stroke-opacity='0.55'/%3E%3Cpath d='M2%2C40 Q8%2C32 15%2C40.5 Q22%2C49 29%2C40 Q36%2C31 42%2C40.5 Q48%2C50 55%2C40 Q62%2C30 68%2C41 Q75%2C52 81%2C40 Q88%2C28 95%2C41 Q101%2C48 103%2C40' fill='none' stroke='%23192060' stroke-width='1.4' stroke-opacity='0.65' stroke-dasharray='19 1 24 2 14 1 30 2'/%3E%3Cpath d='M1%2C52 Q7%2C44 14%2C52.5 Q21%2C61 28%2C52 Q35%2C43 41%2C52 Q47%2C61 54%2C51.5 Q61%2C42 67%2C52 Q74%2C62 80%2C51.5 Q87%2C41 94%2C52 Q100%2C61 103%2C52' fill='none' stroke='%23192060' stroke-width='1.9' stroke-opacity='0.75'/%3E%3Cpath d='M3%2C64 Q9%2C55 16%2C64.5 Q23%2C74 30%2C63.5 Q37%2C53 43%2C64 Q49%2C75 56%2C63 Q63%2C51 69%2C64 Q76%2C77 82%2C63.5 Q89%2C50 95%2C63 Q101%2C76 103%2C64' fill='none' stroke='%23192060' stroke-width='1.2' stroke-opacity='0.5' stroke-dasharray='22 2 17 1 28 3'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.3;
    transform: rotate(-8deg);
    pointer-events: none;
    z-index: 10;
}

/* Blurry floral illustration behind the stamp text */
.postmark::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='140' viewBox='0 0 110 140'%3E%3Crect width='110' height='140' fill='%23f5e6c8'/%3E%3Ccircle cx='55' cy='82' r='16' fill='%23d4607a' opacity='.9'/%3E%3Ccircle cx='55' cy='82' r='8' fill='%23f5c842' opacity='.95'/%3E%3Cellipse cx='55' cy='63' rx='6' ry='12' fill='%23e87a9a' opacity='.85'/%3E%3Cellipse cx='55' cy='101' rx='6' ry='12' fill='%23e87a9a' opacity='.85'/%3E%3Cellipse cx='36' cy='82' rx='12' ry='6' fill='%23e87a9a' opacity='.85'/%3E%3Cellipse cx='74' cy='82' rx='12' ry='6' fill='%23e87a9a' opacity='.85'/%3E%3Cellipse cx='42' cy='69' rx='7' ry='12' fill='%23d46080' opacity='.75' transform='rotate(45 42 69)'/%3E%3Cellipse cx='68' cy='69' rx='7' ry='12' fill='%23d46080' opacity='.75' transform='rotate(-45 68 69)'/%3E%3Cellipse cx='42' cy='95' rx='7' ry='12' fill='%23d46080' opacity='.75' transform='rotate(-45 42 95)'/%3E%3Cellipse cx='68' cy='95' rx='7' ry='12' fill='%23d46080' opacity='.75' transform='rotate(45 68 95)'/%3E%3Cline x1='55' y1='98' x2='55' y2='128' stroke='%23588050' stroke-width='2.5'/%3E%3Cline x1='55' y1='116' x2='38' y2='130' stroke='%23588050' stroke-width='2'/%3E%3Cline x1='55' y1='116' x2='72' y2='132' stroke='%23588050' stroke-width='2'/%3E%3Cellipse cx='44' cy='110' rx='12' ry='6' fill='%23588050' opacity='.8' transform='rotate(-35 44 110)'/%3E%3Cellipse cx='66' cy='114' rx='12' ry='6' fill='%23588050' opacity='.8' transform='rotate(35 66 114)'/%3E%3Ccircle cx='22' cy='28' r='8' fill='%23e87aac' opacity='.8'/%3E%3Ccircle cx='22' cy='28' r='3.5' fill='%23f5c842' opacity='.9'/%3E%3Cellipse cx='22' cy='17' rx='4' ry='7' fill='%23f09abe' opacity='.8'/%3E%3Cellipse cx='22' cy='39' rx='4' ry='7' fill='%23f09abe' opacity='.8'/%3E%3Cellipse cx='11' cy='28' rx='7' ry='4' fill='%23f09abe' opacity='.8'/%3E%3Cellipse cx='33' cy='28' rx='7' ry='4' fill='%23f09abe' opacity='.8'/%3E%3Ccircle cx='88' cy='22' r='7' fill='%23f07060' opacity='.8'/%3E%3Ccircle cx='88' cy='22' r='3' fill='%23f5c842' opacity='.9'/%3E%3Cellipse cx='88' cy='12' rx='3.5' ry='6' fill='%23f09080' opacity='.8'/%3E%3Cellipse cx='88' cy='32' rx='3.5' ry='6' fill='%23f09080' opacity='.8'/%3E%3Cellipse cx='78' cy='22' rx='6' ry='3.5' fill='%23f09080' opacity='.8'/%3E%3Cellipse cx='98' cy='22' rx='6' ry='3.5' fill='%23f09080' opacity='.8'/%3E%3Cellipse cx='15' cy='58' rx='10' ry='5' fill='%23588050' opacity='.7' transform='rotate(-40 15 58)'/%3E%3Cellipse cx='95' cy='52' rx='10' ry='5' fill='%23588050' opacity='.7' transform='rotate(40 95 52)'/%3E%3Cellipse cx='10' cy='102' rx='9' ry='4.5' fill='%23588050' opacity='.65' transform='rotate(20 10 102)'/%3E%3Cellipse cx='100' cy='98' rx='9' ry='4.5' fill='%23588050' opacity='.65' transform='rotate(-20 100 98)'/%3E%3Cellipse cx='55' cy='13' rx='8' ry='6' fill='%23e87a9a' opacity='.85'/%3E%3Cellipse cx='55' cy='8' rx='6' ry='5' fill='%23c85070' opacity='.9'/%3E%3Cline x1='55' y1='19' x2='55' y2='66' stroke='%23588050' stroke-width='2'/%3E%3Cellipse cx='38' cy='38' rx='11' ry='5' fill='%23588050' opacity='.7' transform='rotate(-25 38 38)'/%3E%3Cellipse cx='72' cy='43' rx='11' ry='5' fill='%23588050' opacity='.7' transform='rotate(25 72 43)'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    filter: blur(1.8px);
    opacity: 0.42;
    z-index: 0;
    pointer-events: none;
}

.postmark::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1.5px solid rgba(150, 60, 20, 0.55);
    pointer-events: none;
    z-index: 2;
}

/* Keep text above the blurred background */
.postmark span {
    position: relative;
    z-index: 1;
}

.postmark-city {
    font-weight: 700;
    font-size: var(--postmark-city-size);
}

/* Right side images container */
.postcard-back-images {
    flex: 1;
    width: 100%;
    position: relative;
    min-height: 0;
}

.postcard-back-images .concert-img {
    position: absolute;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.25);
    border: 3px solid #fff;
    background: #ddd;
    cursor: pointer;
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.postcard-back-images :is(.concert-img, .concert-img-placeholder):nth-child(1) {
    width: 55%;
    height: 52%;
    top: 5%;
    left: 0;
    transform: rotate(-4deg);
    z-index: 2;
}

.postcard-back-images :is(.concert-img, .concert-img-placeholder):nth-child(2) {
    width: 48%;
    height: 46%;
    top: 8%;
    right: 0;
    transform: rotate(5deg);
    z-index: 1;
}

.postcard-back-images :is(.concert-img, .concert-img-placeholder):nth-child(3) {
    width: 52%;
    height: 48%;
    bottom: 2%;
    left: 8%;
    transform: rotate(-2deg);
    z-index: 3;
}

.postcard-back-images :is(.concert-img, .concert-img-placeholder):nth-child(4) {
    width: 46%;
    height: 44%;
    bottom: 0%;
    right: 2%;
    transform: rotate(3deg);
    z-index: 4;
}

.postcard-back-images .concert-img-placeholder {
    position: absolute;
    border-radius: 4px;
    border: 2px dashed #bbb;
    background: rgba(200, 200, 200, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 0.65rem;
    font-family: 'Inter', sans-serif;
}

.postcard-back-images .concert-img:hover {
    filter: brightness(1.1);
    box-shadow: 3px 5px 15px rgba(0,0,0,0.4);
}

.postcard-back-images .concert-img:focus-visible {
    outline: 3px solid #f8b500;
    outline-offset: 2px;
    filter: brightness(1.1);
    box-shadow: 3px 5px 15px rgba(0,0,0,0.4);
}

/* Lightbox overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.48);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-img {
    max-width: 88vw;
    max-height: 88vh;
    border-radius: 6px;
    /* box-shadow: 0 20px 60px rgba(0,0,0,0.6); */
    border: 4px solid #fff;
    object-fit: contain;
    z-index: 10001;
    cursor: zoom-out;
}

.lightbox-content {
    position: relative;
    display: inline-block;
    z-index: 10001;
}

.lightbox-close-btn,
.lightbox-nav-btn {
    position: absolute;
    bottom: 16px;
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.9);
    font-size: 2rem;
    font-weight: 300;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10002;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: background 0.2s ease, transform 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-close-btn {
    right: 16px;
}

.lightbox-close-btn:hover,
.lightbox-nav-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

/* Card close button (on flipped card back) */
.card-close-btn {
    position: absolute;
    bottom: var(--card-close-bottom);
    left: var(--card-close-left);
    width: var(--card-close-size);
    height: var(--card-close-size);
    background: rgba(192, 57, 43, 0.2);
    border: none;
    border-radius: 50%;
    color: #ffffffb5;
    font-size: var(--card-close-font-size);
    font-weight: 400;
    line-height: 1;
    padding: 0;
    padding-bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: background 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.postcard.flipped .card-close-btn {
    opacity: 1;
    pointer-events: auto;
}

.card-close-btn:hover {
    background: rgba(192, 57, 43, 0.7);
    color: #fff;
    transform: scale(1.15);
}

.card-close-btn:focus-visible {
    outline: 3px solid #f8b500;
    outline-offset: 3px;
}

.lightbox-nav-btn.prev {
    right: 188px;
}

.lightbox-nav-btn.next {
    right: 102px;
}

/* Navigation arrows */
.coverflow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) translateZ(0);
    width: var(--coverflow-nav-size);
    height: var(--coverflow-nav-size);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    z-index: 200;
    color: white;
    font-size: var(--coverflow-nav-font-size);
    pointer-events: auto;
}

.coverflow-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) translateZ(0) scale(1.1);
}

.coverflow-nav.prev {
    left: var(--coverflow-nav-prev-left);
}

.coverflow-nav.next {
    right: var(--coverflow-nav-next-right);
}

/* Flip hint */
.flip-hint {
    position: absolute;
    bottom: var(--flip-hint-bottom);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(248, 181, 0, 0.9);
    color: #1a1a2e;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 150;
    pointer-events: none;
}

.flip-hint.visible {
    opacity: 1;
}

/* Custom scrollbar – always visible */
.custom-scroll-wrapper {
    position: relative;
    overflow: hidden;
    height: 100%;
}

.custom-scroll-content {
    height: 100%;
    overflow-y: scroll;
    padding-right: 14px; /* room for the custom track */
    scrollbar-width: none; /* Firefox */
}

.custom-scroll-content::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.custom-scroll-track {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: rgba(180, 170, 150, 0.25);
    border-radius: 3px;
}

.custom-scroll-thumb {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    min-height: 18px;
    background: rgba(100, 90, 70, 0.5);
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.custom-scroll-thumb:hover,
.custom-scroll-thumb.dragging {
    background: rgba(80, 70, 50, 0.75);
}

.custom-scroll-track.hidden,
.custom-scroll-thumb.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 1200px) {
    :root {
        --card-width: 380px;
        --card-height: 550px;
        --card-front-border-width: 16px;
        --back-content-width: 550px;
        --back-content-height: 380px;
        --focused-label-size: 1.2rem;
        --postmark-width: 90px;
        --postmark-height: 114px;
        --postmark-font-size: 0.65rem;
        --postmark-city-size: 0.75rem;
        --postmark-cancel-width: 86px;
        --postmark-cancel-height: 86px;
        --postmark-cancel-top: -15px;
        --postmark-cancel-left: -18px;
    }

    .postcard-title-front {
        font-size: 1.8rem;
    }

    .postcard-back-title {
        font-size: 1.4rem;
    }

    .postcard-back-text {
        font-size: 0.65rem;
    }

    .postcard-back-repertoire {
        font-size: 0.62rem;
    }

    .postcard-back-director,
    .postcard-back-coorporation {
        font-size: 0.6rem;
    }

}

@media (max-width: 768px) {
    .top-header {
        padding: 0 1rem;
    }

    .top-header .logo {
        max-width: 250px;
    }

    :root {
        --card-width: 280px;
        --card-height: 381px;
        --card-front-border-width: 10px;
        --back-content-width: 400px;
        --back-content-height: 280px;
        --back-content-padding: 1rem;
        --focused-label-size: 1.2rem;
        --postmark-width: 74px;
        --postmark-height: 94px;
        --postmark-font-size: 0.5rem;
        --postmark-city-size: 0.6rem;
        --postmark-cancel-width: 70px;
        --postmark-cancel-height: 70px;
        --postmark-cancel-top: -12px;
        --postmark-cancel-left: -15px;
        --flip-icon-size: 50px;
        --flip-icon-offset: 15px;
        --flip-icon-svg-size: 35px;
        --card-close-size: 24px;
        --card-close-font-size: 0.9rem;
        --card-close-bottom: -12px;
        --card-close-left: -12px;
        --coverflow-nav-size: 45px;
        --coverflow-nav-font-size: 1.2rem;
        --coverflow-nav-prev-left: 10px;
        --coverflow-nav-next-right: 10px;
    }

    header {
        -webkit-mask-image: linear-gradient(to bottom, black 100%, transparent 100%);
        mask-image: linear-gradient(to bottom, black 100%, transparent 100%);
    }
    .swipe-hint {
        font-size: 1.3rem;
        margin-top: 1.5rem;
        margin-bottom: -0.5rem;
        line-height: 1.3rem;
    }

    .mobile-br {
        display: block;
    }
    
    .postcard-front-overlay {
        padding: 1rem;
    }

    .postcard-year {
        font-size: 0.9rem;
    }

    .postcard-title-front {
        font-size: 1.4rem;
    }

    .postcard-back-left {
        font-size: 0.63rem;
        line-height: 1.55;
        padding-right: 0.5rem;
    }

    .postcard-back-title {
        font-size: 1.1rem;
    }

    .postcard-back-date {
        font-size: 0.65rem;
    }

    .postcard-back-text {
        font-size: 0.6rem;
    }

    .postcard-back-repertoire {
        font-size: 0.56rem;
    }

    .postcard-back-director,
    .postcard-back-coorporation {
        font-size: 0.56rem;
    }

    header h1 {
        font-size: 2rem;
    }
}



/* Short viewport: scale header and postcards proportionally */
@media (max-height: 900px) {
    :root {
        --card-width: min(380px, 50vh);
        --card-height: min(520px, 68vh);
        --card-front-border-width: 14px;
        --back-content-width: min(520px, 68vh);
        --back-content-height: min(380px, 50vh);
        --back-content-padding: 1.25rem;
        --postmark-width: 82px;
        --postmark-height: 104px;
        --postmark-font-size: 0.6rem;
        --postmark-city-size: 0.7rem;
        --postmark-cancel-width: 78px;
        --postmark-cancel-height: 78px;
        --postmark-cancel-top: -13px;
        --postmark-cancel-left: -16px;
        --focused-label-size: 1.5rem;
        --coverflow-nav-size: 45px;
        --coverflow-nav-font-size: 1.2rem;
        --flip-icon-size: 50px;
        --flip-icon-offset: 12px;
        --flip-icon-svg-size: 32px;
    }

    header {
        padding: 1rem 0.5rem;
    }

    header p {
        font-size: 1.8rem;
        margin-top: 2rem;
    }

    .coverflow-container {
        height: calc(100vh - 200px - var(--top-header-height));
        min-height: 400px;
    }

    .swipe-hint {
        margin-top: 1.4rem;
        margin-bottom: 1rem;
    }

    .focused-label.at-bottom {
        bottom: -7px;
    }

    .postcard-title-front {
        font-size: 1.6rem;
    }

    .postcard-year {
        font-size: 0.9rem;
    }

    .postcard-back-left {
        font-size: 0.68rem;
        line-height: 1.55;
        padding-right: 1rem;
    }

    .postcard-back-title {
        font-size: 1.2rem;
    }

    .postcard-back-date {
        font-size: 0.7rem;
    }

    .postcard-back-text,
    .postcard-back-repertoire {
        font-size: 0.63rem;
    }

}

/* Medium-short viewport */
@media (max-height: 900px) {
    :root {
        --card-width: min(280px, 42vh);
        --card-height: min(380px, 58vh);
        --card-front-border-width: 10px;
        --back-content-width: min(400px, 60vh);
        --back-content-height: min(280px, 42vh);
        --back-content-padding: 1rem;
        --postmark-width: 66px;
        --postmark-height: 84px;
        --postmark-font-size: 0.5rem;
        --postmark-city-size: 0.6rem;
        --postmark-cancel-width: 63px;
        --postmark-cancel-height: 63px;
        --postmark-cancel-top: -11px;
        --postmark-cancel-left: -13px;
        --focused-label-size: 1.3rem;
        --flip-icon-size: 45px;
        --flip-icon-svg-size: 30px;
    }

    header {
        padding: 0.5rem 0.5rem;
    }

    header p {
        font-size: 1.4rem;
        margin-top: -8px;
    }

    .coverflow-container {
        height: calc(100vh - 200px - var(--top-header-height));
        min-height: 320px;
    }

    .postcard-title-front {
        font-size: 1.3rem;
    }

    .postcard-year {
        font-size: 0.8rem;
    }

    .postcard-back-left {
        font-size: 0.58rem;
        line-height: 1.55;
        padding-right: 0.6rem;
    }

    .postcard-back-title {
        font-size: 1rem;
    }

    .postcard-back-date {
        font-size: 0.6rem;
    }

    .postcard-back-text,
    .postcard-back-repertoire {
        font-size: 0.54rem;
    }

    .postcard-back-bottom-row dd {
        font-size: 0.55rem;
    }

    .flip-hint {
        font-size: 0.7rem;
        padding: 0.3em 1.2em;
    }
}

/* Very short viewport */
@media (max-height: 550px) {
    :root {
        --card-width: min(180px, 32vh);
        --card-height: min(245px, 44vh);
        --card-front-border-width: 6px;
        --back-content-width: min(260px, 47vh);
        --back-content-height: min(180px, 32vh);
        --back-content-padding: 0.4rem;
        --postmark-width: 46px;
        --postmark-height: 58px;
        --postmark-font-size: 0.3rem;
        --postmark-city-size: 0.4rem;
        --postmark-cancel-width: 44px;
        --postmark-cancel-height: 44px;
        --postmark-cancel-top: -8px;
        --postmark-cancel-left: -9px;
        --focused-label-size: 1.6rem;
        --coverflow-header-cost: 60px; /* container uses calc(100vh - 60px - top-header-height) here */
        --flip-icon-size: 30px;
        --flip-icon-offset: 6px;
        --flip-icon-svg-size: 20px;
        --card-close-size: 18px;
        --card-close-font-size: 0.7rem;
        --card-close-bottom: -9px;
        --card-close-left: -9px;
    }

    header p {
        display: none;
    }

    header {
        padding: 0.3rem 0.5rem;
    }

    .coverflow-container {
        height: calc(100vh - 60px - var(--top-header-height));
        min-height: 250px;
    }

    .postcard-back-left {
        font-size: 0.45rem;
        padding-right: 0.3rem;
        gap: 0.15rem;
    }

    .postcard-back-title {
        font-size: 0.7rem;
    }

    .postcard-back-date {
        font-size: 0.4rem;
    }

    .postcard-back-text,
    .postcard-back-repertoire {
        font-size: 0.4rem;
        line-height: 1.2;
    }

    .postcard-back-left h3 {
        margin-left: 5px;
    }

    .custom-scroll-content {
        padding-left: 5px;
    }

    .postcard-back-repertoire-label,
    .postcard-back-text-label {
        font-size: 0.55rem;
    }

    .postcard-back-bottom-row {
        padding-top: 0.2rem;
        gap: 0.4rem;
    }

    .postcard-back-director,
    .postcard-back-coorporation {
        font-size: 0.4rem;
        max-height: 30px;
    }

    .postcard-back-director .bottom-label,
    .postcard-back-coorporation .bottom-label {
        font-size: 0.55rem;
    }

    .postcard-back-bottom-row {
        padding-left: 5px;
    }
    .postcard-back-bottom-row dt {
        font-size: 0.45rem;
    }
    .postcard-back-bottom-row dd {
        font-size: 0.35rem;
    }

    .postcard-back-right {
        gap: 0.2rem;
    }

    .postcard-back-images {
        gap: 0.15rem;
    }

    .postcard-back-images img {
        max-width: 50px;
        max-height: 35px;
    }

    .focused-label {
        font-size: 1rem;
    }

    .postmark {
        top: 3px;
        right: 3px;
    }
}



/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Visible focus indicators */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #f8b500;
    outline-offset: 2px;
}

.coverflow-container:focus-visible {
    outline: 3px solid #f8b500;
    outline-offset: -3px;
    border-radius: 4px;
}

.coverflow-nav:focus-visible {
    outline: 3px solid #f8b500;
    outline-offset: 3px;
}

.lightbox-nav-btn:focus-visible,
.lightbox-close-btn:focus-visible {
    outline: 3px solid #f8b500;
    outline-offset: 3px;
}

/* ── Reduced motion: disable animations for vestibular safety ── */
@media (prefers-reduced-motion: reduce) {
    /* Disable all card transitions (slide, fade, 3D) */
    .postcard,
    .postcard.focused,
    .postcard-inner,
    .postcard.fade-in-ready,
    .coverflow-wrapper.rapid-nav .postcard {
        transition: none !important;
    }

    /* Disable hover transforms on side cards */
    .postcard:not(.focused):hover {
        transform: none !important;
        filter: brightness(1.15) !important;
    }

    /* Kill pulsing flip icon animations */
    .flip-icon svg {
        animation: none !important;
    }

    .flip-icon::after {
        animation: none !important;
    }

    /* Disable fade-in on load */
    .postcard.fade-in-init {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Simplify nav button hover */
    .coverflow-nav:hover {
        transform: translateY(-50%) translateZ(0) !important;
    }

    /* Simplify lightbox button hover */
    .lightbox-close-btn:hover,
    .lightbox-nav-btn:hover {
        transform: none !important;
    }

    /* Disable concert image hover transform */
    .postcard-back-images .concert-img:hover {
        filter: brightness(1.1);
    }
}
/* Skip-to-content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: #f8b500;
    color: #1a1a2e;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    font-size: 1rem;
    z-index: 10000;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}
