/* ==========================================================================
   MadScientist — Neo-Editorial base
   Shared tokens, reset, typography, and components for the broadsheet UI.
   Page-specific composition lives in each page's stylesheet.
   ========================================================================== */

:root {
    /* Paper and ink */
    --ne-paper: #F4F0E6;
    --ne-paper-raised: #FAF7EF;
    --ne-paper-tint: #ECE5D6;
    --ne-ink: #1A1A1A;
    --ne-ink-soft: #4A4A4A;
    --ne-ink-faint: #6B6557;
    --ne-rule: #1A1A1A;
    --ne-rule-light: #D1CDB8;

    /* Accent and semantic colors */
    --ne-accent: #F29C54;
    --ne-accent-strong: #D97A2E;
    --ne-accent-soft: #FBE3C9;
    --ne-danger: #8C2F1B;
    --ne-success: #3F6B47;

    /* Type */
    --ne-font-display: "Playfair Display", "Merriweather", "Lora", Georgia, serif;
    --ne-font-body: "Inter", "Helvetica Neue", Roboto, Arial, sans-serif;
    --ne-font-mono: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, monospace;
    --ne-font-reading: "Lora", Georgia, "Times New Roman", serif;

    /* Spacing */
    --ne-space-1: 0.25rem;
    --ne-space-2: 0.5rem;
    --ne-space-3: 0.75rem;
    --ne-space-4: 1rem;
    --ne-space-5: 1.5rem;
    --ne-space-6: 2rem;
    --ne-space-7: 3rem;
    --ne-space-8: 4rem;

    /* Shape and layout */
    --ne-radius: 2px;
    --ne-avatar-radius: 4px;
    --ne-shell: 1424px;
    --ne-gutter: clamp(1rem, 2.4vw, 1.5rem);
    --ne-measure: 68ch;
    --ne-focus: 2px solid var(--ne-ink);
    --ne-transition: 160ms ease;
}

/* Reset ------------------------------------------------------------------ */

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

html {
    color-scheme: light;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
fieldset {
    margin: 0;
}

body {
    min-height: 100vh;
    background: var(--ne-paper);
    color: var(--ne-ink);
    font-family: var(--ne-font-body);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button {
    background: none;
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--ne-font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

[hidden] {
    display: none !important;
}

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

:focus-visible {
    outline: var(--ne-focus);
    outline-offset: 3px;
}

/* Accessibility ---------------------------------------------------------- */

.ne-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ne-skip-link {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    padding: 0.65rem 0.9rem;
    background: var(--ne-paper);
    border: 1px solid var(--ne-ink);
    color: var(--ne-ink);
    font-family: var(--ne-font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transform: translateY(-130%);
    transition: transform var(--ne-transition);
}

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

/* Shell and rules -------------------------------------------------------- */

.ne-shell {
    width: min(calc(100% - (var(--ne-gutter) * 2)), var(--ne-shell));
    margin-inline: auto;
}

.ne-rule {
    border: 0;
    border-top: 1px solid var(--ne-rule);
    margin: 0;
}

.ne-rule--light {
    border-top-color: var(--ne-rule-light);
}

/* Site chrome ------------------------------------------------------------ */

.ne-masthead {
    border-bottom: 1px solid var(--ne-rule);
    background: var(--ne-paper);
}

.ne-masthead__inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--ne-space-6);
    padding: 1.15rem 0 0.9rem;
}

.ne-brand {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.ne-wordmark {
    display: inline-block;
    color: var(--ne-ink);
    font-family: var(--ne-font-display);
    font-size: clamp(3rem, 5.4vw, 4.85rem);
    font-weight: 900;
    letter-spacing: -0.055em;
    line-height: 0.82;
}

.ne-wordmark:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.14em;
}

.ne-tagline {
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-display);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-transform: uppercase;
}

.ne-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    color: var(--ne-ink);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.075em;
    line-height: 1;
    text-transform: uppercase;
}

.ne-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    color: var(--ne-ink);
    text-decoration: none;
    white-space: nowrap;
}

.ne-nav__link:hover,
.ne-nav__link.is-active {
    border-bottom-color: var(--ne-accent);
}

.ne-nav__divider {
    width: 1px;
    height: 1rem;
    background: var(--ne-rule);
}

.ne-nav__spacer {
    margin-left: auto;
}

.ne-nav__profile {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 14rem;
    color: var(--ne-ink);
    text-decoration: none;
}

.ne-nav__profile span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ne-nav__profile:hover span:last-child {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ne-footer {
    margin-top: var(--ne-space-7);
    border-top: 1px solid var(--ne-rule);
}

.ne-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding: 1.25rem 0 1.75rem;
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    line-height: 1.5;
    text-transform: uppercase;
}

/* Buttons ---------------------------------------------------------------- */

.ne-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.1rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--ne-rule);
    border-radius: var(--ne-radius);
    background: transparent;
    color: var(--ne-ink);
    font-family: var(--ne-font-body);
    font-size: 0.69rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--ne-transition), color var(--ne-transition), border-color var(--ne-transition);
}

.ne-button:hover {
    background: var(--ne-paper-tint);
}

.ne-button--primary {
    background: var(--ne-accent);
    border-color: var(--ne-rule);
    color: var(--ne-ink);
}

.ne-button--primary:hover {
    background: var(--ne-accent-strong);
}

.ne-button--outline {
    background: transparent;
}

.ne-button--outline:hover {
    background: var(--ne-paper-tint);
}

.ne-button--ghost {
    padding-inline: 0.25rem;
    border-color: transparent;
    color: var(--ne-ink-soft);
}

.ne-button--ghost:hover {
    background: transparent;
    color: var(--ne-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ne-button--small {
    min-height: 1.8rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.63rem;
}

.ne-button--block {
    width: 100%;
}

.ne-button:disabled,
.ne-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Tags, labels, and avatars --------------------------------------------- */

.ne-tag {
    display: inline;
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.45;
    text-transform: uppercase;
    white-space: nowrap;
}

.ne-eyebrow {
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-mono);
    font-size: 0.66rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.ne-meta {
    color: var(--ne-ink-soft);
    font-size: 0.72rem;
    line-height: 1.45;
}

.ne-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    overflow: hidden;
    border: 1px solid var(--ne-rule);
    border-radius: var(--ne-avatar-radius);
    background: var(--ne-accent);
    color: var(--ne-ink);
    font-family: var(--ne-font-body);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    object-fit: cover;
    vertical-align: middle;
}

.ne-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.ne-avatar--xs {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.56rem;
}

.ne-avatar--sm {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 0.64rem;
}

.ne-avatar--md {
    width: 2.1rem;
    height: 2.1rem;
}

.ne-avatar--lg {
    width: 2.8rem;
    height: 2.8rem;
    font-size: 1.05rem;
}

.ne-avatar--xl {
    width: 3.8rem;
    height: 3.8rem;
    font-size: 1.45rem;
}

/* Panels ----------------------------------------------------------------- */

.ne-panel {
    border: 1px solid var(--ne-rule);
    border-radius: var(--ne-radius);
    background: var(--ne-paper);
    padding: var(--ne-space-4);
}

.ne-panel__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--ne-space-3);
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--ne-rule);
    margin-bottom: var(--ne-space-3);
}

.ne-panel__title {
    margin: 0;
    color: var(--ne-ink);
    font-family: var(--ne-font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 0.95;
}

.ne-panel__meta {
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Forms ------------------------------------------------------------------ */

.ne-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ne-label {
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.075em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ne-input,
.ne-textarea {
    width: 100%;
    padding: 0.65rem 0.7rem;
    border: 1px solid var(--ne-rule);
    border-radius: var(--ne-radius);
    background: var(--ne-paper-raised);
    color: var(--ne-ink);
    font-family: var(--ne-font-body);
    font-size: 1rem;
    line-height: 1.45;
    transition: background-color var(--ne-transition), border-color var(--ne-transition);
}

.ne-textarea {
    min-height: 7.5rem;
    resize: vertical;
}

.ne-input::placeholder,
.ne-textarea::placeholder {
    color: var(--ne-ink-soft);
    opacity: 0.7;
}

.ne-input:hover,
.ne-textarea:hover {
    background: var(--ne-paper);
    border-color: var(--ne-ink);
}

.ne-hint {
    color: var(--ne-ink-soft);
    font-size: 0.74rem;
    line-height: 1.45;
}

.ne-message {
    min-height: 1.2em;
    margin: 0;
    color: var(--ne-ink-soft);
    font-size: 0.8rem;
    line-height: 1.45;
}

.ne-message.is-error {
    color: var(--ne-danger);
}

.ne-message.is-success {
    color: var(--ne-success);
}

/* States ----------------------------------------------------------------- */

.ne-loading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 0;
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    line-height: 1.4;
    text-transform: uppercase;
}

.ne-loading::before {
    content: "";
    display: block;
    width: 1.5rem;
    height: 1px;
    background: var(--ne-accent);
    animation: ne-pulse 1.3s ease-in-out infinite;
}

@keyframes ne-pulse {
    0%,
    100% {
        opacity: 0.35;
        transform: scaleX(0.55);
        transform-origin: left;
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
        transform-origin: left;
    }
}

.ne-empty-state {
    padding: 1.35rem 1rem;
    border: 1px solid var(--ne-rule-light);
    border-radius: var(--ne-radius);
    background: var(--ne-paper-raised);
    color: var(--ne-ink-soft);
    font-size: 0.9rem;
    line-height: 1.55;
    text-align: center;
}

.ne-empty-state--error {
    border-color: var(--ne-danger);
    color: var(--ne-danger);
}

.social-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1000;
    max-width: min(22rem, calc(100vw - 2.5rem));
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--ne-ink);
    border-radius: var(--ne-radius);
    background: var(--ne-ink);
    color: var(--ne-paper);
    font-family: var(--ne-font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    line-height: 1.45;
    text-transform: uppercase;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.75rem);
    transition: opacity var(--ne-transition), transform var(--ne-transition), visibility var(--ne-transition);
}

.social-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.social-toast-error {
    border-color: var(--ne-danger);
    background: var(--ne-danger);
    color: var(--ne-paper);
}

/* Shared post and comment components ------------------------------------ */

.ne-post {
    padding: 1.05rem 1.15rem 1rem;
    border: 1px solid var(--ne-rule);
    border-radius: var(--ne-radius);
    background: var(--ne-paper);
}

.ne-post__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
}

.ne-post__tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ne-post__author {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    color: var(--ne-ink);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.ne-post__author:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ne-post__title {
    margin: 0.65rem 0 0.4rem;
    color: var(--ne-ink);
    font-family: var(--ne-font-display);
    font-size: clamp(1.65rem, 2.4vw, 2.45rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.02;
    overflow-wrap: anywhere;
}

.ne-post__title a {
    color: inherit;
    text-decoration: none;
}

.ne-post__title a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.ne-post__summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    max-width: 62ch;
    margin: 0;
    color: var(--ne-ink-soft);
    font-size: 0.94rem;
    line-height: 1.55;
}

.ne-post__read {
    display: inline-block;
    margin-top: 0.55rem;
    color: var(--ne-ink);
    font-family: var(--ne-font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-decoration: underline;
    text-decoration-color: var(--ne-rule-light);
    text-underline-offset: 3px;
    text-transform: uppercase;
}

.ne-post__read:hover {
    text-decoration-color: var(--ne-ink);
}

.ne-post__actions {
    margin-top: 0.95rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--ne-rule-light);
}

.ne-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.ne-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.65rem;
    border: 0;
    border-left: 1px solid var(--ne-rule-light);
    background: transparent;
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-body);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-transform: uppercase;
    cursor: pointer;
}

.ne-action:first-child {
    padding-left: 0;
    border-left: 0;
}

.ne-action:hover {
    color: var(--ne-ink);
}

.ne-action.active {
    color: var(--ne-ink);
    text-decoration: underline;
    text-decoration-color: var(--ne-accent);
    text-underline-offset: 3px;
}

.ne-action .action-icon {
    display: inline-flex;
    flex: none;
    width: 1rem;
    height: 1rem;
    align-items: center;
    justify-content: center;
}

.ne-action .action-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.ne-action .action-count {
    color: var(--ne-ink);
    font-weight: 700;
}

.ne-comment {
    padding-top: 1rem;
    border-top: 1px solid var(--ne-rule-light);
}

.ne-comment__meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.ne-comment__author {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--ne-ink);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.ne-comment__author a {
    color: inherit;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.ne-comment__author a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ne-comment__time {
    flex: none;
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    line-height: 1.4;
    white-space: nowrap;
}

.ne-comment__content {
    margin: 0.55rem 0;
    color: var(--ne-ink);
    font-size: 0.92rem;
    line-height: 1.58;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.ne-comment__replies {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0.75rem 0 0 1.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--ne-rule-light);
}

.ne-comment--preview {
    padding: 0.85rem 1rem;
    border: 1px solid var(--ne-rule-light);
    border-left: 3px solid var(--ne-accent);
    border-radius: var(--ne-radius);
    background: var(--ne-paper-raised);
}

.ne-comment__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.35rem;
    border: 1px solid var(--ne-rule-light);
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
}

.ne-comment__badge:hover {
    border-color: var(--ne-ink);
    color: var(--ne-ink);
}

/* Prose ---------------------------------------------------------------- */

.ne-prose {
    max-width: var(--ne-measure);
    color: var(--ne-ink);
    font-family: var(--ne-font-reading);
    font-size: 1.0625rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.ne-prose > *:first-child {
    margin-top: 0;
}

.ne-prose > *:last-child {
    margin-bottom: 0;
}

.ne-prose p {
    margin: 0 0 1.2em;
}

.ne-prose h1,
.ne-prose h2,
.ne-prose h3,
.ne-prose h4 {
    margin: 1.7em 0 0.55em;
    color: var(--ne-ink);
    font-family: var(--ne-font-display);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.08;
}

.ne-prose h1 {
    font-size: 2.15em;
}

.ne-prose h2 {
    font-size: 1.65em;
}

.ne-prose h3 {
    font-size: 1.3em;
}

.ne-prose h4 {
    font-size: 1.1em;
}

.ne-prose a {
    color: var(--ne-ink);
    text-decoration: underline;
    text-decoration-color: var(--ne-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.ne-prose a:hover {
    text-decoration-color: var(--ne-ink);
}

.ne-prose ul,
.ne-prose ol {
    margin: 0 0 1.2em;
    padding-left: 1.4em;
}

.ne-prose li + li {
    margin-top: 0.35em;
}

.ne-prose blockquote {
    margin: 1.8em 0;
    padding: 0.35em 0 0.35em 1.15em;
    border-left: 3px solid var(--ne-accent);
    color: var(--ne-ink-soft);
    font-style: italic;
}

.ne-prose blockquote p:last-child {
    margin-bottom: 0;
}

.ne-prose code {
    padding: 0.12em 0.3em;
    background: var(--ne-paper-tint);
    color: var(--ne-ink);
    font-family: var(--ne-font-mono);
    font-size: 0.84em;
}

.ne-prose pre {
    margin: 1.6em 0;
    padding: 1rem;
    overflow-x: auto;
    border: 1px solid var(--ne-rule-light);
    border-left: 3px solid var(--ne-ink);
    background: var(--ne-paper-tint);
    font-family: var(--ne-font-mono);
    font-size: 0.82rem;
    line-height: 1.55;
    white-space: pre;
}

.ne-prose pre code {
    padding: 0;
    background: transparent;
    font-size: inherit;
}

.ne-prose img {
    width: 100%;
    height: auto;
    margin: 1.8em 0;
    border: 1px solid var(--ne-rule);
}

.ne-prose figure {
    margin: 1.8em 0;
}

.ne-prose figcaption {
    margin-top: 0.45em;
    color: var(--ne-ink-soft);
    font-family: var(--ne-font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.03em;
    line-height: 1.45;
    text-transform: uppercase;
}

.ne-prose table {
    display: block;
    width: 100%;
    margin: 1.6em 0;
    overflow-x: auto;
    border-collapse: collapse;
    font-family: var(--ne-font-body);
    font-size: 0.86rem;
    line-height: 1.45;
}

.ne-prose th,
.ne-prose td {
    padding: 0.55em 0.65em;
    border: 1px solid var(--ne-rule-light);
    text-align: left;
    vertical-align: top;
}

.ne-prose th {
    background: var(--ne-ink);
    color: var(--ne-paper);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ne-prose mark {
    background: var(--ne-accent-soft);
    color: var(--ne-ink);
}

.ne-prose hr {
    margin: 2.2em 0;
    border: 0;
    border-top: 1px solid var(--ne-rule-light);
}

/* Responsive base ------------------------------------------------------- */

@media (max-width: 900px) {
    .ne-masthead__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }

    .ne-nav {
        width: 100%;
    }

    .ne-nav__spacer {
        margin-left: 0;
    }

    .ne-footer__inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .ne-masthead__inner {
        padding-top: 0.9rem;
    }

    .ne-wordmark {
        font-size: clamp(2.6rem, 12vw, 3.6rem);
    }

    .ne-nav {
        gap: 0.65rem;
        font-size: 0.66rem;
    }

    .ne-nav__divider {
        display: none;
    }

    .ne-post {
        padding: 0.9rem 0.9rem 0.85rem;
    }

    .ne-post__title {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    .ne-post__summary {
        -webkit-line-clamp: 4;
        font-size: 0.9rem;
    }

    .ne-action {
        padding-inline: 0.55rem;
        font-size: 0.61rem;
    }

    .ne-comment__replies {
        margin-left: 0.75rem;
        padding-left: 0.75rem;
    }

    .social-toast {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
