@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville&family=Source+Sans+3:wght@400;600&display=swap');

:root {
    --bg: #0b0b0b;
    --chalk: #ecebe8;
    --muted: #a8a7a4;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--chalk);
    font-family: 'Source Sans 3', system-ui, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--chalk);
}

.home-landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 0.65rem;
    background: var(--bg);
}

.home-motto {
    margin: 0;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--chalk);
}

.pendulum-hero {
    margin: 0;
    width: min(60vmin, 92vw);
    flex: 0 0 auto;
    background: var(--bg);
}

.pendulum-svg {
    display: block;
    width: 100%;
    height: auto;
    background: var(--bg);
}

.pendulum-string {
    fill: none;
    stroke: var(--chalk);
    stroke-width: 5;
    stroke-linecap: round;
}

.pendulum-string-shadow {
    opacity: 0.28;
    transform: translate(2.5px, 1.5px);
}

.pendulum-bob-outline {
    fill: none;
    stroke: var(--chalk);
    stroke-width: 4;
}

.bob-shadow {
    opacity: 0.26;
    transform: translate(2.5px, 2px);
}

.pendulum-bob-fill {
    fill: #f2f1ed;
    opacity: 0;
}

.pendulum-draw .pendulum-string,
.pendulum-draw .pendulum-bob-outline {
    stroke-dasharray: 520;
    stroke-dashoffset: 520;
    animation: pendulum-draw 2.5s ease-out forwards;
}

.pendulum-draw .pendulum-bob-fill {
    animation: pendulum-shade 0.8s ease-out 2.2s forwards;
}

@keyframes pendulum-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes pendulum-shade {
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .pendulum-draw .pendulum-string,
    .pendulum-draw .pendulum-bob-outline {
        animation: none;
        stroke-dashoffset: 0;
    }

    .pendulum-draw .pendulum-bob-fill {
        animation: none;
        opacity: 1;
    }
}

.blog-page,
.admin-page {
    background: var(--bg);
}

.blog-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.blog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(236, 235, 232, 0.2);
}

.site-logo {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--chalk);
}

.culture-switch {
    display: flex;
    gap: 0.35rem;
}

.culture-switch form {
    margin: 0;
}

.culture-btn {
    border: 1px solid rgba(236, 235, 232, 0.35);
    background: transparent;
    color: var(--chalk);
    padding: 0.2rem 0.55rem;
    font: inherit;
    cursor: pointer;
}

.culture-btn[aria-pressed="true"] {
    background: var(--chalk);
    color: var(--bg);
}

.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list li {
    margin-bottom: 1.75rem;
}

.post-list time {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
}

.post-list a {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.35rem;
    text-decoration: none;
    color: var(--chalk);
}

.post-summary {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.markdown-body h2,
.markdown-body h3 {
    font-family: 'Libre Baskerville', Georgia, serif;
    color: var(--chalk);
}

.admin-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid rgba(236, 235, 232, 0.15);
    padding: 0.6rem 0.4rem;
    text-align: left;
}

.form-field {
    margin-bottom: 1rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--chalk);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    max-width: 40rem;
    font: inherit;
    padding: 0.4rem 0.5rem;
    border: 1px solid rgba(236, 235, 232, 0.3);
    background: #141414;
    color: var(--chalk);
}

.form-field.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-field.checkbox input {
    width: auto;
}

.form-error {
    color: #e8a0a0;
}

.delete-form {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(236, 235, 232, 0.15);
}

button,
.btn {
    font: inherit;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--chalk);
    background: var(--chalk);
    color: var(--bg);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button.danger {
    background: #4a1f1f;
    border-color: #c07070;
    color: var(--chalk);
}

.muted {
    color: var(--muted);
}
