:root {
  --bg: #f2ede2;
  --bg-card: rgba(255, 253, 248, 0.72);
  --border: rgba(43, 38, 32, 0.14);
  --border-hover: rgba(43, 38, 32, 0.3);
  --text: #26221d;
  --text-muted: #5c554b;
  --text-faint: #8a8275;
  --accent: #a8632c;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(43, 38, 32, 0.1);
  --shadow-lg: 0 16px 32px rgba(43, 38, 32, 0.16), 0 4px 10px rgba(43, 38, 32, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(245, 240, 230, 0.91), rgba(245, 240, 230, 0.94)),
    url("../img/creacion-de-adan.jpg") center 32% / cover no-repeat fixed;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-title {
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-nav a {
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  flex-shrink: 0;
}

.lang-switch a,
.lang-switch span {
  color: var(--text-faint);
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-switch a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.45);
}

.lang-switch .current {
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
}

.avatar-link {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.avatar-link:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hero */

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent 85%);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.2rem;
  margin: 0 0 0.6rem;
}

.hero p {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0;
}

/* Filters */

.filters {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-row {
  display: flex;
}

.search-input {
  width: 100%;
  max-width: 360px;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-input::placeholder {
  color: var(--text-faint);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.6);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-right: 0.5rem;
}

.pill {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--border-hover);
  color: var(--text);
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdf9f2;
}

/* Grid */

.repo-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.count {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

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

.card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  background: #e6ddc9;
}

.card-body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.card-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--text-faint);
}

.card-status.completado {
  background: var(--accent);
}

.card-title {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.35;
  margin: 0;
}

.card-toggle {
  position: relative;
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.4rem;
  vertical-align: middle;
  flex-shrink: 0;
}

.card-toggle::before,
.card-toggle::after {
  content: "";
  position: absolute;
  background: var(--text-faint);
  transition: transform 0.2s ease;
}

.card-toggle::before {
  left: 0;
  top: 50%;
  width: 100%;
  height: 1.5px;
  transform: translateY(-50%);
}

.card-toggle::after {
  top: 0;
  left: 50%;
  width: 1.5px;
  height: 100%;
  transform: translateX(-50%);
}

.card.expanded .card-toggle::after {
  transform: translateX(-50%) rotate(90deg);
  opacity: 0;
}

.card-author {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
  flex: 1;
}

.card-expand {
  display: none;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.card.expanded .card-expand {
  display: flex;
}

.card-field-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin-bottom: 0.2rem;
}

.card-field p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.card-external {
  align-self: flex-start;
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.card-external:hover {
  background: rgba(255, 255, 255, 0.4);
  border-color: var(--border-hover);
}

.empty-state {
  color: var(--text-faint);
  text-align: center;
  padding: 4rem 1rem;
  font-size: 0.9rem;
}

/* About page */

.about-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 6rem;
}

.quote-block {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.55;
  color: var(--text);
  font-style: italic;
  border-left: 2px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1.5rem;
  margin: 2rem 0 0.75rem;
}

.quote-attr {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin: 0 0 3.5rem 1.6rem;
}

.about-section {
  margin-bottom: 3rem;
}

.about-section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  margin: 0 0 1rem;
}

.about-section p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.about-section ul {
  color: var(--text-muted);
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.about-section li {
  margin-bottom: 0.5rem;
}

/* Footer */

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--text-faint);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .hero h1 {
    font-size: 1.7rem;
  }
  .quote-block {
    font-size: 1.2rem;
  }
}
