:root {
  --ink: #1f2933;
  --muted: #667085;
  --paper: #fffaf2;
  --cream: #f6efe4;
  --clay: #b96f4a;
  --rose: #d86678;
  --teal: #2f8f83;
  --blue: #376fa6;
  --leaf: #6b8e4e;
  --line: rgba(31, 41, 51, 0.12);
  --shadow: 0 22px 60px rgba(70, 50, 32, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", Arial, sans-serif;
  overflow-x: hidden;
}

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

.site-header {
  position: sticky;
  top: 18px;
  z-index: 20;
  width: min(1680px, calc(100% - 48px));
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 26px auto 0;
  padding: 12px 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px 12px 0 0;
  color: #fff;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(14px);
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  width: auto;
  height: auto;
  color: var(--clay);
  background: transparent;
  border-radius: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.8rem;
  letter-spacing: 0;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-links a:hover {
  color: #fff;
}

.hero {
  position: relative;
  width: 100%;
  min-height: 430px;
  display: grid;
  align-items: center;
  margin: 0 auto;
  padding: 58px clamp(28px, 7vw, 84px);
  overflow: hidden;
  border-radius: 0;
  color: #fff;
  background:
    radial-gradient(circle at 70% 50%, rgba(185, 111, 74, 0.18), transparent 35%),
    #080808;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 11, 15, 0.82) 0%, rgba(7, 11, 15, 0.26) 45%, rgba(7, 11, 15, 0.02) 100%);
}

.hero-photo {
  position: absolute;
  right: 6%;
  bottom: 0;
  width: min(56%, 680px);
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 520px;
  padding-top: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
  line-height: 0.96;
  letter-spacing: 0;
}

h1 {
  max-width: 520px;
  margin-bottom: 20px;
  font-size: clamp(2.8rem, 5.4vw, 5.1rem);
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.9rem, 3.2vw, 3.35rem);
}

h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.hero-copy,
.section-heading p,
.story-copy p {
  color: #3f4b57;
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.75;
}

.hero-copy {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.88);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-audio {
  display: flex;
  width: min(100%, 360px);
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

.hero-audio span {
  flex: 0 0 auto;
  max-width: 128px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.76rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-audio audio {
  flex: 1 1 auto;
  min-width: 120px;
  height: 28px;
}

.hero-audio audio:not([src]) {
  display: none;
}

.hero-audio::after {
  content: "Sube un audio en edicion";
  display: none;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.74rem;
  font-weight: 700;
}

.hero-audio:has(audio:not([src]))::after {
  display: block;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
}

.button.primary {
  color: #fff;
  background: var(--clay);
  border-color: var(--clay);
}

.button.secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.16);
}

.welcome-band {
  max-width: 1240px;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 5vw, 70px);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 52px) clamp(28px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: #fff7ec;
}

.home-board {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(22px, 3vw, 44px) clamp(24px, 4vw, 72px);
  border-radius: 0;
  background: var(--paper);
}

.welcome-band h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
}

.welcome-band > p {
  margin: 0;
  color: #536170;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.75;
}

.welcome-links {
  display: grid;
  gap: 10px;
}

.welcome-links a {
  min-width: 132px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  font-weight: 800;
  text-align: center;
}

.section,
.story-section {
  padding: clamp(24px, 3.5vw, 38px) 0;
}

.section-heading {
  max-width: 380px;
  margin-bottom: 24px;
}

.family-panel {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: clamp(18px, 2.5vw, 34px);
  align-items: start;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.family-panel .section-heading h2,
.story-copy h2,
.memories .section-heading h2 {
  font-size: clamp(1.45rem, 2vw, 2.15rem);
  line-height: 1.04;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}

.family-grid-main {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: none;
}

.member-card {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf8;
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.member-card:hover,
.member-card.active {
  transform: translateY(-5px);
  border-color: rgba(185, 111, 74, 0.42);
  box-shadow: 0 18px 45px rgba(70, 50, 32, 0.14);
}

.portrait {
  display: grid;
  width: 100%;
  min-height: 138px;
  aspect-ratio: 4 / 5;
  place-items: center;
  margin-bottom: 2px;
  border-radius: 8px 8px 0 0;
  color: #fff;
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 800;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 -46px 90px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.portrait.has-image {
  color: transparent;
  background-color: #f5efe6;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
}

.portrait-warm {
  background: var(--clay);
}

.portrait-earth {
  background: #7a614f;
}

.portrait-rose {
  background: var(--rose);
}

.portrait-sky {
  background: var(--blue);
}

.portrait-green {
  background: var(--teal);
}

.role {
  padding: 0 18px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.member-card strong {
  padding: 0 18px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.member-card small {
  padding: 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.spotlight {
  grid-column: 2;
  margin-top: 20px;
  display: none;
  padding: clamp(22px, 4vw, 36px);
  border-left: 6px solid var(--clay);
  border-radius: 8px;
  background: #fff7ec;
}

.spotlight h3 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.spotlight p:last-child {
  max-width: 760px;
  color: #495764;
  line-height: 1.7;
}

.story-section {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: clamp(18px, 2.5vw, 34px);
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.story-content {
  display: grid;
  gap: 14px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.timeline article {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(47, 143, 131, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.timeline span {
  grid-row: auto;
  color: var(--teal);
  font-size: 2.2rem;
  font-weight: 800;
}

.timeline p {
  margin: 0;
  color: #536170;
  line-height: 1.6;
}

.timeline small {
  display: inline-block;
  margin: 4px 0 8px;
  color: var(--clay);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.root-photo {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.memory-card {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  border-radius: 8px;
  color: #fff;
  overflow: hidden;
  position: relative;
  background-position: center;
  background-size: cover;
}

.memory-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(20, 25, 29, 0.7), rgba(20, 25, 29, 0.08)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 14px);
}

.memory-card span,
.memory-card h3 {
  position: relative;
}

.memory-card span {
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.memory-card h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2.1rem);
}

.memory-one {
  background: linear-gradient(135deg, #b96f4a, #d86678);
}

.memory-two {
  background: linear-gradient(135deg, #376fa6, #2f8f83);
}

.memory-three {
  background: linear-gradient(135deg, #6b8e4e, #d09a45);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: #fff7ec;
}

.footer p {
  margin: 0;
  color: var(--muted);
}

.footer a {
  font-weight: 800;
}

@media (max-width: 980px) {
  .hero {
    min-height: auto;
    padding-top: 92px;
    padding-bottom: 72px;
  }

  .hero-photo {
    object-position: center 32%;
  }

  .family-grid,
  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .family-panel,
  .story-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .family-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timeline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-links a {
    flex: 0 0 auto;
    font-size: 0.86rem;
  }

  .hero {
    min-height: 92vh;
    margin: 0;
  }

  .hero::after {
    background:
      linear-gradient(0deg, rgba(7, 11, 15, 0.86) 0%, rgba(7, 11, 15, 0.18) 62%),
      linear-gradient(90deg, rgba(7, 11, 15, 0.28) 0%, rgba(7, 11, 15, 0.02) 100%);
  }

  .hero-photo {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 52% 32%;
  }

  .hero-content {
    padding-top: 42vh;
  }

  h1 {
    max-width: 320px;
    font-size: clamp(2.45rem, 14vw, 3.8rem);
    line-height: 0.98;
  }

  h2 {
    font-size: clamp(2rem, 11vw, 3rem);
    line-height: 1.02;
  }

  .section-heading {
    max-width: min(100%, 360px);
  }

  .hero-copy,
  .section-heading p,
  .story-copy p {
    font-size: 1rem;
    line-height: 1.55;
  }

  .hero-audio {
    max-width: 280px;
    padding: 8px 10px;
  }

  .hero-actions,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .welcome-band,
  .family-grid,
  .memory-grid {
    grid-template-columns: 1fr;
  }

  .member-card {
    min-height: auto;
  }

  .portrait {
    min-height: 280px;
    aspect-ratio: 16 / 10;
  }

  .timeline article {
    grid-template-columns: 1fr;
  }

  .timeline span {
    grid-row: auto;
    margin-bottom: 10px;
  }
}

.edit-toggle {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--clay);
  background: transparent;
  border-color: rgba(185, 111, 74, 0.7);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.edit-toggle:hover {
  color: #fff;
}

.button.primary.dark {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.contact-form .button {
  min-height: 38px;
  font-size: 0.86rem;
}

.button.secondary.light {
  color: var(--ink);
  border-color: var(--line);
  background: #fffdf8;
}

.button.danger {
  color: #9b2c2c;
}

.timeline article.user-story {
  border-color: rgba(185, 111, 74, 0.3);
  background: #fffaf2;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
  grid-column: 1 / -1;
  margin-top: 18px;
}

.album-category {
  display: grid;
  gap: 12px;
}

.album-category:has(.album-item:nth-child(3)) {
  grid-column: span 2;
}

.album-category-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-direction: row;
  gap: 14px;
  min-height: auto;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 10px;
}

.album-category-heading span {
  color: var(--ink);
  font-family: "Playfair Display", serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 800;
}

.album-category-heading strong {
  color: var(--clay);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.album-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.album-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.album-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.album-story-mark {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(31, 41, 51, 0.88), rgba(47, 143, 131, 0.72)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 2px, transparent 2px 15px);
  font-family: "Playfair Display", serif;
  font-size: 3rem;
  font-weight: 800;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(620px, 1fr);
  align-items: start;
  gap: clamp(16px, 3vw, 32px);
  max-width: 1240px;
  margin: 0 auto;
  padding-top: 18px;
  padding-bottom: 18px;
  border-top: 1px solid var(--line);
  background: #fffaf2;
}

.contact-section .section-heading {
  max-width: 220px;
  margin-bottom: 0;
}

.contact-section h2 {
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(1.25rem, 1.45vw, 1.6rem);
  font-weight: 800;
  line-height: 1.18;
}

.contact-section .section-heading p:not(.eyebrow) {
  font-size: 0.92rem;
  line-height: 1.45;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  max-width: 900px;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: none;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.contact-form .field-half,
.contact-form .field-subject {
  grid-column: span 4;
}

.contact-form .field-message {
  grid-column: span 9;
}

.contact-form .form-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.contact-form button {
  align-self: end;
  grid-column: span 3;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 0.92rem;
}

.contact-form textarea {
  min-height: 52px;
}

.contact-form textarea {
  resize: vertical;
}

.hidden-field {
  display: none;
}

.thanks-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fffaf2;
}

.thanks-card {
  max-width: 620px;
  padding: clamp(28px, 6vw, 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 18px 45px rgba(70, 50, 32, 0.1);
}

.thanks-card h1 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
}

.thanks-card p:not(.eyebrow) {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.7;
}

.album-body {
  padding: 18px;
}

.album-body span {
  display: block;
  margin-bottom: 8px;
  color: var(--clay);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.album-body p {
  color: var(--muted);
  line-height: 1.6;
}

.remove-entry {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(155, 44, 44, 0.2);
  border-radius: 8px;
  color: #9b2c2c;
  background: #fff5f5;
  font-weight: 800;
  cursor: pointer;
}

body:not(.is-editing) .remove-entry {
  display: none;
}

.editor-section {
  background: #f3efe8;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.editor-card {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.editor-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.editor-card input,
.editor-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.editor-card textarea {
  resize: vertical;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.color-grid input {
  min-height: 52px;
  padding: 4px;
}

.editor-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.backup-tools {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.backup-tools div {
  flex: 1 1 360px;
}

.backup-tools h3,
.backup-tools p {
  margin: 0;
}

.backup-tools p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 980px) {
  .contact-section {
    grid-template-columns: 1fr;
  }

  .album-category-grid,
  .editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .album-category-grid,
  .contact-form,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .contact-form .field-half,
  .contact-form .field-subject,
  .contact-form .field-message,
  .contact-form button {
    grid-column: 1;
  }

  .album-category-heading {
    align-items: flex-start;
    flex-direction: column;
    border-bottom: 1px solid var(--line);
    padding: 0 0 10px;
  }

  .album-category,
  .album-category:has(.album-item:nth-child(3)) {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .album-category-grid {
    grid-template-columns: 1fr;
  }
}
