:root {
    color-scheme: light;
    --paper: #f4f1e8;
    --paper-deep: #e8e2d5;
    --ink: #20272b;
    --muted: #5b6468;
    --rule: #c9c2b4;
    --blue: #2f8bcd;
    --drawer: #17252d;
    --drawer-text: #f4f1e8;
    --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 20rem;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 100%;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

body {
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    background:
        linear-gradient(90deg, rgb(255 255 255 / 18%), transparent 22%, transparent 78%, rgb(0 0 0 / 2%)),
        var(--paper);
}

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

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible {
    outline: 0.1875rem solid var(--blue);
    outline-offset: 0.25rem;
}

.skip-link {
    position: fixed;
    z-index: 30;
    inset-block-start: 1rem;
    inset-inline-start: 1rem;
    padding: 0.65rem 0.9rem;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--sans);
    font-weight: 700;
    transform: translateY(-200%);
}

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

main {
    display: grid;
    place-items: center;
    width: 100%;
    padding: clamp(4rem, 11vh, 8.5rem) clamp(2rem, 8vw, 8rem);
}

.dictionary-entry {
    width: min(100%, 64rem);
    columns: 2;
    column-gap: clamp(3rem, 7vw, 6.5rem);
    column-rule: 1px solid var(--rule);
    column-fill: balance;
    font-size: clamp(1rem, 0.9rem + 0.25vw, 1.125rem);
}

.dictionary-entry h1 {
    margin: 0 0 0.2rem;
    color: var(--ink);
    font-size: clamp(2.8rem, 2rem + 2.2vw, 4.8rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

.dictionary-entry dfn {
    font-style: normal;
}

.pronunciation {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 1.05em;
    letter-spacing: 0.025em;
}

.word-class {
    margin: 0.05rem 0 1.5rem;
    color: var(--blue);
    font-style: italic;
    font-weight: 600;
}

.senses {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: sense;
}

.senses li {
    position: relative;
    margin: 0 0 1.25rem;
    padding-inline-start: 2.1rem;
    break-inside: avoid;
    counter-increment: sense;
}

.senses li::before {
    position: absolute;
    inset-inline-start: 0;
    color: var(--blue);
    content: counter(sense) ".";
    font-family: var(--sans);
    font-size: 0.82em;
    font-weight: 750;
    line-height: 2;
}

.see-also {
    margin: 1.8rem 0 0;
    padding-block-start: 1rem;
    border-block-start: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.92em;
    font-style: italic;
    break-inside: avoid;
}

.see-also span {
    color: var(--ink);
    font-variant: small-caps;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.drawer-toggle {
    position: fixed;
    z-index: 20;
    inset-block-start: 50%;
    inset-inline-end: 0;
    min-width: 2.9rem;
    min-height: 6rem;
    padding: 0.9rem 0.65rem;
    border: 0;
    border-radius: 0.45rem 0 0 0.45rem;
    background: var(--drawer);
    color: var(--drawer-text);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
    transform: translateY(-50%);
}

.drawer-toggle span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.site-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(22rem, calc(100vw - 3rem));
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--drawer);
    color: var(--drawer-text);
}

.site-drawer::backdrop {
    background: rgb(15 24 29 / 48%);
    backdrop-filter: blur(1px);
}

.drawer-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    font-family: var(--sans);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block-end: 1.5rem;
    border-block-end: 1px solid rgb(244 241 232 / 20%);
}

.drawer-header h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.75rem;
    font-weight: 500;
}

.drawer-close {
    position: relative;
    min-width: 3rem;
    min-height: 3rem;
    padding: 0.6rem;
    border: 1px solid rgb(244 241 232 / 35%);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: 0/0 a;
}

.drawer-close::before,
.drawer-close::after {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    width: 1.15rem;
    height: 2px;
    margin: -1px 0 0 -0.575rem;
    background: currentcolor;
    content: "";
}

.drawer-close::before {
    transform: rotate(45deg);
}

.drawer-close::after {
    transform: rotate(-45deg);
}

.drawer-navigation {
    margin: 2.5rem 0;
    padding: 0;
    list-style: none;
}

.drawer-navigation a {
    display: block;
    padding: 0.75rem 0;
    color: inherit;
    font-size: 1.1rem;
    font-weight: 650;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.3em;
}

.drawer-note {
    max-width: 17rem;
    margin: auto 0 0;
    color: rgb(244 241 232 / 72%);
    font-size: 0.88rem;
    line-height: 1.55;
}

.site-footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem clamp(2rem, 5vw, 4.5rem) 1.5rem;
    border-block-start: 1px solid var(--paper-deep);
    color: var(--muted);
    font-family: var(--sans);
    font-size: 0.75rem;
}

.footer-mark {
    display: inline-flex;
}

.footer-mark img {
    display: block;
    width: 2.1rem;
    height: auto;
}

.site-footer p {
    margin: 0;
}

@media (max-width: 47.999rem) {
    main {
        place-items: start center;
        padding: clamp(4.5rem, 12vh, 7rem) 3.75rem 4.5rem 1.5rem;
    }

    .dictionary-entry {
        width: min(100%, 35rem);
        columns: 1;
        column-rule: 0;
    }

    .site-footer {
        align-items: center;
        padding-inline: 1.5rem 3.75rem;
    }
}

@media (max-width: 29.999rem) {
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.65rem;
    }
}

@media (prefers-contrast: more) {
    :root {
        --paper: #fff;
        --ink: #000;
        --muted: #303030;
        --rule: #555;
        --drawer: #000;
    }
}

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