
@font-face {
    font-family: "CMU Serif";
    src: url("/fonts/cmunrm.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "CMU Serif";
    src: url("/fonts/cmunbx.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "CMU Serif";
    src: url("/fonts/cmunti.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: block;
}

@font-face {
    font-family: "CMU Serif";
    src: url("/fonts/cmunbi.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: block;
}

:root {
    --bg: #edf3e6;
    --side: #cbd9c3;
    --ink: #1c2826;
    --mut: #6a7965;
    --line: #c9d6c1;
    --acc: #3d6041;
    --acct: #edf3e6;
    --nav-hover: #52754d;
    --nav-sub: #293a2b;
    --factoid-card: #f7faf3;
    --grain-blend: multiply;
    --serif: "CMU Serif", "Computer Modern Serif", Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
    box-sizing: border-box;
}

:root[data-theme="sepia"] {
    --bg: #f1e8d8;
    --side: #d7c8b1;
    --ink: #241e17;
    --mut: #6a553d;
    --line: #d5c5a9;
    --acc: #80552f;
    --acct: #f1e8d8;
    --nav-hover: #956137;
    --nav-sub: #493720;
    --factoid-card: #f7f1e7;
    --grain-blend: multiply;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="sepia"]) {
        --bg: #111722;
        --side: #0b1222;
        --ink: #dfe4ee;
        --mut: #d3a475;
        --line: #594832;
        --acc: #c08a5a;
        --acct: #0a0f1c;
        --nav-hover: #c08a5a;
        --nav-sub: #c08a5a;
        --grain-blend: overlay;
    }
}

:root[data-theme="dark"] {
    --bg: #111722;
    --side: #0b1222;
    --ink: #dfe4ee;
    --mut: #d3a475;
    --line: #594832;
    --acc: #c08a5a;
    --acct: #0a0f1c;
    --nav-hover: #c08a5a;
    --nav-sub: #c08a5a;
    --factoid-card: #121a2b;
    --grain-blend: overlay;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="sepia"]) {
        --factoid-card: #121a2b;
    }
}

* {
    box-sizing: border-box;
    border-radius: 0;
}

html, body {
    margin: 0;
}

html, aside.l {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

html:hover, aside.l:hover {
    scrollbar-color: var(--acc) transparent;
}

html::-webkit-scrollbar, aside.l::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

html::-webkit-scrollbar-track, aside.l::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb, aside.l::-webkit-scrollbar-thumb {
    background: transparent;
}

html:hover::-webkit-scrollbar-thumb, aside.l:hover::-webkit-scrollbar-thumb {
    background: var(--acc);
}

html::-webkit-scrollbar-button, aside.l::-webkit-scrollbar-button {
    display: none;
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    background-image: url("/grain.png?v=2");
    background-size: 256px 256px;
    background-blend-mode: var(--grain-blend);
    color: var(--ink);
    font: 18px/1.9 var(--serif);
    transition: color .2s ease, background-color .2s ease;
}

h1, h2, h3, .kick, .row a, aside.l h1 {
    font-family: var(--serif);
    line-height: 1.25;
}

h1 {
    margin: .2em 0 .5em;
    font-size: clamp(1.75rem, 2.5vw, 2rem);
}

h2 {
    font-size: 1.4rem;
}

.app {
    display: grid;
    grid-template-columns: clamp(260px, 18vw, 455px) minmax(0, 1fr) 300px;
    min-height: 100vh;
    padding-top: env(safe-area-inset-top, 0px);
}

.app.nr {
    grid-template-columns: clamp(260px, 18vw, 455px) minmax(0, 1fr);
}

aside.l {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    padding: 70px 40px 48px;
    background: var(--side);
    background-image: url("/grain-sidebar.png?v=2");
    background-size: 256px 256px;
    background-blend-mode: soft-light;
    border-right: 1px solid color-mix(in srgb, var(--acc) 18%, var(--line));
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

aside.l h1 {
    margin: 0;
    font-size: 1.9rem;
}

aside.l h1 a {
    text-decoration: none;
}

.tag {
    margin: .2rem 0 1.6rem;
    line-height: 1.5;
}

nav a {
    display: block;
    margin: 4px 0;
    padding: 11px 0 11px 12px;
    border-left: 3px solid transparent;
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .11em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

nav a:hover, nav a:focus-visible, nav a.on {
    border-left-color: var(--nav-hover);
}

nav a.sub {
    margin: 1px 0;
    padding: 5px 0 5px 18px;
    border-left-width: 3px;
    color: var(--nav-sub);
    font-size: .64rem;
    font-weight: 550;
    letter-spacing: .08em;
}

nav a.sub.on {
    color: var(--ink);
}

main {
    max-width: 940px;
    padding: 70px 40px 90px clamp(24px, 5vw, 120px);
    transition: color .2s ease;
}

aside.r {
    padding: 70px 28px 48px 0;
    font-size: .95rem;
}

a {
    color: inherit;
}

.mut {
    color: var(--mut);
    font-family: var(--sans);
    font-size: .86em;
}

.kick {
    color: var(--mut);
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.post-heading .kick {
    position: relative;
    top: -.3em;
    margin-bottom: .2em;
}

.post-heading h1 {
    margin: .4em 0 .35em;
}

.post-body {
    margin-bottom: 3rem;
}

.post-body p {
    margin: 0 0 .75em;
    text-indent: 2em;
}

.post-center p {
    text-indent: 0;
}

.post-body h2,
.post-body h3 {
    margin: 1.8em 0 .55em;
}

.post-body ul,
.post-body ol {
    margin: .5em 0 1em;
    padding-left: 2em;
}

.post-body li {
    margin: .25em 0;
}

.post-body blockquote {
    margin: 1em 0;
    padding: .2em 1em;
    border-left: 3px solid var(--acc);
    color: var(--mut);
}

.post-body blockquote p {
    text-indent: 0;
}

.post-body pre {
    overflow-x: auto;
    margin: 1em 0;
    padding: .8em 1em;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--acc) 7%, var(--bg));
    white-space: pre;
}

.post-body pre code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.post-divider {
    margin: 1.5em 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.post-details {
    margin: 1em 0;
    padding: .65em .9em;
    border: 1px solid var(--line);
}

.post-details summary {
    color: var(--acc);
    cursor: pointer;
    font-weight: 600;
}

.post-details[open] summary {
    margin-bottom: .65em;
}

.post-details p {
    text-indent: 0;
}

.post-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    margin: 1em 0;
}

.post-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--serif);
}

.post-table th,
.post-table td {
    min-width: 5em;
    padding: .45em .65em;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.post-table th {
    background: color-mix(in srgb, var(--acc) 9%, var(--bg));
}

.post-table p {
    margin: 0;
    text-indent: 0;
}

.post-center {
    text-align: center;
}

.post-center .post-image {
    margin-right: auto;
    margin-left: auto;
}

.post-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto;
    border: 1px solid var(--line);
}

.footnote-ref {
    position: relative;
    z-index: 10;
    margin-left: .08em;
    font-family: var(--sans);
    font-size: .68em;
    line-height: 0;
    vertical-align: super;
}

.footnote-ref a {
    color: var(--acc);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footnote-ref a::after {
    position: absolute;
    z-index: 11;
    bottom: 100%;
    left: 50%;
    width: max-content;
    max-width: min(20rem, 75vw);
    padding: .5rem .7rem;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    content: attr(data-note);
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.45;
    opacity: 0;
    pointer-events: auto;
    transform: translate(-50%, .25rem);
    transition: opacity .12s ease, transform .12s ease;
    visibility: hidden;
    white-space: normal;
}

.footnote-ref a:hover::after,
.footnote-ref a:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
    visibility: visible;
}

.footnotes {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    font-size: .9em;
}

.footnotes h2 {
    margin: 0 0 .75rem;
    font-size: 1.15rem;
}

.footnotes ol {
    margin: 0;
    padding-left: 1.5rem;
}

.footnotes li {
    padding: .2rem 0 .55rem .25rem;
    scroll-margin-top: 1rem;
}

.footnote-back {
    margin-left: .25rem;
    color: var(--acc);
    font-family: var(--sans);
    font-size: .8em;
}

.footnote-help {
    margin: -4px 0 10px;
}

.footnote-help code {
    padding: 1px 4px;
    background: color-mix(in srgb, var(--acc) 10%, transparent);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 8px;
}

.editor-toolbar button {
    width: auto;
    margin: 0;
    padding: 5px 9px;
}

#post-body {
    min-height: 20rem;
    resize: vertical;
    font-family: var(--sans);
    line-height: 1.55;
}

.editor-preview {
    min-height: 20rem;
    margin: 0 0 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    background: var(--bg);
}

.editor-preview:empty::before {
    color: var(--mut);
    content: "Nothing to preview yet.";
}

.editor-status {
    min-height: 1.5em;
    margin: -4px 0 8px;
}

.word-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 1rem;
}

.word-admin-card {
    padding: 1rem;
    border: 1px solid var(--line);
}

.word-admin-card h2 {
    margin: 0 0 .75rem;
}

.word-admin-card .daily-word-entry {
    min-height: 12rem;
}

.word-admin-card button {
    margin-top: .75rem;
}

.post-section-title {
    margin: 3rem 0 1rem;
}

.post-likes {
    margin: 3rem 0 0;
}

.post-likes form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.heart-button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border-radius: 50%;
}

.heart-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    transition: fill .2s ease, transform .2s ease;
}

.heart-button:hover:not(:disabled) svg,
.heart-button:disabled svg {
    fill: currentColor;
}

.heart-button:hover:not(:disabled) svg {
    transform: scale(1.08);
}

.yr {
    margin-top: 2em;
    color: var(--mut);
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
    font-size: 1.05rem;
}

.row a {
    font-size: 1.15rem;
    text-decoration: none;
}

.row span {
    color: var(--mut);
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.post-date {
    display: block;
    width: 100%;
    margin: 0 0 1.6rem;
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-align: right;
    text-transform: uppercase;
}

hr {
    width: 50%;
    margin: 2.5rem auto;
    border: 0;
    border-top: 1px solid var(--mut);
}

.card {
    margin: 0 0 28px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-family: var(--sans);
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.card h3 {
    margin: 0;
    font-family: var(--sans);
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.card p {
    margin: .2em 0;
    font-family: var(--serif);
}

.daily-note {
    position: relative;
}

.daily-note h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-note h3::before {
    color: var(--acc);
    content: "✳";
    font-family: var(--sans);
    font-size: .85rem;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
}

.daily-words {
    display: grid;
    gap: 1em;
    margin-top: .65em;
}

.daily-word-entry {
    border-top: 1px solid var(--mut);
    padding-top: .7em;
}

.daily-word-entry h4 {
    margin: 0 0 .35em;
    color: var(--acc);
    font-family: var(--sans);
    font-size: .76rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.daily-word-headword {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 400;
}

.daily-word-latin .daily-word-headword {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
}

.daily-word-greek .daily-word-headword {
    font-weight: 700;
}

.daily-word-form-label {
    display: block;
    color: var(--mut);
    font-family: var(--sans);
    font-size: .68rem;
    font-style: normal;
    font-weight: 400;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.daily-word-meaning {
    margin: .25em 0 .5em;
    font-family: var(--serif);
}

.daily-word-entry dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .15em .55em;
    margin: .45em 0;
    font-size: .82rem;
}

.daily-word-entry dt {
    color: var(--mut);
}

.daily-word-entry dd {
    margin: 0;
}

.daily-word-attestation,
.daily-word-source {
    display: block;
    margin-top: .35em;
    color: var(--mut);
    font-size: .72rem;
    line-height: 1.4;
}

.daily-word-source a {
    color: inherit;
}

input, textarea, select, button {
    padding: 6px 8px;
    border: 1px solid var(--mut);
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: .95rem;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

input, textarea, select {
    width: 100%;
    margin: 2px 0 10px;
}

button {
    padding: 7px 14px;
    border: 1px solid color-mix(in srgb, var(--acc) 45%, transparent);
    background: transparent;
    color: var(--acc);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

button:hover:not(:disabled) {
    border-color: var(--acc);
    background: color-mix(in srgb, var(--acc) 9%, transparent);
}

button.g {
    border-color: var(--mut);
    background: none;
    color: var(--ink);
}

button:disabled {
    opacity: .5;
}

form.sr {
    display: flex;
    gap: 10px;
    margin: 30px 0 20px;
}

form.sr input {
    margin: 0;
}

form.sb {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 24px;
}

form.sb input {
    flex: 1;
    min-width: 0;
    width: 0;
    margin: 0;
    padding: 10px 8px;
    font-size: 16px;
    line-height: 1.3;
}

form.sb button {
    flex: 0 0 auto;
    width: auto;
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.3;
    white-space: nowrap;
}

.hp {
    position: absolute;
    left: -9999px;
}

label {
    display: block;
    color: var(--mut);
    font-size: .9rem;
}

.cm {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.cb {
    flex: 1;
}

.cb p {
    margin: .4em 0;
}

summary {
    cursor: pointer;
    text-align: right;
    font-size: .9rem;
}

.av {
    display: grid;
    width: 56px;
    height: 56px;
    flex: none;
    place-items: center;
    background: var(--line);
    box-shadow: 3px 3px 8px rgb(0 0 0 / 25%);
    font: 700 1.4rem var(--serif);
}

.lg {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0 40px;
}

.tabs a {
    margin-right: 16px;
}

.tabs a.on {
    font-weight: 600;
}

.bars {
    display: flex;
    height: 130px;
    align-items: flex-end;
    gap: 5px;
    margin: 10px 0;
}

.bars i {
    flex: 1;
    background: var(--acc);
    opacity: .8;
}

.admin-likes {
    display: grid;
    gap: 8px;
}

.admin-like-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.admin-like-row span {
    min-width: 0;
}

.admin-like-row time {
    color: var(--mut);
    font-family: var(--sans);
    font-size: .75rem;
    text-align: right;
}

#tt {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 16px;
    z-index: 5;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--acc) 38%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    color: var(--acc);
}

#tt:hover {
    border-color: var(--acc);
    background: var(--side);
}

#tt svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

#tt .theme-moon {
    display: none;
}

:root[data-theme="dark"] #tt .theme-sun {
    display: none;
}

:root[data-theme="dark"] #tt .theme-moon {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="sepia"]) #tt .theme-sun {
        display: none;
    }

    :root:not([data-theme="light"]):not([data-theme="sepia"]) #tt .theme-moon {
        display: block;
    }
}

#fx {
    position: fixed;
    right: 24px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    color: var(--mut);
    font-size: .85rem;
}

@media (max-width: 1050px) {
    .app, .app.nr {
        grid-template-columns: 1fr;
    }

    aside.l {
        position: static;
        height: auto;
        padding: 24px;
    }

    main {
        padding: 24px;
    }

    aside.r {
        padding: 0 24px 60px;
    }
}

@media (max-width: 600px) {
    .admin-like-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .admin-like-row time {
        text-align: left;
    }
}

.rail-divider {
    width: 100%;
    margin: 28px 0;
    border: 0;
    border-top: 1px solid var(--line);
    opacity: 1;
}

.row {
    padding: 10px 0;
}

.row span {
    font-size: .72rem;
}

.yr {
    margin: 12px 0 6px;
    font-size: .72rem;
}

.factoid-entry {
    padding: 8px 0 16px;
    border-bottom: 1px solid var(--line);
    transition: color .2s ease, border-color .2s ease;
}

.factoid-entry h2 {
    margin: 0;
    color: var(--mut);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.factoid-entry p {
    margin: 6px 0 0;
}

.factoid-admin-list {
    display: grid;
    max-height: 65vh;
    gap: 14px;
    overflow-y: auto;
    padding: 2px 10px 12px 2px;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.factoid-admin-list:hover {
    scrollbar-color: var(--acc) transparent;
}

.factoid-admin-list::-webkit-scrollbar {
    width: 6px;
}

.factoid-admin-list::-webkit-scrollbar-thumb {
    background: transparent;
}

.factoid-admin-list:hover::-webkit-scrollbar-thumb {
    background: var(--acc);
}

.factoid-admin-card {
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--factoid-card);
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.factoid-admin-card h2 {
    margin: 0 0 12px;
    font-size: 1.35rem;
}

.factoid-admin-card textarea {
    min-height: 6em;
    resize: vertical;
}

.factoid-admin-actions {
    display: flex;
    gap: 8px;
}

.factoid-admin-card.factoid-new {
    margin-top: 20px;
}
