:root {
    color-scheme: light;
    font-family: Montserrat, Arial, sans-serif;
    color: #202020;
    background: #f3f3f1;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f3f3f1; line-height: 1.55; }
a { color: inherit; }
h1, h2, h3, h4, .project-name, .project-institute, .collection-link {
    font-family: "Russo One", "Arial Black", sans-serif;
    font-weight: 400;
}

.hero {
    color: #fff;
    background: #183b38;
    background:
        radial-gradient(circle at 82% 30%, color-mix(in srgb, var(--accent), white 20%), transparent 25rem),
        linear-gradient(125deg, #17312f, var(--accent));
    padding: 0 max(5vw, 1.25rem) clamp(3rem, 7vw, 6rem);
}

.topbar {
    max-width: 1260px;
    margin: auto;
    padding: 1.1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    border-bottom: 1px solid rgba(255,255,255,.24);
}

.project-identity { display: flex; flex-direction: column; line-height: 1.2; }
.project-name, .project-institute, .collection-link { text-decoration: none; }
.project-name { font-size: 1.15rem; }
.project-institute { margin-top: .25rem; color: rgba(255,255,255,.68); font-size: .78rem; }
.topbar__actions { display: flex; align-items: center; gap: 1.3rem; }
.collection-link { font-size: .88rem; color: rgba(255,255,255,.84); }
.language-switch {
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: .25rem;
}
.language-switch a {
    padding: .33rem .46rem;
    color: rgba(255,255,255,.72);
    font-size: .68rem;
    font-weight: 700;
    text-decoration: none;
}
.language-switch a[aria-current="page"] { background: #fff; color: #1f3432; }

.hero__grid {
    max-width: 1260px;
    margin: clamp(3rem, 6vw, 5.5rem) auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2.2rem, 5vw, 4rem);
}

h1 {
    max-width: 1120px;
    margin: 0;
    font-size: clamp(2.15rem, 4.25vw, 4rem);
    line-height: 1.12;
    letter-spacing: -.025em;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
}

.subtitle {
    max-width: 760px;
    margin: 1.4rem 0 2rem;
    color: rgba(255,255,255,.82);
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.search-link {
    display: inline-flex;
    gap: .8rem;
    align-items: center;
    padding: .85rem 1.15rem;
    border-radius: .25rem;
    background: #fff;
    color: #1f3432;
    font-weight: 700;
    text-decoration: none;
    transition: transform .2s, color .2s;
}
.search-link:hover { transform: translateY(-2px); color: var(--accent); }
.search-link--small { padding: .55rem .8rem; font-size: .82rem; }

.stats {
    width: min(100%, 840px);
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid rgba(255,255,255,.3);
    border-left: 1px solid rgba(255,255,255,.3);
}
.stats div {
    min-width: 0;
    padding: 1.15rem .9rem;
    border-right: 1px solid rgba(255,255,255,.3);
    border-bottom: 1px solid rgba(255,255,255,.3);
}
.stats dt {
    font-family: "Russo One", sans-serif;
    font-size: clamp(1.15rem, 2.25vw, 1.9rem);
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.stats dd {
    margin: .4rem 0 0;
    color: rgba(255,255,255,.68);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.layout {
    max-width: 1260px;
    margin: auto;
    padding: clamp(3rem, 7vw, 6rem) max(5vw, 1.25rem);
    display: grid;
    grid-template-columns: 220px minmax(0, 860px);
    gap: clamp(2rem, 7vw, 7rem);
}
.contents { position: sticky; top: 2rem; align-self: start; font-size: .88rem; }
.contents > p {
    margin-top: 0;
    color: #707070;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.contents ul { margin: 0; padding: 0; list-style: none; }
.contents li { margin: .45rem 0; }
.contents ul ul { padding-left: .75rem; border-left: 1px solid #c9cbc8; }
.contents a { display: block; margin: .45rem 0; color: #4d5553; text-decoration: none; }
.contents a:hover { color: var(--accent); }

.markdown { font-size: 1rem; }
.markdown h2, .annotation h2 {
    margin: 3.6rem 0 1rem;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    line-height: 1.2;
}
.markdown h2:first-child { margin-top: 0; }
.markdown h3 { margin-top: 2.3rem; font-size: 1.25rem; }
.markdown p { max-width: 72ch; }
.markdown blockquote {
    margin: 2rem 0;
    padding: .7rem 1.4rem;
    border-left: 4px solid var(--accent);
    background: #e7e7e3;
}
.markdown table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.markdown th, .markdown td { padding: .75rem; border-bottom: 1px solid #c7cac6; text-align: left; }
.markdown th { color: #555; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; }

.annotation { margin-top: 5rem; padding-top: 1rem; border-top: 2px solid #222; }
.annotation--glosses { border-top-color: var(--accent); }
.section-heading > p { max-width: 72ch; color: #555e5c; }
.tag-search {
    display: block;
    margin: 2rem 0 2.5rem;
    color: #555;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.tag-search span { display: block; margin-bottom: .5rem; }
.tag-search input {
    width: 100%;
    padding: .85rem 1rem;
    border: 1px solid #afb4b0;
    border-radius: .2rem;
    background: white;
    font: inherit;
    font-size: 1rem;
    text-transform: none;
    letter-spacing: normal;
    outline: none;
}
.tag-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 82%); }
.language-block { margin: 3rem 0; }
.language-block > h3 { padding-bottom: .8rem; border-bottom: 2px solid #222; font-size: 1.55rem; }
.tag-groups { display: grid; gap: 1.25rem; }
.tag-group { padding: 1.2rem; border: 1px solid #c5c9c5; background: #fafaf8; }
.tag-group h4 { margin: 0 0 1rem; font-size: 1rem; color: #333; }
.tag-group h4 span {
    float: right;
    min-width: 2rem;
    padding: .12rem .45rem;
    border-radius: 999px;
    background: #e3e5e1;
    font-family: Montserrat, sans-serif;
    font-size: .7rem;
    text-align: center;
}
.tag-list {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem 1rem;
}
.tag-item {
    min-width: 0;
    width: 100%;
    display: block !important;
    border-bottom: 1px solid #d8dad7;
    padding: .2rem 0 .55rem;
}
.tag-item summary,
.tag-summary {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(4.5rem, auto) 1fr;
    gap: .7rem;
    align-items: baseline;
}
.tag-item summary {
    cursor: pointer;
    list-style: none;
}
.tag-item summary::-webkit-details-marker { display: none; }
.tag-item summary::after {
    content: "+";
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    color: #949a97;
}
.tag-item[open] summary::after { content: "−"; }
.tag-item code { color: var(--accent); font-weight: 700; overflow-wrap: anywhere; }
.tag-item summary span,
.tag-summary span {
    padding-right: 1.2rem;
    color: #59605f;
    font-size: .86rem;
    overflow-wrap: anywhere;
}
.tag-item--static { padding-top: .35rem; }
.tag-item p {
    margin: .5rem 0 0;
    padding: .65rem .75rem;
    border-left: 3px solid var(--accent);
    background: #eef0ec;
    color: #4f5755;
    font-size: .82rem;
}

footer {
    padding: 2rem max(5vw, 1.25rem);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    background: #222;
    color: #e8e8e6;
}
footer div { display: flex; flex-direction: column; }
footer strong { font-family: "Russo One", sans-serif; font-weight: 400; }
footer span { color: #aaa; font-size: .78rem; }
footer a { color: #78c4a5; text-decoration: none; font-weight: 700; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .contents { display: none; }
}

@media (max-width: 640px) {
    .topbar { align-items: flex-start; }
    .collection-link, .search-link--small { display: none; }
    .stats { grid-template-columns: 1fr; }
    .stats dt { font-size: 1.45rem; }
    .tag-list { grid-template-columns: 1fr; }
    footer { flex-direction: column; }
}
