:root {
  --accent: #BD5D38;
  --accent-dark: #9a4a2c;
  --text: #1a202c;
  --text-muted: #718096;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --border: #e2e8f0;
  --nav-height: 64px;
  --max-width: 1100px;
  --radius: 12px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 1rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; display: block; }


/* ── Navigation ─────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  flex: 1;
  transition: color 0.2s;
}
.logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}


/* ── Sections ────────────────────────────────────── */

section {
  padding: 5rem 1.5rem;
}

section:nth-child(even) {
  background: var(--bg-alt);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.section-lead {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  max-width: 60ch;
}


/* ── About ───────────────────────────────────────── */

#about {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
}

.about-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4rem;
}

.about-text { flex: 1; }

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

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

.tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.about-text p {
  color: #4a5568;
  margin-bottom: 1rem;
  max-width: 55ch;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 1rem;
  border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.social-links a:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.about-photo img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 8px 32px rgba(189, 93, 56, 0.2);
}


/* ── Cards ───────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--accent);
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card h3 i { font-size: 0.75em; opacity: 0.5; margin-left: 0.3em; }

.card .role {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.card p { color: #4a5568; font-size: 0.95rem; }

.card-cta {
  display: block;
  cursor: pointer;
  color: inherit;
}

.card-project-image {
  width: 100%;
  height: 160px;
  object-fit: contain;
  object-position: center;
  margin-bottom: 1rem;
  border-radius: 6px;
}

.card-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}



/* ── Post list (writing index + homepage teaser) ─── */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 1.5rem;
}

.post-card {
  display: block;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
  transition: color 0.2s;
}

.post-card--has-image {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.post-card-image {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.post-card-body { flex: 1; }
.post-card:first-child { border-top: 1px solid var(--border); }
.post-card:hover { color: var(--accent); }
.post-card:hover h3 { color: var(--accent); }

.post-date {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.post-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  transition: color 0.2s;
}

.post-card p {
  color: #4a5568;
  font-size: 0.9rem;
  margin: 0;
}

.writing-more {
  margin-top: 1.25rem;
  font-weight: 500;
}


/* ── Post page ───────────────────────────────────── */

.post-hero {
  margin-bottom: 2rem;
}

.post-hero img,
.post-hero picture {
  display: block;
  width: 100%;
  max-width: 68ch;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 0;
}

.post-page { padding: 3rem 1.5rem 5rem; }

.post-back {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}
.post-back:hover { color: var(--accent); }

.post-header { margin-bottom: 2.5rem; }
.post-header h1 { margin-bottom: 0.5rem; }

.post-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
}


.post-content {
  max-width: 68ch;
  color: #2d3748;
  font-size: 1.0625rem;
  line-height: 1.8;
}

.post-content h2 { font-size: 1.5rem; margin: 2.5rem 0 0.75rem; }
.post-content h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { margin: 0 0 1.25rem 1.5rem; }
.post-content li { margin-bottom: 0.4rem; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}
.post-content code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.875em;
}
.post-content pre {
  background: #1a202c;
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.875rem;
}
.post-content img { border-radius: 8px; margin: 1.5rem 0 0.5rem; max-width: 100%; }
.post-content img + em {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}
.post-content a { text-decoration: underline; text-underline-offset: 3px; }


/* ── Footer ──────────────────────────────────────── */

footer {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
}


/* ── Mobile ──────────────────────────────────────── */

@media (max-width: 768px) {
  header { position: relative; }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 0.875rem 1.5rem; font-size: 0.9rem; }

  .about-content { flex-direction: column-reverse; gap: 2rem; text-align: center; }
  .social-links { justify-content: center; }
  .about-text p { max-width: none; }
  .about-photo img { width: 160px; height: 160px; }

}
