:root {
    --ink: #172033;
    --muted: #667085;
    --surface: #ffffff;
    --soft: #f7f4ef;
    --line: #e5e7eb;
    --brand: #7f1d1d;
    --brand-dark: #4c1111;
    --accent: #d4a017;
    --success: #166534;
    --warning: #92400e;
    --shadow: 0 18px 45px rgba(23, 32, 51, .08);
    --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}
a { color: inherit; }
img, iframe { max-width: 100%; }
.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -100px; background: #fff; padding: 10px 14px; z-index: 100; }
.skip-link:focus { top: 12px; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(229,231,235,.9); backdrop-filter: blur(12px); }
.header-inner { min-height: 76px; display: flex; gap: 22px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: max-content; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 800; letter-spacing: -.05em; }
.brand strong { display: block; font-size: 1rem; }
.brand small { display: block; color: var(--muted); font-size: .72rem; }
.main-nav { display: flex; gap: 20px; margin-left: auto; }
.main-nav a { text-decoration: none; font-weight: 650; font-size: .92rem; }
.main-nav a:hover { color: var(--brand); }
.header-search { display: flex; background: #f2f4f7; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.header-search input { width: 180px; border: 0; background: transparent; padding: 10px 12px; outline: none; }
.header-search button { border: 0; background: var(--ink); color: #fff; padding: 10px 14px; cursor: pointer; }
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--line); background: #fff; padding: 9px 12px; border-radius: 10px; }
.hero { position: relative; overflow: hidden; padding: 84px 0 72px; background: linear-gradient(130deg, var(--brand-dark), var(--brand) 62%, #a43a2f); color: #fff; }
.hero:before, .hero:after { content: ""; position: absolute; border-radius: 999px; background: rgba(255,255,255,.07); }
.hero:before { width: 420px; height: 420px; right: -120px; top: -170px; }
.hero:after { width: 260px; height: 260px; left: 45%; bottom: -180px; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.35fr .65fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.hero h1 { margin: 18px 0 14px; max-width: 820px; font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1.02; letter-spacing: -.055em; }
.hero p { max-width: 700px; color: rgba(255,255,255,.83); font-size: 1.08rem; }
.hero-search { display: flex; gap: 10px; max-width: 760px; margin-top: 26px; padding: 9px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.hero-search input { flex: 1; min-width: 0; border: 0; padding: 13px 14px; font-size: 1rem; outline: none; }
.hero-search button { border: 0; border-radius: 11px; background: var(--ink); color: #fff; padding: 12px 22px; font-weight: 750; cursor: pointer; }
.hero-stats { display: grid; gap: 13px; }
.stat-card { padding: 20px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.09); border-radius: 17px; backdrop-filter: blur(8px); }
.stat-card strong { display: block; font-size: 2rem; }
.stat-card span { color: rgba(255,255,255,.75); }
.section { padding: 66px 0; }
.section-white { background: #fff; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 26px; }
.section-heading h2, .page-hero h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.1; letter-spacing: -.04em; }
.section-heading p { margin: 7px 0 0; color: var(--muted); max-width: 720px; }
.text-link { color: var(--brand); font-weight: 750; text-decoration: none; }
.exam-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.exam-card { display: flex; flex-direction: column; min-height: 220px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(23,32,51,.04); text-decoration: none; transition: .2s ease; }
.exam-card:hover { transform: translateY(-4px); border-color: rgba(127,29,29,.35); box-shadow: var(--shadow); }
.exam-card .kicker { color: var(--brand); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.exam-card h3 { margin: 14px 0 10px; font-size: 1.25rem; line-height: 1.3; }
.exam-card p { color: var(--muted); margin: 0; }
.exam-card footer { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 20px; color: var(--muted); font-size: .9rem; }
.paper-list { display: grid; gap: 14px; }
.paper-card { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.paper-icon { display: grid; place-items: center; width: 52px; height: 60px; border-radius: 12px; background: #fee2e2; color: var(--brand); font-size: .72rem; font-weight: 850; }
.paper-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.paper-meta span { padding: 3px 8px; border-radius: 999px; background: #f2f4f7; color: var(--muted); font-size: .76rem; }
.paper-card h3 { margin: 8px 0 4px; font-size: 1.08rem; }
.paper-card h3 a { text-decoration: none; }
.paper-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.paper-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 750; font-size: .88rem; cursor: pointer; }
.button:hover { background: var(--brand-dark); }
.button-light { background: #fff; color: var(--brand); }
.button-light:hover { background: #fff7f7; }
.button-dark { background: var(--ink); border-color: var(--ink); }
.status-pill { display: inline-flex; padding: 7px 10px; border-radius: 999px; font-size: .78rem; font-weight: 750; }
.status-pill.pending { background: #fff7ed; color: var(--warning); }
.page-hero { padding: 48px 0 32px; background: #fff; border-bottom: 1px solid var(--line); }
.page-hero p { max-width: 800px; color: var(--muted); font-size: 1.03rem; }
.breadcrumbs { padding-top: 20px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: .86rem; }
.breadcrumbs li:not(:last-child):after { content: "/"; margin-left: 8px; color: #b8bec8; }
.breadcrumbs a { text-decoration: none; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-bar a { padding: 8px 12px; border: 1px solid var(--line); background: #fff; border-radius: 10px; text-decoration: none; font-weight: 650; font-size: .88rem; }
.filter-bar a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.content-grid { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 28px; align-items: start; }
.sidebar-card, .content-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.sidebar-card + .sidebar-card { margin-top: 16px; }
.sidebar-card h2, .content-card h2 { margin-top: 0; font-size: 1.2rem; }
.sidebar-card a { display: block; padding: 7px 0; text-decoration: none; color: var(--muted); }
.sidebar-card a:hover { color: var(--brand); }
.info-band { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.info-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.info-item strong { display: block; font-size: 1.2rem; margin-bottom: 5px; }
.info-item p { margin: 0; color: var(--muted); }
.year-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; }
.year-card { padding: 20px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-align: center; text-decoration: none; }
.year-card strong { display: block; font-size: 1.35rem; }
.year-card span { color: var(--muted); font-size: .82rem; }
.search-panel { display: flex; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px; margin-bottom: 24px; }
.search-panel input, .form-control { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; }
.search-panel input { border: 0; outline: none; }
.pdf-viewer { width: 100%; min-height: 75vh; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.paper-detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.paper-detail-head h1 { margin: 10px 0; }
.notice { padding: 15px 17px; border-radius: 12px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; }
.pagination { display: flex; justify-content: center; gap: 7px; margin-top: 28px; }
.pagination a { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); background: #fff; border-radius: 10px; text-decoration: none; }
.pagination a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 15px 17px; }
.faq details + details { margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 750; }
.flash-wrap { padding-top: 12px; }
.flash { padding: 12px 15px; border-radius: 10px; background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.flash.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.site-footer { margin-top: 64px; padding: 56px 0 24px; background: #111827; color: #e5e7eb; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer a { display: block; color: #cbd5e1; text-decoration: none; margin: 7px 0; }
.footer-bottom { display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid #374151; margin-top: 36px; padding-top: 20px; color: #94a3b8; font-size: .82rem; }
.footer-bottom p { margin: 0; }
.footer-bottom a { display: inline; }
.prose { font-size: 1rem; }
.prose h2 { margin-top: 32px; }
.prose p, .prose li { color: #475467; }
@media (max-width: 980px) {
    .header-search { display: none; }
    .hero-grid, .content-grid { grid-template-columns: 1fr; }
    .hero-stats { grid-template-columns: repeat(3,1fr); }
    .exam-grid { grid-template-columns: repeat(2,1fr); }
    .year-grid { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 760px) {
    .header-inner { flex-wrap: wrap; padding: 12px 0; }
    .nav-toggle { display: inline-flex; }
    .main-nav { display: none; width: 100%; order: 4; flex-direction: column; gap: 0; padding: 8px 0; }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 10px 0; border-top: 1px solid var(--line); }
    .hero { padding: 54px 0; }
    .hero h1 { font-size: 2.8rem; }
    .hero-search { flex-direction: column; }
    .hero-stats, .info-band { grid-template-columns: 1fr; }
    .exam-grid { grid-template-columns: 1fr; }
    .paper-card { grid-template-columns: auto 1fr; align-items: start; }
    .paper-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .section-heading, .paper-detail-head, .footer-bottom { flex-direction: column; align-items: flex-start; }
    .year-grid { grid-template-columns: repeat(2,1fr); }
    .footer-grid { grid-template-columns: 1fr; }
}


/* v1.2 public archive refinements */
.exam-grid-simple { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.exam-card-simple { min-height: 0; padding: 20px; }
.exam-card-simple h3 { margin: 0 0 18px; font-size: 1.08rem; }
.exam-card-simple footer { border-top: 1px solid var(--line); padding-top: 14px; }
.exam-card-simple footer span { display: grid; gap: 1px; }
.exam-card-simple footer strong { color: var(--ink); font-size: .98rem; }
.button-large { padding: 13px 18px; font-size: .94rem; white-space: nowrap; }
.paper-post { display: grid; gap: 18px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 18px 0 8px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.detail-list div { padding: 15px 17px; border-bottom: 1px solid var(--line); }
.detail-list div:nth-child(odd) { border-right: 1px solid var(--line); }
.detail-list div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.detail-list dd { margin: 4px 0 0; color: var(--ink); font-weight: 650; }
.detail-list dd a { color: var(--brand); text-decoration: none; }
.pdf-access-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 30px; padding: 22px; border-radius: 16px; background: #fff7f7; border: 1px solid #fecaca; }
.pdf-access-card h2 { margin: 0 0 5px; }
.pdf-access-card p { margin: 0; }
.availability-note { color: var(--warning) !important; font-weight: 700; }
.paper-faq h2 { margin-bottom: 16px; }
.related-links a { padding: 12px 0; border-bottom: 1px solid var(--line); }
.related-links a:last-child { border-bottom: 0; }
.related-links strong, .related-links small { display: block; }
.related-links strong { color: var(--ink); font-size: .9rem; line-height: 1.35; }
.related-links small { margin-top: 4px; color: var(--muted); }
@media (max-width: 980px) {
    .exam-grid-simple { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .exam-grid-simple, .detail-list { grid-template-columns: 1fr; }
    .detail-list div, .detail-list div:nth-child(odd), .detail-list div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
    .detail-list div:last-child { border-bottom: 0; }
    .pdf-access-card { align-items: flex-start; flex-direction: column; }
    .button-large { white-space: normal; }
}

/* v1.3 faster mobile PDF access */
.pdf-button-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button.pdf-opening { opacity: .72; pointer-events: none; }
.pdf-mobile-notice {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 100;
    width: min(440px, calc(100% - 28px));
    transform: translate(-50%, 18px);
    padding: 12px 15px;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    box-shadow: 0 16px 40px rgba(17, 24, 39, .24);
    font-size: .88rem;
    opacity: 0;
    visibility: hidden;
    transition: .2s ease;
}
.pdf-mobile-notice.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@media (max-width: 760px) {
    .pdf-button-group { width: 100%; }
    .pdf-button-group .button { flex: 1 1 150px; }
}
