:root {
    /* Day mode colors (default) */
    --bg-color: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #4b5563;
    --text-light: #d1d5db;
    --border-color: #d1d5db;
    --link-color: #374151;
    --link-hover: #1f2937;
    --button-bg: #f3f4f6;
    --button-text: #374151;
    --header-bg: rgba(255, 255, 255, 0.95);
    --code-bg: #f3f4f6;
    --separator-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
}

.night-mode {
    /* Night mode colors */
    --bg-color: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-light: #64748b;
    --border-color: #334155;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
    --button-bg: #1e293b;
    --button-text: #cbd5e1;
    --header-bg: rgba(15, 23, 42, 0.95);
    --code-bg: #1e293b;
    --separator-color: #334155;
    --success-color: #34d399;
    --error-color: #f87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 300;
    font-style: normal;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 42rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Terminal header */
.terminal {
    font-size: 0.85rem;
    font-variant-ligatures: normal;
    font-feature-settings: "calt" 1;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.terminal a {
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
}

.terminal .text-light {
    color: var(--text-light);
    text-decoration: underline;
}

/* Theme toggle */
.theme-toggle {
    margin-left: 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.theme-toggle:hover {
    background-color: var(--button-bg);
}

.theme-toggle .icon {
    display: block;
}

.night-mode .theme-toggle .sun {
    display: none;
}

.night-mode .theme-toggle .moon {
    display: block;
}

.theme-toggle .sun {
    display: block;
}

.theme-toggle .moon {
    display: none;
}

/* About section */
.about-section {
    padding-top: 0.5rem;
}

@media (min-width: 640px) {
    .about-section {
        padding-top: 2rem;
    }
}

.about-section p {
    margin-bottom: 1rem;
}

/* Essays list */
.essays-list {
    margin-top: 4rem;
}

.essays-intro {
    margin-bottom: 2rem;
}

.essays-intro a {
    color: var(--link-color);
    text-decoration: none;
}

.essays-intro a:hover {
    color: var(--link-hover);
}

.essays-container {
    list-style: none;
}

.essay-item {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.essay-item:hover {
    border-color: var(--border-color);
    background-color: var(--button-bg);
}

.essay-item h2 {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.essay-item h2 a {
    color: var(--text-primary);
    text-decoration: none;
}

.essay-item h2 a:hover {
    color: var(--link-color);
}

.essay-item .date {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Essay content */
.essay-content {
    padding-top: 1rem;
}

@media (min-width: 768px) {
    .essay-content {
        padding-top: 2rem;
    }
}

.essay-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.essay-date {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    display: block;
}

.essay-body {
    font-size: 1.125rem;
    line-height: 1.7;
}

.essay-body p {
    margin-bottom: 1.5rem;
}

.essay-body h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.essay-body img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    border-radius: 0.25rem;
}

.essay-body code {
    background-color: var(--code-bg);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.9em;
}

.essay-body a {
    color: var(--link-color);
    text-decoration: none;
}

.essay-body a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.essay-body .separator {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-tertiary);
}

/* Newsletter */
.newsletter {
    margin: 2rem 0;
}

.newsletter p {
    margin-bottom: 1rem;
}

.newsletter-form {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.newsletter-input {
    flex: 1;
    height: 3rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0 1rem;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: "IBM Plex Mono", monospace;
    font-weight: 300;
    font-style: normal;
    font-size: 1rem;
}

.newsletter-input::placeholder {
    color: var(--text-tertiary);
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.newsletter-button {
    padding: 0 1.5rem;
    height: 3rem;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 0.375rem;
    font-family: "IBM Plex Mono", monospace;
    font-weight: 300;
    font-style: normal;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.newsletter-button:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.newsletter-button .dot {
    color: var(--text-secondary);
}

/* Back links */
.back-link {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--separator-color);
}

.back-link a {
    color: var(--link-color);
    text-decoration: none;
}

.back-link a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Footer */
footer {
    width: 100%;
    text-align: center;
    padding-top: 2.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
