@font-face {
    font-family: 'Triplicate A';
    src: url('/fonts/TriplicateA-Regular.a0f7f0a329c2e9e9.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Triplicate A';
    src: url('/fonts/TriplicateA-Italic.d04ffffdc2cfaf39.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Triplicate A';
    src: url('/fonts/TriplicateA-Bold.34586789b3fb920a.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Triplicate A';
    src: url('/fonts/TriplicateA-BoldItalic.f426e59da21ad3fd.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Triplicate A Code';
    src: url('/fonts/TriplicateACode-Regular.61719db81a2ce2dc.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    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: 'Triplicate A', Arial, sans-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: 36rem;
    margin: 0 auto;
    padding: 0 0.5rem;
}

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

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

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

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

.search-label {
    display: block;
    color: var(--ink);
    font-size: 0.9rem;
    margin-bottom: 0.45rem;
}

.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 {
    max-width: 36rem;
    margin: 0 auto;
    padding: 1.5rem 0;
    text-align: left;
}

.results {
    min-height: 100px;
}

.entry {
    margin-bottom: 2.5rem;
    /* 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 {
    color: var(--ink-faint);
    display: inline-block;
    font-family: 'Triplicate A Code', ui-monospace, monospace;
    font-size: 0.9rem;
    margin-left: 0.65rem;
    vertical-align: baseline;
}

.inflections,
.alternate-spellings,
.meta-field {
    color: var(--ink-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.inflection-label,
.definition-fields,
.definition-notes,
.definition-authors,
.phrase-authors {
    color: var(--ink-secondary);
}

.inflection-label,
.definition-fields {
    font-style: italic;
}

.inflection-pronunciation {
    color: var(--ink-faint);
    font-family: 'Triplicate A Code', ui-monospace, monospace;
}

.definition-fields::after {
    content: " ";
}

.sub-sense {
    color: var(--ink-secondary);
    font-weight: 700;
    margin-right: 0.35rem;
}

.definition-notes,
.definition-authors {
    font-size: 0.95em;
}

.definition-authors::before,
.phrase-authors::before {
    content: " — ";
}

.definition-pos {
    color: var(--ink-secondary);
    font-style: italic;
    margin-right: 0.35rem;
}

.related-forms ul {
    list-style: none;
}

.related-forms li {
    margin-bottom: 0.35rem;
}

.note,
.usage {
    color: var(--ink-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.note footer {
    color: var(--ink-faint);
    font-size: 0.9em;
    margin-top: 0.25rem;
    text-align: right;
}

.phrase-etymology {
    color: var(--ink-secondary);
    font-style: italic;
    margin-bottom: 0.4rem;
}

.phrase-authors {
    font-size: 0.9rem;
    margin-top: 0.4rem;
    text-align: right;
}

.etymology {
    color: var(--ink-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* 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,
.etymology a,
.phrase-etymology a,
.note a,
.usage a,
.synonyms-prose 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,
.etymology a:hover,
.phrase-etymology a:hover,
.note a:hover,
.usage a:hover,
.synonyms-prose a:hover {
    color: var(--crossref-active);
    opacity: 1;
}

/* A handful of Webster's synonym blocks are a discrimination in prose rather
   than a list; they read as body text, not as a row of words. */
.synonyms-prose {
    line-height: 1.6;
}

/* 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 {
    color: var(--ink-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    font-style: normal;
}

.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 {
    color: var(--ink-faint);
    display: block;
    font-style: normal;
    margin-top: -0.5rem;
    text-align: right;
    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;
}

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

.about p {
    margin-bottom: 2rem;
}

.about a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.references {
    list-style: none;
}

.references li {
    margin-bottom: 0.5rem;
}

@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.25rem 0;
    }
}
