@font-face {
    font-family: 'Vollkorn';
    src: url('/fonts/Vollkorn-Regular.33c0e4742dbf693d.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vollkorn';
    src: url('/fonts/Vollkorn-Italic.9261dc54be8ee1c5.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Vollkorn';
    src: url('/fonts/Vollkorn-Bold.e905eac2b4b6286b.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vollkorn';
    src: url('/fonts/Vollkorn-BoldItalic.736a206307fa2446.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* The ink ramp runs paper -> ink -> muted -> secondary -> faint. Every step
   clears 4.5:1 against both paper and tint, in both themes. */
:root {
    color-scheme: light dark;

    --paper: #ffffff;
    --tint: #f9f9f9;
    --ink: #333333;
    --ink-muted: #555555;
    --ink-secondary: #666666;
    --ink-faint: #737373;
    --field-border: #cccccc;
    --rule-strong: #dddddd;
    --rule: #eeeeee;
    --hairline: #f0f0f0;
    --crossref: #0066cc;
    --crossref-active: #0052a3;
    --alert: #d32f2f;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #1a1a1a;
        --tint: #242424;
        --ink: #d4d4d4;
        --ink-muted: #a9a9a9;
        --ink-secondary: #969696;
        --ink-faint: #8c8c8c;
        --field-border: #565656;
        --rule-strong: #3d3d3d;
        --rule: #303030;
        --hairline: #2b2b2b;
        --crossref: #6aa9e0;
        --crossref-active: #9cc4ec;
        --alert: #ef8a8a;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vollkorn', Georgia, serif;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
}

::selection {
    background: var(--ink);
    color: var(--paper);
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

a {
    color: var(--ink);
    text-decoration: none;
}

a:hover {
    opacity: 0.7;
}

em {
    font-style: italic;
}

strong {
    font-weight: bold;
}

.container {
    max-width: 42rem;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.header {
    text-align: center;
    padding: 2rem 0;
}

.title {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.title-link {
    color: var(--ink);
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    color: var(--ink);
    background: var(--paper);
    caret-color: var(--ink);
    border: 1px solid var(--field-border);
    border-radius: 0;
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--ink-faint);
    opacity: 1;
}

/* The border shift is the entire focus signal -- the outline is suppressed
   because the dropdown hangs flush off the bottom edge. */
.search-input:focus,
.search-input:focus-visible {
    border-color: var(--ink);
    outline: none;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border: 1px solid var(--field-border);
    border-top: none;
    border-radius: 0;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 10;
    text-align: left;
}

.suggestions.active {
    display: block;
}

.suggestion-item {
    display: block;
    padding: 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--hairline);
    font-size: 0.95rem;
    color: var(--ink);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item[aria-selected="true"] {
    background: var(--tint);
    opacity: 1;
}

.primary {
    padding: 2rem 0;
    text-align: left;
}

.results {
    min-height: 100px;
}

.entry {
    margin-bottom: 3rem;
    /* An anchored entry lands a line below the viewport edge, not against it. */
    scroll-margin-top: 1.5rem;
}

/* The permalink sits at the headword's baseline, faint until reached for. It
   is a real link first: with no clipboard it still puts the entry's URL in the
   address bar. */
.entry-anchor {
    font-size: 1rem;
    color: var(--ink-faint);
    text-decoration: none;
    margin-left: 0.25rem;
}

.entry-anchor:hover,
.entry-anchor:focus-visible {
    color: var(--ink);
    text-decoration: underline;
}

.copy-status {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--ink-faint);
    margin-left: 0.5rem;
}

.wordTitle {
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.pos {
    font-size: 0.9rem;
    color: var(--ink-secondary);
    font-style: italic;
    font-weight: 400;
    margin-left: 0.5rem;
}

.entry-counter {
    font-size: 0.9rem;
    color: var(--ink-faint);
}

.pronunciation {
    display: block;
    font-size: 0.9rem;
    color: var(--ink-faint);
    margin-bottom: 1rem;
    font-family: "Courier New", monospace;
}

.meta-field {
    font-size: 0.9rem;
    color: var(--ink-secondary);
    margin-bottom: 1rem;
}

.etymology {
    font-size: 0.9rem;
    color: var(--ink-secondary);
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--tint);
    border-left: 2px solid var(--rule-strong);
}

/* More room above a label than below it, so each section reads as belonging to
   what follows rather than to what it interrupts. */
.entry section {
    margin-top: 1.5rem;
}

.section-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.definitions {
    list-style: none;
    counter-reset: def-counter;
}

.definitions li {
    margin-bottom: 0.75rem;
    counter-increment: def-counter;
    padding-left: 1.5rem;
    position: relative;
}

.definitions li::before {
    content: counter(def-counter) ".";
    position: absolute;
    left: 0;
    color: var(--ink-faint);
    font-weight: 700;
}

/* Cross-references, wherever definitional text carries them. */
.definitions a,
.quotes a,
.phrase-body a {
    color: var(--crossref);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    font-style: normal;
}

.definitions a:hover,
.quotes a:hover,
.phrase-body a:hover {
    color: var(--crossref-active);
    opacity: 1;
}

/* Synonyms and antonyms are the same kind of list and share one treatment. */
.synonyms,
.antonyms {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.synonyms a,
.antonyms a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

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

.examples li {
    margin-bottom: 0.75rem;
    padding-left: 0;
    font-size: 0.95rem;
    color: var(--ink-muted);
    line-height: 1.5;
}

.quotes {
    font-size: 0.95rem;
    color: var(--ink-secondary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    font-style: italic;
}

.quotes p {
    margin-bottom: 0.75rem;
}

.phrases {
    margin: 0;
    padding: 0;
}

.phrase-name {
    font-weight: 700;
    margin-top: 1rem;
}

.phrase-field {
    font-weight: 400;
    font-style: italic;
    color: var(--ink-secondary);
}

.phrase-body {
    margin: 0.25rem 0 0 1.25rem;
}

.phrase-body p {
    margin: 0 0 0.4rem;
}

.phrase-body .quotes {
    margin: 0 0 0.6rem;
}

.quote-author {
    font-style: normal;
    color: var(--ink-faint);
    white-space: nowrap;
}

.error {
    color: var(--alert);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* The near-miss list on a failed lookup. Kept apart from .suggestions -- that
   class is the autocomplete dropdown, which is display:none until .active, and
   sharing it hid this list entirely. */
.did-you-mean {
    margin-bottom: 1.5rem;
}

.suggestion-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.suggestion-list a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.footer-section {
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.divider {
    height: 1px;
    border: none;
    background: var(--rule);
    margin-bottom: 1.5rem;
}

.footer {
    font-size: 0.85rem;
    color: var(--ink-faint);
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }

    .header {
        padding: 1.5rem 0;
    }

    .title {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .wordTitle {
        font-size: 1.5rem;
    }

    .primary {
        padding: 1.5rem 0;
    }
}
