:root {
    --primary: #041139;
    --accent:  #d7a100;

    --bg-light:   #f4f1ea;
    --text-light: #222;

    --bg-dark:   #121826;
    --text-dark: #f5f5f5;
}

/* ── Reset & base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* ── Header ───────────────────────────────────── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    background: var(--bg-light);
    border-bottom: 1px solid rgba(4, 17, 57, 0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

body.dark-mode header {
    background: var(--bg-dark);
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

/* ── Logo ─────────────────────────────────────── */
.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo-container:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.logo-image {
    height: 28px;
    width: auto;
    max-width: 28px;
    margin-right: 10px;
}

.logo-text {
    color: var(--primary);
    font-size: 18px;
    font-weight: bold;
    transition: color 0.2s ease;
    white-space: nowrap;
}

body.dark-mode .logo-text {
    color: var(--accent);
}

.logo-container:hover .logo-text {
    color: var(--accent);
}

/* ── Nav ──────────────────────────────────────── */
nav {
    display: flex;
    gap: 22px;
}

nav a {
    text-decoration: none;
    color: var(--primary);
    font-size: 14px;
    transition: color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

body.dark-mode nav a {
    color: var(--text-dark);
}

nav a:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

/* ── Mode toggle ──────────────────────────────── */
.toggle-btn {
    padding: 7px 16px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.toggle-btn:hover {
    background: var(--accent);
    color: var(--primary);
}

/* ── Main content ─────────────────────────────── */
main {
    min-height: calc(100vh - 62px - 80px); /* fill between header and footer */
    padding: 72px 50px 80px;
    max-width: 900px;
    /* no margin: auto — keeps left-aligned look matching original intent */
}

/* ── Typography ───────────────────────────────── */
h1 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 22px;
    font-size: 26px;
    line-height: 1.3;
}

body.dark-mode h1 {
    color: var(--accent);
}

p {
    line-height: 1.75;
    margin-top: 0;
    margin-bottom: 16px;
}

/* ── Links inside content ─────────────────────── */
main a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

main a:hover {
    color: var(--accent);
}

/* ── Footer ───────────────────────────────────── */
footer {
    text-align: center;
    padding: 24px 20px;
    background: var(--bg-light);
    border-top: 1px solid rgba(4, 17, 57, 0.08);
    font-size: 13px;
}

body.dark-mode footer {
    background: var(--bg-dark);
    border-top-color: rgba(255, 255, 255, 0.07);
}

footer p {
    margin: 0;
    color: var(--primary);
    opacity: 0.55;
}

body.dark-mode footer p {
    color: var(--text-dark);
}

/* ── Social links ─────────────────────────────── */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}

.social-links a {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

body.dark-mode .social-links a {
    color: var(--text-dark);
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

/* ── Contact page social block ────────────────── */
.contact-socials {
    margin-top: 32px;
}

.contact-socials p {
    margin-bottom: 12px;
    color: inherit;
}

.contact-socials .social-links {
    justify-content: flex-start;
    margin-bottom: 0;
}

/* ── Forms (contact) ──────────────────────────── */
input, textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.7);
    outline: none;
    transition: border-color 0.2s ease;
}

input:focus, textarea:focus {
    border-color: var(--accent);
}

body.dark-mode input,
body.dark-mode textarea {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px 20px;
    }

    nav {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
        gap: 14px;
    }

    main {
        padding: 48px 24px 64px;
    }

    h1 {
        font-size: 22px;
    }
}

/* ── Homepage feed section ────────────────────── */
.feed-section {
    padding: 0 50px 80px;
    max-width: 900px;
}

.feed-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-top: 1px solid rgba(4, 17, 57, 0.12);
    padding-top: 36px;
    margin-bottom: 28px;
}

body.dark-mode .feed-section-header {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.feed-section-header h2 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary);
    font-weight: bold;
    margin: 0;
}

body.dark-mode .feed-section-header h2 {
    color: var(--accent);
}

.feed-section-header a {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: opacity 0.2s;
}

.feed-section-header a:hover { opacity: 0.7; }

.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1px;
    background: rgba(4, 17, 57, 0.08);
    border: 1px solid rgba(4, 17, 57, 0.08);
    margin-bottom: 40px;
}

body.dark-mode .feed-grid {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.06);
}

.feed-card {
    background: var(--bg-light);
    padding: 22px 24px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.2s ease;
    min-height: 120px;
}

body.dark-mode .feed-card {
    background: var(--bg-dark);
}

.feed-card:hover {
    background: rgba(215, 161, 0, 0.06);
}

.feed-card-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.feed-card-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.4;
    flex: 1;
}

body.dark-mode .feed-card-title {
    color: var(--text-dark);
}

.feed-card-meta {
    font-size: 12px;
    color: var(--primary);
    opacity: 0.45;
}

body.dark-mode .feed-card-meta {
    color: var(--text-dark);
}

.feed-empty {
    padding: 32px 24px;
    font-size: 13px;
    color: var(--primary);
    opacity: 0.4;
    font-style: italic;
    background: var(--bg-light);
}

body.dark-mode .feed-empty {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* ── Updates page ─────────────────────────────── */
.updates-list { margin-top: 8px; }

.update-item {
    border-top: 1px solid rgba(4, 17, 57, 0.1);
    padding: 28px 0;
    max-width: 680px;
}

body.dark-mode .update-item {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.update-item:last-child {
    border-bottom: 1px solid rgba(4, 17, 57, 0.1);
}

body.dark-mode .update-item:last-child {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.update-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 8px;
}

.update-title {
    font-size: 17px;
    font-weight: bold;
    color: var(--primary);
    margin: 0 0 10px;
    line-height: 1.35;
}

body.dark-mode .update-title { color: var(--text-dark); }

.update-author {
    font-size: 12px;
    opacity: 0.5;
    margin-bottom: 12px;
}

.update-excerpt {
    font-size: 14px;
    line-height: 1.75;
    margin: 0 0 14px;
}

.update-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: opacity 0.2s;
}

.update-link:hover { opacity: 0.7; }

.updates-empty {
    margin-top: 40px;
    font-size: 14px;
    color: var(--primary);
    opacity: 0.45;
    font-style: italic;
}

body.dark-mode .updates-empty { color: var(--text-dark); }

@media (max-width: 768px) {
    .feed-section { padding: 0 24px 60px; }
    .feed-grid { grid-template-columns: 1fr; }
}
