:root {
    --wp-ink: var(--l2p-ink, #12143a);
    --wp-ink-2: var(--l2p-ink-2, #1f2468);
    --wp-glow: var(--l2p-glow, #959afd);
    --wp-display: var(--l2p-display, 'Sora', 'Anek Telugu', sans-serif);
    --wp-mono: var(--l2p-mono, ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace);

    --wp-header-height: 4.25rem;
    --wp-rail-width: 18.5rem;
}

html,
body {
    overflow-x: clip;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html,
    body {
        scroll-behavior: auto;
    }
}

h1,
h2,
h3,
.section-title,
.hero h1 {
    font-family: var(--wp-display);
    letter-spacing: -0.01em;
}

.brand-text {
    font-family: Artemus, sans-serif;
    line-height: 1;
    color: #272a64;
    transform: translateY(.2em);
}

html[data-bs-theme=dark] .brand-text {
    color: rgba(222, 226, 230, 0.75);
}

.mono {
    font-family: var(--wp-mono);
}

.tabular {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bs-primary);
}

.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -3.5rem;
    z-index: 1080;
    padding: 0.55rem 0.95rem;
    border-radius: 0.6rem;
    background-color: var(--bs-primary);
    color: #fff;
    text-decoration: none;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 0.75rem;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: 0.35rem;
}

/* --- Header --- */

.doc-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--wp-header-height);
    display: flex;
    align-items: center;
    background-color: color-mix(in srgb, var(--bs-body-bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--bs-border-color);
}

.doc-header .navbar-brand {
    min-width: 0;
}

.doc-header .nav-link {
    font-weight: 500;
    white-space: nowrap;
    color: var(--bs-secondary-color);
}

.doc-header .nav-link:hover {
    color: var(--bs-primary);
}

.read-progress {
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 2px;
    width: 0;
    background-color: var(--bs-primary);
    transition: width 0.1s linear;
}

.lightDarkSwitch {
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 1040;
}

/* --- Hero --- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 4.5rem 0 4rem;
    color: #fff;
    background:
        radial-gradient(1100px 480px at 12% -15%, color-mix(in srgb, var(--wp-glow) 40%, transparent), transparent 60%),
        linear-gradient(158deg, var(--wp-ink-2), var(--wp-ink));
}

html[data-bs-theme=dark] .hero {
    background:
        radial-gradient(1100px 480px at 12% -15%, color-mix(in srgb, var(--wp-glow) 38%, transparent), transparent 60%),
        linear-gradient(158deg, color-mix(in srgb, var(--wp-ink-2) 55%, var(--bs-body-bg)), var(--bs-body-bg));
}

.hero-eyebrow {
    color: color-mix(in srgb, var(--wp-glow) 55%, #fff);
}

.hero h1 {
    font-weight: 800;
    line-height: 1.06;
    font-size: clamp(2.1rem, 4.4vw, 3.4rem);
    margin: 0.6rem 0 1rem;
    max-width: 22ch;
}

.hero-lead {
    font-size: 1.12rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
    max-width: 42rem;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.75rem;
}

.btn-hero-ghost {
    --bs-btn-color: #fff;
    --bs-btn-bg: rgba(255, 255, 255, 0.08);
    --bs-btn-border-color: rgba(255, 255, 255, 0.28);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.16);
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.5);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: rgba(255, 255, 255, 0.2);
    --bs-btn-active-border-color: rgba(255, 255, 255, 0.5);
    border-width: 1px;
    border-style: solid;
    font-weight: 500;
}

.hero-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background-color: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1rem;
    overflow: hidden;
}

.hero-fact {
    padding: 1.15rem 1.25rem;
    background-color: color-mix(in srgb, var(--wp-ink) 55%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hero-fact-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.35rem;
}

.hero-fact-value {
    display: block;
    font-family: var(--wp-display);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.hero-fact-value small {
    display: block;
    font-family: var(--wp-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0.3rem;
}

@media (max-width: 991.98px) {
    .hero-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 479.98px) {
    .hero-facts {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --- Shell --- */

.doc-shell {
    display: grid;
    grid-template-columns: var(--wp-rail-width) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
    max-width: 84rem;
    margin-inline: auto;
}

.doc-rail {
    position: sticky;
    top: var(--wp-header-height);
    max-height: calc(100vh - var(--wp-header-height) - 4.5rem);
    overflow-y: auto;
    padding: 2.5rem 0 3rem;
    scrollbar-width: thin;
}

.rail-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bs-secondary-color);
}

.rail-section {
    margin-bottom: 1.6rem;
}

.rail-link {
    display: flex;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem;
    margin-left: -0.75rem;
    border-left: 2px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.35;
}

.rail-link:hover {
    color: var(--bs-primary);
    border-left-color: color-mix(in srgb, var(--bs-primary) 50%, transparent);
}

.rail-link.is-active {
    color: var(--bs-primary);
    font-weight: 600;
    border-left-color: var(--bs-primary);
    background-color: color-mix(in srgb, var(--bs-primary) 8%, transparent);
}

.rail-num {
    flex: 0 0 auto;
    font-family: var(--wp-mono);
    font-size: 0.78rem;
    line-height: 1.65;
    color: var(--bs-tertiary-color);
}

.rail-link.is-active .rail-num {
    color: var(--bs-primary);
}

.rail-subs {
    display: none;
    margin: 0.15rem 0 0.5rem;
    padding: 0;
    list-style: none;
    border-left: 2px solid color-mix(in srgb, var(--bs-primary) 25%, transparent);
    margin-left: -0.75rem;
}

.rail-link.is-active + .rail-subs {
    display: block;
}

.rail-sub {
    display: block;
    padding: 0.2rem 0.75rem 0.2rem 1.9rem;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    text-decoration: none;
}

.rail-sub:hover,
.rail-sub.is-active {
    color: var(--bs-primary);
}

.rail-toggle {
    display: none;
}

.doc-main {
    padding: 2.5rem 0 4rem;
    min-width: 0;
}

/* --- Document body --- */

.doc-body {
    max-width: 48rem;
    font-size: 1.02rem;
    line-height: 1.78;
}

.doc-section {
    scroll-margin-top: calc(var(--wp-header-height) + 1.5rem);
    padding-top: 1rem;
}

.doc-section + .doc-section {
    margin-top: 3.5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--bs-border-color);
}

.doc-body h2 {
    font-weight: 700;
    font-size: clamp(1.55rem, 2.6vw, 2rem);
    margin: 0 0 1.25rem;
}

.doc-body h3 {
    font-weight: 600;
    font-size: 1.18rem;
    margin: 2.25rem 0 0.75rem;
    scroll-margin-top: calc(var(--wp-header-height) + 1.5rem);
}

.doc-body h4 {
    font-weight: 600;
    font-size: 1.02rem;
    margin: 1.75rem 0 0.6rem;
}

.section-num {
    display: block;
    font-family: var(--wp-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bs-primary);
    margin-bottom: 0.5rem;
}

.head-anchor {
    margin-left: 0.4rem;
    font-family: var(--wp-mono);
    font-size: 0.7em;
    font-weight: 400;
    color: var(--bs-tertiary-color);
    text-decoration: none;
    border: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

h2:hover .head-anchor,
h3:hover .head-anchor,
.head-anchor:focus-visible {
    opacity: 1;
}

.doc-body p {
    margin-bottom: 1.15rem;
}

.doc-body ul,
.doc-body ol {
    margin-bottom: 1.15rem;
    padding-left: 1.25rem;
}

.doc-body li {
    margin-bottom: 0.45rem;
}

.doc-body a {
    color: var(--bs-primary);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--bs-primary) 35%, transparent);
}

.doc-body a:hover {
    border-bottom-color: var(--bs-primary);
}

.doc-body strong {
    font-weight: 600;
    color: var(--bs-emphasis-color);
}

.doc-body code {
    font-family: var(--wp-mono);
    font-size: 0.88em;
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
    color: var(--bs-emphasis-color);
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    overflow-wrap: anywhere;
}

.doc-body pre {
    position: relative;
    margin-bottom: 1.75rem;
    padding: 1.1rem 1.25rem;
    border-radius: 0.8rem;
    overflow-x: auto;
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
}

.doc-body pre code {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 0.86rem;
    line-height: 1.65;
    color: var(--bs-body-color);
    overflow-wrap: normal;
}

.copy-button {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.doc-body pre:hover .copy-button,
.copy-button:focus-visible {
    opacity: 1;
}

.copy-button:hover {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.copy-button.is-copied {
    color: var(--bs-success);
    border-color: var(--bs-success);
    opacity: 1;
}

.table-scroll {
    margin-bottom: 1.75rem;
    overflow-x: auto;
}

.doc-body table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.doc-body th,
.doc-body td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--bs-border-color);
    white-space: nowrap;
}

.doc-body td.wrap,
.doc-body th.wrap {
    white-space: normal;
    min-width: 14rem;
}

.doc-body th {
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.74rem;
}

.doc-body td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.doc-body th.num {
    text-align: right;
}

.doc-body tbody tr:hover {
    background-color: color-mix(in srgb, var(--bs-primary) 5%, transparent);
}

.doc-body blockquote {
    margin: 0 0 1.5rem;
    padding: 0.85rem 1.15rem;
    border-radius: 0.7rem;
    border-left: 3px solid var(--bs-primary);
    background-color: color-mix(in srgb, var(--bs-primary) 7%, transparent);
    color: var(--bs-secondary-color);
}

.doc-body blockquote p:last-child {
    margin-bottom: 0;
}

/* --- Callouts --- */

.callout {
    display: flex;
    gap: 1rem;
    margin: 0 0 1.75rem;
    padding: 1.15rem 1.35rem;
    border-radius: 0.9rem;
    border: 1px solid var(--bs-border-color);
    border-left: 3px solid var(--bs-primary);
    background-color: color-mix(in srgb, var(--bs-primary) 6%, transparent);
}

.callout-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    font-size: 1.05rem;
    color: var(--bs-primary);
    background-color: color-mix(in srgb, var(--bs-primary) 14%, transparent);
}

.callout-body {
    min-width: 0;
}

.callout-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.callout p:last-child {
    margin-bottom: 0;
}

.callout-warning {
    border-left-color: var(--bs-warning);
    background-color: color-mix(in srgb, var(--bs-warning) 7%, transparent);
}

.callout-warning .callout-icon {
    color: var(--bs-warning);
    background-color: color-mix(in srgb, var(--bs-warning) 14%, transparent);
}

.callout-danger {
    border-left-color: var(--bs-danger);
    background-color: color-mix(in srgb, var(--bs-danger) 6%, transparent);
}

.callout-danger .callout-icon {
    color: var(--bs-danger);
    background-color: color-mix(in srgb, var(--bs-danger) 14%, transparent);
}

.pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bs-warning);
    background-color: color-mix(in srgb, var(--bs-warning) 14%, transparent);
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* --- Stats and figures --- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1px;
    margin: 0 0 1.75rem;
    background-color: var(--bs-border-color);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    overflow: hidden;
}

.stat-tile {
    padding: 1.15rem 1.25rem;
    background-color: var(--bs-body-bg);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.35rem;
}

.stat-value {
    display: block;
    font-family: var(--wp-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.stat-note {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
}

.alloc-list {
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    overflow: hidden;
}

.alloc-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: baseline;
    gap: 0.75rem;
    margin: 0;
    padding: 0.85rem 1.15rem;
    background-color: var(--bs-body-bg);
}

.alloc-item + .alloc-item {
    border-top: 1px solid var(--bs-border-color);
}

.alloc-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--alloc-width, 0%);
    background-color: color-mix(in srgb, var(--bs-primary) 13%, transparent);
    pointer-events: none;
}

.alloc-item > * {
    position: relative;
}

.alloc-name {
    font-weight: 500;
    min-width: 0;
}

.alloc-share {
    font-family: var(--wp-display);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.alloc-amount {
    font-family: var(--wp-mono);
    font-size: 0.82rem;
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
    min-width: 5.5rem;
    text-align: right;
}

@media (max-width: 575.98px) {
    .alloc-item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .alloc-amount {
        grid-column: 2;
        text-align: right;
    }
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    margin: 0 0 1.75rem;
}

.link-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    height: 100%;
    padding: 1.15rem 1.25rem;
    border-radius: 0.9rem;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover {
    transform: translateY(-2px);
    color: var(--bs-body-color);
    border-color: color-mix(in srgb, var(--bs-primary) 45%, var(--bs-border-color));
    box-shadow: 0 12px 30px -20px color-mix(in srgb, var(--bs-primary) 55%, #000);
}

.link-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.link-card-title i {
    color: var(--bs-primary);
}

.link-card-url {
    font-family: var(--wp-mono);
    font-size: 0.8rem;
    color: var(--bs-primary);
    overflow-wrap: anywhere;
}

.link-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

.glossary {
    margin: 0 0 1.75rem;
}

.glossary dt {
    font-weight: 600;
    color: var(--bs-emphasis-color);
}

.glossary dd {
    margin: 0 0 1rem;
    color: var(--bs-secondary-color);
}

.doc-foot-note {
    max-width: 48rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--bs-border-color);
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

/* --- Responsive --- */

@media (max-width: 1199.98px) {
    .doc-shell {
        gap: 2.5rem;
    }
}

@media (max-width: 991.98px) {
    .doc-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .doc-rail {
        position: static;
        display: none;
        max-height: none;
        padding: 1.5rem 0 0;
    }

    .doc-rail.is-open {
        display: block;
    }

    .rail-toggle {
        display: inline-flex;
        margin-top: 1.5rem;
    }

    .doc-main {
        padding-top: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .link-card,
    .copy-button,
    .head-anchor,
    .skip-link,
    .read-progress {
        transition: none;
    }
}

/* --- Print --- */

@page {
    margin: 18mm 15mm;
}

@media print {
    .doc-header,
    .doc-rail,
    .rail-toggle,
    .lightDarkSwitch,
    .skip-link,
    .copy-button,
    footer,
    .hero-actions {
        display: none !important;
    }

    .hero {
        color: #000;
        background: none;
        padding: 0 0 1.5rem;
    }

    .hero-lead,
    .hero-eyebrow,
    .hero-fact-label,
    .hero-fact-value small {
        color: #444 !important;
    }

    .hero-facts {
        border-color: #ccc;
        background-color: #fff;
    }

    .hero-fact {
        background-color: #fff;
        border: 1px solid #eee;
    }

    .doc-shell {
        display: block;
    }

    .doc-body {
        max-width: none;
        font-size: 10pt;
        line-height: 1.5;
    }

    .doc-body p,
    .doc-body ul,
    .doc-body ol {
        margin-bottom: 0.6rem;
    }

    .doc-body h2 {
        font-size: 15pt;
        margin-bottom: 0.6rem;
    }

    .doc-body h3 {
        font-size: 11.5pt;
        margin: 1rem 0 0.4rem;
    }

    .callout,
    .stat-grid,
    .alloc-list,
    .table-scroll,
    .link-grid {
        margin-bottom: 0.9rem;
    }

    .link-card {
        break-inside: avoid;
    }

    .doc-body pre {
        margin-bottom: 0.9rem;
        padding: 0.6rem 0.8rem;
    }

    .doc-section + .doc-section {
        border-top: 0;
        margin-top: 1.5rem;
        padding-top: 0;
    }

    .doc-section {
        page-break-inside: auto;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }

    table,
    figure,
    .callout,
    .stat-grid,
    .alloc-list {
        page-break-inside: avoid;
    }

    .table-scroll {
        overflow: visible;
    }

    a {
        border-bottom: 0 !important;
    }
}

/* The whitepaper runs edge to edge in a container-fluid, so the shared footer drops the
   centred container widths and follows the page padding instead. */
.l2p-footer-inner {
    max-width: none;
    padding-inline: 1rem;
}

@media (min-width: 992px) {
    .l2p-footer-inner {
        padding-inline: 1.5rem;
    }
}
