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

:root {
    --bg: #18052b;
    --border: rgba(178, 161, 242, 0.18);
    --text: #f2efff;
    --accent: #b2a1f2;
    --max-width: 600px;
    --font-heading: "Host Grotesk", sans-serif;
    --font-body: "Spectral", serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* --- Header / Nav --- */

header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
}

.site-title {
    font-family: var(--font-heading);
    color: var(--accent);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.site-title:hover {
    text-decoration: underline;
}

/* --- Main --- */

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.25rem;
    flex: 1;
    width: 100%;
}

/* --- Index page --- */

h1 {
    color: var(--accent);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.article-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.article-card a {
    display: flex;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.article-card a:hover,
.article-card a:focus-visible {
    border-color: var(--accent);
}

.article-info {
    flex: 1;
    padding: 1rem 1.25rem;
    min-width: 0;
}

.article-info h2 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.25rem;
    font-weight: 600;
    line-height: 1.35;
}

.article-info time {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0.6;
}

.article-info p {
    margin-top: 0.4rem;
    font-size: 0.88rem;
    color: var(--text);
    opacity: 0.7;
    line-height: 1.5;
}

.article-thumb-wrap {
    flex-shrink: 0;
    width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Article page --- */

.article-header {
    margin-bottom: 1.5rem;
}

.article-header h1 {
    margin-bottom: 0.4rem;
}

.article-header time {
    color: var(--text);
    opacity: 0.6;
    font-size: 0.85rem;
}

.article-hero {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 2rem;
}

.article-body h2 {
    color: var(--accent);
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-body h3 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-body p {
    margin-bottom: 1.2rem;
}

.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body a:hover {
    color: #cfc3fd;
}

.article-body img {
    max-width: 100%;
    border-radius: 6px;
    margin: 1rem 0;
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 1.2rem 0;
    color: var(--text);
    opacity: 0.85;
    border-radius: 0 4px 4px 0;
}

.article-body code {
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    border: 1px solid var(--border);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

.article-body pre {
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.2rem 0;
}

.article-body pre code {
    padding: 0;
    border: none;
}

.article-body ul,
.article-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
}

.article-body li {
    margin-bottom: 0.3rem;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* --- Back link --- */

.back-link {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.back-link a {
    font-family: var(--font-heading);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
}

.back-link a:hover {
    text-decoration: underline;
}

/* --- Footer --- */

footer {
    font-family: var(--font-heading);
    border-top: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    text-align: center;
    color: var(--text);
    opacity: 0.5;
    font-size: 0.85rem;
    margin-top: auto;
}

/* --- Responsive --- */

@media (max-width: 640px) {
    main {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.35rem;
    }

    .article-thumb-wrap {
        width: 100px;
    }
}
