.frame {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    min-height: 100vh;
}

.rail {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100vh;
    padding: 1.75rem 1.25rem;
    overflow-y: auto;
    background: var(--paper);
    color: var(--ink);
    border-right: 1px solid var(--ink);
}

.rail-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--ink);
    font-family: var(--head);
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.wordmark:hover {
    color: var(--ink);
}

.wm-word {
    display: inline-flex;
    align-items: center;
}

.wm-o {
    position: relative;
    display: inline-block;
    width: 0.74em;
    height: 0.74em;
    margin: 0 0.05em;
    border: 0.15em solid currentColor;
    border-radius: 50%;
}

.wm-o::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.13em;
    height: 1em;
    background: var(--accent);
    border-radius: 0.1em;
    transform: translate(-50%, -50%) rotate(24deg);
}

.wm-tag {
    padding: 0.28em 0.42em 0.24em;
    font-size: 0.6em;
    letter-spacing: 0.06em;
    color: var(--white);
    background: var(--accent);
    border-radius: 0 0.55em 0 0.55em;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.7rem;
    font-family: var(--head);
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid var(--ink);
    border-radius: 999px;
}

.lang-switch a {
    padding: 0.1rem 0.15rem;
    color: var(--ink-soft);
    text-decoration: none;
}

.lang-switch a:hover {
    color: var(--accent);
}

.lang-switch a[aria-current=true] {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.lang-dot {
    color: var(--ink-soft);
}

.rail-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--ink);
    border-radius: 0.7rem 0 0.7rem 0;
    cursor: pointer;
}

.rail-bars,
.rail-bars::before,
.rail-bars::after {
    display: block;
    width: 1.2rem;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.rail-bars {
    position: relative;
}

.rail-bars::before,
.rail-bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.rail-bars::before {
    top: -0.4rem;
}

.rail-bars::after {
    top: 0.4rem;
}

.rail.is-open .rail-bars {
    background: transparent;
}

.rail.is-open .rail-bars::before {
    transform: translateY(0.4rem) rotate(45deg);
}

.rail.is-open .rail-bars::after {
    transform: translateY(-0.4rem) rotate(-45deg);
}

.rail-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--ink);
}

.rail-list li {
    border-bottom: 1px solid var(--ink);
}

.rail-list a {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    padding: 0.8rem 0.5rem;
    color: var(--ink);
    font-family: var(--head);
    font-weight: 700;
    text-decoration: none;
}

.rail-list a:hover {
    color: var(--ink);
    background: var(--paper-2);
}

.rail-num {
    font-size: 0.78rem;
    color: var(--base-deep);
}

.rail-list a[aria-current=page] {
    color: var(--paper);
    background: var(--ink);
}

.rail-list a[aria-current=page] .rail-num {
    color: var(--accent-light);
}

.rail-note {
    margin: auto 0 0;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.stage {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stage-inner {
    display: grid;
    gap: clamp(1rem, 2.4vw, 1.75rem);
    padding: clamp(0.9rem, 3vw, 2.5rem);
}

.stage-inner:focus {
    outline: none;
}

.slab {
    position: relative;
    padding: clamp(1.25rem, 3.6vw, 2.75rem);
    overflow: hidden;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--ink);
}

.slab--notch {
    border-radius: 0 2.75rem 0 0;
}

.slab--leaf {
    border-radius: 2.75rem 0 2.75rem 0;
}

.slab--tint {
    background: var(--paper-2);
}

.slab--dark {
    color: var(--paper);
    background: var(--ink);
}

.slab--dark h2,
.slab--dark h3 {
    color: var(--paper);
}

.slab--dark a {
    color: var(--accent-light);
}

.slab--dark .btn,
.slab--dark .btn--solid {
    color: var(--ink);
    background: var(--paper);
    border-color: var(--paper);
}

.slab--dark .btn:hover {
    color: var(--white);
    background: var(--accent);
    border-color: var(--accent);
}

.slab--dark .person-role {
    color: var(--accent-light);
}

.slab--dark .person-mark {
    color: var(--white);
    background: var(--accent);
}

.slab--accent {
    color: var(--white);
    background: var(--accent);
}

.slab--accent h2,
.slab--accent a {
    color: var(--white);
}

.ghost::before {
    content: attr(data-ghost);
    position: absolute;
    right: -0.04em;
    bottom: -0.24em;
    z-index: 0;
    font-family: var(--head);
    font-size: clamp(8rem, 26vw, 21rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--ghost);
    pointer-events: none;
    user-select: none;
}

.slab--dark.ghost::before {
    color: hsla(24, 47%, 96%, 0.07);
}

.slab--accent.ghost::before {
    color: hsla(0, 0%, 100%, 0.12);
}

.ghost > * {
    position: relative;
    z-index: 1;
}

.tag {
    display: inline-block;
    margin-bottom: 1.1rem;
    padding-bottom: 0.2rem;
    font-family: var(--head);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--base-deep);
    border-bottom: 1px solid currentColor;
}

.slab--dark .tag {
    color: var(--accent-light);
}

.slab--accent .tag {
    color: var(--white);
}

.lead {
    max-width: 38rem;
    font-size: clamp(1.08rem, 1.8vw, 1.22rem);
}

.hero-grid,
.split {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(1.25rem, 3.5vw, 3rem);
    align-items: center;
}

.split--top {
    align-items: start;
}

.hero-figure {
    padding: 1.25rem 1rem 0;
    background: var(--paper-2);
    border: 1px solid var(--ink);
    border-radius: 12rem 12rem 0 0;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.65rem 1.35rem;
    font-family: var(--head);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
    text-decoration: none;
    background: var(--paper);
    border: 1px solid var(--ink);
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    color: var(--ink);
    background: var(--paper-2);
}

.btn--solid {
    color: var(--paper);
    background: var(--ink);
}

.btn--solid:hover {
    color: var(--white);
    background: var(--accent);
    border-color: var(--accent);
}

.slab--accent .btn {
    color: var(--ink);
    background: var(--paper);
    border-color: var(--paper);
}

.slab--accent .btn:hover {
    color: var(--ink);
    background: var(--white);
}

.slab--accent .btn--line {
    color: var(--white);
    background: transparent;
    border-color: var(--white);
}

.slab--accent .btn--line:hover {
    color: var(--accent);
    background: var(--white);
}

.cells {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--ink);
    border-left: 1px solid var(--ink);
}

.cell {
    padding: 1.5rem 1.35rem;
    color: var(--ink);
    background: var(--paper);
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}

.cell:nth-child(2) {
    background: var(--paper-2);
}

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

.cell-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.paper-card {
    max-width: 30rem;
    margin-top: 1.75rem;
    padding: 1.25rem 1.5rem;
    font-family: var(--head);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink);
    background: var(--paper);
    border-left: 0.4rem solid var(--accent);
    border-radius: 0 1.5rem 1.5rem 0;
}

.ledger {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--ink);
}

.ledger li {
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1.35rem 0;
    border-bottom: 1px solid var(--ink);
}

.ledger h3 {
    margin-bottom: 0.35em;
}

.ledger p {
    margin: 0;
}

.ledger-num {
    font-family: var(--head);
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;
    color: var(--accent);
}

.steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps li {
    position: relative;
    padding: 0.75rem 0 0.75rem 3rem;
    border-bottom: 1px solid currentColor;
    counter-increment: step;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.7rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    font-family: var(--head);
    font-weight: 800;
    color: var(--white);
    background: var(--accent);
    border-radius: 50% 50% 50% 0;
}

.photo {
    overflow: hidden;
    background: var(--paper-2);
    border: 1px solid var(--ink);
    border-radius: 0 0 3rem 0;
}

.photo img {
    width: 100%;
    object-fit: cover;
}

.photo--wide img {
    aspect-ratio: 3 / 2;
}

.photo--tall img {
    aspect-ratio: 3 / 4;
}

.photo figcaption {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--ink-soft);
    border-top: 1px solid var(--ink);
}

.person {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
}

.person-mark {
    display: grid;
    place-items: center;
    width: 5.5rem;
    height: 5.5rem;
    font-family: var(--head);
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--paper);
    background: var(--ink);
    border-radius: 50% 50% 0 50%;
}

.person-role {
    margin-bottom: 0.6rem;
    font-family: var(--head);
    font-weight: 700;
    color: var(--accent);
}

.phone-big {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-family: var(--head);
    font-size: clamp(1.6rem, 5vw, 2.3rem);
    font-weight: 900;
    letter-spacing: 0.02em;
}

.ticks {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ticks li {
    position: relative;
    padding: 0.45rem 0 0.45rem 1.6rem;
    border-bottom: 1px solid var(--ink);
}

.ticks li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 1rem;
    width: 0.6rem;
    height: 0.6rem;
    background: var(--accent);
    border-radius: 0 50% 50% 50%;
}

.pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: clamp(1rem, 2.4vw, 1.75rem);
}

.pair > .slab {
    height: 100%;
}

.prose > * {
    max-width: 46rem;
}

.prose h2 {
    margin-top: 2rem;
    padding-top: 1.1rem;
    font-size: 1.35rem;
    border-top: 1px solid var(--ink);
}

.prose h2:first-child {
    margin-top: 0;
}

.facts {
    display: grid;
    grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr);
    max-width: 46rem;
    margin: 0;
    border-top: 1px solid var(--ink);
}

.facts dt,
.facts dd {
    margin: 0;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--ink);
}

.facts dt {
    padding-right: 1rem;
    font-family: var(--head);
    font-weight: 700;
}

.foot {
    margin-top: auto;
    padding: 1.5rem clamp(0.9rem, 3vw, 2.5rem) 1.25rem;
    font-size: 0.93rem;
    color: var(--ink);
    background: var(--paper);
    border-top: 1px solid var(--ink);
}

.foot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem 2rem;
}

.foot-grid p {
    margin: 0 0 0.3rem;
}

.foot-name {
    font-family: var(--head);
    font-weight: 900;
    letter-spacing: 0.03em;
}

.foot-label {
    color: var(--ink-soft);
}

.foot-base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.6rem 1.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid hsla(24, 30%, 8%, 0.3);
}

.foot-base p {
    margin: 0;
}

.foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.foot-links a {
    color: var(--ink);
}

.foot-links a:hover,
.foot-links a[aria-current=page] {
    color: var(--accent);
}

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

    .rail {
        z-index: 20;
        gap: 0;
        height: auto;
        padding: 0.7rem 1rem;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--ink);
    }

    .rail-top {
        flex-direction: row;
        align-items: center;
        gap: 0.6rem;
    }

    .wordmark {
        margin-right: auto;
        font-size: 1.3rem;
    }

    .rail-toggle {
        display: inline-flex;
    }

    .js .rail-nav {
        display: none;
    }

    .rail-nav {
        margin-top: 0.75rem;
    }

    .js .rail.is-open .rail-nav {
        display: block;
    }

    .rail-note {
        display: none;
    }

    .hero-grid,
    .split {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-figure {
        max-width: 22rem;
    }
}

@media (max-width: 520px) {
    .ledger li {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.4rem;
    }

    .facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .facts dt {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .person {
        grid-template-columns: minmax(0, 1fr);
    }

    .btn {
        width: 100%;
    }

    .slab--notch {
        border-radius: 0 1.75rem 0 0;
    }

    .slab--leaf {
        border-radius: 1.75rem 0 1.75rem 0;
    }
}

@media (max-width: 380px) {
    .wordmark {
        font-size: 1.15rem;
    }

    .lang-switch {
        padding: 0.2rem 0.5rem;
    }
}
