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

:root {
    --ink: #1a1a1a;
    --paper: #f5f2eb;
    --accent: #3172c8;
    --muted: #888;
    --border: #d8d3c8;
}

[data-theme="dark"] {
    --ink: #e8e4db;
    --paper: #1a1917;
    --accent: #3172c8;
    --muted: #666;
    --border: #2e2c28;
}

html { font-size: 16px; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s, color 0.3s;
}

/* ── Header ── */

header {
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 4rem;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--ink);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-links a {
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.social-links a:hover {
  color: var(--ink);
}

.social-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.site-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

.site-name span {
  color: var(--accent);
}

/* ── Nav ── */
nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

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

/* ── Theme toggle ── */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: color 0.2s, border-color 0.2s, transform 0.3s;
    padding: 0;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--ink);
    border-color: var(--ink);
}

.theme-toggle:active {
    transform: rotate(20deg);
}

.theme-toggle svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    transition: opacity 0.2s, transform 0.3s;
}

.icon-sun { display: block; }
.icon-moon { display: none; }

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ── Main ── */
main {
    flex: 1;
    max-width: 740px;
    width: 100%;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* ── Footer ── */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.3s;
}

.footer-left {
    font-size: 0.8rem;
    color: var(--muted);
}

.footer-links {
    display: flex;
    gap: 1.25rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-links svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* -- Feed -- */
.feed {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 640px;
  margin: 0 auto;
}

.card {
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  background: var(--paper);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}

.card--article { border-left: 3px solid var(--accent); }
.card--photo   { border-left: 3px solid #7a9e7e; }
.card--video   { border-left: 3px solid #7a8fae; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-type {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.card-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.card-title a {
  text-decoration: none;
  color: var(--ink);
  transition: color 0.2s;
}

.card-title a:hover { color: var(--accent); }

.card-excerpt {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.card-readmore {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.card-readmore:hover { opacity: 0.7; }

.card-media img {
  width: 100%;
  border-radius: 8px;
  display: block;
  margin-top: 0.75rem;
}

.card-media--video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin-top: 0.75rem;
}

.card-media--video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 8px;
}