/* --- Global Styles & Off-White Palette --- */
:root {
    --bg-color: #fcfbf7;
    --card-bg: #f5f4f0;
    --text-main: #2b2b2a;
    --text-muted: #666562;
    --accent: #4a5d4e;
    --border: #e6e5e0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover { opacity: 0.8; }

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 60px 0;
    border-bottom: 1px solid var(--border);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
}

/* --- Navigation --- */
nav {
    position: sticky;
    top: 0;
    background-color: rgba(252, 251, 247, 0.95);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0 20px;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
}

.nav-links a.active {
    color: var(--accent);
}

/* --- Hamburger --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: auto;
    height: auto;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.25s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Hero Section --- */
#home {
    padding: 80px 0;
}

.hero-text h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
}

/* --- Cards Layout --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--card-bg);
    padding: 24px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.card h4 {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5px;
    font-weight: normal;
}

/* --- Page Header --- */
.page-header {
    padding: 60px 0 40px;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 560px;
}

.medium-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: -128.5px;
    margin-top: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 4px;
    transition: background 0.2s;
}
.medium-link-writing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 4px;
    transition: background 0.2s;
}

.medium-link:hover {
    background: var(--card-bg);
    opacity: 1;
}

/* --- Writing Sections --- */
.writing-section {
    padding: 50px 0;
    border-bottom: 1px solid var(--border);
}

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* --- Article Cards --- */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.article-card {
    background: var(--card-bg);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    transition: background 0.15s;
}

.article-card:last-child {
    border-bottom: none;
}

.article-card:hover {
    background: #eeeee9;
}

.article-card-left {
    flex: 1;
    min-width: 0;
}

.article-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    background: rgba(74, 93, 78, 0.08);
    padding: 2px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
}

.article-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.35;
}

.article-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.article-card-right {
    flex-shrink: 0;
    text-align: right;
}

.article-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.article-read {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
}

/* --- Research Notes --- */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.note-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
}

.note-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.note-card p {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.note-meta {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

/* --- Empty State --- */
.empty-state {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* --- Footer --- */
footer {
    background-color: var(--card-bg);
    padding: 60px 0;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 0 20px;
    max-width: 900px;
    margin: 0 auto;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-inner p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group input,
.form-group textarea {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
}

.form-group textarea {
    resize: vertical;
    height: 100px;
}

button {
    background-color: var(--text-main);
    color: var(--bg-color);
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    width: 100%;
}

button:hover { background-color: var(--accent); }

.social-links {
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.social-links i {
    font-size: 1.4rem;
    color: var(--text-main);
    transition: transform 0.2s, color 0.2s;
}

.social-links i:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.copyright {
    margin-top: 40px;
    font-size: 0.85rem;
    color: var(--text-muted);
    grid-column: span 2;
    text-align: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .copyright { grid-column: span 1; }
    .hero-text h1 { font-size: 2rem; }
    .hero-text p { font-size: 1rem; }
    section { padding: 40px 0; }
    .article-card { flex-direction: column; gap: 10px; }
    .article-card-right { text-align: left; }
    .page-header h1 { font-size: 1.7rem; }
}

@media (max-width: 640px) {
    .hamburger { display: flex; }

    .nav-links {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(252, 251, 247, 0.98);
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
    }

    .nav-links.open { display: flex; }

    .nav-links li a {
        display: block;
        padding: 12px 20px;
        font-size: 0.95rem;
        color: var(--text-main);
        font-weight: 500;
    }

    .nav-links li a:hover { background: var(--card-bg); opacity: 1; }
}

@media (max-width: 480px) {
    .logo { font-size: 1rem; }
    .hero-text h1 { font-size: 1.6rem; }
    .hero-text p { font-size: 0.95rem; }
    h2 { font-size: 1.4rem; }
    .card { padding: 16px; }
    section { padding: 32px 0; }
}