:root {
    --ink: #142b2b;
    --ink-soft: #294242;
    --paper: #f3efe5;
    --paper-bright: #fbfaf6;
    --acid: #d8ff62;
    --orange: #ef744b;
    --blue: #b9d9f0;
    --line: rgba(20, 43, 43, 0.2);
    --muted: #65706c;
    --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    --sans: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

body.dialog-open {
    overflow: hidden;
}

/* Keep the first impression as a contained search instrument. */
body.landing-lock {
    height: 100dvh;
    overflow: hidden;
}

body.landing-lock main > :not(.hero):not(.search-stage),
body.landing-lock footer {
    display: none;
}

body.landing-lock .hero {
    min-height: 310px;
    height: 38dvh;
    padding-top: 48px;
    padding-bottom: 72px;
}

body.landing-lock .search-stage {
    height: 62dvh;
    min-height: 0;
    padding-bottom: 18px;
    overflow: hidden;
}

body.landing-lock .search-panel {
    margin-top: -34px;
    padding: 28px clamp(24px, 4vw, 52px) 24px;
}

body.landing-lock .search-heading {
    margin-bottom: 20px;
}

body.landing-lock .popular-searches {
    padding-top: 16px;
}

body.landing-lock .results,
body.landing-lock .search-welcome {
    max-height: calc(62dvh - 300px);
    overflow-y: auto;
    scrollbar-color: var(--orange) transparent;
}

body.landing-lock .search-status {
    margin-top: 16px;
}

body.landing-lock .load-more-wrap {
    padding-bottom: 8px;
}

.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;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--acid);
    color: var(--ink);
    transform: translateY(-150%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    min-height: 88px;
    padding: 0 clamp(24px, 5vw, 76px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ink);
    color: var(--paper-bright);
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
    position: relative;
    z-index: 5;
}

.brand {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border: 1px solid currentColor;
    display: grid;
    place-items: center;
    transform: rotate(-4deg);
}

.brand-mark b {
    font: 700 16px/1 var(--mono);
    transform: rotate(4deg);
}

.brand-name {
    font: 700 18px/1 var(--sans);
    letter-spacing: -0.04em;
}

.brand-name i {
    font-family: var(--serif);
    font-weight: 400;
}

.site-header nav,
footer nav {
    display: flex;
    align-items: center;
    gap: clamp(18px, 3vw, 42px);
}

.site-header nav a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    transition: color 160ms ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
    color: #fff;
}

.site-header nav .api-link {
    border: 1px solid rgba(255, 255, 255, 0.36);
    color: #fff;
    padding: 10px 14px;
}

.hero {
    min-height: 530px;
    padding: 88px clamp(24px, 7vw, 108px) 104px;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 70px;
    align-items: end;
    color: var(--paper-bright);
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        var(--ink);
    background-size: 54px 54px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 65% 30%, rgba(216, 255, 98, 0.09), transparent 36%);
}

.hero-copy,
.hero-aside {
    position: relative;
    z-index: 2;
}

.eyebrow {
    margin: 0 0 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 11px;
    font-weight: 700;
}

.eyebrow span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--acid);
}

.eyebrow.dark span {
    background: var(--orange);
}

.hero h1 {
    max-width: 920px;
    margin: 0;
    font: 400 clamp(58px, 7.3vw, 112px)/0.88 var(--serif);
    letter-spacing: -0.065em;
}

.hero h1 em,
.dataset-copy h2 em {
    color: var(--acid);
    font-weight: 400;
}

.hero-deck {
    max-width: 690px;
    margin: 35px 0 0;
    color: rgba(255, 255, 255, 0.66);
    font: 400 clamp(17px, 1.5vw, 21px)/1.52 var(--sans);
}

.hero-aside {
    padding: 0 0 7px 28px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.corpus-number {
    position: relative;
    margin-bottom: 35px;
}

.corpus-number strong {
    display: block;
    font: 400 58px/1 var(--serif);
    letter-spacing: -0.06em;
}

.corpus-number > span:last-child {
    display: block;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.56);
    font-size: 12px;
}

.live-pulse {
    width: 8px;
    height: 8px;
    position: absolute;
    top: 4px;
    right: 0;
    border-radius: 50%;
    background: var(--acid);
    box-shadow: 0 0 0 5px rgba(216, 255, 98, 0.12);
}

.hero-aside dl {
    margin: 0;
}

.hero-aside dl div {
    padding: 11px 0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11px;
}

.hero-aside dt {
    color: rgba(255, 255, 255, 0.45);
}

.hero-aside dd {
    margin: 0;
    font-weight: 650;
}

.hero-orbit {
    position: absolute;
    border: 1px solid rgba(216, 255, 98, 0.17);
    border-radius: 50%;
    pointer-events: none;
}

.orbit-one {
    width: 570px;
    height: 570px;
    top: -365px;
    right: 16%;
}

.orbit-two {
    width: 260px;
    height: 260px;
    bottom: -190px;
    left: 47%;
}

.search-stage {
    padding: 0 clamp(24px, 7vw, 108px) 110px;
    background: var(--paper);
}

.search-panel {
    position: relative;
    z-index: 3;
    margin-top: -52px;
    padding: clamp(30px, 4.3vw, 62px);
    background: var(--paper-bright);
    box-shadow: 0 24px 70px rgba(20, 43, 43, 0.12);
    border-top: 5px solid var(--acid);
}

.search-heading {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
}

.section-number {
    flex: none;
    margin: 4px 0 0;
    font: 600 11px/1 var(--mono);
    color: var(--orange);
}

.section-number.light {
    color: var(--acid);
}

.search-heading h2,
.citation-intro h2 {
    margin: 0;
    font: 400 clamp(29px, 3vw, 43px)/1 var(--serif);
    letter-spacing: -0.035em;
}

.search-heading p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.search-input-wrap {
    min-height: 76px;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 9px 10px 9px 25px;
    border: 1px solid var(--ink);
    background: #fff;
    transition: box-shadow 160ms ease, border-color 160ms ease;
}

.search-input-wrap:focus-within {
    box-shadow: 0 0 0 4px rgba(216, 255, 98, 0.6);
}

.search-input-wrap > svg {
    width: 23px;
    stroke: var(--ink);
    stroke-width: 1.7;
    fill: none;
}

.search-input-wrap input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: 400 clamp(19px, 2.1vw, 28px)/1 var(--serif);
}

.search-input-wrap input::placeholder {
    color: #a2a49e;
}

.search-input-wrap button,
.primary-action {
    min-height: 56px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 0 24px;
    border: 0;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}

.search-input-wrap button:hover,
.search-input-wrap button:focus-visible,
.primary-action:hover,
.primary-action:focus-visible {
    background: #214141;
    transform: translateY(-1px);
}

.search-input-wrap button svg,
.primary-action svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.search-input-wrap button[disabled] {
    cursor: wait;
    opacity: 0.72;
}

.search-tools {
    padding: 16px 1px 0;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.year-fields {
    display: flex;
    align-items: end;
    gap: 11px;
}

.year-fields label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font: 600 9px/1 var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.year-fields select {
    width: 118px;
    padding: 7px 24px 7px 0;
    color: var(--ink);
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    outline: 0;
    background: transparent;
    font-size: 12px;
}

.year-fields > span {
    padding-bottom: 7px;
    color: #a3a8a2;
}

.search-hint {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11px;
}

.popular-searches {
    padding-top: 26px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.popular-searches > span {
    margin-right: 5px;
    color: var(--muted);
    font: 600 9px/1 var(--sans);
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.popular-searches button {
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 30px;
    color: var(--ink-soft);
    background: transparent;
    font-size: 11px;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.popular-searches button:hover,
.popular-searches button:focus-visible {
    color: #fff;
    background: var(--ink);
}

.citation-callout {
    margin-top: 25px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(239, 116, 75, .45);
    background: rgba(239, 116, 75, .08);
}

.citation-callout-mark {
    color: var(--orange);
    font-size: 18px;
}

.citation-callout p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.45;
}

.citation-callout strong {
    color: var(--ink);
}

.citation-callout a {
    color: var(--ink);
    font-size: 10px;
    font-weight: 750;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.search-status {
    max-width: 990px;
    margin: 40px auto 0;
}

.search-status:not(:empty) {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.search-status strong {
    color: var(--ink);
}

.results {
    max-width: 990px;
    margin: 0 auto;
}

.result-card {
    padding: 30px 0 27px;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 25px;
    border-bottom: 1px solid var(--line);
    animation: result-in 260ms ease both;
}

@keyframes result-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

.match-score {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    position: relative;
    border-radius: 50%;
    background: conic-gradient(var(--orange) var(--score), rgba(20, 43, 43, 0.1) 0);
}

.match-score::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--paper);
}

.match-score span {
    position: relative;
    z-index: 1;
    font: 700 11px/1 var(--mono);
}

.result-main h3 {
    margin: 0;
    font: 400 clamp(21px, 2.2vw, 29px)/1.13 var(--serif);
    letter-spacing: -0.025em;
}

.result-title-button {
    max-width: 100%;
    padding: 0;
    color: inherit;
    border: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease;
}

.result-title-button:hover,
.result-title-button:focus-visible {
    color: #315f68;
    border-bottom-color: var(--orange);
    outline: 0;
}

.result-company {
    margin: 8px 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.result-meta span {
    padding: 5px 8px;
    background: rgba(20, 43, 43, 0.055);
    color: var(--ink-soft);
    font: 600 9px/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.result-meta .source-badge {
    background: rgba(216, 255, 98, 0.56);
}

.result-actions {
    min-width: 128px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
}

.result-actions a,
.result-actions button {
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: transparent;
    cursor: pointer;
}

.result-actions a:hover,
.result-actions a:focus-visible,
.result-actions button:hover,
.result-actions button:focus-visible {
    border-color: var(--orange);
}

.result-actions .inspect-contract {
    padding: 9px 12px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    transition: background 150ms ease;
}

.result-actions .inspect-contract:hover,
.result-actions .inspect-contract:focus-visible {
    color: var(--ink);
    background: var(--acid);
    border-color: var(--ink);
}

.load-more-wrap {
    text-align: center;
}

.load-more {
    margin-top: 35px;
    padding: 13px 22px;
    color: var(--ink);
    border: 1px solid var(--ink);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.search-welcome {
    padding: 82px 0 0;
    text-align: center;
}

.welcome-rule {
    position: relative;
    height: 54px;
}

.welcome-rule::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    height: 54px;
    border-left: 1px solid var(--line);
}

.welcome-rule span {
    width: 7px;
    height: 7px;
    position: absolute;
    left: calc(50% - 3px);
    top: 0;
    border-radius: 50%;
    background: var(--orange);
}

.search-welcome > p {
    margin: 20px 0 24px;
    font: italic 400 24px/1.2 var(--serif);
}

.contract-types {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px 34px;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.about-section {
    padding: 100px clamp(24px, 7vw, 108px) 112px;
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) 230px;
    gap: 7vw;
    color: #fff;
    background: var(--ink);
}

.section-label span {
    display: block;
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.about-main h2,
.dataset-copy h2 {
    margin: 0;
    font: 400 clamp(45px, 5.6vw, 78px)/0.96 var(--serif);
    letter-spacing: -0.055em;
}

.about-lede {
    max-width: 850px;
    margin: 38px 0;
    color: rgba(255, 255, 255, 0.82);
    font: 400 clamp(18px, 1.7vw, 23px)/1.5 var(--sans);
}

.about-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.about-columns p {
    margin: 0;
    color: rgba(255, 255, 255, 0.57);
    font-size: 13px;
    line-height: 1.75;
}

.about-note {
    align-self: end;
    padding: 22px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.24);
    border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.about-note span {
    color: var(--acid);
    font: 700 9px/1 var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.about-note p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.62);
    font: italic 400 14px/1.55 var(--serif);
}

.dataset-section {
    padding: 110px clamp(24px, 7vw, 108px);
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(440px, 1.1fr);
    align-items: center;
    gap: clamp(50px, 8vw, 130px);
    background: var(--blue);
}

.dataset-copy .eyebrow {
    margin-top: 28px;
}

.dataset-copy h2 em {
    color: #315f68;
}

.dataset-copy > p:not(.section-number, .eyebrow) {
    max-width: 560px;
    margin: 28px 0;
    color: #426163;
    font-size: 15px;
    line-height: 1.65;
}

.dataset-actions {
    margin-top: 34px;
    display: flex;
    align-items: center;
    gap: 26px;
}

.primary-action {
    min-height: 56px;
    text-decoration: none;
}

.text-action {
    font-size: 12px;
    font-weight: 700;
    text-underline-offset: 4px;
}

.download-card {
    box-shadow: 18px 22px 0 rgba(20, 43, 43, 0.11);
}

.terminal-top {
    height: 48px;
    padding: 0 19px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.55);
    background: #203535;
}

.terminal-top > span {
    width: 7px;
    height: 7px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
}

.terminal-top p {
    margin: 0 auto;
    padding-right: 35px;
    font: 10px/1 var(--mono);
}

.terminal-body {
    min-height: 240px;
    padding: 30px;
    position: relative;
    color: #eef1e9;
    background: var(--ink);
}

.terminal-comment {
    margin: 0 0 9px;
    color: #718888;
    font: 11px/1.4 var(--mono);
}

.terminal-body code {
    margin: 0 0 27px;
    display: block;
    overflow-wrap: anywhere;
    color: #eef1e9;
    font: 11px/1.6 var(--mono);
}

.terminal-body .prompt {
    color: var(--acid);
}

.copy-command {
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d7e0d9;
    border: 1px solid rgba(255, 255, 255, 0.23);
    background: transparent;
    font: 10px/1 var(--mono);
    cursor: pointer;
}

.copy-command svg,
.citation-meta button svg {
    width: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.download-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--paper-bright);
}

.download-facts div {
    padding: 20px 24px;
}

.download-facts div + div {
    border-left: 1px solid var(--line);
}

.download-facts strong,
.download-facts span {
    display: block;
}

.download-facts strong {
    font: 400 21px/1.1 var(--serif);
}

.download-facts span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.citation-section {
    padding: 110px clamp(24px, 7vw, 108px);
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: clamp(50px, 9vw, 140px);
    background: var(--paper-bright);
}

.citation-section::before {
    content: "CITE THE STUDY THAT BUILT THIS ARCHIVE";
    grid-column: 1 / -1;
    color: var(--orange);
    font: 700 10px/1 var(--mono);
    letter-spacing: .14em;
}

.citation-intro p:last-child {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.citation-intro h2 {
    margin-top: 18px;
}

.citation-card {
    position: relative;
    padding-top: 15px;
}

.quote-mark {
    position: absolute;
    top: -17px;
    left: -46px;
    color: var(--orange);
    font: 400 66px/1 var(--serif);
}

.citation-text {
    max-width: 910px;
    margin: 0 0 40px;
    font: 400 clamp(25px, 3.2vw, 45px)/1.28 var(--serif);
    letter-spacing: -0.035em;
}

.citation-meta {
    padding-top: 17px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
}

.citation-meta > span {
    color: var(--muted);
    font: 600 9px/1 var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.citation-meta > div {
    display: flex;
    align-items: center;
    gap: 20px;
}

.citation-meta button,
.citation-meta a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    border: 0;
    background: transparent;
    font-size: 10px;
    font-weight: 700;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* ---------- Selected contract ---------- */

.contract-dialog {
    width: min(1120px, calc(100vw - 40px));
    max-width: none;
    max-height: calc(100dvh - 40px);
    margin: auto;
    padding: 0;
    border: 0;
    color: var(--ink);
    background: transparent;
    overflow: visible;
}

.contract-dialog::backdrop {
    background: rgba(7, 25, 25, 0.78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.contract-sheet {
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(rgba(20, 43, 43, 0.025) 1px, transparent 1px),
        var(--paper-bright);
    background-size: 100% 38px;
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.32);
    border-top: 5px solid var(--acid);
}

.contract-sheet-header {
    min-height: 76px;
    padding: 0 28px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #fff;
    background: var(--ink);
}

.contract-sheet-header p,
.contract-sheet-header span {
    margin: 0;
}

.contract-sheet-header p {
    font: 700 10px/1 var(--sans);
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.contract-sheet-header > div > span {
    margin-top: 7px;
    display: block;
    color: rgba(255, 255, 255, 0.52);
    font: 10px/1 var(--mono);
}

.dialog-close {
    width: 42px;
    height: 42px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    cursor: pointer;
}

.dialog-close span {
    width: 17px;
    height: 1px;
    position: absolute;
    top: 20px;
    left: 12px;
    background: #fff;
}

.dialog-close span:first-child {
    transform: rotate(45deg);
}

.dialog-close span:last-child {
    transform: rotate(-45deg);
}

.dialog-close:hover,
.dialog-close:focus-visible {
    border-color: var(--acid);
    outline: 0;
}

.contract-sheet-body {
    min-height: 0;
    padding: clamp(38px, 5vw, 70px);
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr) 210px;
    gap: clamp(28px, 5vw, 70px);
    overflow-y: auto;
}

.contract-sheet-body > * {
    min-width: 0;
}

.selected-score {
    align-self: start;
    text-align: center;
}

.selected-score-ring {
    width: 88px;
    height: 88px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    position: relative;
    border-radius: 50%;
    background: conic-gradient(var(--orange) var(--score), rgba(20, 43, 43, 0.1) 0);
}

.selected-score-ring::after {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--paper-bright);
}

.selected-score-ring span {
    position: relative;
    z-index: 1;
    font: 700 15px/1 var(--mono);
}

.selected-score > p {
    margin: 10px 0 0;
    color: var(--muted);
    font: 600 8px/1 var(--sans);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.selected-eyebrow {
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font: 600 9px/1 var(--mono);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.selected-eyebrow i {
    width: 20px;
    height: 1px;
    background: var(--orange);
}

.selected-contract-main h2 {
    max-width: 700px;
    margin: 0;
    font: 400 clamp(35px, 4.2vw, 58px)/1.02 var(--serif);
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
}

.selected-company {
    margin: 15px 0 30px;
    color: var(--muted);
    font-size: 14px;
}

.selected-facts {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.selected-facts div {
    min-width: 0;
    padding: 16px 18px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.selected-facts dt {
    margin-bottom: 7px;
    color: var(--muted);
    font: 600 8px/1 var(--sans);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.selected-facts dd {
    margin: 0;
    font: 600 11px/1.35 var(--mono);
    overflow-wrap: anywhere;
}

.selected-identifier {
    margin-top: 24px;
}

.selected-identifier > span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font: 600 8px/1 var(--sans);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.selected-identifier > div {
    min-width: 0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(20, 43, 43, 0.055);
}

.selected-identifier code {
    display: block;
    min-width: 0;
    flex: 1;
    color: var(--ink-soft);
    font: 9px/1.4 var(--mono);
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-identifier button {
    width: 28px;
    height: 28px;
    flex: none;
    display: grid;
    place-items: center;
    color: var(--ink);
    border: 0;
    background: transparent;
    cursor: pointer;
}

.selected-identifier button:hover,
.selected-identifier button:focus-visible {
    color: var(--orange);
}

.selected-identifier svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.selected-note {
    align-self: end;
    padding: 19px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.selected-note span {
    color: var(--orange);
    font: 700 8px/1 var(--sans);
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.selected-note p {
    margin: 10px 0 0;
    color: var(--muted);
    font: italic 400 14px/1.5 var(--serif);
    overflow-wrap: anywhere;
}

.contract-sheet-actions {
    min-height: 82px;
    padding: 13px 28px;
    flex: none;
    display: flex;
    align-items: center;
    gap: 25px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.contract-sheet-actions a {
    color: var(--ink);
    font-size: 10px;
    font-weight: 700;
    text-underline-offset: 4px;
}

.contract-sheet-actions .selected-primary-action {
    min-height: 54px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 35px;
    color: #fff;
    background: var(--ink);
    text-decoration: none;
}

.selected-primary-action:hover,
.selected-primary-action:focus-visible {
    color: var(--ink);
    background: var(--acid);
}

.selected-primary-action svg {
    width: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

footer {
    min-height: 130px;
    padding: 35px clamp(24px, 5vw, 76px);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 30px;
    color: #fff;
    background: #0d2121;
}

footer > p {
    margin: 0;
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
}

footer > p a {
    color: rgba(255, 255, 255, 0.75);
    text-underline-offset: 3px;
}

footer nav {
    justify-self: end;
    gap: 22px;
}

footer nav a {
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
    text-decoration: none;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 20;
    padding: 13px 17px;
    color: #fff;
    background: var(--ink);
    box-shadow: 0 9px 30px rgba(20, 43, 43, 0.26);
    font-size: 11px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.error-state,
.empty-state {
    margin: 35px 0;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--line);
}

.empty-state strong,
.error-state strong {
    display: block;
    margin-bottom: 8px;
    font: 400 24px/1.2 var(--serif);
}

.empty-state p,
.error-state p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 55px;
    }

    .hero-aside {
        max-width: 470px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .corpus-number {
        margin: 0;
    }

    .about-section {
        grid-template-columns: 80px minmax(0, 1fr);
    }

    .about-note {
        grid-column: 2;
    }

    .dataset-section {
        grid-template-columns: 1fr;
    }

    .dataset-copy {
        max-width: 720px;
    }

    .citation-section {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 50px;
    }

    footer {
        grid-template-columns: 1fr 1fr;
    }

    footer > p {
        grid-row: 2;
    }
}

@media (max-width: 680px) {
    .site-header {
        min-height: 72px;
    }

    .site-header nav a:not(.api-link) {
        display: none;
    }

    .hero {
        min-height: auto;
        padding-top: 65px;
        padding-bottom: 96px;
    }

    .hero h1 {
        font-size: clamp(52px, 16vw, 74px);
    }

    .hero-aside {
        grid-template-columns: 1fr;
    }

    .search-stage {
        padding-left: 14px;
        padding-right: 14px;
        padding-bottom: 75px;
    }

    .search-panel {
        margin-top: -35px;
        padding: 25px 18px 28px;
    }

    .search-heading {
        gap: 14px;
    }

    .search-input-wrap {
        min-height: auto;
        grid-template-columns: 22px minmax(0, 1fr);
        gap: 10px;
        padding: 15px;
    }

    .search-input-wrap button {
        min-height: 48px;
        grid-column: 1 / -1;
        width: 100%;
    }

    .search-tools {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-hint {
        display: none;
    }

    .year-fields {
        width: 100%;
    }

    .year-fields label {
        flex: 1;
    }

    .year-fields select {
        width: 100%;
    }

    .popular-searches {
        align-items: flex-start;
    }

    .popular-searches > span {
        width: 100%;
        margin-bottom: 2px;
    }

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

    .citation-callout a {
        grid-column: 2;
    }

    body.landing-lock .hero {
        min-height: 255px;
        height: 31dvh;
        padding-top: 42px;
        padding-bottom: 62px;
    }

    body.landing-lock .search-stage {
        height: 69dvh;
    }

    body.landing-lock .results,
    body.landing-lock .search-welcome {
        max-height: calc(69dvh - 385px);
    }

    .result-card {
        grid-template-columns: 53px minmax(0, 1fr);
        gap: 16px;
    }

    .match-score {
        width: 50px;
        height: 50px;
    }

    .result-actions {
        grid-column: 2;
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .contract-dialog {
        width: 100vw;
        max-height: 100dvh;
        margin: 0;
    }

    .contract-sheet {
        width: 100vw;
        min-height: 100dvh;
        max-height: 100dvh;
        border-top-width: 4px;
    }

    .contract-sheet-header {
        min-height: 68px;
        padding: 0 18px;
    }

    .contract-sheet-body {
        padding: 30px 20px;
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .selected-score {
        display: flex;
        align-items: center;
        gap: 10px;
        text-align: left;
    }

    .selected-score-ring {
        width: 60px;
        height: 60px;
        margin: 0;
    }

    .selected-score-ring span {
        font-size: 11px;
    }

    .selected-score > p {
        margin: 0;
    }

    .selected-contract-main h2 {
        font-size: clamp(33px, 10vw, 47px);
    }

    .selected-note {
        margin-top: 3px;
    }

    .contract-sheet-actions {
        min-height: auto;
        padding: 14px 18px;
        flex-wrap: wrap;
        gap: 12px 20px;
    }

    .contract-sheet-actions .selected-primary-action {
        width: 100%;
        justify-content: space-between;
    }

    .about-section {
        padding-top: 75px;
        padding-bottom: 80px;
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .about-note {
        grid-column: 1;
    }

    .about-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dataset-section,
    .citation-section {
        padding-top: 75px;
        padding-bottom: 80px;
    }

    .dataset-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .download-card {
        box-shadow: 8px 10px 0 rgba(20, 43, 43, 0.11);
    }

    .terminal-body {
        padding: 24px 19px;
    }

    .citation-section {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .quote-mark {
        display: none;
    }

    .citation-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .citation-meta > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    footer {
        padding-top: 44px;
        padding-bottom: 44px;
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    footer > p {
        grid-row: auto;
    }

    footer nav {
        justify-self: start;
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
