/* mybadge.id - Credential Verification Design System */
/* Colors: #0B3D5C (navy), #D4D5D7 (platinum), #F8F9FA (bg), #F2F4F7 (bg-secondary),
   #1A1D2E (text-primary), #5A5F72 (text-secondary), #2E7D8F (accent), #E8EAEC (highlight),
   #C9CBD0 (border), #EDF0F5 (hover-bg) */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', serif;
    background-color: #F8F9FA;
    color: #1A1D2E;
    line-height: 1.7;
    background-image: radial-gradient(ellipse at center, #F8F9FA 0%, #F2F4F7 100%);
    min-height: 100vh;
}

/* Grid Background (Desktop only) */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(to right, #E8EAEC 1px, transparent 1px),
        linear-gradient(to bottom, #E8EAEC 1px, transparent 1px);
    background-size: 4rem 4rem;
    opacity: 0.4;
}

@media (max-width: 767px) {
    .grid-background {
        display: none;
    }
}

/* ================================
   HERO SECTION (Document Header)
   ================================ */

.document-header {
    position: relative;
    padding: 10vh 4vw 6vh;
    text-align: center;
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.masthead {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: #0B3D5C;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.header-rule {
    width: 100%;
    max-width: 400px;
    height: 2px;
    background-color: #0B3D5C;
    margin: 0 auto 1.2rem;
}

.subtitle {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    color: #5A5F72;
    letter-spacing: 0.02em;
}

/* ================================
   CREDENTIAL SECTION
   ================================ */

.credential-section {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 4vh 4vw 8vh;
}

/* ================================
   CREDENTIAL CARDS
   ================================ */

.credential-card {
    background-color: #F2F4F7;
    border: 1px solid #C9CBD0;
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-20px);
    transition: background-color 50ms ease, box-shadow 50ms ease;
    will-change: opacity, transform;
    position: relative;
}

.credential-card.revealed {
    opacity: 1;
    transform: translateX(0);
}

.credential-card:hover {
    background-color: #EDF0F5;
    box-shadow: 0 4px 12px rgba(11, 61, 92, 0.08);
}

.credential-card:hover .badge-shimmer {
    animation-duration: 6.67s;
}

.credential-card:hover .verification-marker .checkmark {
    transform: scale(1.15) rotate(5deg);
}

/* Card Header Bar */
.card-header-bar {
    background-color: #0B3D5C;
    padding: 0.65rem 1.2rem;
}

.card-category {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Card Body */
.card-body {
    display: grid;
    grid-template-columns: 140px 1fr;
    grid-template-rows: 1fr auto;
    gap: 1.5rem;
    padding: 1.8rem;
    position: relative;
}

/* Badge Visual */
.badge-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    grid-row: 1 / 3;
}

.badge-svg {
    width: 100px;
    height: auto;
    display: block;
}

.badge-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(212, 213, 215, 0.3) 50%, transparent 100%);
    background-size: 300% 300%;
    animation: shimmer 8s ease-in-out infinite;
    pointer-events: none;
    border-radius: 2px;
}

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

/* Credential Text */
.credential-text {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.credential-title {
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: #0B3D5C;
    line-height: 1.4;
}

.credential-issuer,
.credential-date {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.82rem, 0.95vw, 0.9rem);
    color: #5A5F72;
    line-height: 1.5;
}

.credential-description {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.88rem, 1vw, 0.95rem);
    color: #1A1D2E;
    line-height: 1.7;
    margin-top: 0.3rem;
}

.credential-id {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    color: #5A5F72;
    letter-spacing: 0.06em;
    margin-top: 0.4rem;
    word-break: break-all;
}

/* Verification Marker */
.verification-marker {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-self: end;
    align-self: end;
    padding: 0.3rem 0.6rem;
    border: 1px solid #0B3D5C;
    border-radius: 2px;
    background-color: rgba(248, 249, 250, 0.7);
}

.verification-marker .checkmark {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.checkmark path {
    stroke-dasharray: 20px;
    stroke-dashoffset: 20px;
    animation: drawCheck 0.6s ease-in-out forwards;
}

@keyframes drawCheck {
    0% { stroke-dashoffset: 20px; }
    100% { stroke-dashoffset: 0px; }
}

.verified-text {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    color: #2E7D8F;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ================================
   PERFORATED DIVIDER
   ================================ */

.perforated-divider {
    border: none;
    border-top: 2px dashed #C9CBD0;
    margin: 3vh 0;
}

/* ================================
   TIMELINE SECTION
   ================================ */

.timeline-section {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 4vh auto 8vh;
    padding: 0 4vw;
    text-align: center;
}

.section-title {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 1.6vw, 1.4rem);
    color: #0B3D5C;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3rem;
}

.timeline {
    position: relative;
    padding: 0 1rem;
}

.timeline-track {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding-top: 0.5rem;
}

.timeline-line {
    position: absolute;
    top: calc(0.5rem + 4px);
    left: 4px;
    right: 4px;
    height: 1px;
    background-color: #0B3D5C;
    z-index: 0;
}

.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    cursor: default;
}

.node-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #D4D5D7;
    border: 1px solid #0B3D5C;
    margin-bottom: 0.6rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.timeline-node:hover .node-circle {
    background-color: #2E7D8F;
    transform: scale(1.4);
}

.node-label {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: #5A5F72;
    white-space: nowrap;
}

/* ================================
   FOOTER (Validation Statement)
   ================================ */

.validation-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid #C9CBD0;
    padding: 6vh 4vw 4vh;
    text-align: center;
}

.footer-content {
    max-width: 620px;
    margin: 0 auto;
}

.validation-statement {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.82rem, 0.95vw, 0.9rem);
    color: #5A5F72;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.integrity-hash {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-checkmark {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.footer-checkmark path {
    stroke-dasharray: 20px;
    stroke-dashoffset: 20px;
    animation: drawCheck 0.6s ease-in-out 1s forwards;
}

.hash-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.6rem, 0.72vw, 0.68rem);
    color: #5A5F72;
    letter-spacing: 0.04em;
    word-break: break-all;
}

.validation-pattern {
    margin: 1.5rem auto;
    max-width: 200px;
    opacity: 0.6;
}

.qr-pattern {
    width: 100%;
    height: auto;
}

.footer-domain {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    color: #0B3D5C;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 1rem;
}

/* ================================
   CARD REVEAL ANIMATION
   ================================ */

.credential-card.reveal-animate {
    animation: cardReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ================================
   BADGE APPEAR ANIMATION
   ================================ */

.badge-visual .badge-svg {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.credential-card.revealed .badge-visual .badge-svg {
    opacity: 1;
}

/* ================================
   RESPONSIVE
   ================================ */

/* Tablet */
@media (max-width: 1199px) and (min-width: 768px) {
    .card-body {
        grid-template-columns: 120px 1fr;
        gap: 1.2rem;
        padding: 1.4rem;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .document-header {
        padding: 6vh 6vw 4vh;
    }

    .credential-section {
        padding: 2vh 4vw 6vh;
    }

    .card-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 1rem;
        padding: 1.2rem;
    }

    .badge-visual {
        grid-row: auto;
        justify-self: center;
    }

    .badge-svg {
        width: 80px;
    }

    .verification-marker {
        justify-self: center;
    }

    .timeline-track {
        flex-wrap: wrap;
        gap: 1.2rem;
        justify-content: center;
    }

    .timeline-line {
        display: none;
    }

    .timeline-node {
        flex-direction: row;
        gap: 0.4rem;
    }

    .node-circle {
        margin-bottom: 0;
    }
}
