@font-face {
    font-family: 'Oswald';
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/Oswald-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Oswald';
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/Oswald-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'Oswald';
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/Oswald-Bold.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Sans 3';
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/SourceSans3-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Sans 3';
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/SourceSans3-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Sans 3';
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/SourceSans3-Bold.woff2') format('woff2');
}

:root {
    --red: #C00D0E;
    --red-light: #e8494a;
    --red-wash: rgba(192, 13, 14, 0.08);
    --red-blob: rgba(192, 13, 14, 0.22);
    --white: #ffffff;
    --gray-50: #f8f8f8;
    --gray-100: #ededed;
    --gray-400: #999;
    --gray-600: #555;
    --gray-800: #222;
    --card-radius: 20px;
    --card-max-w: 380px;
}

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

body {
    font-family: 'Source Sans 3', sans-serif;
    background: var(--white);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* ── Organic blobs in background ── */
.blob {
    position: fixed;
    background: var(--red-blob);
    filter: blur(8px);
    pointer-events: none;
    z-index: 0;
}

.blob--1 {
    width: 240px;
    height: 220px;
    top: -40px;
    right: -30px;
    border-radius: 30% 70% 53% 47% / 26% 46% 54% 74%;
    animation: morph1 14s ease-in-out infinite alternate;
}

.blob--2 {
    width: 200px;
    height: 180px;
    bottom: -30px;
    left: -25px;
    border-radius: 62% 38% 44% 56% / 48% 32% 68% 52%;
    animation: morph2 16s ease-in-out infinite alternate;
}

@keyframes morph1 {
    0% {
        border-radius: 30% 70% 53% 47% / 26% 46% 54% 74%;
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        border-radius: 58% 42% 28% 72% / 68% 34% 66% 32%;
        transform: translate(-10px, 15px) rotate(6deg);
    }

    50% {
        border-radius: 42% 58% 72% 28% / 36% 72% 28% 64%;
        transform: translate(-20px, 30px) rotate(-4deg);
    }

    75% {
        border-radius: 68% 32% 44% 56% / 50% 28% 72% 50%;
        transform: translate(-8px, 20px) rotate(8deg);
    }

    100% {
        border-radius: 35% 65% 60% 40% / 72% 40% 60% 28%;
        transform: translate(-15px, 10px) rotate(-2deg);
    }
}

@keyframes morph2 {
    0% {
        border-radius: 62% 38% 44% 56% / 48% 32% 68% 52%;
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        border-radius: 36% 64% 58% 42% / 70% 42% 58% 30%;
        transform: translate(12px, -10px) rotate(-5deg);
    }

    50% {
        border-radius: 50% 50% 30% 70% / 38% 62% 38% 62%;
        transform: translate(8px, -22px) rotate(7deg);
    }

    75% {
        border-radius: 72% 28% 52% 48% / 44% 56% 44% 56%;
        transform: translate(18px, -8px) rotate(-3deg);
    }

    100% {
        border-radius: 40% 60% 66% 34% / 56% 44% 56% 44%;
        transform: translate(5px, -15px) rotate(4deg);
    }
}

/* ── Flip container ── */
.flip-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--card-max-w);
    perspective: 1200px;
    animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.flip-inner {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-inner.flipped {
    transform: rotateY(180deg);
}

/* ── Card (shared front & back) ── */
.card {
    width: 100%;
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.06),
        0 8px 24px rgba(192, 13, 14, 0.10),
        0 24px 48px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card--front {
    position: relative;
}

.card--back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
}

.card--back .card__body {
    flex: 1;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Card Header ── */
.card__header {
    background: var(--red);
    color: var(--white);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card__badge {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.38;
    letter-spacing: -0.08px;
    text-transform: uppercase;
    opacity: 0.85;
}

.card__nummer {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 34px;
    line-height: 1.21;
    letter-spacing: 0.37px;
}

/* ── Image area ── */
.card__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card__image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--gray-400);
    font-size: 14px;
}

.card__image-placeholder svg {
    opacity: 0.3;
}

/* ── Card Body ── */
.card__body {
    padding: 24px;
}

.card__title {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: var(--gray-800);
    line-height: 1.21;
    letter-spacing: 0.36px;
    margin-bottom: 8px;
}

.card__subtitle {
    font-size: 15px;
    font-weight: 600;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: -0.24px;
    line-height: 1.33;
    margin-bottom: 16px;
}

/* ── Data rows ── */
.card__data {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.card__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.card__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.card__label {
    font-size: 13px;
    line-height: 1.38;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: -0.08px;
    font-weight: 600;
}

.card__value {
    font-family: 'Oswald', sans-serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.29;
    letter-spacing: -0.41px;
    color: var(--gray-800);
    text-align: right;
}

/* ── Footer ── */
.card__footer {
    padding: 16px 24px;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    border-top: 1px solid var(--gray-100);
}

.card__org {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: 0.07px;
    color: var(--gray-400);
    text-transform: uppercase;
}

/* ── Swipe hint ── */
.swipe-hint {
    margin-top: 20px;
    font-size: 13px;
    color: var(--gray-400);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeHint 3s ease-in-out infinite;
}

.swipe-hint svg {
    opacity: 0.5;
}

@keyframes fadeHint {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ── Back side ── */
.card__beschreibung {
    font-size: 15px;
    line-height: 1.5;
    color: var(--gray-600);
    margin-bottom: 24px;
}

.card__divider {
    border: none;
    border-top: 1px solid var(--gray-100);
    margin: 0 0 16px 0;
}

.card__section-label {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.38;
    letter-spacing: -0.08px;
    color: var(--gray-400);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card__chip {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.38;
    color: var(--red);
    background: var(--red-wash);
    border-radius: 8px;
    padding: 6px 12px;
}

/* ── Transition for card swap ── */
.card--exit {
    animation: cardOut 0.3s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes cardOut {
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.97);
    }
}

.card--enter {
    animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Skeleton / Placeholder ── */
.skeleton__header {
    background: var(--red);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.skeleton__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--gray-100);
}

.skeleton__body {
    padding: 24px;
}

.skeleton__footer {
    padding: 16px 24px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

.placeholder {
    display: inline-block;
    background: var(--gray-100);
    border-radius: 4px;
    height: 1em;
    vertical-align: middle;
}

.placeholder--light {
    background: rgba(255, 255, 255, 0.25);
}

.placeholder--dark {
    background: var(--gray-100);
}

.placeholder-glow .placeholder {
    animation: placeholder-glow 1.8s ease-in-out infinite;
}

@keyframes placeholder-glow {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

/* ── Responsive: larger screens ── */
@media (min-width: 600px) {
    .flip-container {
        max-width: 420px;
    }

    .card__title {
        font-size: 30px;
    }

    .card__nummer {
        font-size: 32px;
    }
}
