#historia {
  background-color: var(--c-cream);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Leaf corner decorations */
#historia::before,
#historia::after {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  opacity: 0.15;
}

#historia::before {
  top: 16px;
  left: -16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Cpath d='M15 135 Q45 100 70 75 Q100 45 130 15' stroke='%236B7D67' fill='none' stroke-width='2' stroke-linecap='round'/%3E%3Cellipse cx='38' cy='108' rx='18' ry='9' fill='%236B7D67' transform='rotate(-42 38 108)'/%3E%3Cellipse cx='62' cy='83' rx='16' ry='8' fill='%236B7D67' transform='rotate(-48 62 83)'/%3E%3Cellipse cx='88' cy='58' rx='15' ry='7' fill='%236B7D67' transform='rotate(-54 88 58)'/%3E%3Cellipse cx='112' cy='35' rx='13' ry='6' fill='%236B7D67' transform='rotate(-60 112 35)'/%3E%3Cpath d='M62 83 Q55 68 46 70' stroke='%236B7D67' fill='none' stroke-width='1.2' stroke-linecap='round'/%3E%3Cellipse cx='44' cy='68' rx='10' ry='5' fill='%236B7D67' transform='rotate(-20 44 68)'/%3E%3C/svg%3E");
}

#historia::after {
  bottom: 16px;
  right: -16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Cpath d='M15 135 Q45 100 70 75 Q100 45 130 15' stroke='%236B7D67' fill='none' stroke-width='2' stroke-linecap='round'/%3E%3Cellipse cx='38' cy='108' rx='18' ry='9' fill='%236B7D67' transform='rotate(-42 38 108)'/%3E%3Cellipse cx='62' cy='83' rx='16' ry='8' fill='%236B7D67' transform='rotate(-48 62 83)'/%3E%3Cellipse cx='88' cy='58' rx='15' ry='7' fill='%236B7D67' transform='rotate(-54 88 58)'/%3E%3Cellipse cx='112' cy='35' rx='13' ry='6' fill='%236B7D67' transform='rotate(-60 112 35)'/%3E%3C/svg%3E");
  transform: rotate(180deg);
}

/* Timeline */
.timeline {
  position: relative;
  margin-top: var(--sp-lg);
  text-align: left;
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: var(--c-gold-light);
}

.timeline-item {
  display: flex;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--c-cream);
  border: 2px solid var(--c-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  z-index: 1;
}

.timeline-body {
  min-width: 0;
  padding-top: 0.35rem;
}

.timeline-year {
  font-family: var(--f-serif);
  font-size: 1.2rem;
  color: var(--c-gold);
  font-weight: 600;
  display: block;
}

.timeline-title {
  font-family: var(--f-serif);
  font-size: 1.05rem;
  color: var(--c-dark);
  margin: 0.2rem 0;
}

.timeline-desc {
  font-size: 0.88rem;
  color: var(--c-dark-soft);
  line-height: 1.55;
  max-width: 35rem;
}

@media (max-width: 480px) {
  .timeline {
    margin-top: var(--sp-md);
  }

  .timeline::before {
    left: 22px;
    top: 23px;
    bottom: 23px;
  }

  .timeline-item {
    gap: 0.8rem;
    margin-bottom: 1.35rem;
  }

  .timeline-dot {
    width: 46px;
    height: 46px;
    font-size: 1.15rem;
  }

  .timeline-body {
    padding-top: 0.15rem;
  }

  .timeline-year {
    font-size: 1.05rem;
  }

  .timeline-title {
    font-size: 0.98rem;
    line-height: 1.2;
  }

  .timeline-desc {
    font-size: 0.79rem;
    line-height: 1.45;
  }
}

/* Compact mode for phones with very little vertical space (e.g. iPhone SE). */
@media (max-width: 480px) and (max-height: 740px) {
  #historia {
    height: 100svh;
    overflow-y: auto;
    justify-content: flex-start;
    padding: 0.7rem 1rem;
  }

  #historia .section-inner { margin-block: auto; }

  #historia .label {
    margin-bottom: 0.4rem;
    font-size: 0.62rem;
    letter-spacing: 0.17em;
  }

  #historia .title {
    margin-bottom: 0.45rem;
    font-size: clamp(1.45rem, 6.2vw, 1.65rem);
    line-height: 1.1;
  }

  #historia .divider {
    width: 42px;
    margin: 0.45rem auto;
  }

  #historia .timeline {
    margin-top: 0.55rem;
  }

  #historia .timeline::before {
    left: 19px;
    top: 20px;
    bottom: 20px;
  }

  #historia .timeline-item {
    gap: 0.65rem;
    margin-bottom: 0.7rem;
  }

  #historia .timeline-dot {
    width: 40px;
    height: 40px;
    border-width: 1.5px;
    font-size: 1rem;
  }

  #historia .timeline-body {
    padding-top: 0;
  }

  #historia .timeline-year {
    font-size: 0.98rem;
    line-height: 1.1;
  }

  #historia .timeline-title {
    margin: 0.12rem 0;
    font-size: 0.98rem;
    line-height: 1.2;
  }

  #historia .timeline-desc {
    font-size: 0.84rem;
    line-height: 1.4;
  }

  #historia::before,
  #historia::after {
    width: 100px;
    height: 100px;
  }
}
