/* White paper — certificate presentation */

.page-whitepaper {
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 122, 255, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 100%, rgba(255, 184, 77, 0.08) 0%, transparent 50%),
        var(--bg-deep);
}

.page-whitepaper main {
    max-width: none;
    margin: 0;
    padding: calc(var(--header-height) + 1.5rem) 1.25rem 4rem;
}

.cert-stage {
    max-width: 860px;
    margin: 0 auto;
}

/* --- Certificate frame --- */
.certificate {
    position: relative;
}

.cert-frame {
    position: relative;
    background:
        linear-gradient(165deg, #fdfbf7 0%, #f8f4ec 35%, #f5f0e6 100%);
    border: 3px solid #c9a227;
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(201, 162, 39, 0.35),
        0 0 0 8px rgba(201, 162, 39, 0.12),
        0 0 0 9px rgba(201, 162, 39, 0.55),
        0 24px 64px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 2.5rem 2.25rem 2rem;
    color: #1c1c22;
}

.cert-frame::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(201, 162, 39, 0.45);
    pointer-events: none;
}

/* Corner ornaments */
.cert-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: #a8841a;
    border-style: solid;
    pointer-events: none;
    z-index: 1;
}

.cert-corner--tl { top: 18px; left: 18px; border-width: 2px 0 0 2px; }
.cert-corner--tr { top: 18px; right: 18px; border-width: 2px 2px 0 0; }
.cert-corner--bl { bottom: 18px; left: 18px; border-width: 0 0 2px 2px; }
.cert-corner--br { bottom: 18px; right: 18px; border-width: 0 2px 2px 0; }

/* --- Header --- */
.cert-header {
    text-align: center;
    padding: 0 0.5rem 0.25rem;
}

.cert-seal {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff 0%, #f0ebe0 100%);
    border: 3px solid #c9a227;
    box-shadow:
        0 0 0 4px rgba(201, 162, 39, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-seal img {
    border-radius: 18%;
    width: 56px;
    height: 56px;
}

.cert-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #8a7340;
    margin-bottom: 0.65rem;
}

.cert-title {
    font-family: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
    font-size: clamp(1.65rem, 4.5vw, 2.35rem);
    font-weight: 700;
    line-height: 1.2;
    color: #141418;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
}

.cert-lead {
    font-size: 1.02rem;
    line-height: 1.65;
    color: #4a4a55;
    max-width: 580px;
    margin: 0 auto 1.1rem;
}

.cert-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    font-size: 0.82rem;
    color: #5c5c68;
}

.cert-meta-item strong {
    color: #8a7340;
    font-weight: 700;
    margin-right: 0.25rem;
}

.cert-meta-divider {
    color: #c9a227;
    font-size: 0.55rem;
    opacity: 0.8;
}

/* --- Ornate divider --- */
.cert-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 0 0.5rem;
}

.cert-divider span:not(.cert-divider-gem) {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.55), transparent);
}

.cert-divider-gem {
    color: #c9a227;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* --- Body sections --- */
.cert-body {
    padding: 0 0.25rem;
}

.cert-section {
    display: grid;
    grid-template-columns: 2.75rem 1fr;
    gap: 0.75rem 1rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}

.cert-section--last {
    border-bottom: none;
    padding-bottom: 0.25rem;
}

.cert-section-num {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #c9a227;
    line-height: 1;
    padding-top: 0.15rem;
    text-align: center;
    opacity: 0.85;
}

.cert-section-content h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #141418;
    margin-bottom: 0.45rem;
    letter-spacing: 0.01em;
}

.cert-section-content p {
    font-size: 0.93rem;
    line-height: 1.65;
    color: #3d3d48;
}

.cert-section-content p + p {
    margin-top: 0.55rem;
}

.cert-section-content ul {
    margin: 0.45rem 0 0 1.1rem;
    font-size: 0.93rem;
    line-height: 1.6;
    color: #3d3d48;
}

.cert-section-content li + li {
    margin-top: 0.3rem;
}

.cert-section-content strong {
    color: #1c1c22;
}

/* KPI grid inside certificate */
.cert-kpis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.cert-kpi {
    background: rgba(201, 162, 39, 0.08);
    border: 1px solid rgba(201, 162, 39, 0.28);
    border-radius: 6px;
    padding: 0.65rem 0.75rem;
}

.cert-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a7340;
}

.cert-kpi-value {
    margin-top: 0.2rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #2a2a32;
    line-height: 1.35;
}

/* --- Footer --- */
.cert-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 1rem;
    padding-top: 0.5rem;
}

.cert-footer-col {
    min-width: 0;
}

.cert-footer-col--right {
    text-align: right;
}

.cert-footer-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8a7340;
    margin-bottom: 0.35rem;
}

.cert-signature {
    font-family: 'Snell Roundhand', 'Brush Script MT', 'Segoe Script', cursive;
    font-size: 1.65rem;
    color: #1a2744;
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.cert-ref {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a2744;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

.cert-footer-sub {
    font-size: 0.78rem;
    color: #6e6e7a;
    margin-top: 0.2rem;
}

/* Verified stamp */
.cert-stamp {
    flex-shrink: 0;
}

.cert-stamp-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(0, 122, 255, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotate(-12deg);
    background: rgba(0, 122, 255, 0.06);
    box-shadow: inset 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.cert-stamp-text {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #007AFF;
}

.cert-stamp-year {
    font-size: 0.95rem;
    font-weight: 800;
    color: #007AFF;
    line-height: 1;
}

/* --- Actions below certificate --- */
.cert-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.page-whitepaper .btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.page-whitepaper .btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-bright);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.page-whitepaper .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .cert-frame {
        padding: 1.75rem 1.25rem 1.5rem;
    }

    .cert-section {
        grid-template-columns: 2rem 1fr;
        gap: 0.5rem 0.65rem;
    }

    .cert-section-num {
        font-size: 1.1rem;
    }

    .cert-kpis {
        grid-template-columns: 1fr;
    }

    .cert-footer {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }

    .cert-footer-col--right {
        text-align: center;
    }

    .cert-meta-divider {
        display: none;
    }

    .cert-meta {
        flex-direction: column;
        gap: 0.35rem;
    }
}

/* --- Print --- */
@media print {
    body.page-whitepaper > header,
    body.page-whitepaper > footer,
    .cert-actions,
    .skip-link {
        display: none !important;
    }

    .page-whitepaper main {
        padding: 0;
    }

    .page-whitepaper {
        background: white;
    }

    .cert-frame {
        box-shadow: none;
        border-width: 2px;
        page-break-inside: avoid;
    }

    .cert-section {
        break-inside: avoid;
    }
}
