:root {
  --bg: #EDE4D3;
  --bg-alt: #E5D9C3;
  --bg-card: #FAF4E8;
  --bg-input: #F5EBDB;
  --border-soft: #D4C4A8;

  --body: #2B1810;
  --body-2: #3D2817;
  --heading: #6B4E2E;
  --gold: #8B6B3D;
  --gold-deep: #6E5229;
  --muted: #5C4530;
  --muted-2: #8B7355;

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Lato', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --radius: 8px;
  --nav-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
p { text-wrap: pretty; }
a { color: var(--gold-deep); }

/* Reset interactive defaults */
button, input, select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  outline: none;
}
button { cursor: pointer; }

/* bg wash */
.bg-wash-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.06;
  max-width: 100vw;
  overflow: hidden;
}
.bg-wash-wrap svg { width: 100%; height: 100%; max-width: 100%; }
main { position: relative; z-index: 1; }

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.reveal-in { opacity: 1; transform: translateY(0); }

/* —— NAV —— */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(237, 228, 211, 0.78);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: background 300ms var(--ease), border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.nav-scrolled {
  background: rgba(237, 228, 211, 0.94);
  border-bottom: 1px solid rgba(139, 107, 61, 0.18);
  box-shadow: 0 1px 18px rgba(43, 24, 16, 0.05);
}
.nav-inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.nav-logo-mark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 32px;
  color: var(--gold);
  line-height: 1;
  transform: translateY(-1px);
}
.nav-logo-text {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--body-2);
}
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0; padding: 0;
}
.nav-link {
  position: relative;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--body-2);
  letter-spacing: 0.01em;
  padding: 22px 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 300ms var(--ease);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 16px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 280ms var(--ease);
}
.nav-link:hover { color: var(--gold-deep); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--gold-deep); }
.nav-link.active::after { transform: scaleX(1); }
.nav-link:focus-visible { color: var(--gold-deep); }
.nav-link:focus-visible::after { transform: scaleX(1); }

/* mobile hamburger */
.nav-burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--body-2);
  transition: background 200ms var(--ease);
}
.nav-burger:hover { background: rgba(139, 107, 61, 0.08); }
.nav-burger svg { width: 22px; height: 22px; }

.nav-mobile {
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid rgba(139, 107, 61, 0.18);
  box-shadow: 0 12px 28px rgba(43, 24, 16, 0.10);
  padding: 16px 24px 24px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 49;
}
.nav-mobile.open { display: flex; }
.nav-mobile .nav-link {
  padding: 14px 8px;
  min-height: 44px;
  font-size: 19px;
  justify-content: flex-start;
  width: 100%;
}
.nav-mobile .nav-link::after { bottom: 10px; }

/* —— SECTION COMMONS —— */
.section-kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 13px;
  color: var(--gold-deep);
  font-weight: 700;
  margin: 0 0 18px;
}
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 4.2vw, 44px);
  line-height: 1.25;
  color: var(--heading);
  margin: 0 0 28px;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}
.section-title em, .section-title i {
  color: var(--gold-deep);
  font-style: italic;
}

/* divider */
.divider { display: flex; justify-content: center; padding: 40px 0 48px; }
.divider-svg {
  width: 320px;
  max-width: 70vw;
  height: auto;
  opacity: 0.55;
}

/* —— HERO —— */
.hero {
  position: relative;
  padding: 180px 48px 120px;
  text-align: center;
  overflow: hidden;
}
.hero-motif-wrap {
  position: absolute;
  top: 120px; left: 50%;
  transform: translateX(-50%);
  width: min(900px, 92vw);
  max-width: 900px;
  opacity: 0.16;
  pointer-events: none;
}
.hero-motif-wrap svg { width: 100%; height: auto; max-width: 900px; }
.hero-inner { position: relative; z-index: 2; max-width: 820px; margin: 0 auto; }
.hero-kicker {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--gold-deep);
  margin: 0 0 18px;
  letter-spacing: 0.04em;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(68px, 10vw, 132px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--heading);
  margin: 0 0 10px;
}
.hero-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 2.6vw, 30px);
  color: var(--body);
  margin: 0 0 36px;
  letter-spacing: 0.02em;
}
.hero-blurb {
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1.8;
  color: var(--body);
  margin: 0 auto 48px;
  max-width: 560px;
}
.hero-cta {
  display: inline-block;
  padding: 16px 40px;
  border-radius: 999px;
  background: transparent;
  color: var(--gold-deep);
  border: 1px solid var(--gold);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  min-height: 44px;
  transition: background 300ms var(--ease), color 300ms var(--ease),
              box-shadow 300ms var(--ease), transform 300ms var(--ease);
}
.hero-cta:hover {
  background: var(--gold);
  color: var(--bg-card);
  box-shadow: 0 10px 24px rgba(139, 107, 61, 0.24);
  transform: translateY(-1px);
}
.hero-cta:focus-visible {
  box-shadow: 0 0 0 3px rgba(139, 107, 61, 0.22);
}

/* featured row */
.home-featured {
  padding: 40px 48px 80px;
  max-width: 1200px;
  margin: 0 auto;
}
.home-featured-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.home-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 56px;
}
.home-featured-foot { text-align: center; }

/* —— ABOUT —— */
.about {
  padding: 140px 48px 120px;
  background: var(--bg-alt);
  border-top: 1px solid rgba(139, 107, 61, 0.1);
  border-bottom: 1px solid rgba(139, 107, 61, 0.1);
}
.about-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 96px;
  align-items: center;
}
.about-portrait-col { display: flex; justify-content: center; }
.portrait { position: relative; width: 360px; height: 360px; }
.portrait-frame-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.95;
}
.portrait-frame-wrap svg { width: 100%; height: 100%; }
.portrait-photo {
  position: absolute;
  inset: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 30% 25%, #F5E5D1 0%, #E4CFB4 40%, #CEB28E 100%);
  box-shadow:
    inset 0 0 0 2px rgba(139, 107, 61, 0.3),
    0 10px 28px rgba(43, 24, 16, 0.14);
}
.portrait-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(139, 107, 61, 0.10) 0 6px,
      transparent 6px 14px);
}
.portrait-mono {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--body);
  letter-spacing: 0.1em;
  padding: 8px 14px;
  background: rgba(250, 244, 232, 0.85);
  border-radius: 20px;
}
.about-text-col .about-p {
  font-size: 20px;
  line-height: 1.8;
  color: var(--body);
  margin: 0 0 22px;
  max-width: 56ch;
}
.about-sig { display: flex; flex-direction: column; gap: 12px; }
.about-signature {
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  color: var(--gold-deep);
  margin-top: 8px;
}

/* —— ESCRITOS —— */
.escritos {
  padding: 140px 48px 120px;
  max-width: 1240px;
  margin: 0 auto;
}
.escritos-head { text-align: center; max-width: 760px; margin: 0 auto 56px; }
.escritos-intro {
  font-size: 20px;
  color: var(--body);
  margin: 0;
}

/* filter bar */
.filter-bar {
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}
.filter-search {
  position: relative;
  flex: 1;
  max-width: 500px;
}
.filter-search-icon {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted-2);
  pointer-events: none;
}
.filter-search input {
  width: 100%;
  height: 52px;
  padding: 0 20px 0 52px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--body);
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.filter-search input::placeholder {
  color: var(--muted-2);
  font-style: italic;
  opacity: 1;
}
.filter-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139, 107, 61, 0.1);
}

/* Custom select */
.filter-select {
  position: relative;
  width: 200px;
  flex-shrink: 0;
}
.filter-select-btn {
  width: 100%;
  height: 52px;
  padding: 0 44px 0 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--body);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.filter-select-btn:hover { border-color: var(--gold); }
.filter-select-btn:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139, 107, 61, 0.1);
}
.filter-select-chevron {
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--gold-deep);
  pointer-events: none;
  transition: transform 200ms var(--ease);
}
.filter-select.open .filter-select-chevron {
  transform: translateY(-50%) rotate(180deg);
}
.filter-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(43, 24, 16, 0.14);
  padding: 6px;
  z-index: 20;
  max-height: 280px;
  overflow-y: auto;
}
.filter-select-option {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--body);
  text-align: left;
  transition: background 150ms var(--ease), color 150ms var(--ease);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.filter-select-option:hover { background: rgba(139, 107, 61, 0.10); color: var(--gold-deep); }
.filter-select-option.selected { color: var(--gold-deep); font-style: italic; }

/* grid */
.poems-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 44px;
}

/* Card */
.poem-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(139, 107, 61, 0.18);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(43, 24, 16, 0.08);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 280ms var(--ease), box-shadow 280ms var(--ease),
              border-color 280ms var(--ease);
}
.poem-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(43, 24, 16, 0.12);
  border-color: var(--gold);
}
.poem-card:hover .poem-card-arrow { transform: translateX(6px); }
.poem-card:hover .poem-card-title { color: var(--gold-deep); }
.poem-card:focus-visible {
  outline: 0;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139, 107, 61, 0.22), 0 10px 30px rgba(43, 24, 16, 0.12);
}
.poem-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
}
.poem-card-image > svg { width: 100%; height: 100%; display: block; }
.poem-card-body { padding: 28px 32px; }
.poem-card-year {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--gold-deep);
  text-transform: uppercase;
  display: block;
  margin: 0 0 10px;
}
.poem-card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.2;
  color: var(--heading);
  margin: 0 0 16px;
  letter-spacing: -0.005em;
  transition: color 300ms var(--ease);
  text-wrap: balance;
}
.poem-card-excerpt {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.6;
  color: var(--body);
  white-space: pre-wrap;
  margin: 0 0 20px;
}
.poem-card-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
  opacity: 0.45;
  margin: 0 0 18px;
}
.poem-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}
.poem-card-read {
  font-family: var(--sans);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-deep);
  font-weight: 700;
}
.poem-card-arrow {
  font-size: 18px;
  color: var(--gold-deep);
  transition: transform 300ms var(--ease);
}

/* pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 72px auto 0;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--gold-deep);
  flex-wrap: wrap;
}
.pagination button {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--gold-deep);
  padding: 8px 14px;
  border-radius: 6px;
  min-width: 44px;
  min-height: 44px;
  transition: background 200ms var(--ease);
}
.pagination button:hover:not(:disabled) { background: rgba(139, 107, 61, 0.10); }
.pagination button.active { color: var(--body-2); font-style: italic; font-weight: 600; }
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }
.pagination .ellipsis { padding: 0 6px; color: var(--gold); opacity: 0.7; }
.pagination .edge { padding: 8px 18px; font-style: italic; }

/* poem page */
.poem-page { padding-top: 140px; padding-bottom: 120px; }
.poem-page-hero {
  width: 100%;
  height: 400px;
  overflow: hidden;
  background: var(--bg-alt);
  position: relative;
}
.poem-page-hero > svg { width: 100%; height: 100%; display: block; }
.poem-page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(237,228,211,0) 60%, rgba(237,228,211,0.9) 100%);
  pointer-events: none;
}
.poem-page-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 32px 0;
  text-align: center;
}
.poem-page-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(42px, 5vw, 58px);
  line-height: 1.15;
  color: var(--heading);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.poem-page-year {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--gold-deep);
  text-transform: uppercase;
  margin: 0 0 44px;
}
.poem-page-body {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.9;
  color: var(--body-2);
  white-space: pre-wrap;
  margin: 0 auto 48px;
  max-width: 600px;
  text-align: center;
}
.poem-page-sig {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--gold-deep);
  margin: 0 0 48px;
}
.poem-page-divider { margin: 0 auto 36px; max-width: 320px; opacity: 0.6; }
.poem-page-back {
  display: inline-block;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--gold-deep);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 4px;
  min-height: 44px;
  border-bottom: 1px solid rgba(139, 107, 61, 0.35);
  transition: color 280ms var(--ease), border-color 280ms var(--ease);
}
.poem-page-back:hover { color: var(--body-2); border-bottom-color: var(--body-2); }

/* placeholder svg */
.ph-img { width: 100%; height: 100%; display: block; }

/* empty */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
}

/* footer */
.footer {
  padding: 56px 48px;
  text-align: center;
  background: var(--bg-alt);
  border-top: 1px solid rgba(139, 107, 61, 0.18);
  margin-top: 40px;
}
.footer-name {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 26px;
  color: var(--gold-deep);
  margin: 0 0 6px;
}
.footer-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--body);
  margin: 0 0 16px;
}
.footer-fine {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin: 0;
  text-transform: uppercase;
}

/* responsive */
@media (max-width: 960px) {
  .nav-inner { padding: 0 20px; gap: 12px; }
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }

  .hero { padding: 140px 24px 80px; }
  .about { padding: 120px 24px 80px; }
  .about-inner { grid-template-columns: 1fr; gap: 48px; }
  .about-portrait-col .portrait { width: 280px; height: 280px; }
  .escritos { padding: 120px 24px 80px; }
  .home-featured { padding: 40px 24px 80px; }
  .home-featured-grid { grid-template-columns: 1fr; gap: 28px; }
  .poems-grid { grid-template-columns: 1fr; gap: 28px; }
  .poem-card-body { padding: 24px; }
  .poem-card-title { font-size: 28px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-search { max-width: 100%; }
  .filter-select { width: 100%; }
  .poem-page-hero { height: 280px; }
  .poem-page-inner { padding: 56px 24px 0; }
  .poem-page-body { font-size: 20px; }
  .footer { padding: 44px 24px; }
  .section-title { font-size: 32px; }
}
@media (max-width: 560px) {
  .nav-logo-text { display: none; }
  .hero-title { font-size: 58px; }
}
