:root {
    --ink: #111411;
    --paper: #f5f1e8;
    --paper-soft: #ebe5d8;
    --line: rgba(17, 20, 17, .14);
    --gold: #bca46a;
    --green: #2f6f62;
    --green-deep: #173d38;
    --white: #fffaf0;
    --shadow: 0 28px 80px rgba(17, 20, 17, .18);
}

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

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(17, 20, 17, .04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(17, 20, 17, .035) 1px, transparent 1px),
        var(--paper);
    background-size: 44px 44px;
    color: var(--ink);
    font-family: Poppins, sans-serif;
    font-size: 1.6rem;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(47, 111, 98, .08), transparent 38%, rgba(188, 164, 106, .12));
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.8rem clamp(2rem, 4vw, 6rem);
    border-bottom: 1px solid rgba(17, 20, 17, .12);
    background: rgba(245, 241, 232, .82);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: .2rem;
    font-family: "Playfair Display", serif;
    font-size: clamp(2.8rem, 4vw, 4.2rem);
    font-weight: 700;
    letter-spacing: 0;
}

.brand strong {
    color: var(--green);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2vw, 3rem);
    font-size: 1.4rem;
    font-weight: 600;
}

.site-nav a {
    position: relative;
    padding: .8rem 0;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: .2rem;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .28s ease;
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left;
}

main {
    position: relative;
    z-index: 1;
    width: min(146rem, calc(100% - 4rem));
    margin: 0 auto;
}

.certificate-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(28rem, 38rem);
    gap: clamp(3rem, 6vw, 8rem);
    align-items: end;
    padding: clamp(7rem, 12vw, 13rem) 0 clamp(4rem, 8vw, 8rem);
}

.eyebrow,
.preview-kicker,
.certificate-provider {
    margin: 0;
    color: var(--green);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.hero-copy h1 {
    max-width: 86rem;
    margin: 1.2rem 0 2rem;
    font-family: "Playfair Display", serif;
    font-size: clamp(5.2rem, 10vw, 12rem);
    line-height: .88;
    letter-spacing: 0;
}

.hero-copy,
.hero-ledger,
.preview-panel {
    min-width: 0;
}

.hero-copy p:not(.eyebrow) {
    max-width: 72rem;
    margin: 0;
    color: rgba(17, 20, 17, .72);
    font-family: "Open Sans", sans-serif;
    font-size: clamp(1.7rem, 2vw, 2.1rem);
    line-height: 1.7;
}

.hero-ledger {
    border-left: 1px solid var(--line);
    padding: 1.2rem 0 1.2rem 3rem;
}

.hero-ledger span {
    display: block;
    color: var(--green-deep);
    font-family: "Playfair Display", serif;
    font-size: clamp(8rem, 13vw, 15rem);
    font-weight: 700;
    line-height: .8;
}

.hero-ledger p {
    margin: 1.6rem 0 0;
    color: rgba(17, 20, 17, .68);
    line-height: 1.65;
}

.certificates-shell {
    display: grid;
    grid-template-columns: minmax(34rem, 46rem) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 5rem);
    align-items: start;
    padding-bottom: 7rem;
}

.certificate-list {
    display: grid;
    gap: 1.2rem;
}

.certificate-card {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.8rem;
    background: rgba(255, 250, 240, .72);
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: border-color .25s ease, transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.certificate-card:hover,
.certificate-card.is-active {
    border-color: rgba(47, 111, 98, .42);
    background: var(--white);
    box-shadow: 0 16px 40px rgba(17, 20, 17, .1);
    transform: translateY(-2px);
}

.certificate-card.is-active {
    outline: 2px solid rgba(188, 164, 106, .48);
}

.certificate-card h3 {
    margin: .7rem 0 .7rem;
    font-size: clamp(1.8rem, 2vw, 2.2rem);
    line-height: 1.18;
}

.certificate-card p:not(.certificate-provider) {
    margin: 0 0 1.4rem;
    color: rgba(17, 20, 17, .66);
    font-family: "Open Sans", sans-serif;
    font-size: 1.45rem;
    line-height: 1.55;
}

.certificate-action {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--green-deep);
    font-size: 1.35rem;
    font-weight: 800;
}

.certificate-action::after {
    content: "->";
    color: var(--gold);
}

.preview-panel {
    position: sticky;
    top: 9.5rem;
    min-width: 0;
    border: 1px solid rgba(17, 20, 17, .14);
    border-radius: 8px;
    background: #171916;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.preview-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 250, 240, .12);
    color: var(--white);
}

.preview-kicker {
    color: #cab677;
}

.preview-topline h2 {
    margin: .6rem 0 0;
    font-size: clamp(2rem, 3vw, 3.4rem);
    line-height: 1.12;
}

.open-pdf {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 250, 240, .2);
    border-radius: 999px;
    padding: 1rem 1.4rem;
    color: var(--white);
    font-size: 1.35rem;
    font-weight: 700;
    transition: background .25s ease, border-color .25s ease;
}

.open-pdf:hover {
    border-color: #cab677;
    background: rgba(202, 182, 119, .12);
}

.preview-frame {
    max-height: min(78vh, 82rem);
    min-height: 48rem;
    overflow: auto;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .04), transparent),
        #2a2d28;
}

.preview-frame img {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    background: #f4f4f4;
}

.preview-frame p {
    margin: 0;
    padding: 3rem;
    color: var(--white);
}

.preview-frame a {
    color: #cab677;
    text-decoration: underline;
}

@media (max-width: 1023px) {
    .certificate-hero,
    .certificates-shell {
        grid-template-columns: 1fr;
    }

    .hero-ledger {
        border-top: 1px solid var(--line);
        border-left: 0;
        padding: 2.4rem 0 0;
    }

    .preview-panel {
        position: static;
        order: -1;
    }

    .certificate-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    main {
        width: min(146rem, calc(100% - 2.8rem));
    }

    .site-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 1.4rem;
    }

    .site-nav {
        width: 100%;
        gap: 1.8rem;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: .2rem;
        white-space: nowrap;
    }

    .certificate-hero {
        padding-top: 5rem;
    }

    .hero-copy h1 {
        font-size: clamp(4rem, 12vw, 4.8rem);
        line-height: .92;
    }

    .hero-copy p:not(.eyebrow),
    .hero-ledger p {
        max-width: 34ch;
        overflow-wrap: break-word;
    }

    .certificate-list {
        grid-template-columns: 1fr;
    }

    .preview-topline {
        align-items: flex-start;
        flex-direction: column;
    }

    .open-pdf {
        width: 100%;
        text-align: center;
    }

    .preview-frame {
        max-height: 62vh;
        min-height: 40rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
