:root {
    --bg: #243027;
    --bg-soft: #2d362e;
    --surface: #354038;
    --ink: #e8ebe7;
    --muted: #a8b0a6;
    --faint: #7d877b;
    --line: #3f4a41;
    --accent: #e8d0d3;
    --accent-deep: #d4a8ac;
    --font: "Source Sans 3", system-ui, sans-serif;
    --font-display: "Cormorant Garamond", Georgia, serif;
    --max: 58rem;
}

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

body {
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(ellipse 80% 50% at 85% 10%, rgba(212, 168, 172, 0.08), transparent 50%),
        radial-gradient(ellipse 70% 45% at 10% 90%, rgba(90, 110, 95, 0.25), transparent 55%),
        var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

.wrap {
    width: min(var(--max), calc(100% - 2.5rem));
    margin: 0 auto;
    padding: 2.5rem 0 4rem;
}

/* Header */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    padding-bottom: 1.75rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}

/* Search */
.search {
    display: flex;
    gap: 0.45rem;
    flex: 1 1 14rem;
    max-width: 22rem;
    margin-left: auto;
}

.search__input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 0.85rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.35rem;
    padding: 0.35rem 0.7rem;
    height: 2rem;
}

.search__input::placeholder {
    color: var(--faint);
}

.search__input:focus {
    outline: 1px solid var(--accent-deep);
    border-color: var(--accent-deep);
}

.search__button {
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bg);
    background: var(--accent);
    border: none;
    border-radius: 0.35rem;
    padding: 0 0.75rem;
    height: 2rem;
    cursor: pointer;
    white-space: nowrap;
}

.search__button:hover {
    background: var(--accent-deep);
}

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

@media (max-width: 520px) {
    .search {
        flex-basis: 100%;
        max-width: none;
        margin-left: 0;
    }
}

/* Two-column layout */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15rem;
    gap: 2.5rem;
    align-items: start;
}

.layout__main {
    min-width: 0;
}

.layout__sidebar {
    min-width: 0;
}

.sidebar-block + .sidebar-block {
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

.sidebar-block__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.sidebar-block__name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.sidebar-block__text {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.55;
    font-style: italic;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--muted);
}

.sidebar-nav a:hover,
.sidebar-nav a.is-active {
    color: var(--accent);
}

.sidebar-nav a.is-active {
    text-decoration: underline;
    text-underline-offset: 0.25rem;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--accent-deep);
}

@media (max-width: 720px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .layout__sidebar {
        order: 2;
        padding-top: 1.5rem;
        border-top: 1px solid var(--line);
    }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.brand__mark {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 40%;
    display: block;
    border: 1px solid var(--line);
}

.brand__name {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--accent);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 1.25rem;
}

/* Posts */
.post-list {
    list-style: none;
}

.post-list > li + li {
    border-top: 1px solid var(--line);
    margin-top: 1.35rem;
    padding-top: 1.35rem;
}

.post {
    display: block;
}

.post__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
    font-size: 0.82rem;
    color: var(--faint);
    margin-bottom: 0.35rem;
}

.post__meta span {
    color: var(--accent-deep);
    font-weight: 600;
}

.post__title {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3vw, 1.65rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
    color: var(--ink);
    transition: color 0.15s ease;
}

.post:hover .post__title {
    color: var(--accent);
}

.post__excerpt {
    color: var(--muted);
    font-size: 0.98rem;
    max-width: 36rem;
}

.post-empty {
    color: var(--muted);
    padding: 1rem 0;
}

/* Single post */
.post-page__back {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.post-page__back:hover {
    color: var(--accent);
}

.post-page__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--faint);
    margin-bottom: 0.65rem;
}

.post-page__meta a {
    color: var(--accent-deep);
    font-weight: 600;
}

.post-page__title {
    font-family: var(--font-display);
    font-size: clamp(1.85rem, 5vw, 2.5rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 0.85rem;
    color: var(--ink);
}

.post-page__excerpt {
    color: var(--muted);
    font-size: 1.05rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.prose {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--ink);
}

.prose > * + * {
    margin-top: 1rem;
}

.prose h2,
.prose h3 {
    font-family: var(--font-display);
    font-weight: 600;
    margin-top: 1.75rem;
    color: var(--accent);
}

.prose h2 { font-size: 1.35rem; }
.prose h3 { font-size: 1.15rem; }

.prose ul,
.prose ol {
    padding-left: 1.25rem;
}

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

.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}

.prose code {
    font-size: 0.9em;
    background: var(--surface);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    color: var(--accent);
}

/* Footer */
.site-footer {
    margin-top: 3.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--faint);
}
