/* ─── Variables ─── */
:root {
  --bg: #EFE5D0;
  --bg-alt: #EFE5D0;
  --text: #1C1008;
  --text-muted: #6B4F3A;
  --accent: #8B5A2B;
  --accent-dark: #5C3518;
  --border: #D8C9AD;
  --card-bg: #F5ECD8;
  --nav-bg: #2C1508;
  --nav-text: #F0E4CC;
  --nav-accent: #C4A882;

  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;

  --content-width: 960px;
  --wide-width: 1100px;
  --nav-height: 68px;

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; background: none; border: none; font: inherit; }

/* ─── Base ─── */
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.85;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bg-alt {
  flex: 1;
}

/* ─── Grain overlay ─── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 9999;
}

/* ─── Typography ─── */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

p { margin-bottom: 1.5rem; }
p:last-child { margin-bottom: 0; }

/* ─── Nav ─── */
#nav {
  position: relative;
  z-index: 500;
  height: var(--nav-height);
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  transition: box-shadow 0.4s var(--ease);
}

#nav.scrolled {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.45);
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--nav-text);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-logo:hover { color: var(--nav-accent); }

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nav-text);
  opacity: 0.65;
  transition: opacity 0.2s, color 0.2s;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--nav-accent);
  transition: width 0.3s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  color: var(--nav-accent);
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* ─── Mobile nav ─── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.25s;
}

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

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background: var(--nav-bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    z-index: 499;
  }

  .nav-open .nav-links { transform: translateX(0); }
  .nav-links a { font-size: 1.1rem; opacity: 0.8; }
}

/* ─── Page wrapper ─── */
.page-content { padding-top: 0; }

/* ─── Hero ─── */
.hero {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 90, 43, 0.07) 0%, transparent 65%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(196, 168, 130, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 20%, rgba(139, 90, 43, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  animation: heroFadeUp 0.9s 0.2s both var(--ease);
}

.hero-title {
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 1.5rem;
  animation: heroFadeUp 0.9s 0.38s both var(--ease);
}

.hero-subtitle {
  font-size: clamp(1.5rem, 2.7vw, 1.8rem);
  color: var(--text-muted);
  max-width: 460px;
  line-height: 1.75;
  margin-bottom: 2.75rem;
  font-style: italic;
  animation: heroFadeUp 0.9s 0.55s both var(--ease);
}

.hero .btn { animation: heroFadeUp 0.9s 0.7s both var(--ease); }

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.5;
  margin-top: 2rem;
  animation: heroFadeUp 1s 1.1s both var(--ease);
}

.scroll-line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.35; transform: scaleY(1) translateY(0); }
  50%       { opacity: 0.9;  transform: scaleY(0.85) translateY(4px); }
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 2.25rem;
  border-radius: 2px;
  transition: all 0.28s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(139, 90, 43, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ─── Sections ─── */
.section { padding: 6rem 2rem; }

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

.section-wide { max-width: var(--wide-width); }

.section-header { margin-bottom: 3.5rem; }

.section-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.75rem;
}

.section-divider {
  width: 44px;
  height: 2px;
  background: var(--accent);
  margin-top: 1rem;
}

/* ─── Post cards ─── */
.posts-grid {
  display: grid;
  gap: 1.5rem;
}

.post-card {
  display: block;
  padding: 2rem 2.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 48px rgba(45, 27, 14, 0.13);
  border-color: var(--accent);
}

.post-card-meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.post-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.post-card-excerpt {
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}

.post-card-arrow {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  transition: letter-spacing 0.2s;
}

.post-card:hover .post-card-arrow { letter-spacing: 0.15em; }

/* ─── Archive ─── */
.archive-section { padding: 5rem 2rem 6rem; }

.archive-inner {
  max-width: 680px;
  margin: 0 auto;
}

.archive-year-group { margin-bottom: 0.5rem; }

.archive-year {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 3.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.archive-year:first-child { margin-top: 0; }

.archive-item {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid rgba(216, 201, 173, 0.4);
  transition: padding-left 0.3s var(--ease);
}

.archive-item:last-child { border-bottom: none; }
.archive-item:hover { padding-left: 0.625rem; }

.archive-date {
  font-family: var(--sans);
  font-size: 0.775rem;
  color: var(--text-muted);
  min-width: 68px;
  flex-shrink: 0;
}

.archive-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s;
  line-height: 1.4;
}

.archive-item:hover .archive-title { color: var(--accent); }

/* ─── Page header (non-home) ─── */
.page-header {
  padding: 5rem 2rem 3.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-header h1 { font-size: clamp(2rem, 5vw, 3.25rem); }

/* ─── About ─── */
.about-section { padding: 5rem 2rem 7rem; }

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

.about-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  margin-bottom: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
}

.about-content p { margin-bottom: 1.75rem; }
.about-content p:last-child { margin-bottom: 0; }
.about-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── Contact ─── */
.contact-section { padding: 5rem 2rem 7rem; }

.contact-inner {
  max-width: 580px;
  margin: 0 auto;
}

.contact-intro { color: var(--text-muted); margin-bottom: 3rem; }

.form-group { margin-bottom: 1.75rem; }

.form-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.875rem 1rem;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.45;
}

.form-textarea {
  resize: vertical;
  min-height: 190px;
  line-height: 1.7;
}

/* ─── Post / Article ─── */
.post-header {
  padding: 5.5rem 2rem 3rem;
  text-align: center;
  max-width: var(--content-width);
  margin: 0 auto;
}

.post-meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.post-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.15;
  margin-top: 3rem;
}

.ornament {
  text-align: center;
  color: var(--border);
  font-size: 1.1rem;
  letter-spacing: 0.6rem;
  padding: 2rem 0;
  margin-top: -40px;
}

.post-body {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.post-body p { margin-bottom: 1.75rem; text-indent: 2em; }

.post-body h2 {
  font-size: 1.75rem;
  margin: 3rem 0 1.25rem;
}

.post-body h3 {
  font-size: 1.375rem;
  margin: 2.25rem 0 1rem;
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.75rem;
  margin: 2.5rem 0;
  font-style: italic;
  color: var(--text-muted);
}

.post-body ul,
.post-body ol {
  margin: 1.25rem 0 1.75rem 1.5rem;
  list-style: disc;
}

.post-body ol { list-style: decimal; }
.post-body li { margin-bottom: 0.5rem; }

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-body a:hover { color: var(--accent-dark); }

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3.5rem 0;
}

.post-back {
  padding: 0 2rem 5rem;
  max-width: var(--content-width);
  margin: 0 auto;
}

.post-back a {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: color 0.2s;
}

.post-back a:hover { color: var(--accent); }

/* ─── Footer ─── */
footer {
  background: var(--nav-bg);
  padding: 2.75rem 2rem;
}

.footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-name {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--nav-text);
  font-weight: 500;
  margin-bottom: 0;
}

.footer-copy {
  font-family: var(--sans);
  font-size: 0.775rem;
  color: var(--nav-text);
  opacity: 0.4;
  margin-bottom: 0;
}

/* ─── Fade-up scroll animation ─── */
.fade-up {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings */
.fade-up:nth-child(2) { transition-delay: 0.1s; }
.fade-up:nth-child(3) { transition-delay: 0.2s; }
.fade-up:nth-child(4) { transition-delay: 0.3s; }

/* ─── Alt background ─── */
.bg-alt { background: var(--bg-alt); }

/* ─── Utilities ─── */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  #nav { padding: 0 1.25rem; }
  .section { padding: 4rem 1.25rem; }
  .hero { padding: 3.5rem 1.25rem 4rem; }
  .archive-section,
  .about-section,
  .contact-section { padding: 3.5rem 1.25rem 5rem; }
  .page-header { padding: 3.5rem 1.25rem 2.5rem; }
  .post-header,
  .post-body,
  .post-back { padding-left: 1.25rem; padding-right: 1.25rem; }
  .footer-inner { flex-direction: column; text-align: center; }
}
