.paper-header,
body {
    font-size: 14px !important;
}

.paper-header .paper-name {
    max-width: 1200px;
}

.paper-header.paper-header {
    padding: 3.8rem 1.25rem 2.4rem !important;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    text-align: center;
}

.paper-header .project-brand {
    margin: 0;
    background: linear-gradient(90deg, #2563eb, #8b5cf6);
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    font-size: clamp(4.2rem, 9vw, 6.4rem);
    font-weight: 900;
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.paper-header .paper-name {
    max-width: 1200px;
    margin: 1rem auto 0;
    color: #172554 !important;
    font-family: Montserrat, sans-serif !important;
    font-size: clamp(1.35rem, 3.2vw, 2.15rem) !important;
    font-weight: 900 !important;
    letter-spacing: -0.03em !important;
    line-height: 1.25 !important;
    text-transform: none !important;
    -webkit-text-fill-color: currentColor !important;
}

.paper-header .subpage-name {
    display: flex;
    width: fit-content;
    max-width: min(1200px, calc(100% - 32px));
    min-height: 2.6rem;
    align-items: center;
    justify-content: center;
    margin: 1.25rem auto 0;
    padding: 0.85rem 0.2rem 0;
    border-top: 2px solid #dbeafe;
    color: #1e3a8a;
    font-family: Montserrat, sans-serif !important;
    font-size: 1.08rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.015em !important;
    line-height: 1.35 !important;
    text-align: center;
    text-transform: none;
}

.paper-header .paper-authors {
    margin-top: 1.05rem !important;
    font-size: 0.96rem !important;
}

.paper-header .paper-affiliations {
    margin-top: 0.15rem !important;
    font-size: 0.82rem !important;
}

.section-nav.section-nav,
.site-nav.site-nav {
    gap: 0.16rem;
    padding: 0.6rem 1.25rem;
}

.section-nav.section-nav a,
.site-nav.site-nav a {
    padding: 0.6rem 0.95rem;
    font-family: Montserrat, sans-serif !important;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.page-index.page-index {
    display: flex;
    width: 100%;
    max-width: none;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0 auto 3.5rem;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.page-index.page-index .page-index-label {
    padding-right: 0.8rem;
    border-right: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.page-index.page-index a {
    color: #475569;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
}

.page-index.page-index a:hover {
    color: #2563eb;
}

.page-index + main {
    margin-top: 0 !important;
}

.shared-citation {
    width: min(1180px, calc(100% - 56px));
    margin: 5rem auto;
}

.shared-citation > h2 {
    margin: 0 0 1.5rem;
    color: #1e3a8a;
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-align: center;
}

.shared-citation-card {
    overflow: hidden;
    border: 1px solid #dbeafe;
    border-radius: 1.25rem;
    background: #f8fafc;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.045);
}

.shared-citation-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.shared-citation-meta a {
    color: #2563eb;
    font-weight: 900;
    text-decoration: none;
}

.shared-citation-card pre {
    margin: 0;
    padding: 1.25rem;
    overflow-x: auto;
    color: #1e293b;
    font: 500 0.8rem/1.75 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre;
}

.project-footer.project-footer {
    margin: 5rem 0 0;
    padding: 3.5rem 1.25rem 2rem !important;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc !important;
    color: #475569;
    text-align: left;
}

.project-disclaimer {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.disclaimer-heading {
    margin-bottom: 2rem;
    text-align: center;
}

.disclaimer-heading > span {
    display: inline-block;
    margin-bottom: 0.65rem;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: #4b5563;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.project-disclaimer h2 {
    margin: 0;
    color: #1e293b;
    font-size: 1.22rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.project-disclaimer p {
    margin: 0;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.8;
}

.project-disclaimer p + p {
    margin-top: 1rem;
}

.project-disclaimer p > strong {
    color: #1e293b;
    font-weight: 900;
}

.takedown-policy {
    margin-top: 1.5rem;
    padding: 1.25rem 1.4rem;
    border: 1px solid #fee2e2;
    border-radius: 1rem;
    background: #fef2f2;
    color: #7f1d1d;
    box-shadow: 0 6px 18px rgba(127, 29, 29, 0.05);
}

.takedown-policy > strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.takedown-policy p {
    color: #7f1d1d;
    font-size: 0.8rem;
}

.project-disclaimer a {
    color: #2563eb;
    font-weight: 800;
    text-decoration: none;
}

.project-disclaimer a:hover {
    text-decoration: underline;
}

.project-footer-note {
    width: min(1180px, 100%);
    margin: 1.5rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 0.7rem;
    text-align: center;
}

main {
    width: min(1320px, calc(100% - 64px)) !important;
}

.paper-section {
    width: min(1240px, calc(100% - 64px)) !important;
}

.paper-section-wide {
    width: min(1380px, calc(100% - 64px)) !important;
}

#paradigm .paper-surface {
    max-width: 820px !important;
}

#framework .paper-surface {
    max-width: 1040px !important;
}

#cases .paper-surface {
    max-width: 1040px !important;
}

.hierarchy {
    max-width: 1200px !important;
}

.section-heading > h2,
.group-head > h2,
.mode-heading > h2,
.pipeline-title.pipeline-title {
    margin: 0 !important;
    color: #1e3a8a !important;
    font-family: Montserrat, sans-serif !important;
    font-size: 1.65rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.25 !important;
}

main p,
main li,
.paper-section p,
.paper-section li {
    font-size: 0.88rem !important;
    line-height: 1.82 !important;
}

.paper-caption,
.section-heading p {
    font-size: 0.82rem !important;
}

.source-note {
    max-width: 980px !important;
    font-size: 0.74rem !important;
}

.trace-step span,
.chapter-head span,
.case-facts span,
.metric-list span,
.video-label span {
    font-size: 0.7rem !important;
}

.trace-step strong,
.video-label strong,
.case-tag,
.level-tag,
.eyebrow {
    font-size: 0.68rem !important;
}

.explore-feature span,
.page-map span,
.route-copy span {
    font-size: 0.74rem !important;
}

.route-copy strong,
.page-map strong {
    font-size: 0.94rem !important;
}

/* Group the project-level navigation by reading path. */
.section-nav.nav-groups,
.site-nav.nav-groups {
    overflow: visible !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.62rem 1rem;
}

.nav-groups > .nav-home,
.nav-groups .nav-group-trigger {
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.62rem 1rem !important;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    font-family: Montserrat, sans-serif;
    font-size: 0.84rem !important;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-groups > .nav-home:hover,
.nav-groups > .nav-home[aria-current="page"],
.nav-groups .nav-group-trigger:hover,
.nav-groups .nav-group.current > .nav-group-trigger,
.nav-groups .nav-group[open] > .nav-group-trigger {
    border-color: #dbeafe;
    background: #eff6ff;
    color: #2563eb;
}

.nav-group {
    position: relative;
    flex: none;
}

.nav-group > summary {
    list-style: none;
}

.nav-group > summary::-webkit-details-marker {
    display: none;
}

.nav-group-caret {
    display: inline-block;
    color: #94a3b8;
    font-size: 0.78rem;
    transition: transform 0.2s ease;
}

.nav-group[open] .nav-group-caret {
    transform: rotate(180deg);
}

.nav-group-menu {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 50%;
    z-index: 80;
    display: grid;
    width: min(430px, calc(100vw - 24px));
    gap: 0.35rem;
    padding: 0.55rem;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 18px 46px rgba(15,23,42,0.16);
    transform: translateX(-50%);
    backdrop-filter: blur(16px);
}

.nav-group-menu a {
    display: grid;
    grid-template-columns: 2rem minmax(0,1fr);
    align-items: center;
    gap: 0.7rem;
    padding: 0.72rem 0.78rem !important;
    border-radius: 0.75rem !important;
    color: #334155 !important;
    text-align: left;
    text-decoration: none;
}

.nav-group-menu a.nav-item-plain {
    grid-template-columns: minmax(0,1fr);
}

.nav-group-menu a:hover,
.nav-group-menu a[aria-current="page"] {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

.nav-group-menu small {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 900;
}

.nav-group-menu a:hover small,
.nav-group-menu a[aria-current="page"] small {
    background: #dbeafe;
    color: #1d4ed8;
}

.nav-group-menu strong,
.nav-group-menu em {
    display: block;
}

.nav-group-menu strong {
    color: inherit;
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 900;
    line-height: 1.35;
}

.nav-group-menu em {
    margin-top: 0.15rem;
    color: #94a3b8;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1.35;
}

main .text-xs,
.paper-section .text-xs {
    font-size: 0.78rem !important;
}

main [class*="text-[8px]"],
.paper-section [class*="text-[8px]"],
main [class*="text-[9px]"],
.paper-section [class*="text-[9px]"] {
    font-size: 0.72rem !important;
}

main [class*="text-[10px]"],
.paper-section [class*="text-[10px]"] {
    font-size: 0.72rem !important;
}

main [class*="text-[11px]"],
.paper-section [class*="text-[11px]"] {
    font-size: 0.78rem !important;
}

main [class*="text-[12px]"],
.paper-section [class*="text-[12px]"] {
    font-size: 0.78rem !important;
}

main [class*="text-[13px]"],
.paper-section [class*="text-[13px]"] {
    font-size: 0.84rem !important;
}

@media (max-width: 767px) {
    .paper-header.paper-header { padding: 3rem 1rem 2rem !important; }
    .paper-header .project-brand { font-size: clamp(3.6rem, 18vw, 5rem); }
    .paper-header .paper-name { font-size: clamp(1.2rem, 6vw, 1.65rem) !important; }
    .paper-header .subpage-name { max-width: calc(100% - 24px); min-height: 2.3rem; font-size: 0.96rem !important; text-align: center; }
    main,
    .paper-section,
    .paper-section-wide { width: min(100% - 24px, 1760px) !important; }
    .page-index.page-index { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; margin-bottom: 3rem; padding-right: 1rem; padding-left: 1rem; }
    .page-index.page-index .page-index-label { flex: none; }
    .page-index.page-index a { flex: none; }
    .shared-citation { width: min(100% - 24px, 1180px); margin: 4rem auto; }
    .shared-citation > h2 { font-size: 1.35rem; }
    .shared-citation-card pre { padding: 1rem; font-size: 0.68rem; }
    .project-footer.project-footer { padding: 2.75rem 1rem 1.5rem !important; }
    .section-heading > h2,
    .group-head > h2,
    .mode-heading > h2,
    .pipeline-title.pipeline-title { font-size: 1.35rem !important; }
    .section-nav.nav-groups,
    .site-nav.nav-groups { justify-content: center !important; padding-right: 0.5rem; padding-left: 0.5rem; }
    .nav-groups > .nav-home,
    .nav-groups .nav-group-trigger { min-height: 2.2rem; padding: 0.58rem 0.78rem !important; font-size: 0.76rem !important; }
    .nav-group-menu { position: fixed; top: 4.2rem; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 5rem); overflow-y: auto; transform: none; }
}
