/* Pure Amino — science page: research library with per-peptide sections,
   paper-grid cards, modal detail view. Ported from design-source/science.html. */

:root {
    /* Paper-tone overrides used on the science page */
    --sci-paper:    #E6E8EA;
    --sci-paper-2:  #DDDFE2;
    --sci-hairline: #B6B9BC;
    --sci-ink:      #141718;
    --sci-dim:      #5B5D5B;
}

body.page-template-page-science {
    background: var(--sci-paper);
    color: var(--sci-ink);
}

.sci-wrap a { color: inherit; text-decoration: none; }

.sci-wrap .mono { font-family: var(--font-mono); font-size: 11px; }
.sci-wrap .cap {
    font-weight: 500; font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
}
.sci-wrap .axis-left {
    display: flex; align-items: center; gap: 12px;
    font-weight: 500; font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
}
.sci-wrap .axis-left::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: .55; }
.sci-wrap .axis-left .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Buttons — science page uses a tighter scale than the global .btn */
.sci-wrap .sci-btn {
    font-weight: 500; font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
    padding: 13px 22px;
    background: var(--sci-ink); color: var(--sci-paper);
    display: inline-flex; align-items: center; gap: 10px;
    transition: background .22s;
    border: 1px solid var(--sci-ink);
}
.sci-wrap .sci-btn:hover { background: #000; }
.sci-wrap .sci-btn.ghost { background: transparent; color: var(--sci-ink); }
.sci-wrap .sci-btn.ghost:hover { background: var(--sci-ink); color: var(--sci-paper); }
.sci-wrap .sci-btn .arr { transition: transform .22s; }
.sci-wrap .sci-btn:hover .arr { transform: translateX(4px); }

/* Hero */
.sci-hero {
    padding: 80px 40px 60px;
    border-bottom: 1px solid var(--sci-hairline);
    display: grid; grid-template-columns: 1.35fr 1fr; gap: 60px;
    align-items: flex-end;
    position: relative; overflow: hidden;
}
.sci-hero .crumb {
    display: flex; gap: 12px;
    font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
    color: var(--sci-dim);
    margin-bottom: 28px;
}
.sci-hero h1 {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(64px, 11vw, 180px);
    line-height: .86; letter-spacing: -.035em; text-transform: uppercase;
}
.sci-hero h1 em { font-style: normal; color: var(--ghk-core); }
.sci-hero .sub {
    font-family: var(--font-display); font-weight: 500;
    font-size: 24px; letter-spacing: -.01em; line-height: 1.25;
    max-width: 42ch; color: #333;
    margin-top: 22px; text-transform: none;
}

.hero-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    border: 1px solid var(--sci-hairline);
}
.hero-stats .cell {
    padding: 24px;
    border-right: 1px solid var(--sci-hairline);
    border-bottom: 1px solid var(--sci-hairline);
    display: flex; flex-direction: column; gap: 8px;
}
.hero-stats .cell:nth-child(2n) { border-right: none; }
.hero-stats .cell:nth-last-child(-n+2) { border-bottom: none; }
.hero-stats .cell .k {
    font-size: 10px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
    color: var(--sci-dim);
}
.hero-stats .cell .v {
    font-family: var(--font-display); font-weight: 600;
    font-size: 56px; letter-spacing: -.025em; line-height: .95;
}
.hero-stats .cell .v sup { font-size: .4em; vertical-align: top; }
.hero-stats .cell .m { font-family: var(--font-mono); font-size: 11px; color: var(--sci-dim); }

/* Method strip */
.method {
    padding: 60px 40px;
    border-bottom: 1px solid var(--sci-hairline);
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.method .m {
    padding: 0 28px;
    border-right: 1px solid var(--sci-hairline);
    display: flex; flex-direction: column; gap: 12px;
}
.method .m:first-child { padding-left: 0; }
.method .m:last-child { border-right: none; padding-right: 0; }
.method .m .num { font-family: var(--font-mono); font-size: 11px; color: var(--sci-dim); }
.method .m .t {
    font-family: var(--font-display); font-weight: 600;
    font-size: 22px; letter-spacing: -.015em; text-transform: uppercase; line-height: 1.05;
}
.method .m .d {
    font-size: 11px; line-height: 1.8; letter-spacing: .2em;
    text-transform: uppercase; font-weight: 500; color: #444;
}

/* Peptide section */
.pep { border-bottom: 1px solid var(--sci-hairline); scroll-margin-top: 90px; }
.pep-head {
    padding: 56px 40px 32px;
    display: grid; grid-template-columns: minmax(260px, 1.1fr) minmax(320px, 1.6fr) auto;
    gap: 40px; align-items: flex-end;
    position: relative; overflow: hidden;
}
.pep-head::before {
    content: attr(data-bigcode);
    position: absolute; right: -10px; bottom: -60px;
    font-family: var(--font-display); font-weight: 600;
    font-size: 320px; letter-spacing: -.05em; line-height: .8;
    color: currentColor; opacity: .06; text-transform: uppercase; pointer-events: none;
}
.pep-head .h-left { position: relative; }
.pep-head .h-left .axis-left { color: currentColor; margin-bottom: 18px; max-width: 220px; }
.pep-head h2 {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(48px, 7vw, 108px);
    line-height: .9; letter-spacing: -.03em; text-transform: uppercase;
    color: var(--sci-ink);
}
.pep-head h2 sub { font-size: .42em; font-weight: 500; vertical-align: baseline; letter-spacing: 0; }
.pep-head .h-mid { position: relative; }
.pep-head .h-mid .tag {
    font-family: var(--font-display); font-weight: 500;
    font-size: 22px; letter-spacing: -.01em; line-height: 1.3;
    color: #333; max-width: 40ch;
}
.pep-head .h-mid .meta { display: flex; gap: 28px; margin-top: 22px; flex-wrap: wrap; }
.pep-head .h-mid .meta .m {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 10px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
    color: var(--sci-dim);
}
.pep-head .h-mid .meta .m b {
    font-family: var(--font-mono); font-size: 14px;
    color: var(--sci-ink); font-weight: 500; letter-spacing: 0;
}
.pep-head .h-right {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    position: relative; width: 220px; justify-self: end;
}
.pep-head .h-right .vial { height: 200px; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .2)); }

/* Papers grid */
.papers { padding: 0 40px 56px; display: block; }
.paper-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--sci-hairline);
}
.paper-grid .paper:nth-child(2n) { border-right: 1px solid var(--sci-hairline); }
.paper-grid .paper:nth-child(3n) { border-right: none; }
.paper {
    padding: 28px 28px 22px;
    border-right: 1px solid var(--sci-hairline);
    border-bottom: 1px solid var(--sci-hairline);
    display: flex; flex-direction: column; gap: 14px;
    cursor: pointer; position: relative; overflow: hidden;
    transition: background .25s;
    min-height: 260px;
}
.paper:hover { background: var(--sci-paper-2); }
.paper .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: currentColor; }
.paper .meta-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 10px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
    color: var(--sci-dim);
}
.paper .meta-row .tag {
    display: inline-flex; align-items: center; gap: 8px;
    color: currentColor; padding: 3px 8px; border: 1px solid currentColor;
}
.paper .meta-row .doi { font-family: var(--font-mono); letter-spacing: 0; }
.paper .title {
    font-family: var(--font-display); font-weight: 600;
    font-size: 22px; letter-spacing: -.015em; line-height: 1.12;
    color: var(--sci-ink); text-transform: none;
}
.paper .authors {
    font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500;
    color: #3a3c3a; line-height: 1.6;
}
.paper .authors em { font-style: normal; color: var(--sci-dim); }
.paper .journal {
    font-family: var(--font-mono); font-size: 11px; color: var(--sci-dim);
    padding-top: 10px; border-top: 1px dashed var(--sci-hairline);
    margin-top: auto;
    display: flex; justify-content: space-between; align-items: center;
}
.paper .journal .cite {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 11px; color: var(--sci-ink);
}
.paper .cta {
    position: absolute; top: 16px; right: 16px;
    opacity: 0; transform: translateY(-4px);
    transition: all .22s;
    font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
    padding: 5px 10px;
    background: var(--sci-ink); color: var(--sci-paper);
}
.paper:hover .cta { opacity: 1; transform: none; }

/* Anchor nav */
.anchor-bar {
    position: sticky; top: 65px; z-index: 30;
    background: var(--sci-paper);
    border-bottom: 1px solid var(--sci-hairline);
    display: flex; gap: 0;
    overflow-x: auto;
}
.anchor-bar a {
    padding: 14px 22px;
    font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
    color: var(--sci-dim);
    border-right: 1px solid var(--sci-hairline);
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all .22s;
    flex-shrink: 0;
}
.anchor-bar a .d { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.anchor-bar a:hover, .anchor-bar a.on { background: var(--sci-ink); color: var(--sci-paper); }
.anchor-bar a:hover .d, .anchor-bar a.on .d { background: currentColor; }
.anchor-bar .count {
    margin-left: auto;
    padding: 14px 22px;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--sci-dim); border-right: none;
}

/* Database strip between sections */
.dbstrip {
    padding: 40px;
    background: var(--sci-ink); color: var(--sci-paper);
    display: flex; justify-content: space-between; align-items: center; gap: 40px;
    flex-wrap: wrap;
}
.dbstrip h3 {
    font-family: var(--font-display); font-weight: 600;
    font-size: 28px; letter-spacing: -.02em; text-transform: uppercase; line-height: 1;
}
.dbstrip .logos {
    display: flex; gap: 32px; flex-wrap: wrap;
    font-family: var(--font-mono); font-size: 11px; opacity: .7;
}
.dbstrip .logos span { padding: 6px 12px; border: 1px solid rgba(230, 232, 234, .3); }

/* Ethics / citation */
.ethics {
    padding: 80px 40px;
    border-bottom: 1px solid var(--sci-hairline);
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
    align-items: flex-start;
}
.ethics h2 {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(40px, 5vw, 72px);
    line-height: .95; letter-spacing: -.025em; text-transform: uppercase;
}
.ethics p {
    font-size: 11px; line-height: 1.8; letter-spacing: .22em; text-transform: uppercase;
    text-align: justify; font-weight: 500; color: #333; margin-top: 18px;
}
.ethics .cite-card {
    background: var(--sci-paper-2);
    border: 1px solid var(--sci-hairline);
    padding: 32px;
}
.ethics .cite-card h4 {
    font-family: var(--font-display); font-weight: 600;
    font-size: 18px; letter-spacing: -.01em; text-transform: uppercase;
    margin-bottom: 12px;
}
.ethics .cite-card pre {
    font-family: var(--font-mono); font-size: 11px; line-height: 1.7;
    white-space: pre-wrap;
    background: var(--sci-paper);
    padding: 18px;
    border: 1px solid var(--sci-hairline);
    margin-top: 10px;
    color: var(--sci-ink);
}

/* Science sub-footer ("Cited.") above the global footer */
.sci-foot {
    padding: 60px 40px 28px;
    font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
    color: var(--sci-dim);
}
.sci-foot .mega {
    font-family: var(--font-display); font-weight: 600;
    font-size: min(22vw, 280px);
    line-height: .85; letter-spacing: -.04em;
    text-transform: uppercase;
    color: var(--sci-ink);
    text-align: center;
    margin-bottom: 40px;
}
.sci-foot .row {
    display: flex; justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--sci-hairline);
}

/* Modal */
.scrim {
    position: fixed; inset: 0;
    background: rgba(20, 23, 24, .7);
    backdrop-filter: blur(8px);
    opacity: 0; pointer-events: none;
    transition: opacity .28s;
    z-index: 90;
}
.scrim.on { opacity: 1; pointer-events: auto; }
.modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -46%) scale(.97);
    width: min(720px, 92vw); max-height: 88vh;
    background: var(--sci-paper);
    z-index: 91;
    opacity: 0; pointer-events: none;
    transition: all .28s;
    display: flex; flex-direction: column;
    border: 1px solid var(--sci-ink);
}
.modal.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head {
    padding: 26px 30px;
    border-bottom: 1px solid var(--sci-hairline);
    display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
}
.modal-head .mh-left { display: flex; flex-direction: column; gap: 8px; }
.modal-head .tag {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 10px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
    align-self: flex-start;
    padding: 3px 8px;
    border: 1px solid currentColor;
}
.modal-head h3 {
    font-family: var(--font-display); font-weight: 600;
    font-size: 22px; letter-spacing: -.015em; line-height: 1.15;
    color: var(--sci-ink); text-transform: none;
}
.modal-head button { font-size: 22px; color: var(--sci-dim); }
.modal-body {
    padding: 26px 30px;
    overflow: auto;
    display: flex; flex-direction: column; gap: 20px;
}
.modal-body .mb-row {
    display: flex; justify-content: space-between; gap: 24px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--sci-hairline);
    font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 500;
}
.modal-body .mb-row span:first-child { color: var(--sci-dim); }
.modal-body .mb-row span:last-child {
    font-family: var(--font-mono); letter-spacing: 0; text-transform: none;
    color: var(--sci-ink); text-align: right; max-width: 60%;
}
.modal-body .abstract {
    font-size: 13px; line-height: 1.65; color: #222;
    font-family: var(--font-body);
    padding-top: 8px;
}
.modal-body .abstract h5 {
    font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
    color: var(--sci-dim);
    margin-bottom: 10px;
}
.modal-foot {
    padding: 20px 30px;
    border-top: 1px solid var(--sci-hairline);
    display: flex; gap: 10px; justify-content: flex-end;
}

@media (max-width: 900px) {
    .sci-hero, .method, .ethics, .pep-head {
        grid-template-columns: 1fr;
        padding: 40px 20px;
        gap: 20px;
    }
    .sci-hero h1 { font-size: clamp(48px, 12vw, 96px); }
    .hero-stats { grid-template-columns: 1fr 1fr; }
    .method .m {
        border-right: none; padding: 0;
        border-bottom: 1px solid var(--sci-hairline);
        padding-bottom: 16px;
    }
    .anchor-bar { flex-wrap: wrap; gap: 12px 16px; padding: 16px 20px; }
    .paper-grid { grid-template-columns: 1fr; }
    .paper { border-right: none; }
    .papers { padding: 0 20px 40px; }
    .pep-head { padding: 40px 20px 20px; }
    .pep-head .h-right { align-items: flex-start; }
    .modal {
        width: 100vw; max-width: 100vw; left: 0; right: 0;
        height: 100vh; max-height: 100vh; top: 0; bottom: 0;
        border-radius: 0;
    }
    .sci-foot .mega { font-size: clamp(96px, 28vw, 200px); }
}

@media (max-width: 480px) {
    .sci-hero, .method, .ethics, .pep-head { padding: 32px 18px; }
    .sci-hero h1 { font-size: clamp(40px, 14vw, 72px); }
    .hero-stats { grid-template-columns: 1fr; }
    .papers { padding: 0 18px 32px; }
    .pep-head { padding: 32px 18px 16px; }
    .sci-btn { padding: 12px 18px; min-height: 44px; }
    .modal-head, .modal-body, .modal-foot { padding: 18px; }
    .modal-foot { flex-wrap: wrap; gap: 8px; }
    .modal-foot .sci-btn { flex: 1; min-width: 120px; justify-content: center; }
}
