/* ============================================
   Delemed AG — Under Construction
   Brand: Magenta #D60062 / Dark #1A1A2E
   ============================================ */

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

:root {
    --magenta: #D60062;
    --magenta-light: #FF1A7A;
    --dark: #1A1A2E;
    --darker: #0F0F1E;
    --card: rgba(255, 255, 255, 0.04);
    --text: #E0E0E8;
    --text-muted: #8888AA;
    --glow: rgba(214, 0, 98, 0.35);
}

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--darker);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Background EKG canvas --- */
#pulse-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Main container --- */
.container {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2.5rem 2rem;
    max-width: 700px;
    width: 100%;
}

/* --- Logo --- */
.logo {
    height: 64px;
    width: auto;
    margin-bottom: 2.5rem;
    filter: drop-shadow(0 0 20px var(--glow));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 35px var(--glow));
}

/* --- Heading with glitch effect --- */
.glitch {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    position: relative;
    margin-bottom: 0.5rem;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    right: 0;
    overflow: hidden;
    clip-path: inset(0);
}

.glitch::before {
    color: var(--magenta);
    animation: glitch-1 3s infinite linear;
}

.glitch::after {
    color: #00B48C;
    animation: glitch-2 3s infinite linear;
}

@keyframes glitch-1 {
    0%, 93%, 100% { clip-path: inset(0 0 100% 0); }
    94% { clip-path: inset(20% 0 40% 0); transform: translateX(-3px); }
    96% { clip-path: inset(60% 0 10% 0); transform: translateX(3px); }
    98% { clip-path: inset(0 0 100% 0); }
}

@keyframes glitch-2 {
    0%, 95%, 100% { clip-path: inset(0 0 100% 0); }
    96% { clip-path: inset(40% 0 20% 0); transform: translateX(4px); }
    98% { clip-path: inset(10% 0 60% 0); transform: translateX(-2px); }
}

/* --- Tagline --- */
.tagline {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-style: italic;
}

/* --- Countdown --- */
.countdown {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.time-block {
    background: var(--card);
    border: 1px solid rgba(214, 0, 98, 0.15);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    min-width: 80px;
    backdrop-filter: blur(8px);
    transition: border-color 0.3s;
}

.time-block:hover {
    border-color: var(--magenta);
}

.digits {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
    line-height: 1.1;
}

.label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* --- Progress bar --- */
.progress-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50px;
    height: 22px;
    margin: 0 auto 2rem;
    max-width: 420px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--magenta), var(--magenta-light), #FF6B9D);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
    transition: width 1s ease;
    box-shadow: 0 0 15px var(--glow);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --- Ping button --- */
.ping-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--magenta);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px var(--glow);
}

.ping-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--glow);
    background: var(--magenta-light);
}

.ping-btn:active,
.ping-btn.pressed {
    transform: scale(0.96);
}

.ping-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50px;
    border: 2px solid var(--magenta-light);
    animation: pulse-ring 2s ease-out infinite;
    pointer-events: none;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* --- Server response --- */
.response {
    margin-top: 1rem;
    min-height: 1.5em;
    font-size: 0.95rem;
    color: var(--magenta-light);
    transition: opacity 0.3s;
}

.response.flash {
    animation: flash 0.6s ease;
}

@keyframes flash {
    0% { opacity: 0; transform: translateY(5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- Vitals strip --- */
.vitals {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.vitals strong {
    color: var(--magenta-light);
}

#heart {
    display: inline-block;
    color: var(--magenta);
    font-size: 1rem;
    transition: transform 0.15s ease;
}

#heart.beat {
    transform: scale(1.4);
    color: var(--magenta-light);
}

/* --- Footer --- */
footer {
    margin-top: 3rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* --- Responsive --- */
@media (max-width: 520px) {
    .glitch {
        font-size: 1.8rem;
    }
    .countdown {
        gap: 0.6rem;
    }
    .time-block {
        min-width: 60px;
        padding: 0.7rem 0.6rem;
    }
    .digits {
        font-size: 1.6rem;
    }
    .vitals {
        font-size: 0.7rem;
        gap: 0.4rem;
    }
    .vitals span:nth-child(2),
    .vitals span:nth-child(4) {
        display: none;
    }
}
